40 PetscBool flg = PETSC_TRUE;
45 if (flg != PETSC_TRUE)
47 "*** ERROR -my_file (MESH FILE NEEDED)");
53 int restricted_side_set = 205;
55 &restricted_side_set, PETSC_NULL);
57 double shift[] = {0, 0, 0};
62 "three values expected");
64 int fixed_edges_blockset = 100;
66 &fixed_edges_blockset, PETSC_NULL);
68 int corner_nodes_blockset = 1;
70 &corner_nodes_blockset, PETSC_NULL);
72 double tol[] = {0, 0, 0};
75 if (flg && nmax_tol != 3)
78 PetscBool test = PETSC_FALSE;
84 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
86 boost::make_shared<WrapMPIComm>(PETSC_COMM_WORLD,
false);
89 new ParallelComm(&moab, moab_comm_wrap->get_comm());
116 bit_level0,
BitRefLevel().set(), MBTET,
"out_tets_init_level0.vtk",
119 bit_last,
BitRefLevel().set(), MBTET,
"out_tets_bit_last.vtk",
"VTK",
122 int no_of_ents_not_in_database = -1;
123 Range ents_not_in_database;
125 core.getInterface<
BitRefManager>()->getAllEntitiesNotInDatabase(
126 ents_not_in_database);
127 no_of_ents_not_in_database = ents_not_in_database.size();
141 Range fixed_edges, corner_nodes;
144 fixed_edges_blockset,
SIDESET, 1, fixed_edges,
true);
148 fixed_edges_blockset,
BLOCKSET, 1, fixed_edges,
true);
152 corner_nodes_blockset,
BLOCKSET, 0, corner_nodes,
true);
156 Range restriced_surface;
159 restricted_side_set,
SIDESET, 2, restriced_surface,
true);
179 CHKERR moab.get_entities_by_dimension(0, 3, tets,
false);
184 const int nb_ref_cut = 1;
185 const int nb_ref_trim = 1;
188 auto shift_after_ref = [&]() {
192 for (
int ll = 1; ll != nb_ref_cut + nb_ref_trim + 1; ++ll)
195 nb_ref_cut + nb_ref_trim, mask,
VERBOSE);
201 ->writeEntitiesAllBitLevelsByType(
BitRefLevel().set(), MBTET,
202 "all_bits.vtk",
"VTK",
"");
205 double def_position[] = {0, 0, 0};
207 CHKERR moab.tag_get_handle(
"POSITION", 3, MB_TYPE_DOUBLE,
th,
208 MB_TAG_CREAT | MB_TAG_SPARSE, def_position);
215 fixed_edges, corner_nodes,
true,
false);
222 ->updateAllMeshsetsByEntitiesChildren(
BitRefLevel().set(first_bit + 1));
226 "out_split_tets.vtk",
"VTK",
"");
230 "out_split_prism.vtk",
"VTK",
"");
233 for (
int ll = 0; ll != first_bit + 2; ++ll)
240 for (
int ll = 0; ll != first_bit; ++ll)
243 first_bit, shift_mask,
VERBOSE);
249 "out_tets_shift_level0.vtk",
"VTK",
"");
252 "out_tets_shift_level1.vtk",
"VTK",
"");
255 "out_tets_shift_level1_prism.vtk",
"VTK",
"");
259 Range adj_surface_edges;
261 adj_surface_edges, moab::Interface::UNION);
263 CHKERR moab.delete_entities(adj_surface_edges);
264 CHKERR moab.delete_entities(surface_verts);
271 CHKERR moab.create_meshset(MESHSET_SET, meshset);
273 CHKERR moab.get_entities_by_dimension(0, 3, tets,
true);
274 CHKERR moab.add_entities(meshset, tets);
275 CHKERR moab.write_file(
"out.vtk",
"VTK",
"", &meshset, 1);
276 CHKERR moab.delete_entities(&meshset, 1);
279 bit_last,
BitRefLevel().set(), MBTET,
"out_tets_bit_last.vtk",
"VTK",
282 "left_entities.vtk",
"VTK",
"");
287 core.getInterface<
BitRefManager>()->getAllEntitiesNotInDatabase(ents);
288 if (no_of_ents_not_in_database !=
static_cast<int>(ents.size())) {
289 MOFEM_LOG(
"WORLD", Sev::inform) << subtract(ents, ents_not_in_database);
291 CHKERR moab.create_meshset(MESHSET_SET, meshset);
293 CHKERR moab.get_entities_by_dimension(0, 3, tets,
true);
294 CHKERR moab.add_entities(meshset, subtract(ents, ents_not_in_database));
295 CHKERR moab.write_file(
"not_cleanded.vtk",
"VTK",
"", &meshset, 1);
296 CHKERR moab.delete_entities(&meshset, 1);
298 "Inconsistent number of ents %d!=%d",
299 no_of_ents_not_in_database, ents.size());