v0.15.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
OpCheckGaussCoords< ELE_OP, PARENT_ELE > Struct Template Reference
Inheritance diagram for OpCheckGaussCoords< ELE_OP, PARENT_ELE >:
[legend]
Collaboration diagram for OpCheckGaussCoords< ELE_OP, PARENT_ELE >:
[legend]

Public Member Functions

 OpCheckGaussCoords ()
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 

Detailed Description

template<typename ELE_OP, typename PARENT_ELE>
struct OpCheckGaussCoords< ELE_OP, PARENT_ELE >
Examples
mofem/atom_tests/child_and_parent.cpp.

Definition at line 138 of file child_and_parent.cpp.

Constructor & Destructor Documentation

◆ OpCheckGaussCoords()

template<typename ELE_OP , typename PARENT_ELE >
OpCheckGaussCoords< ELE_OP, PARENT_ELE >::OpCheckGaussCoords ( )
inline
Examples
mofem/atom_tests/child_and_parent.cpp.

Definition at line 139 of file child_and_parent.cpp.

139: ELE_OP(NOSPACE, ELE_OP::OPSPACE) {}
@ NOSPACE
Definition definitions.h:83

Member Function Documentation

◆ doWork()

template<typename ELE_OP , typename PARENT_ELE >
MoFEMErrorCode OpCheckGaussCoords< ELE_OP, PARENT_ELE >::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)
inline
Examples
mofem/atom_tests/child_and_parent.cpp.

Definition at line 141 of file child_and_parent.cpp.

142 {
144
145 MatrixDouble parent_coords;
146
147 PARENT_ELE parent_fe(this->getPtrFE()->mField);
148 auto op = new ELE_OP(NOSPACE, ELE_OP::OPSPACE);
149 op->doWorkRhsHook = [&](DataOperator *op_ptr, int side,
150 EntityType type,
153
154 MOFEM_LOG("SELF", Sev::noisy)
155 << "parent_coords in op "
156 << static_cast<ELE_OP *>(op_ptr)->getCoordsAtGaussPts();
157
158 parent_coords = static_cast<ELE_OP *>(op_ptr)->getCoordsAtGaussPts();
160 };
161 parent_fe.getOpPtrVector().push_back(op);
162
163 MOFEM_LOG("SELF", Sev::noisy) << "fe name " << this->getFEName();
164 CHKERR this->loopParent(this->getFEName(), &parent_fe);
165 MOFEM_LOG("SELF", Sev::noisy) << "parent_coords " << parent_coords;
166
167 MatrixDouble child_coords = this->getCoordsAtGaussPts();
168 MOFEM_LOG("SELF", Sev::noisy) << "child_coords " << child_coords;
169
170 child_coords -= parent_coords;
171
172 MOFEM_LOG("SELF", Sev::noisy) << "Corrds diffs" << child_coords;
173
174 double n = 0;
175 for (auto d : child_coords.data())
176 n += d * d;
177
178 if (sqrt(n) > 1e-12)
179 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
180 "Parent and child global coords at integration points are "
181 "diffrent norm = %3.2e",
182 sqrt(n));
183
185 }
#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()
#define CHKERR
Inline error check.
#define MOFEM_LOG(channel, severity)
Log.
const double n
refractive index of diffusive medium
base operator to do operations at Gauss Pt. level
Data on single entity (This is passed as argument to DataOperator::doWork)

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