v0.13.1
Public Member Functions | Private Attributes | List of all members
OpRotatingFrameTools::OpVolumeSideCalculateEP Struct Reference

#include <users_modules/multifield_plasticity/src/RotatingFrameOperators.hpp>

Inheritance diagram for OpRotatingFrameTools::OpVolumeSideCalculateEP:
[legend]
Collaboration diagram for OpRotatingFrameTools::OpVolumeSideCalculateEP:
[legend]

Public Member Functions

 OpVolumeSideCalculateEP (const std::string field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 101 of file RotatingFrameOperators.hpp.

Constructor & Destructor Documentation

◆ OpVolumeSideCalculateEP()

OpRotatingFrameTools::OpVolumeSideCalculateEP::OpVolumeSideCalculateEP ( const std::string  field_name,
boost::shared_ptr< CommonData common_data_ptr 
)

Definition at line 470 of file RotatingFrameOperators.cpp.

473 commonDataPtr(common_data_ptr) {
474 std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
475 doEntities[MBTET] = true;
476 doEntities[MBHEX] = true;
477}
DomainSideEle::UserDataOperator DomainSideEleOp
constexpr auto field_name
@ OPROW
operator doWork function is executed on FE rows

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpRotatingFrameTools::OpVolumeSideCalculateEP::doWork ( int  side,
EntityType  type,
EntData data 
)

Definition at line 479 of file RotatingFrameOperators.cpp.

480 {
482 const int nb_gauss_pts = getGaussPts().size2();
483 const int nb_base_functions = data.getN().size2();
484 // commonDataPtr->mStressPtr->resize(6, nb_gauss_pts);
485 // auto &t_D = commonDataPtr->tD;
486 // auto t_strain =
487 // getFTensor2SymmetricFromMat<3>(*(commonDataPtr->mStrainPtr)); auto t_stress
488 // = getFTensor2SymmetricFromMat<3>(*(commonDataPtr->mStressPtr));
489 // FIXME: this is wrong, resize only on zero type
490 const size_t nb_dofs = data.getIndices().size();
491 // data.getFieldData().size() == 0
492 // if (side == getFaceSideNumber()) {
493 if (nb_dofs) {
494
495 // for testing //FIXME:
496 MatrixDouble diff = getCoordsAtGaussPts() - getFaceCoordsAtGaussPts();
497 const double eps = 1e-12;
498 if (norm_inf(diff) > eps)
499 SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID,
500 "coordinates at integration pts are different");
501
502 const size_t nb_gauss_pts = data.getN().size1();
503
504 auto base_function = data.getFTensor0N();
505 // MatrixDouble *ep_elem_data = nullptr;
506 int test_nb_in_loop = getFEMethod()->nInTheLoop;
507 int test_face_sense = getFaceSense();
508 MatrixDouble &mat_ep = commonDataPtr->plasticStrainSideMap[getFaceSense()];
509 mat_ep.resize(6, nb_gauss_pts, false);
510 mat_ep.clear();
511
512 // if (getFEMethod()->nInTheLoop == 0)
513 // ep_elem_data = &(commonDataPtr->plasticStrainLeft);
514 // else
515 // ep_elem_data = &(commonDataPtr->plasticStrainRight);
516
517 // mat_ep.resize(6, nb_gauss_pts, false);
518 // mat_ep.clear();
519 auto values_at_gauss_pts = getFTensor2SymmetricFromMat<3>(mat_ep);
520 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
521 auto field_data = data.getFTensor2SymmetricFieldData<3>();
522 size_t bb = 0;
523 for (; bb != nb_dofs / 6; ++bb) {
524 values_at_gauss_pts(i, j) += field_data(i, j) * base_function;
525 ++base_function;
526 }
527 for (; bb != nb_base_functions; ++bb)
528 ++base_function;
529 ++values_at_gauss_pts;
530 }
531 }
533}
static const double eps
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
@ MOFEM_ATOM_TEST_INVALID
Definition: definitions.h:53
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:88
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *,(Tensor_Dim *(Tensor_Dim+1))/2 >, Tensor_Dim > getFTensor2SymmetricFieldData()
Return symmetric FTensor rank 2, i.e. matrix from filed data coeffinects.
const VectorInt & getIndices() const
Get global indices of dofs on entity.

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<CommonData> OpRotatingFrameTools::OpVolumeSideCalculateEP::commonDataPtr
private

Definition at line 107 of file RotatingFrameOperators.hpp.


The documentation for this struct was generated from the following files: