130 {
131
133
134 try {
135
136 moab::Core mb_instance;
137 moab::Interface &moab = mb_instance;
138
139 PetscBool flg = PETSC_TRUE;
142 255, &flg);
143 if (flg != PETSC_TRUE)
145
146 enum spaces { MYH1, MYHDIV, MYLASTSPACEOP };
147 const char *list_spaces[] = {"h1", "hdiv"};
148 PetscInt choice_space_value =
H1;
150 MYLASTSPACEOP, &choice_space_value, &flg);
151 bool is_hdiv = (choice_space_value == MYHDIV) ? true : false;
152
153 const char *option;
154 option = "";
156
157
158 auto add_atom_logging = [is_hdiv]() {
160 auto get_log_file_name = [is_hdiv]() {
161 if (is_hdiv)
162 return "forces_and_sources_testing_contact_prism_element_HDIV.txt";
163 else
164 return "forces_and_sources_testing_contact_prism_element.txt";
165 };
166
167 auto core_log = logging::core::get();
168 core_log->add_sink(
172
173
174 logging::add_file_log(keywords::file_name = get_log_file_name(),
175 keywords::filter =
176 MoFEM::LogKeywords::channel == "ATOM_TEST");
178 };
179
180 CHKERR add_atom_logging();
181
182
187
188
191 std::vector<BitRefLevel> bit_levels;
193
194 int ll = 1;
196
197 CHKERR PetscPrintf(PETSC_COMM_WORLD,
"Insert Interface %d\n",
198 cit->getMeshsetId());
200 {
201
203 CHKERR moab.create_meshset(MESHSET_SET, ref_level_meshset);
205 ->getEntitiesByTypeAndRefLevel(bit_levels.back(),
207 ref_level_meshset);
209 ->getEntitiesByTypeAndRefLevel(bit_levels.back(),
211 ref_level_meshset);
212 Range ref_level_tets;
213 CHKERR moab.get_entities_by_handle(ref_level_meshset, ref_level_tets,
214 true);
215
216 CHKERR interface->
getSides(cubit_meshset, bit_levels.back(),
true, 0);
217
219
221 cubit_meshset, true, true, 0);
222
223 CHKERR moab.delete_entities(&ref_level_meshset, 1);
224 }
225
229 ->updateMeshsetByEntitiesChildren(cubit_meshset, bit_levels.back(),
230 cubit_meshset, MBMAXTYPE, true);
231 }
232 }
233
234
235 if (is_hdiv)
237 else
239
241 3);
242
243
245
246
251 "MESH_NODE_POSITIONS");
252
253
255
256
258 "TEST_FE1");
259
261 bit_levels.back());
262
263
265
268 "MESH_NODE_POSITIONS");
269
271 "TEST_FE1");
272
273
274 constexpr int order = 3;
275
276 if (is_hdiv) {
279 } else {
284 }
285
290 1);
291
292
294
295 if (!is_hdiv) {
296
299 }
301 m_field, "MESH_NODE_POSITIONS");
302 CHKERR m_field.
loop_dofs(
"MESH_NODE_POSITIONS", ent_method_mesh_positions);
303
304
306
308
312
313
314
317
319
320 using UMDataOp = ForcesAndSourcesCore::UserDataOperator;
321 using ContactDataOp =
323
325 fe1.getOpPtrVector().push_back(
326 new MyOp(UMDataOp::OPROW, ContactDataOp::FACEMASTER));
327 fe1.getOpPtrVector().push_back(
328 new MyOp(UMDataOp::OPROW, ContactDataOp::FACESLAVE));
329 fe1.getOpPtrVector().push_back(
330 new MyOp(UMDataOp::OPROWCOL, ContactDataOp::FACEMASTERMASTER));
331 fe1.getOpPtrVector().push_back(
332 new MyOp(UMDataOp::OPROWCOL, ContactDataOp::FACEMASTERSLAVE));
333 fe1.getOpPtrVector().push_back(
334 new MyOp(UMDataOp::OPROWCOL, ContactDataOp::FACESLAVEMASTER));
335 fe1.getOpPtrVector().push_back(
336 new MyOp(UMDataOp::OPROWCOL, ContactDataOp::FACESLAVESLAVE));
337 fe1.getOpPtrVector().push_back(
new CallingOp(UMDataOp::OPCOL));
338 fe1.getOpPtrVector().push_back(
new CallingOp(UMDataOp::OPROW));
339 fe1.getOpPtrVector().push_back(
new CallingOp(UMDataOp::OPROWCOL));
341
342 }
344
346
347 return 0;
348}
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base nme:nme847.
@ HDIV
field with continuous normal traction
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elements.
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_row)=0
set field col which finite element use
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)=0
set field row which finite element use
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
virtual MoFEMErrorCode set_field_order(const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
virtual MoFEMErrorCode add_ents_to_field_by_type(const Range &ents, const EntityType type, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)=0
Make a loop over dofs.
virtual MoFEMErrorCode loop_finite_elements(const std::string problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
Iterator that loops over all the Cubit MeshSets in a moFEM field.
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
MoFEMErrorCode partitionGhostDofs(const std::string name, int verb=VERBOSE)
determine ghost nodes
MoFEMErrorCode partitionSimpleProblem(const std::string name, int verb=VERBOSE)
partition problem dofs
MoFEMErrorCode buildProblem(const std::string name, const bool square_matrix, int verb=VERBOSE)
build problem data structures
MoFEMErrorCode partitionFiniteElements(const std::string name, bool part_from_moab=false, int low_proc=-1, int hi_proc=-1, int verb=VERBOSE)
partition finite elements
virtual MoFEMErrorCode add_problem(const std::string &name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add problem.
virtual MoFEMErrorCode modify_problem_ref_level_add_bit(const std::string &name_problem, const BitRefLevel &bit)=0
add ref level to problem
virtual MoFEMErrorCode modify_problem_add_finite_element(const std::string name_problem, const std::string &fe_name)=0
add finite element to problem, this add entities assigned to finite element to a particular problem
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
virtual MoFEMErrorCode add_field(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_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add field.
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.
Deprecated interface functions.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
Create interface from given surface and insert flat prisms in-between.
MoFEMErrorCode getSides(const int msId, const CubitBCType cubit_bc_type, const BitRefLevel mesh_bit_level, const bool recursive, int verb=QUIET)
Store tetrahedra from each side of the interface separately in two child meshsets of the parent meshs...
MoFEMErrorCode splitSides(const EntityHandle meshset, const BitRefLevel &bit, const int msId, const CubitBCType cubit_bc_type, const bool add_interface_entities, const bool recursive=false, int verb=QUIET)
Split nodes and other entities of tetrahedra on both sides of the interface and insert flat prisms in...
Problem manager is used to build and partition problems.
Projection of edge entities with one mid-node on hierarchical basis.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Operator used to check consistency between local coordinates and global cooridnates for integrated po...