v0.14.0
Public Member Functions | Public Attributes | List of all members
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)
 
 MyOp (const char type, const char face_type)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Public Attributes

MatrixShallowArrayAdaptor< doubleevalPoints
 
const char faceType
 

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

Definition at line 25 of file field_evaluator.cpp.

26  : OP("FIELD1", OP::OPROW),
27  evalPoints(
28  getMatrixAdaptor(eval_points.data(), eval_points.size() / 3, 3)) {}

◆ MyOp() [2/2]

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

Definition at line 19 of file forces_and_sources_testing_contact_prism_element.cpp.

21  "FIELD1", "FIELD1", type, face_type),
22  faceType(face_type) {}

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 
)
inline

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  }

◆ doWork() [2/3]

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

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  }

◆ doWork() [3/3]

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

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  SETERRQ2(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
64  "Difference at %d error = %3.4e", pt_number, error);
65  }
66  }
68  }

Member Data Documentation

◆ evalPoints

template<typename OP >
MatrixShallowArrayAdaptor<double> MyOp< OP >::evalPoints

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:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
MoFEM::EntitiesFieldData::EntData::getFieldData
const VectorDouble & getFieldData() const
get dofs values
Definition: EntitiesFieldData.hpp:1241
MyOp::faceType
const char faceType
Definition: forces_and_sources_testing_contact_prism_element.cpp:18
convert.type
type
Definition: convert.py:64
MoFEM::getMatrixAdaptor
auto getMatrixAdaptor(T1 ptr, const size_t n, const size_t m)
Get Matrix adaptor.
Definition: Templates.hpp:57
MyOp::evalPoints
MatrixShallowArrayAdaptor< double > evalPoints
Definition: field_evaluator.cpp:23
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
MOFEM_ATOM_TEST_INVALID
@ MOFEM_ATOM_TEST_INVALID
Definition: definitions.h:40
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
OP
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346