v0.15.0
Loading...
Searching...
No Matches
MyOp< OP > Struct Template Reference

Operator used to check consistency between local coordinates and global cooridnates for integrated points and evaluated points. More...

Inheritance diagram for MyOp< OP >:
[legend]
Collaboration diagram for MyOp< OP >:
[legend]

Public Member Functions

 MyOp (std::array< double, 12 > &eval_points)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side.
 
 MyOp (const char type, const char face_type)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side.
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on left hand side.
 
- Public Member Functions inherited from MoFEM::ContactPrismElementForcesAndSourcesCore::UserDataOperator
 UserDataOperator (const FieldSpace space)
 
 UserDataOperator (const std::string &field_name, const char type)
 
 UserDataOperator (const std::string &row_field_name, const std::string &col_field_name, const char type)
 
 UserDataOperator (const std::string &row_field_name, const std::string &col_field_name, const char type, const char face_type)
 
 UserDataOperator (const std::string &field_name, const char type, const char face_type)
 
int getFaceType () const
 Get operator types.
 
boost::shared_ptr< const NumeredEntFiniteElementgetNumeredEntFiniteElementPtr () const
 
double getAreaMaster ()
 get face aRea Master
 
double getAreaSlave ()
 get face aRea Slave
 
VectorAdaptor getNormalMaster ()
 get face normal vector to Master face
 
VectorAdaptor getTangentMasterOne ()
 get first face tangent vector to Master face
 
VectorAdaptor getTangentMasterTwo ()
 get second face tangent vector to Master face
 
VectorAdaptor getNormalSlave ()
 get face normal vector to Slave face
 
VectorAdaptor getTangentSlaveOne ()
 get first face tangent vector to Slave face
 
VectorAdaptor getTangentSlaveTwo ()
 get second face tangent vector to Slave face
 
MatrixDoublegetGaussPtsMaster ()
 get Gauss point at Master face
 
MatrixDoublegetGaussPtsSlave ()
 get Gauss point at Slave face
 
auto getFTensor0IntegrationWeightSlave ()
 Get integration weights for slave side.
 
auto getFTensor0IntegrationWeightMaster ()
 Get integration weights for master side.
 
VectorDouble getCoordsMaster ()
 get triangle coordinates
 
VectorDouble getCoordsSlave ()
 get triangle coordinates
 
MatrixDoublegetCoordsAtGaussPtsMaster ()
 get coordinates at Gauss pts on full prism.
 
MatrixDoublegetCoordsAtGaussPtsSlave ()
 get coordinates at Gauss pts on full prism.
 
const ContactPrismElementForcesAndSourcesCoregetContactPrismElementForcesAndSourcesCore ()
 return pointer to triangle finite element object
 
MoFEMErrorCode loopSideVolumes (const string fe_name, VolumeElementForcesAndSourcesCoreOnContactPrismSide &fe_method, const int side_type, const EntityHandle ent_for_side)
 
- Public Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
 UserDataOperator (const FieldSpace space, const char type=OPSPACE, const bool symm=true)
 
 UserDataOperator (const std::string field_name, const char type, const bool symm=true)
 
 UserDataOperator (const std::string row_field_name, const std::string col_field_name, const char type, const bool symm=true)
 
boost::shared_ptr< const NumeredEntFiniteElementgetNumeredEntFiniteElementPtr () const
 Return raw pointer to NumeredEntFiniteElement.
 
EntityHandle getFEEntityHandle () const
 Return finite element entity handle.
 
int getFEDim () const
 Get dimension of finite element.
 
EntityType getFEType () const
 Get dimension of finite element.
 
boost::weak_ptr< SideNumbergetSideNumberPtr (const int side_number, const EntityType type)
 Get the side number pointer.
 
EntityHandle getSideEntity (const int side_number, const EntityType type)
 Get the side entity.
 
int getNumberOfNodesOnElement () const
 Get the number of nodes on finite element.
 
MoFEMErrorCode getProblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get row indices.
 
MoFEMErrorCode getProblemColIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get col indices.
 
const FEMethodgetFEMethod () const
 Return raw pointer to Finite Element Method object.
 
int getOpType () const
 Get operator types.
 
void setOpType (const OpType type)
 Set operator type.
 
void addOpType (const OpType type)
 Add operator type.
 
int getNinTheLoop () const
 get number of finite element in the loop
 
int getLoopSize () const
 get size of elements in the loop
 
std::string getFEName () const
 Get name of the element.
 
ForcesAndSourcesCoregetPtrFE () const
 
ForcesAndSourcesCoregetSidePtrFE () const
 
ForcesAndSourcesCoregetRefinePtrFE () const
 
const PetscData::SwitchesgetDataCtx () const
 
const KspMethod::KSPContext getKSPCtx () const
 
const SnesMethod::SNESContext getSNESCtx () const
 
const TSMethod::TSContext getTSCtx () const
 
Vec getKSPf () const
 
Mat getKSPA () const
 
Mat getKSPB () const
 
Vec getSNESf () const
 
Vec getSNESx () const
 
Mat getSNESA () const
 
Mat getSNESB () const
 
Vec getTSu () const
 
Vec getTSu_t () const
 
Vec getTSu_tt () const
 
Vec getTSf () const
 
Mat getTSA () const
 
Mat getTSB () const
 
int getTSstep () const
 
double getTStime () const
 
double getTStimeStep () const
 
double getTSa () const
 
double getTSaa () const
 
MatrixDoublegetGaussPts ()
 matrix of integration (Gauss) points for Volume Element
 
auto getFTensor0IntegrationWeight ()
 Get integration weights.
 
MatrixDoublegetCoordsAtGaussPts ()
 Gauss points and weight, matrix (nb. of points x 3)
 
auto getFTensor1CoordsAtGaussPts ()
 Get coordinates at integration points assuming linear geometry.
 
double getMeasure () const
 get measure of element
 
doublegetMeasure ()
 get measure of element
 
MoFEMErrorCode loopSide (const string &fe_name, ForcesAndSourcesCore *side_fe, const size_t dim, const EntityHandle ent_for_side=0, boost::shared_ptr< Range > fe_range=nullptr, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy, AdjCache *adj_cache=nullptr)
 User calls this function to loop over elements on the side of face. This function calls finite element with its operator to do calculations.
 
MoFEMErrorCode loopThis (const string &fe_name, ForcesAndSourcesCore *this_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over the same element using a different set of integration points. This function calls finite element with its operator to do calculations.
 
MoFEMErrorCode loopParent (const string &fe_name, ForcesAndSourcesCore *parent_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over parent elements. This function calls finite element with its operator to do calculations.
 
MoFEMErrorCode loopChildren (const string &fe_name, ForcesAndSourcesCore *child_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over parent elements. This function calls finite element with its operator to do calculations.
 
MoFEMErrorCode loopRange (const string &fe_name, ForcesAndSourcesCore *range_fe, boost::shared_ptr< Range > fe_range, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 Iterate over range of elements.
 
- Public Member Functions inherited from MoFEM::DataOperator
 DataOperator (const bool symm=true)
 
virtual ~DataOperator ()=default
 
virtual MoFEMErrorCode opLhs (EntitiesFieldData &row_data, EntitiesFieldData &col_data)
 
virtual MoFEMErrorCode opRhs (EntitiesFieldData &data, const bool error_if_no_base=false)
 
bool getSymm () const
 Get if operator uses symmetry of DOFs or not.
 
void setSymm ()
 set if operator is executed taking in account symmetry
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem
 

Public Attributes

MatrixShallowArrayAdaptor< doubleevalPoints
 
const char faceType
 
- Public Attributes inherited from MoFEM::ContactPrismElementForcesAndSourcesCore::UserDataOperator
char faceType
 
- Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
char opType
 
std::string rowFieldName
 
std::string colFieldName
 
FieldSpace sPace
 
- Public Attributes inherited from MoFEM::DataOperator
DoWorkLhsHookFunType doWorkLhsHook
 
DoWorkRhsHookFunType doWorkRhsHook
 
bool sYmm
 If true assume that matrix is symmetric structure.
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity.
 
booldoVertices
 \deprectaed If false skip vertices
 
booldoEdges
 \deprectaed If false skip edges
 
booldoQuads
 \deprectaed
 
booldoTris
 \deprectaed
 
booldoTets
 \deprectaed
 
booldoPrisms
 \deprectaed
 

Additional Inherited Members

- Public Types inherited from MoFEM::ContactPrismElementForcesAndSourcesCore::UserDataOperator
enum  FaceType {
  FACEMASTER = 1 << 0 , FACESLAVE = 1 << 1 , FACEMASTERMASTER = 1 << 2 , FACEMASTERSLAVE = 1 << 3 ,
  FACESLAVEMASTER = 1 << 4 , FACESLAVESLAVE = 1 << 5 , FACELAST = 1 << 6
}
 
- Public Types inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
enum  OpType {
  OPROW = 1 << 0 , OPCOL = 1 << 1 , OPROWCOL = 1 << 2 , OPSPACE = 1 << 3 ,
  OPLAST = 1 << 3
}
 Controls loop over entities on element. More...
 
using AdjCache
 
- Public Types inherited from MoFEM::DataOperator
using DoWorkLhsHookFunType
 
using DoWorkRhsHookFunType
 
- Static Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
static const char *const OpTypeNames []
 
- Protected Member Functions inherited from MoFEM::ContactPrismElementForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoregetSidePtrFE () const
 
- Protected Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
virtual MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
- Protected Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 

Detailed Description

template<typename OP>
struct MyOp< OP >

Operator used to check consistency between local coordinates and global cooridnates for integrated points and evaluated points.

Examples
field_evaluator.cpp, forces_and_sources_testing_edge_element.cpp, and forces_and_sources_testing_flat_prism_element.cpp.

Definition at line 21 of file field_evaluator.cpp.

Constructor & Destructor Documentation

◆ MyOp() [1/2]

template<typename OP >
MyOp< OP >::MyOp ( std::array< double, 12 > & eval_points)
inline
Examples
field_evaluator.cpp, forces_and_sources_testing_edge_element.cpp, and forces_and_sources_testing_flat_prism_element.cpp.

Definition at line 25 of file field_evaluator.cpp.

26 : OP("FIELD1", OP::OPROW),
28 getMatrixAdaptor(eval_points.data(), eval_points.size() / 3, 3)) {}
auto getMatrixAdaptor(T1 ptr, const size_t n, const size_t m)
Get Matrix adaptor.
Definition Templates.hpp:57
MatrixShallowArrayAdaptor< double > evalPoints

◆ MyOp() [2/2]

template<typename OP >
MyOp< OP >::MyOp ( const char type,
const char face_type )
inline

Member Function Documentation

◆ doWork() [1/3]

template<typename OP >
MoFEMErrorCode MyOp< OP >::doWork ( int row_side,
int col_side,
EntityType row_type,
EntityType col_type,
EntitiesFieldData::EntData & row_data,
EntitiesFieldData::EntData & col_data )
inlinevirtual

Operator for bi-linear form, usually to calculate values on left hand side.

Reimplemented from MoFEM::DataOperator.

Definition at line 66 of file forces_and_sources_testing_contact_prism_element.cpp.

69 {
71
72 if (row_data.getFieldData().empty())
74
75 MOFEM_LOG("ATOM_TEST", Sev::inform) << "NH1NH1";
76 MOFEM_LOG("ATOM_TEST", Sev::inform)
77 << "row side: " << row_side << " row_type: " << row_type;
78 MOFEM_LOG("ATOM_TEST", Sev::inform) << row_data;
79 MOFEM_LOG("ATOM_TEST", Sev::inform) << "NH1NH1";
80 MOFEM_LOG("ATOM_TEST", Sev::inform)
81 << "col side: " << col_side << " col_type: " << col_type;
82 MOFEM_LOG("ATOM_TEST", Sev::inform) << col_data;
83
85 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MOFEM_LOG(channel, severity)
Log.
const VectorDouble & getFieldData() const
get dofs values

◆ doWork() [2/3]

template<typename OP >
MoFEMErrorCode MyOp< OP >::doWork ( int side,
EntityType type,
EntitiesFieldData::EntData & data )
inlinevirtual

Operator for linear form, usually to calculate values on right hand side.

Reimplemented from MoFEM::DataOperator.

Examples
field_evaluator.cpp, forces_and_sources_testing_edge_element.cpp, and forces_and_sources_testing_flat_prism_element.cpp.

Definition at line 30 of file field_evaluator.cpp.

31 {
33 if (type == MBVERTEX) {
34
35 MOFEM_LOG("SELF", Sev::inform) << "FE " << OP::getFEEntityHandle();
36
37 MOFEM_LOG("SELF", Sev::inform) << "Integration pts" << std::endl;
38 MOFEM_LOG("SELF", Sev::inform) << OP::getGaussPts() << endl;
39
40 MOFEM_LOG("SELF", Sev::inform) << "Global coordinates " << endl;
41 MOFEM_LOG("SELF", Sev::inform) << OP::getCoordsAtGaussPts() << std::endl;
42
43 for (int gg = 0; gg != OP::getCoordsAtGaussPts().size1(); ++gg) {
44 int pt_number = OP::getGaussPts()(OP::getGaussPts().size1() - 1, gg);
45
46 MOFEM_LOG("SELF", Sev::inform) << "gg " << gg << std::endl;
47 MOFEM_LOG("SELF", Sev::inform) << "pt " << pt_number << std::endl;
48
49 ublas::matrix_row<MatrixDouble> coord_at_gauss_pt(
50 OP::getCoordsAtGaussPts(), gg);
51 ublas::matrix_row<MatrixShallowArrayAdaptor<double>> eval_coord(
52 evalPoints, pt_number);
53
54 MOFEM_LOG("SELF", Sev::inform) << "coord_at_gauss_pt ";
55 MOFEM_LOG("SELF", Sev::inform) << coord_at_gauss_pt << std::endl;
56
57 MOFEM_LOG("SELF", Sev::inform) << "eval_coord ";
58 MOFEM_LOG("SELF", Sev::inform) << eval_coord << std::endl;
59
60 double error = norm_2(coord_at_gauss_pt - eval_coord);
61
62 if (error > 1e-12)
63 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
64 "Difference at %d error = %3.4e", pt_number, error);
65 }
66 }
68 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
Definition definitions.h:40
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()

◆ doWork() [3/3]

template<typename OP >
MoFEMErrorCode MyOp< OP >::doWork ( int side,
EntityType type,
EntitiesFieldData::EntData & data )
inlinevirtual

Operator for linear form, usually to calculate values on right hand side.

Reimplemented from MoFEM::DataOperator.

Definition at line 24 of file forces_and_sources_testing_contact_prism_element.cpp.

25 {
27
28 if (data.getFieldData().empty())
30
31 MOFEM_LOG("ATOM_TEST", Sev::inform) << "NH1";
32 MOFEM_LOG("ATOM_TEST", Sev::inform)
33 << "side: " << side << " type: " << type;
34 MOFEM_LOG("ATOM_TEST", Sev::inform) << data;
35
36 if (faceType == FACEMASTER) {
37 MOFEM_LOG("ATOM_TEST", Sev::inform)
38 << "coords Master " << std::fixed << std::setprecision(2)
39 << getCoordsMaster();
40 MOFEM_LOG("ATOM_TEST", Sev::inform)
41 << "area Master " << std::fixed << std::setprecision(2)
42 << getAreaMaster();
43 MOFEM_LOG("ATOM_TEST", Sev::inform)
44 << "normal Master " << std::fixed << std::setprecision(2)
45 << getNormalMaster();
46 MOFEM_LOG("ATOM_TEST", Sev::inform)
47 << "coords at Gauss Pts Master " << std::fixed
48 << std::setprecision(2) << getCoordsAtGaussPtsMaster();
49 } else {
50 MOFEM_LOG("ATOM_TEST", Sev::inform)
51 << "coords Slave " << std::fixed << std::setprecision(2)
52 << getCoordsSlave();
53 MOFEM_LOG("ATOM_TEST", Sev::inform)
54 << "area Slave " << std::fixed << std::setprecision(2)
55 << getAreaSlave();
56 MOFEM_LOG("ATOM_TEST", Sev::inform)
57 << "normal Slave " << std::fixed << std::setprecision(2)
58 << getNormalSlave();
59 MOFEM_LOG("ATOM_TEST", Sev::inform)
60 << "coords at Gauss Pts Slave " << std::fixed
61 << std::setprecision(2) << getCoordsAtGaussPtsSlave();
62 }
64 }
MatrixDouble & getCoordsAtGaussPtsMaster()
get coordinates at Gauss pts on full prism.
MatrixDouble & getCoordsAtGaussPtsSlave()
get coordinates at Gauss pts on full prism.

Member Data Documentation

◆ evalPoints

template<typename OP >
MatrixShallowArrayAdaptor<double> MyOp< OP >::evalPoints
Examples
field_evaluator.cpp.

Definition at line 23 of file field_evaluator.cpp.

◆ faceType

template<typename OP >
const char MyOp< OP >::faceType

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