276 Range tets_level, prisms_level;
285 tets_level.merge(prisms_level);
288 CHKERR skin.find_skin(0, tets_level,
false, mesh_skin);
290 mesh_skin = mesh_skin.subset_by_type(MBTRI);
292 Range faces_to_remove, contact_faces;
295 faces_to_remove = subtract(faces_to_remove, contact_faces);
297 mesh_skin = subtract(mesh_skin, faces_to_remove);
299 CHKERR m_field.
get_moab().get_connectivity(mesh_skin, fix_material_nodes);
302 Range fixed_edges_nodes;
303 CHKERR m_field.
get_moab().get_connectivity(fixed_edges, fixed_edges_nodes,
306 Range crack_faces_and_fixed_edges_nodes;
308 cP.
crackFaces, crack_faces_and_fixed_edges_nodes,
true);
309 crack_faces_and_fixed_edges_nodes =
310 intersect(crack_faces_and_fixed_edges_nodes, fixed_edges_nodes);
312 Range crack_faces_edges;
314 cP.
crackFaces, 1,
false, crack_faces_edges, moab::Interface::UNION);
315 Range not_fixed_edges = intersect(crack_faces_edges, fixed_edges);
316 Range not_fixed_edges_nodes;
318 not_fixed_edges_nodes,
true);
319 crack_faces_and_fixed_edges_nodes =
320 subtract(crack_faces_and_fixed_edges_nodes, not_fixed_edges_nodes);
321 fix_material_nodes.merge(crack_faces_and_fixed_edges_nodes);
323 Range not_fixed_edges_skin;
324 CHKERR skin.find_skin(0, not_fixed_edges,
false, not_fixed_edges_skin);
325 fix_material_nodes.merge(
331 CHKERR m_field.
get_moab().write_file(
"fixed_faces.vtk",
"VTK",
"",
337 fix_material_nodes.merge(
cP.
getInterface<CPMeshCut>()->getCornerNodes());
340 auto bc_fix_nodes = [&m_field,
344 CHKERR m_field.
get_moab().get_entities_by_handle(meshset, ents,
true);
347 fix_material_nodes.merge(nodes);
352 CHKERR bc_fix_nodes(it->getMeshset());
358 CHKERR bc_fix_nodes(it->getMeshset());
366 CHKERR bc_fix_nodes(it->getMeshset());
375 fix_material_nodes.merge(contact_nodes);
381 if (
bit->getName().compare(0, 9,
"SPRING_BC") == 0) {
391 fix_material_nodes.merge(contact_nodes);
396 Range interface_nodes;
399 fix_material_nodes.merge(interface_nodes);
402 auto add_nodes_on_opposite_side_of_prism = [&m_field, &fix_material_nodes,
403 this](
bool only_contact_prisms =
408 fix_material_nodes, 3,
false, adj_prisms, moab::Interface::UNION);
409 adj_prisms = adj_prisms.subset_by_type(MBPRISM);
410 if (only_contact_prisms) {
413 for (
auto p : adj_prisms) {
416 CHKERR m_field.
get_moab().get_connectivity(p, conn, num_nodes,
false);
418 for (
int n = 0;
n != 3; ++
n) {
419 if (fix_material_nodes.find(conn[
n]) != fix_material_nodes.end()) {
420 add_nodes.insert(conn[3 +
n]);
422 if (fix_material_nodes.find(conn[3 +
n]) !=
423 fix_material_nodes.end()) {
424 add_nodes.insert(conn[
n]);
427 fix_material_nodes.merge(add_nodes);
432 CHKERR add_nodes_on_opposite_side_of_prism();
438 auto copy_map = [&fix_material_nodes](
const auto &map) {
439 std::map<EntityHandle, double> map_copy;
440 for (
auto &
m : map) {
441 if (fix_material_nodes.find(
m.first) == fix_material_nodes.end()) {
442 map_copy[
m.first] =
m.second;
448 const std::map<EntityHandle, double> map_j = copy_map(
cP.
mapJ);
449 const std::map<EntityHandle, double> map_g1 = copy_map(
cP.
mapG1);
451 auto find_max = [](
const auto &map) {
454 max = fmax(
m.second, max);
458 const double max_j = find_max(map_j);
459 const double max_g1 = find_max(map_g1);
461 for (
auto &
m : map_j) {
464 fix_material_nodes.insert(
m.first);
472 "No points to move on crack front");
488 CHKERR add_nodes_on_opposite_side_of_prism(
true);