92 {
96
98 CHKERR mOab.tag_get_handle(
"BOUNDARY_CONDITIONS", 1, MB_TYPE_INTEGER, bc_tag,
99 MB_TAG_CREAT | MB_TAG_SPARSE);
100
101 std::vector<std::tuple<int, std::string, std::string>> conditions = {
102 {1, "FIX_ALL", "FIX_ALL"},
103 {2, "FIX_X", "FIX_X"},
104 {3, "FIX_Y", "FIX_Y"},
105 {4, "FIX_Z", "FIX_Z"},
106 {5, "FIX_X_2", "DISP_X"},
107 {6, "FIX_Y_2", "DISP_Y"},
108 {7, "FIX_Z_2", "DISP_Z"},
109 {8, "FORCE_X", "FORCE_X"},
110 {9, "FORCE_Y", "FORCE_Y"},
111 {10, "FORCE_Z", "FORCE_Z"},
112 {11, "VEL_X", "VEL_X"},
113 {12, "VEL_Y", "VEL_Y"},
114 {13, "VEL_Z", "VEL_Z"},
115 {14, "ACCL_X", "ACCL_X"},
116 {15, "ACCL_Y", "ACCL_Y"},
117 {16, "ACCL_Z", "ACCL_Z"},
118 {17, "TEMP", "TEMP"},
119 {18, "PRESSURE", "PRESSURE"},
120 {19, "HEAT_FLUX", "HEAT_FLUX"},
121 {20, "CONTACT", "CONTACT"},
122 {21, "DISPLACEMENT", "DISPLACEMENT"},
123 {22, "ROTATE_ALL", "ROTATE_ALL"},
124 {23, "ROTATE_X", "ROTATE_X"},
125 {24, "ROTATE_Y", "ROTATE_Y"},
126 {25, "ROTATE_Z", "ROTATE_Z"},
127 {26, "TEMPERATURE", "TEMPERATURE"},
128 {50, "TIE_MATRIX", "TIE_MATRIX"}};
129
130 for (auto &condition : conditions) {
131 int desired_val = std::get<0>(condition);
132 const void *desired_val_ptr = &desired_val;
134 CHKERR mOab.get_entities_by_type_and_tag(0, MBVERTEX, &bc_tag,
135 &desired_val_ptr, 1, bc);
136
137 if (!bc.empty()) {
139 CHKERR mOab.get_adjacencies(bc, 2,
true, faces, moab::Interface::UNION);
141 CHKERR mOab.get_adjacencies(bc, 1,
true, edges, moab::Interface::UNION);
142
144 CHKERR mOab.get_adjacencies(faces, 0,
false, adj_nodes,
145 moab::Interface::UNION);
146
148 non_BC_nodes = subtract(adj_nodes, bc);
150 CHKERR mOab.get_adjacencies(non_BC_nodes, 2,
false, non_BC_faces,
151 moab::Interface::UNION);
153 CHKERR mOab.get_adjacencies(non_BC_nodes, 1,
false, non_BC_edges,
154 moab::Interface::UNION);
155
156 faces = subtract(faces, non_BC_faces);
157 edges = subtract(edges, non_BC_edges);
158
159 MOFEM_LOG_C(
"WORLD", Sev::inform,
"Number of nodes assigned to %s = %d",
160 std::get<2>(condition).c_str(), bc.size());
161 MOFEM_LOG_C(
"WORLD", Sev::inform,
"Number of edges assigned to %s = %d",
162 std::get<2>(condition).c_str(), edges.size());
163 MOFEM_LOG_C(
"WORLD", Sev::inform,
"Number of faces assigned to %s = %d",
164 std::get<2>(condition).c_str(), faces.size());
165
167 std::get<1>(condition));
169 bc);
171 edges);
173 faces);
174 } else {
176 }
177 }
178
180}
#define MOFEM_LOG_C(channel, severity, format,...)
MoFEMErrorCode getBlockSetBCFromMesh(std::string)