14 : mField(m_field), mOab(moab) {}
34 CHKERR getBoundaryConditions();
35 CHKERR setBoundaryConditions();
36 CHKERR getMaterialProperties();
45 CHKERR mField.getInterface(simpleInterface);
46 CHKERR simpleInterface->getOptions();
47 CHKERR simpleInterface->loadFile();
55 CHKERR mField.getInterface(meshsets_manager_ptr);
58 CHKERR mOab.tag_get_handle(
"BOUNDARY_CONDITIONS", 1, MB_TYPE_INTEGER, bc_tag,
59 MB_TAG_CREAT | MB_TAG_SPARSE);
61 std::vector<std::tuple<int, std::string, std::string>> conditions = {
62 {1,
"FIX_ALL",
"FIX_ALL"},
63 {2,
"FIX_X",
"FIX_X"},
64 {3,
"FIX_Y",
"FIX_Y"},
65 {4,
"FIX_Z",
"FIX_Z"},
66 {5,
"FIX_X_2",
"DISP_X"},
67 {6,
"FIX_Y_2",
"DISP_Y"},
68 {7,
"FIX_Z_2",
"DISP_Z"},
69 {8,
"FORCE_X",
"FORCE_X"},
70 {9,
"FORCE_Y",
"FORCE_Y"},
71 {10,
"FORCE_Z",
"FORCE_Z"},
72 {11,
"VEL_X",
"VEL_X"},
73 {12,
"VEL_Y",
"VEL_Y"},
74 {13,
"VEL_Z",
"VEL_Z"},
75 {14,
"ACCL_X",
"ACCL_X"},
76 {15,
"ACCL_Y",
"ACCL_Y"},
77 {16,
"ACCL_Z",
"ACCL_Z"},
79 {18,
"PRESSURE",
"PRESSURE"},
80 {19,
"HEAT_FLUX",
"HEAT_FLUX"},
81 {20,
"CONTACT",
"CONTACT"},
82 {50,
"TIE_MATRIX",
"TIE_MATRIX"}};
84 for (
auto &condition : conditions) {
85 int desired_val = std::get<0>(condition);
86 const void *desired_val_ptr = &desired_val;
88 CHKERR mOab.get_entities_by_type_and_tag(0, MBVERTEX, &bc_tag,
89 &desired_val_ptr, 1, bc);
93 CHKERR mOab.get_adjacencies(bc, 2,
true, faces, moab::Interface::UNION);
95 CHKERR mOab.get_adjacencies(bc, 1,
true, edges, moab::Interface::UNION);
98 CHKERR mOab.get_adjacencies(faces, 0,
false, adj_nodes,
99 moab::Interface::UNION);
102 non_BC_nodes = subtract(adj_nodes, bc);
104 CHKERR mOab.get_adjacencies(non_BC_nodes, 2,
false, non_BC_faces,
105 moab::Interface::UNION);
107 CHKERR mOab.get_adjacencies(non_BC_nodes, 1,
false, non_BC_edges,
108 moab::Interface::UNION);
110 faces = subtract(faces, non_BC_faces);
111 edges = subtract(edges, non_BC_edges);
113 MOFEM_LOG_C(
"WORLD", Sev::inform,
"Number of nodes assigned to %s = %d",
114 std::get<2>(condition).c_str(), bc.size());
115 MOFEM_LOG_C(
"WORLD", Sev::inform,
"Number of edges assigned to %s = %d",
116 std::get<2>(condition).c_str(), edges.size());
117 MOFEM_LOG_C(
"WORLD", Sev::inform,
"Number of faces assigned to %s = %d",
118 std::get<2>(condition).c_str(), faces.size());
121 std::get<1>(condition));
138 CHKERR mField.getInterface(meshsets_interface_ptr);
144 <<
"Print all meshsets (old and added from meshsets "
145 "configurational file)";
146 for (
auto cit = meshsets_interface_ptr->
getBegin();
147 cit != meshsets_interface_ptr->
getEnd(); cit++)
156 CHKERR mField.getInterface(meshsets_manager_ptr);
159 rval = mOab.get_entities_by_type(0, MBHEX, ents,
true);
160 if (
rval != MB_SUCCESS) {
162 <<
"No hexes in the mesh, no material block set. Not Implemented";
166 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Material block ADOLCMAT set added";
168 <<
"Other material block sets not implemented";
176 char mesh_out_file[255] =
"out_vtk.h5m";
178 CHKERR PetscOptionsBegin(mField.get_comm(),
"",
"Read vtk tool",
"none");
179 CHKERR PetscOptionsString(
"-output_file",
"output mesh file name",
"",
180 "out.h5m", mesh_out_file, 255, PETSC_NULL);
181 ierr = PetscOptionsEnd();
184 CHKERR mOab.write_file(mesh_out_file);
196 CHKERR mOab.get_entities_by_dimension(0, 3, ents);
197 if (ents.size() != 125) {
200 "atom test %d failed: Wrong number of elements %d, should be 125",
205 CHKERR mField.getInterface(meshsets_manager_ptr);
209 CHKERR mField.get_moab().get_entities_by_dimension(it->meshset, 2, ents,
211 if (it->getMeshsetId() == 1) {
212 if (it->getName() !=
"FIX_ALL") {
214 "atom test %d failed: Wrong name of meshset %d, should be "
216 atom_test, it->getMeshsetId(), it->getName());
218 if (ents.size() != 25) {
220 "atom test %d failed: Wrong number of entities in meshset "
221 "%d with %d, should be 25",
222 atom_test, it->getMeshsetId(), ents.size());
224 }
else if (it->getMeshsetId() == 2) {
225 if (it->getName() !=
"FIX_X") {
227 "atom test %d failed: Wrong name of meshset %d, should be "
229 atom_test, it->getMeshsetId(), it->getName());
231 if (ents.size() != 25) {
233 "atom test %d failed: Wrong number of entities in meshset "
234 "%d with %d, should be 25",
235 atom_test, it->getMeshsetId(), ents.size());
237 }
else if (it->getMeshsetId() == 100) {
238 if (it->getName() !=
"ADOLCMAT") {
240 "atom test %d failed: Wrong name of meshset %d, should be "
242 atom_test, it->getMeshsetId(), it->getName());
250 static char help[] =
"...\n\n";
252 int main(
int argc,
char *argv[]) {
259 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
261 pcomm =
new ParallelComm(&moab, PETSC_COMM_WORLD);