101 {
103
106
107 std::regex((boost::format("%s(.*)") % block_name).str())
108
109 );
110
111 for (auto bc : bcs) {
113 CHK_MOAB_THROW(bc->getMeshsetIdEntitiesByDimension(m_field.get_moab(), dim,
114 faces, true),
115 "get meshset ents");
117 }
118
120};
121
123 const std::string block_name, int dim) {
124 std::map<std::string, Range>
r;
125
128
129 std::regex((boost::format("%s(.*)") % block_name).str())
130
131 );
132
133 for (auto bc : bcs) {
136 faces, true),
137 "get meshset ents");
138 r[bc->getName()] = faces;
139 }
140
142}
143
145 const unsigned int cubit_bc_type) {
148 CHKERR mesh_mng->getMeshset(ms_id, cubit_bc_type, meshset);
149 return meshset;
150};
151
152static auto save_range(moab::Interface &moab,
const std::string name,
153 const Range r, std::vector<Tag> tags = {}) {
156 CHKERR moab.add_entities(*out_meshset, r);
158 CHKERR moab.write_file(name.c_str(),
"VTK",
"", out_meshset->get_ptr(), 1,
159 tags.data(), tags.size());
160 } else {
161 MOFEM_LOG(
"SELF", Sev::warning) <<
"Empty range for " << name;
162 }
164};
165
168 ParallelComm *pcomm =
171 PSTATUS_SHARED | PSTATUS_MULTISHARED,
172 PSTATUS_NOT, -1, &boundary_ents),
173 "filter_pstatus");
174 return boundary_ents;
175};
176
179 ParallelComm *pcomm =
181 CHK_MOAB_THROW(pcomm->filter_pstatus(skin, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1,
182 &owner_ents),
183 "filter_pstatus");
184 return owner_ents;
185};
186
190 CHK_MOAB_THROW(skin.find_skin(0, body_ents,
false, skin_ents),
"find_skin");
191 return skin_ents;
192};
193
196 ParallelComm *pcomm =
199 Range crack_skin_without_bdy;
200 if (pcomm->rank() == 0) {
202 CHKERR moab.get_adjacencies(crack_faces, 1,
true, crack_edges,
203 moab::Interface::UNION);
204 auto crack_skin =
get_skin(m_field, crack_faces);
208 "get_entities_by_dimension");
209 auto body_skin =
get_skin(m_field, body_ents);
210 Range body_skin_edges;
211 CHK_MOAB_THROW(moab.get_adjacencies(body_skin, 1,
true, body_skin_edges,
212 moab::Interface::UNION),
213 "get_adjacencies");
214 crack_skin_without_bdy = subtract(crack_skin, body_skin_edges);
216 for (
auto &
m : front_edges_map) {
217 auto add_front = subtract(
m.second, crack_edges);
218 auto i = intersect(
m.second, crack_edges);
220 crack_skin_without_bdy.merge(add_front);
221 } else {
static auto get_block_meshset(MoFEM::Interface &m_field, const int ms_id, const unsigned int cubit_bc_type)
static auto get_range_from_block_map(MoFEM::Interface &m_field, const std::string block_name, int dim)
static auto filter_owners(MoFEM::Interface &m_field, Range skin)
static auto filter_true_skin(MoFEM::Interface &m_field, Range &&skin)
static auto get_skin(MoFEM::Interface &m_field, Range body_ents)
static auto get_crack_front_edges(MoFEM::Interface &m_field, Range crack_faces)
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
FTensor::Index< 'i', SPACE_DIM > i
auto get_temp_meshset_ptr(moab::Interface &moab)
Create smart pointer to temporary meshset.
FTensor::Index< 'm', 3 > m
Interface for managing meshsets containing materials and boundary conditions.