33 {
34
35
37
38 try {
39
40
41 moab::Core moab_core;
42 moab::Interface &moab = moab_core;
43
44
47
48
49 DMType dm_name = "DMMOFEM";
51
52
55 {
56
57
59
61
64
68
69
70
71 std::array<double, 6> coords = {0, 0, 0, 0, 0, 0};
73 2);
75 ->makeFieldEntitiesMultishared(
"GLOBAL", 0,
NOISY);
77 ->setFieldEntitiesBitRefLevel(
"GLOBAL",
BitRefLevel().set());
78
79
80
81
82
86 vols);
87
90
91
93
95
96 int count_skeleton_fe;
97 int count_side_fe;
98 int count_meshset_fe;
99 int count_meshset_side_fe;
100
102
103
105 op_side_fe->doWorkRhsHook = [&](
DataOperator *op_ptr,
int side,
108 auto domain_op =
static_cast<DomainEleOp *
>(op_ptr);
110
112 << "Side element name [ " << count_side_fe << " ] "
113 << domain_op->getFEName();
114
115 ++count_side_fe;
116
118 };
119
120
121 auto side_fe = boost::make_shared<DomainEle>(m_field);
122 side_fe->getOpPtrVector().push_back(op_side_fe);
123
124
125
130
132 << "Element name [ " << count_skeleton_fe << " ] "
133 << bdy_op->getFEName();
134
137
138 ++count_skeleton_fe;
139
141 };
142
144 op_bdy_fe->doWorkRhsHook = do_work_rhs;
145
147 op_skeleton_fe->doWorkRhsHook = do_work_rhs;
148
149
151 op_meshset_side_fe->doWorkRhsHook =
154 auto domain_op =
static_cast<DomainEleOp *
>(op_ptr);
156
158 << "Side element name [ " << count_side_fe << " ] "
159 << domain_op->getFEName();
160
161 ++count_meshset_side_fe;
162
164 };
165
166 auto meshset_side_fe = boost::make_shared<DomainEle>(m_field);
167 meshset_side_fe->getOpPtrVector().push_back(op_meshset_side_fe);
168
169 auto op_meshset_fe = new ForcesAndSourcesCore::UserDataOperator(
170 "GLOBAL", ForcesAndSourcesCore::UserDataOperator::OPROW);
171 op_meshset_fe->doWorkRhsHook = [&](
DataOperator *op_ptr,
int side,
176 << "Meshset element name field data " << data.getFieldData();
178 << "Meshset element name indices " << data.getIndices();
179
180
183 boost::make_shared<Range>(vols));
184
185 ++count_meshset_fe;
187 };
188
189
190 count_skeleton_fe = 0;
191 count_side_fe = 0;
192 count_meshset_fe = 0;
193 count_meshset_side_fe = 0;
194
199
201 << "Number of elements " << count_skeleton_fe;
203 << "Number of side elements " << count_side_fe;
205 << "Number of meshset elements " << count_meshset_fe;
207 << "Number of meshset side elements " << count_meshset_side_fe;
208
209 if (count_skeleton_fe != 16)
211 "Wrong numbers of FEs");
212 if (count_side_fe != 24)
214 "Wrong numbers of side FEs");
215 if (count_meshset_fe != 2)
217 "Wrong numbers of side FEs");
218 if (count_meshset_side_fe != 16)
220 "Wrong numbers of side FEs");
221 }
222 }
224
225
227
228 return 0;
229}
DomainEle::UserDataOperator DomainEleOp
Finire element operator type.
BoundaryEle::UserDataOperator BoundaryEleOp
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base nme:nme847.
@ L2
field with C-1 continuity
@ NOFIELD
scalar or vector of scalars describe (no true field)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
MoFEMErrorCode loopFiniteElements(SmartPetscObj< DM > dm=nullptr)
Iterate finite elements.
boost::ptr_deque< UserDataOperator > & getOpBoundaryRhsPipeline()
Get the Op Boundary Rhs Pipeline object.
boost::ptr_deque< UserDataOperator > & getOpSkeletonRhsPipeline()
Get the Op Skeleton Rhs Pipeline object.
#define MOFEM_LOG(channel, severity)
Log.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
virtual moab::Interface & get_moab()=0
virtual MoFEMErrorCode create_vertices_and_add_to_field(const std::string name, const double coords[], int size, int verb=DEFAULT_VERBOSITY)=0
Create a vertices and add to field object.
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
base operator to do operations at Gauss Pt. level
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
PipelineManager interface.
boost::ptr_deque< UserDataOperator > & getOpMeshsetRhsPipeline()
Get the Op Meshset Rhs Pipeline object.
Simple interface for fast problem set-up.
MoFEMErrorCode addDomainField(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add field on domain.
bool & getAddBoundaryFE()
Get the addSkeletonFE.
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
MoFEMErrorCode addMeshsetField(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add meshset field.
MoFEMErrorCode getOptions()
get options
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
auto & getMeshsetFiniteElementEntities()
Range of entities added to meshset finite element.
bool & getAddSkeletonFE()
Get the addSkeletonFE.
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
const std::string getDomainFEName() const
Get the Domain FE Name.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.