v0.14.0
Loading...
Searching...
No Matches
Files | Classes | Macros | Functions
MeshsetsManager

Interface for meshsets with entities with data and boundary conditions. More...

Collaboration diagram for MeshsetsManager:

Files

file  MeshsetsManager.hpp
 MeshsetsManager interface.
 

Classes

struct  MoFEM::MeshsetsManager
 Interface for managing meshsets containing materials and boundary conditions. More...
 

Macros

#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
 Iterator that loops over all the Cubit MeshSets in a moFEM field. More...
 
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
 Iterator that loops over a specific Cubit MeshSet in a moFEM field. More...
 
#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. More...
 
#define _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_(MESHSET_MANAGER, NAME, IT)
 Iterator that loops over Cubit BlockSet having a particular name. More...
 

Functions

CubitMeshSet_multiIndex::iterator MoFEM::MeshsetsManager::getBegin () const
 get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT) More...
 
CubitMeshSet_multiIndex::iterator MoFEM::MeshsetsManager::getEnd () const
 get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT) More...
 
CubitMeshsetByType::iterator MoFEM::MeshsetsManager::getBegin (const unsigned int cubit_bc_type) const
 get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT) More...
 
CubitMeshsetByType::iterator MoFEM::MeshsetsManager::getEnd (const unsigned int cubit_bc_type) const
 get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT) More...
 
CubitMeshsetByMask::iterator MoFEM::MeshsetsManager::getBySetTypeBegin (const unsigned int cubit_bc_type) const
 get end iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT) More...
 
CubitMeshsetByMask::iterator MoFEM::MeshsetsManager::getBySetTypeEnd (const unsigned int cubit_bc_type) const
 get end iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT) More...
 
CubitMeshsetByName::iterator MoFEM::MeshsetsManager::getBegin (const std::string &name) const
 get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT) More...
 
CubitMeshsetByName::iterator MoFEM::MeshsetsManager::getEnd (const std::string &name) const
 get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT) More...
 
bool MoFEM::MeshsetsManager::checkMeshset (const int ms_id, const CubitBCType cubit_bc_type) const
 check for CUBIT Id and CUBIT type More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::addMeshset (const CubitBCType cubit_bc_type, const int ms_id, const std::string name="")
 add cubit meshset More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr (const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
 get cubit meshset More...
 
const CubitMeshSetsMoFEM::MeshsetsManager::getCubitMeshsetPtr (const int ms_id, const CubitBCType cubit_bc_type) const
 get cubit meshset More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr (const CubitBCType cubit_bc_type, std::vector< const CubitMeshSets * > &vec_ptr) const
 Get vector of pointer by bc type. More...
 
std::vector< const CubitMeshSets * > MoFEM::MeshsetsManager::getCubitMeshsetPtr (const CubitBCType cubit_bc_type) const
 Get vector of pointer by bc type. More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr (const string name, const CubitMeshSets **cubit_meshset_ptr) const
 get cubit meshset More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr (const std::regex reg_exp_name, std::vector< const CubitMeshSets * > &vec_ptr) const
 Get vector of pointer to blocksets with name satisfying regular expression. More...
 
std::vector< const CubitMeshSets * > MoFEM::MeshsetsManager::getCubitMeshsetPtr (const std::regex reg_exp_name) const
 Get vector of pointer to blocksets with name satisfying regular expression. More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::getEntitiesByDimension (const int ms_id, const unsigned int cubit_bc_type, const int dimension, Range &entities, const bool recursive=true) const
 get entities from CUBIT/meshset of a particular entity dimension More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::getEntitiesByDimension (const int ms_id, const unsigned int cubit_bc_type, Range &entities, const bool recursive=true) const
 get entities related to CUBIT/meshset, More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::getMeshset (const int ms_id, const unsigned int cubit_bc_type, EntityHandle &meshset) const
 get meshset from CUBIT Id and CUBIT type More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::getMeshsetsByType (const unsigned int cubit_bc_type, Range &meshsets) const
 get all CUBIT meshsets by CUBIT type More...
 

Detailed Description

Interface for meshsets with entities with data and boundary conditions.

Macro Definition Documentation

◆ _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_

#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_ (   MESHSET_MANAGER,
  CUBITBCTYPE,
  IT 
)
Value:
CubitMeshsetByType::iterator IT = \
MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(CUBITBCTYPE); \
IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(CUBITBCTYPE); \
IT++
constexpr IntegrationType IT
Definition: plastic.cpp:47

Iterator that loops over a specific Cubit MeshSet in a moFEM field.

Parameters
mFieldmoFEM Field
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
iterator
Examples
ElasticityMixedFormulation.hpp, HookeElement.cpp, add_cubit_meshsets.cpp, bone_adaptation.cpp, elasticity.cpp, field_blas.cpp, nonlinear_dynamics.cpp, and simple_elasticity.cpp.

Definition at line 49 of file MeshsetsManager.hpp.

◆ _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_

#define _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_ (   MESHSET_MANAGER,
  NAME,
  IT 
)
Value:
CubitMeshsetByName::iterator IT = \
MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(NAME); \
IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(NAME); \
IT++

Iterator that loops over Cubit BlockSet having a particular name.

Parameters
MESHSET_MANAGERmeshset manager (works as well with Interface)
NAMEname
ITiterator

Example:

for(_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(mField,"SOME_BLOCK_NAME",it) {
...
}
#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 at line 94 of file MeshsetsManager.hpp.

◆ _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_

#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_ (   MESHSET_MANAGER,
  CUBITBCTYPE,
  IT 
)
Value:
CubitMeshsetByMask::iterator IT = \
MESHSET_MANAGER.get_meshsets_manager_ptr()->getBySetTypeBegin( \
CUBITBCTYPE); \
IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getBySetTypeEnd( \
CUBITBCTYPE); \
IT++

Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.

Parameters
MESHSET_MANAGERmeshset manager (works as well with Interface)
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
iterator

Example:

...
}
@ NODESET
Definition: definitions.h:146
@ DISPLACEMENTSET
Definition: definitions.h:150
Examples
MagneticElement.hpp, Remodeling.cpp, UnsaturatedFlow.hpp, add_cubit_meshsets.cpp, cell_forces.cpp, continuity_check_on_contact_prism_side_ele.cpp, cubit_bc_test.cpp, elasticity.cpp, forces_and_sources_testing_flat_prism_element.cpp, helmholtz.cpp, hertz_surface.cpp, mesh_cut.cpp, mesh_insert_interface_atom.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, photon_diffusion.cpp, simple_contact.cpp, simple_contact_thermal.cpp, test_jacobian_of_simple_contact_element.cpp, unsaturated_transport.cpp, and wavy_surface.cpp.

Definition at line 71 of file MeshsetsManager.hpp.

◆ _IT_CUBITMESHSETS_FOR_LOOP_

#define _IT_CUBITMESHSETS_FOR_LOOP_ (   MESHSET_MANAGER,
  IT 
)
Value:
CubitMeshSet_multiIndex::iterator IT = \
MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(); \
IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(); \
IT++

Iterator that loops over all the Cubit MeshSets in a moFEM field.

Parameters
MESHSET_MANAGERmeshset manager (works as well with Interface)
iterator
Examples
add_cubit_meshsets.cpp, bone_adaptation.cpp, continuity_check_on_contact_prism_side_ele.cpp, forces_and_sources_testing_flat_prism_element.cpp, mesh_insert_interface_atom.cpp, mortar_contact_thermal.cpp, simple_contact.cpp, simple_contact_thermal.cpp, split_sideset.cpp, and unsaturated_transport.cpp.

Definition at line 34 of file MeshsetsManager.hpp.

Function Documentation

◆ addMeshset()

MoFEMErrorCode MoFEM::MeshsetsManager::addMeshset ( const CubitBCType  cubit_bc_type,
const int  ms_id,
const std::string  name = "" 
)

add cubit meshset

Parameters
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
ms_idid of the BLOCKSET/SIDESET/BLOCKSET
nameof set
Examples
add_cubit_meshsets.cpp, and mesh_cut.cpp.

Definition at line 312 of file MeshsetsManager.cpp.

314 {
315 Interface &m_field = cOre;
316 moab::Interface &moab = m_field.get_moab();
318 if (checkMeshset(ms_id, cubit_bc_type)) {
319 SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
320 "such cubit meshset is already there", ms_id);
321 }
322
323 CubitMeshSets cmeshset(moab, cubit_bc_type, ms_id);
324 if ((cmeshset.cubitBcType & CubitBCType(NODESET | SIDESET | BLOCKSET))
325 .any()) {
326 auto p = cubitMeshsets.insert(cmeshset);
327 if (!p.second) {
328 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
329 "meshset not inserted");
330 }
331 if (name.size() > 0) {
332 bool success =
333 cubitMeshsets.modify(p.first, CubitMeshSets_change_name(moab, name));
334 if (!success) {
335 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
336 "name to cubit meshset can not be set");
337 }
338 }
339 }
340
342}
static Index< 'p', 3 > p
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ SIDESET
Definition: definitions.h:147
@ BLOCKSET
Definition: definitions.h:148
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
bool checkMeshset(const int ms_id, const CubitBCType cubit_bc_type) const
check for CUBIT Id and CUBIT type
std::bitset< 32 > CubitBCType
Definition: Types.hpp:52
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
moab::Interface & get_moab()
Definition: Core.hpp:322
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets

◆ checkMeshset()

bool MoFEM::MeshsetsManager::checkMeshset ( const int  ms_id,
const CubitBCType  cubit_bc_type 
) const

check for CUBIT Id and CUBIT type

Todo:
All cubit interface functions should be outsourced to dedicated interface
Parameters
ms_idid of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
Examples
heat_equation.cpp, mesh_cut.cpp, mesh_smoothing.cpp, and reaction_diffusion.cpp.

Definition at line 287 of file MeshsetsManager.cpp.

288 {
289 auto miit =
290 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
291 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
292 if (miit !=
293 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
294 return true;
295 }
296 return false;
297}

◆ getBegin() [1/3]

CubitMeshSet_multiIndex::iterator MoFEM::MeshsetsManager::getBegin ( ) const
inline

get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT)

for(IT_CUBITMESHSETS_FOR_LOOP(mField,it) { ... }

Definition at line 243 of file MeshsetsManager.hpp.

243 {
244 return cubitMeshsets.begin();
245 }

◆ getBegin() [2/3]

CubitMeshsetByName::iterator MoFEM::MeshsetsManager::getBegin ( const std::string &  name) const
inline

get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT)

for(IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP(mField,NODESET|DISPLACEMENTSET,it) { ... }

Parameters
typeof meshset (NODESET, SIDESET or BLOCKSET and more)

Definition at line 351 of file MeshsetsManager.hpp.

351 {
352 return cubitMeshsets.get<CubitMeshsets_name>().lower_bound(name);
353 }

◆ getBegin() [3/3]

CubitMeshsetByType::iterator MoFEM::MeshsetsManager::getBegin ( const unsigned int  cubit_bc_type) const
inline

get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT)

for(IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(mField,NODESET|DISPLACEMENTSET,it) { ... }

Parameters
typeof meshset (NODESET, SIDESET or BLOCKSET and more)

Definition at line 276 of file MeshsetsManager.hpp.

276 {
277 return cubitMeshsets.get<CubitMeshsetType_mi_tag>().lower_bound(
278 cubit_bc_type);
279 }

◆ getBySetTypeBegin()

CubitMeshsetByMask::iterator MoFEM::MeshsetsManager::getBySetTypeBegin ( const unsigned int  cubit_bc_type) const
inline

get end iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT)

for(IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(mField,NODESET,it) { ... }

Parameters
typeof meshset (NODESET, SIDESET or BLOCKSET and more)

Definition at line 314 of file MeshsetsManager.hpp.

314 {
315 return cubitMeshsets.get<CubitMeshsetMaskedType_mi_tag>().lower_bound(
316 cubit_bc_type);
317 }

◆ getBySetTypeEnd()

CubitMeshsetByMask::iterator MoFEM::MeshsetsManager::getBySetTypeEnd ( const unsigned int  cubit_bc_type) const
inline

get end iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT)

for(IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(mField,NODESET,it) { ... }

Parameters
typeof meshset (NODESET, SIDESET or BLOCKSET and more)

Definition at line 332 of file MeshsetsManager.hpp.

332 {
333 return cubitMeshsets.get<CubitMeshsetMaskedType_mi_tag>().upper_bound(
334 cubit_bc_type);
335 }

◆ getCubitMeshsetPtr() [1/7]

std::vector< const CubitMeshSets * > MoFEM::MeshsetsManager::getCubitMeshsetPtr ( const CubitBCType  cubit_bc_type) const

Get vector of pointer by bc type.

Returns
MoFEMErrorCode

Definition at line 569 of file MeshsetsManager.cpp.

569 {
570 std::vector<const CubitMeshSets *> vec_ptr;
571 CHK_MOAB_THROW(getCubitMeshsetPtr(cubit_bc_type, vec_ptr),
572 "Error in getting meshsets by name");
573 return vec_ptr;
574}
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:576
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset

◆ getCubitMeshsetPtr() [2/7]

MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr ( const CubitBCType  cubit_bc_type,
std::vector< const CubitMeshSets * > &  vec_ptr 
) const

Get vector of pointer by bc type.

Parameters
std::vector<constCubitMeshSets *>
Returns
MoFEMErrorCode

Definition at line 551 of file MeshsetsManager.cpp.

553 {
555 for (auto &c : cubitMeshsets) {
556 if ((c.getBcType() & cubit_bc_type) == cubit_bc_type) {
557 vec_ptr.push_back(&c);
558 }
559 }
560 std::sort(vec_ptr.begin(), vec_ptr.end(),
561 [](const CubitMeshSets *a, const CubitMeshSets *b) {
562 return a->getMeshsetId() < b->getMeshsetId();
563 });
564
566}
const double c
speed of light (cm/ns)

◆ getCubitMeshsetPtr() [3/7]

const CubitMeshSets * MoFEM::MeshsetsManager::getCubitMeshsetPtr ( const int  ms_id,
const CubitBCType  cubit_bc_type 
) const

get cubit meshset

Definition at line 524 of file MeshsetsManager.cpp.

525 {
526 const CubitMeshSets *cubit_meshset_ptr;
528 getCubitMeshsetPtr(ms_id, cubit_bc_type, &cubit_meshset_ptr),
529 "Get not get meshset");
530 return cubit_meshset_ptr;
531}
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:595

◆ getCubitMeshsetPtr() [4/7]

MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr ( const int  ms_id,
const CubitBCType  cubit_bc_type,
const CubitMeshSets **  cubit_meshset_ptr 
) const

get cubit meshset

Examples
EshelbianPlasticity.cpp, dynamic_first_order_con_law.cpp, plastic.cpp, and thermo_elastic.cpp.

Definition at line 505 of file MeshsetsManager.cpp.

507 {
508 Interface &m_field = cOre;
510 auto miit =
511 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
512 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
513 if (miit !=
514 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
515 *cubit_meshset_ptr = &*miit;
516 } else {
517 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
518 "msId = %d is not there", ms_id);
519 }
521}

◆ getCubitMeshsetPtr() [5/7]

std::vector< const CubitMeshSets * > MoFEM::MeshsetsManager::getCubitMeshsetPtr ( const std::regex  reg_exp_name) const

Get vector of pointer to blocksets with name satisfying regular expression.

for (auto m :
m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
(boost::format("%s(.*)") % block_name).str()
))
) {
MOFEM_LOG("WORLD", Sev::inform) << m->getName();
Rants ents;
m_field.get_moab().get_entities_by_dimension(
m->getMeshset(), 0, ents, false);
auto print_vets = [](boost::shared_ptr<FieldEntity> ent_ptr) {
if(!(ent_ptr->getPStatus() & PSTATUS_NOT_OWNED)) {
MOFEM_LOG("SYNC", Sev::inform) << ents_ptr->getName() << ": " <<
ent_ptr->getEntFieldData();
}
};
CHKERR m_field.getInterface<FieldBlas>()->fieldLambdaOnEntities(
print_vets, "VELOCITIES", &ents);
CHKERR m_field.getInterface<FieldBlas>()->fieldLambdaOnEntities(
print_vets, "DISPLACEMENTS", &ents);
MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::ifrom);
}
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
Definition: LogManager.hpp:352
#define CHKERR
Inline error check.
Definition: definitions.h:535
FTensor::Index< 'm', SPACE_DIM > m
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
Interface for managing meshsets containing materials and boundary conditions.
Parameters
reg_exp_name
Returns
std::vector<const CubitMeshSets *>

Definition at line 596 of file MeshsetsManager.cpp.

596 {
597 std::vector<const CubitMeshSets *> vec_ptr;
598 CHK_MOAB_THROW(getCubitMeshsetPtr(reg_exp_name, vec_ptr),
599 "Error in getting meshsets by name");
600 return vec_ptr;
601}

◆ getCubitMeshsetPtr() [6/7]

MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr ( const std::regex  reg_exp_name,
std::vector< const CubitMeshSets * > &  vec_ptr 
) const

Get vector of pointer to blocksets with name satisfying regular expression.

Parameters
reg_exp_name
std::vector<constCubitMeshSets *>
Returns
MoFEMErrorCode

Definition at line 576 of file MeshsetsManager.cpp.

578 {
580 auto r =
581 cubitMeshsets.get<CubitMeshsetMaskedType_mi_tag>().equal_range(BLOCKSET);
582 for (; r.first != r.second; ++r.first) {
583 const auto name = r.first->getName();
584 if (std::regex_match(name, reg_exp_name)) {
585 vec_ptr.push_back(&*r.first);
586 }
587 }
588 std::sort(vec_ptr.begin(), vec_ptr.end(),
589 [](const CubitMeshSets *a, const CubitMeshSets *b) {
590 return a->getMeshsetId() < b->getMeshsetId();
591 });
593}
int r
Definition: sdf.py:8

◆ getCubitMeshsetPtr() [7/7]

MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr ( const string  name,
const CubitMeshSets **  cubit_meshset_ptr 
) const

get cubit meshset

Definition at line 533 of file MeshsetsManager.cpp.

534 {
535 Interface &m_field = cOre;
537 auto miit = cubitMeshsets.get<CubitMeshsets_name>().lower_bound(name);
538 auto hi_miit = cubitMeshsets.get<CubitMeshsets_name>().upper_bound(name);
539 if (std::distance(miit, hi_miit) == 0) {
540 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
541 "meshset name <%s> is not there", name.c_str());
542 }
543 if (std::distance(miit, hi_miit) > 1) {
544 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
545 "more that one meshser of that name <%s>", name.c_str());
546 }
547 *cubit_meshset_ptr = &*miit;
549}

◆ getEnd() [1/3]

CubitMeshSet_multiIndex::iterator MoFEM::MeshsetsManager::getEnd ( ) const
inline

get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT)

for(IT_CUBITMESHSETS_FOR_LOOP(mField,it) { ... }

Definition at line 257 of file MeshsetsManager.hpp.

257 {
258 return cubitMeshsets.end();
259 }

◆ getEnd() [2/3]

CubitMeshsetByName::iterator MoFEM::MeshsetsManager::getEnd ( const std::string &  name) const
inline

get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT)

for(IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP(mField,NODESET|DISPLACEMENTSET,it) { ... }

Parameters
typeof meshset (NODESET, SIDESET or BLOCKSET and more)

Definition at line 369 of file MeshsetsManager.hpp.

369 {
370 return cubitMeshsets.get<CubitMeshsets_name>().upper_bound(name);
371 }

◆ getEnd() [3/3]

CubitMeshsetByType::iterator MoFEM::MeshsetsManager::getEnd ( const unsigned int  cubit_bc_type) const
inline

get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT)

for(IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(mField,NODESET|DISPLACEMENTSET,it) { ... }

Parameters
typeof meshset (NODESET, SIDESET or BLOCKSET and more)

Definition at line 296 of file MeshsetsManager.hpp.

296 {
297 return cubitMeshsets.get<CubitMeshsetType_mi_tag>().upper_bound(
298 cubit_bc_type);
299 }

◆ getEntitiesByDimension() [1/2]

MoFEMErrorCode MoFEM::MeshsetsManager::getEntitiesByDimension ( const int  ms_id,
const unsigned int  cubit_bc_type,
const int  dimension,
Range entities,
const bool  recursive = true 
) const

get entities from CUBIT/meshset of a particular entity dimension

Nodeset can contain nodes, edges, triangles and tets. This applies to other meshsets too. The nodeset's meshset contain the nodes in the MIDDLE of the surface or volume which is done by default in Cubit, Hence if all nodes on a particular nodeset are required, one should get all triangles or tetrahedrons for which the nodeset was create in Cubit, and get all the connectivities of tris/tets.

Parameters
ms_idid of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
dimensions(0 - Nodes, 1 - Edges, 2 - Faces, 3 - Volume(tetrahedral))
Rangecontaining the retrieved entities
recursiveIf true, meshsets containing meshsets are queried recursively. Returns the contents of meshsets, but not the meshsets themselves if true.
Examples
mesh_cut.cpp, and prism_elements_from_surface.cpp.

Definition at line 603 of file MeshsetsManager.cpp.

605 {
606 Interface &m_field = cOre;
607 moab::Interface &moab = m_field.get_moab();
609 auto miit =
610 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
611 boost::make_tuple(msId, cubit_bc_type));
612 if (miit !=
613 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
614 CHKERR miit->getMeshsetIdEntitiesByDimension(moab, dimension, entities,
615 recursive);
616 } else {
617 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
618 "msId = %d is not there", msId);
619 }
621}

◆ getEntitiesByDimension() [2/2]

MoFEMErrorCode MoFEM::MeshsetsManager::getEntitiesByDimension ( const int  ms_id,
const unsigned int  cubit_bc_type,
Range entities,
const bool  recursive = true 
) const

get entities related to CUBIT/meshset,

NODESET will get Vertices only, even if the NODESET contains edges, tris and tets SIDESET will get Tris, BLOCKSET will get Tets, DISPLACEMENTSET and FORCESET are stored in NODESET, PRESSURESET is stored in Sideset.

Parameters
ms_idid of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
Rangecontaining the retrieved entities related to the
recursiveIf true, meshsets containing meshsets are queried recursively. Returns the contents of meshsets, but not the meshsets themselves if true.

Definition at line 623 of file MeshsetsManager.cpp.

625 {
626 Interface &m_field = cOre;
627 moab::Interface &moab = m_field.get_moab();
629 auto miit =
630 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
631 boost::make_tuple(ms_id, cubit_bc_type));
632 if (miit !=
633 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
634 CHKERR miit->getMeshsetIdEntitiesByDimension(moab, entities, recursive);
635 } else {
636 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
637 "ms_id = %d is not there", ms_id);
638 }
640}

◆ getMeshset()

MoFEMErrorCode MoFEM::MeshsetsManager::getMeshset ( const int  ms_id,
const unsigned int  cubit_bc_type,
EntityHandle meshset 
) const

get meshset from CUBIT Id and CUBIT type

Parameters
ms_idid of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
meshsetwhere to store the retrieved entities
Examples
free_surface.cpp, and mesh_cut.cpp.

Definition at line 642 of file MeshsetsManager.cpp.

644 {
645 Interface &m_field = cOre;
647 auto miit =
648 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
649 boost::make_tuple(ms_id, cubit_bc_type));
650 if (miit !=
651 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
652 meshset = miit->meshset;
653 } else {
654 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
655 "ms_id = %d is not there", ms_id);
656 }
658}

◆ getMeshsetsByType()

MoFEMErrorCode MoFEM::MeshsetsManager::getMeshsetsByType ( const unsigned int  cubit_bc_type,
Range meshsets 
) const

get all CUBIT meshsets by CUBIT type

Parameters
seeCubitBC (NODESET, SIDESET or BLOCKSET and more).
meshsetsis range of meshsets

Definition at line 676 of file MeshsetsManager.cpp.

677 {
679 auto miit =
680 cubitMeshsets.get<CubitMeshsetType_mi_tag>().lower_bound(cubit_bc_type);
681 auto hi_miit =
682 cubitMeshsets.get<CubitMeshsetType_mi_tag>().upper_bound(cubit_bc_type);
683 for (; miit != hi_miit; miit++) {
684 meshsets.insert(miit->meshset);
685 }
687}