v0.14.0
Static Public Member Functions | List of all members
MortarContactStructures Struct Reference

#include <users_modules/mortar_contact/src/MakeStructures.hpp>

Static Public Member Functions

static MoFEMErrorCode masterSlaveTrianglesCreation (MoFEM::Interface &m_field, Range &range_surf_master, Range &range_surf_slave, int step=1)
 
static MoFEMErrorCode findContactSurfacePairs (MoFEM::Interface &m_field, std::vector< std::pair< Range, Range >> &contact_surface_pairs)
 

Detailed Description

Definition at line 18 of file MakeStructures.hpp.

Member Function Documentation

◆ findContactSurfacePairs()

static MoFEMErrorCode MortarContactStructures::findContactSurfacePairs ( MoFEM::Interface m_field,
std::vector< std::pair< Range, Range >> &  contact_surface_pairs 
)
inlinestatic

Definition at line 43 of file MakeStructures.hpp.

45  {
47 
48  std::map<std::string, Range> slave_surface_map, master_surface_map;
49 
50  auto fill_surface_map = [&](auto &surface_map, std::string surface_name) {
52 
54  if (it->getName().compare(0, surface_name.size(), surface_name) == 0) {
55  Range tris;
56  CHKERR m_field.get_moab().get_entities_by_type(it->meshset, MBTRI,
57  tris, true);
58  std::string key = it->getName().substr(surface_name.size());
59  auto res =
60  surface_map.insert(std::pair<std::string, Range>(key, tris));
61  if (!res.second) {
62  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
63  "Contact surface name %s used more than once",
64  it->getName().c_str());
65  }
66  }
67  }
68 
70  };
71 
72  CHKERR fill_surface_map(slave_surface_map, "MORTAR_SLAVE");
73  CHKERR fill_surface_map(master_surface_map, "MORTAR_MASTER");
74 
75  for (const auto &[key, slave_range] : slave_surface_map) {
76  auto master_search = master_surface_map.find(key);
77  if (master_search != master_surface_map.end()) {
78  contact_surface_pairs.push_back(
79  std::pair<Range, Range>(slave_range, master_search->second));
80  master_surface_map.erase(master_search);
81  } else {
82  SETERRQ2(
83  PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
84  "Cannot find pairing contact surface MORTAR_MASTER%s for existing "
85  "surface MORTAR_SLAVE%s",
86  key.c_str(), key.c_str());
87  }
88  }
89 
90  if (!master_surface_map.empty()) {
91  std::string key = master_surface_map.begin()->first;
92  SETERRQ2(
93  PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
94  "Cannot find pairing contact surface MORTAR_SLAVE%s for existing "
95  "surface MORTAR_MASTER%s",
96  key.c_str(), key.c_str());
97  }
98 
100  }

◆ masterSlaveTrianglesCreation()

static MoFEMErrorCode MortarContactStructures::masterSlaveTrianglesCreation ( MoFEM::Interface m_field,
Range range_surf_master,
Range range_surf_slave,
int  step = 1 
)
inlinestatic

Definition at line 20 of file MakeStructures.hpp.

23  {
26  if (it->getName().compare(0, 13, "MORTAR_MASTER") == 0) {
27  CHKERR m_field.get_moab().get_entities_by_type(it->meshset, MBTRI,
28  range_surf_master, true);
29  }
30  }
31 
33  if (it->getName().compare(0, 12, "MORTAR_SLAVE") == 0) {
34  rval = m_field.get_moab().get_entities_by_type(it->meshset, MBTRI,
35  range_surf_slave, true);
37  }
38  }
39 
41  }

The documentation for this struct was generated from the following file:
CHKERRQ_MOAB
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:467
MoFEM::Exceptions::rval
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:74
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
Range
_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_
#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.
Definition: MeshsetsManager.hpp:71
BLOCKSET
@ BLOCKSET
Definition: definitions.h:161
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359