v0.14.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
child_and_parent.cpp.

Definition at line 137 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
child_and_parent.cpp.

Definition at line 138 of file child_and_parent.cpp.

138: 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
child_and_parent.cpp.

Definition at line 140 of file child_and_parent.cpp.

141 {
143
144 MatrixDouble parent_coords;
145
146 PARENT_ELE parent_fe(this->getPtrFE()->mField);
147 auto op = new ELE_OP(NOSPACE, ELE_OP::OPSPACE);
148 op->doWorkRhsHook = [&](DataOperator *op_ptr, int side,
152
153 MOFEM_LOG("SELF", Sev::noisy)
154 << "parent_coords in op "
155 << static_cast<ELE_OP *>(op_ptr)->getCoordsAtGaussPts();
156
157 parent_coords = static_cast<ELE_OP *>(op_ptr)->getCoordsAtGaussPts();
159 };
160 parent_fe.getOpPtrVector().push_back(op);
161
162 MOFEM_LOG("SELF", Sev::noisy) << "fe name " << this->getFEName();
163 CHKERR this->loopParent(this->getFEName(), &parent_fe);
164 MOFEM_LOG("SELF", Sev::noisy) << "parent_coords " << parent_coords;
165
166 MatrixDouble child_coords = this->getCoordsAtGaussPts();
167 MOFEM_LOG("SELF", Sev::noisy) << "child_coords " << child_coords;
168
169 child_coords -= parent_coords;
170
171 MOFEM_LOG("SELF", Sev::noisy) << "Corrds diffs" << child_coords;
172
173 double n = 0;
174 for (auto d : child_coords.data())
175 n += d * d;
176
177 if (sqrt(n) > 1e-12)
178 SETERRQ1(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
179 "Parent and child global coords at integration points are "
180 "diffrent norm = %3.2e",
181 sqrt(n));
182
184 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ MOFEM_ATOM_TEST_INVALID
Definition: definitions.h:40
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
FTensor::Index< 'n', SPACE_DIM > n
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: dTensor0.hpp:27
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: