269 {
272
274 Range tets_level, prisms_level;
277 tets_level);
280 prisms_level);
281
283 tets_level.merge(prisms_level);
284
286 CHKERR skin.find_skin(0, tets_level,
false, mesh_skin);
287
288 mesh_skin = mesh_skin.subset_by_type(MBTRI);
289
290 Range faces_to_remove, contact_faces;
293 faces_to_remove = subtract(faces_to_remove, contact_faces);
294
295 mesh_skin = subtract(mesh_skin, faces_to_remove);
296
297 CHKERR m_field.
get_moab().get_connectivity(mesh_skin, fix_material_nodes);
298
300 Range fixed_edges_nodes;
301 CHKERR m_field.
get_moab().get_connectivity(fixed_edges, fixed_edges_nodes,
302 true);
303
304 Range crack_faces_and_fixed_edges_nodes;
306 cP.
crackFaces, crack_faces_and_fixed_edges_nodes,
true);
307 crack_faces_and_fixed_edges_nodes =
308 intersect(crack_faces_and_fixed_edges_nodes, fixed_edges_nodes);
309
310 Range crack_faces_edges;
312 cP.
crackFaces, 1,
false, crack_faces_edges, moab::Interface::UNION);
313 Range not_fixed_edges = intersect(crack_faces_edges, fixed_edges);
314 Range not_fixed_edges_nodes;
316 not_fixed_edges_nodes, true);
317 crack_faces_and_fixed_edges_nodes =
318 subtract(crack_faces_and_fixed_edges_nodes, not_fixed_edges_nodes);
319 fix_material_nodes.merge(crack_faces_and_fixed_edges_nodes);
320
321 Range not_fixed_edges_skin;
322 CHKERR skin.find_skin(0, not_fixed_edges,
false, not_fixed_edges_skin);
323 fix_material_nodes.merge(
329 CHKERR m_field.
get_moab().write_file(
"fixed_faces.vtk",
"VTK",
"",
330 &meshset, 1);
332 }
333
334
335 fix_material_nodes.merge(
cP.
getInterface<CPMeshCut>()->getCornerNodes());
336
337
338 auto bc_fix_nodes = [&m_field,
342 CHKERR m_field.
get_moab().get_entities_by_handle(meshset, ents,
true);
345 fix_material_nodes.merge(nodes);
347 };
350 CHKERR bc_fix_nodes(it->getMeshset());
351 }
352
356 CHKERR bc_fix_nodes(it->getMeshset());
357 }
358 }
359
361
364 CHKERR bc_fix_nodes(it->getMeshset());
365 }
366 }
367
368
372 contact_nodes);
373 fix_material_nodes.merge(contact_nodes);
374 }
375
377
379 if (
bit->getName().compare(0, 9,
"SPRING_BC") == 0) {
381 }
382 }
383 }
384
385 {
388 contact_nodes);
389 fix_material_nodes.merge(contact_nodes);
390 }
391
392
394 Range interface_nodes;
396 interface_nodes);
397 fix_material_nodes.merge(interface_nodes);
398 }
399
400 auto add_nodes_on_opposite_side_of_prism = [&m_field, &fix_material_nodes,
401 this](bool only_contact_prisms =
402 false) {
406 fix_material_nodes, 3, false, adj_prisms, moab::Interface::UNION);
407 adj_prisms = adj_prisms.subset_by_type(MBPRISM);
408 if (only_contact_prisms) {
410 }
411 for (
auto p : adj_prisms) {
412 int num_nodes;
416 for (
int n = 0;
n != 3; ++
n) {
417 if (fix_material_nodes.find(conn[
n]) != fix_material_nodes.end()) {
418 add_nodes.insert(conn[3 +
n]);
419 }
420 if (fix_material_nodes.find(conn[3 +
n]) !=
421 fix_material_nodes.end()) {
422 add_nodes.insert(conn[
n]);
423 }
424 }
425 fix_material_nodes.merge(add_nodes);
426 }
428 };
429
430 CHKERR add_nodes_on_opposite_side_of_prism();
431
433 if (fix_small_g) {
434
436 auto copy_map = [&fix_material_nodes](const auto &map) {
437 std::map<EntityHandle, double> map_copy;
438 for (
auto &
m : map) {
439 if (fix_material_nodes.find(
m.first) == fix_material_nodes.end()) {
440 map_copy[
m.first] =
m.second;
441 }
442 }
443 return map_copy;
444 };
445
446 const std::map<EntityHandle, double> map_j = copy_map(
cP.
mapJ);
447 const std::map<EntityHandle, double> map_g1 = copy_map(
cP.
mapG1);
448
449 auto find_max = [](const auto &map) {
450 double max = 0;
452 max = fmax(
m.second, max);
453 return max;
454 };
455
456 const double max_j = find_max(map_j);
457 const double max_g1 = find_max(map_g1);
458
459 for (
auto &
m : map_j) {
462 fix_material_nodes.insert(
m.first);
463 } else {
465 }
466 }
467
470 "No points to move on crack front");
471 }
472
474 }
475
481 }
484 }
485
486 CHKERR add_nodes_on_opposite_side_of_prism(
true);
487
489 }
@ MOFEM_DATA_INCONSISTENCY
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'm', SPACE_DIM > m
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet 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.
const FTensor::Tensor2< T, Dim, Dim > Vec
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
std::map< std::string, BitRefLevel > mapBitLevel
MoFEM::Interface & mField
map< EntityHandle, double > mapJ
hashmap of J - release energy at nodes
Range mortarContactElements
PetscBool fixContactNodes
double fractionOfFixedNodes
Range constrainedInterface
Range of faces on the constrained interface.
PetscBool isPressureAle
If true surface pressure is considered in ALE.
map< EntityHandle, double > mapG1
hashmap of g1 - release energy at nodes
PetscBool areSpringsAle
If true surface spring is considered in ALE.
PetscBool isSurfaceForceAle
If true surface pressure is considered in ALE.
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
Deprecated interface functions.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.