v0.15.0
Loading...
Searching...
No Matches
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.
 
#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.
 
#define _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_(MESHSET_MANAGER, NAME, IT)
 Iterator that loops over Cubit BlockSet having a particular name.
 

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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
bool MoFEM::MeshsetsManager::checkMeshset (const int ms_id, const CubitBCType cubit_bc_type) const
 check for CUBIT Id and CUBIT type
 
MoFEMErrorCode MoFEM::MeshsetsManager::addMeshset (const CubitBCType cubit_bc_type, const int ms_id, const std::string name="")
 add cubit meshset
 
MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr (const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
 get cubit meshset
 
const CubitMeshSetsMoFEM::MeshsetsManager::getCubitMeshsetPtr (const int ms_id, const CubitBCType cubit_bc_type) const
 get cubit meshset
 
MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr (const CubitBCType cubit_bc_type, std::vector< const CubitMeshSets * > &vec_ptr) const
 Get vector of pointer by bc type.
 
std::vector< const CubitMeshSets * > MoFEM::MeshsetsManager::getCubitMeshsetPtr (const CubitBCType cubit_bc_type) const
 Get vector of pointer by bc type.
 
MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr (const string name, const CubitMeshSets **cubit_meshset_ptr) const
 get cubit meshset
 
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.
 
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.
 
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
 
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,
 
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
 
MoFEMErrorCode MoFEM::MeshsetsManager::getMeshsetsByType (const unsigned int cubit_bc_type, Range &meshsets) const
 get all CUBIT meshsets by CUBIT type
 

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 )

#include <src/interfaces/MeshsetsManager.hpp>

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

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 )

#include <src/interfaces/MeshsetsManager.hpp>

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.

94#define _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_(MESHSET_MANAGER, NAME, IT) \
95 CubitMeshsetByName::iterator IT = \
96 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(NAME); \
97 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(NAME); \
98 IT++

◆ _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_

#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_ ( MESHSET_MANAGER,
CUBITBCTYPE,
IT )

#include <src/interfaces/MeshsetsManager.hpp>

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:

Examples
MagneticElement.hpp, Remodeling.cpp, UnsaturatedFlow.hpp, add_cubit_meshsets.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, mesh_cut.cpp, mesh_insert_interface_atom.cpp, navier_stokes.cpp, photon_diffusion.cpp, and unsaturated_transport.cpp.

Definition at line 71 of file MeshsetsManager.hpp.

◆ _IT_CUBITMESHSETS_FOR_LOOP_

#define _IT_CUBITMESHSETS_FOR_LOOP_ ( MESHSET_MANAGER,
IT )

#include <src/interfaces/MeshsetsManager.hpp>

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, split_sideset.cpp, and unsaturated_transport.cpp.

Definition at line 34 of file MeshsetsManager.hpp.

34#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT) \
35 CubitMeshSet_multiIndex::iterator IT = \
36 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(); \
37 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(); \
38 IT++

Function Documentation

◆ addMeshset()

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

#include <src/interfaces/MeshsetsManager.hpp>

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 396 of file MeshsetsManager.cpp.

398 {
399 Interface &m_field = cOre;
400 moab::Interface &moab = m_field.get_moab();
402 if (checkMeshset(ms_id, cubit_bc_type)) {
403 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
404 "such cubit meshset is already there id = %d", ms_id);
405 }
406
407 CubitMeshSets cmeshset(moab, cubit_bc_type, ms_id);
408 if ((cmeshset.cubitBcType & CubitBCType(NODESET | SIDESET | BLOCKSET))
409 .any()) {
410 auto p = cubitMeshsets.insert(cmeshset);
411 if (!p.second) {
412 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
413 "meshset not inserted");
414 }
415 if (name.size() > 0) {
416 bool success =
417 cubitMeshsets.modify(p.first, CubitMeshSets_change_name(moab, name));
418 if (!success) {
419 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
420 "name to cubit meshset can not be set");
421 }
422 }
423 }
424
426}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ SIDESET
@ BLOCKSET
@ 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()
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
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

#include <src/interfaces/MeshsetsManager.hpp>

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 371 of file MeshsetsManager.cpp.

372 {
373 auto miit =
374 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
375 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
376 if (miit !=
377 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
378 return true;
379 }
380 return false;
381}

◆ getBegin() [1/3]

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

#include <src/interfaces/MeshsetsManager.hpp>

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 247 of file MeshsetsManager.hpp.

247 {
248 return cubitMeshsets.begin();
249 }

◆ getBegin() [2/3]

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

#include <src/interfaces/MeshsetsManager.hpp>

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 355 of file MeshsetsManager.hpp.

355 {
356 return cubitMeshsets.get<CubitMeshsets_name>().lower_bound(name);
357 }

◆ getBegin() [3/3]

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

#include <src/interfaces/MeshsetsManager.hpp>

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 280 of file MeshsetsManager.hpp.

280 {
281 return cubitMeshsets.get<CubitMeshsetType_mi_tag>().lower_bound(
282 cubit_bc_type);
283 }

◆ getBySetTypeBegin()

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

#include <src/interfaces/MeshsetsManager.hpp>

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 318 of file MeshsetsManager.hpp.

318 {
319 return cubitMeshsets.get<CubitMeshsetMaskedType_mi_tag>().lower_bound(
320 cubit_bc_type);
321 }

◆ getBySetTypeEnd()

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

#include <src/interfaces/MeshsetsManager.hpp>

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 336 of file MeshsetsManager.hpp.

336 {
337 return cubitMeshsets.get<CubitMeshsetMaskedType_mi_tag>().upper_bound(
338 cubit_bc_type);
339 }

◆ getCubitMeshsetPtr() [1/7]

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

#include <src/interfaces/MeshsetsManager.hpp>

Get vector of pointer by bc type.

Returns
MoFEMErrorCode

Definition at line 649 of file MeshsetsManager.cpp.

649 {
650 std::vector<const CubitMeshSets *> vec_ptr;
651 CHK_MOAB_THROW(getCubitMeshsetPtr(cubit_bc_type, vec_ptr),
652 "Error in getting meshsets by name");
653 return vec_ptr;
654}
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
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

#include <src/interfaces/MeshsetsManager.hpp>

Get vector of pointer by bc type.

Parameters
std::vector<constCubitMeshSets *>
Returns
MoFEMErrorCode

Definition at line 635 of file MeshsetsManager.cpp.

637 {
639 auto r = cubitMeshsets.get<CubitMeshsetType_mi_tag>().equal_range(
640 cubit_bc_type.to_ulong());
641 for (auto it = r.first; it != r.second; ++it) {
642 vec_ptr.push_back(&*it);
643 }
644 sortMeshsets(vec_ptr);
646}
int r
Definition sdf.py:8
static void sortMeshsets(std::vector< const CubitMeshSets * > &vec_ptr)

◆ getCubitMeshsetPtr() [3/7]

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

#include <src/interfaces/MeshsetsManager.hpp>

get cubit meshset

Definition at line 608 of file MeshsetsManager.cpp.

609 {
610 const CubitMeshSets *cubit_meshset_ptr;
612 getCubitMeshsetPtr(ms_id, cubit_bc_type, &cubit_meshset_ptr),
613 "Get not get meshset");
614 return cubit_meshset_ptr;
615}
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.

◆ getCubitMeshsetPtr() [4/7]

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

#include <src/interfaces/MeshsetsManager.hpp>

get cubit meshset

Examples
EshelbianPlasticity.cpp, adolc_plasticity.cpp, dynamic_first_order_con_law.cpp, mofem/tutorials/vec-7/adjoint.cpp, plastic.cpp, seepage.cpp, and thermo_elastic.cpp.

Definition at line 589 of file MeshsetsManager.cpp.

591 {
592 Interface &m_field = cOre;
594 auto miit =
595 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
596 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
597 if (miit !=
598 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
599 *cubit_meshset_ptr = &*miit;
600 } else {
601 SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
602 "msId = %d is not there", ms_id);
603 }
605}

◆ getCubitMeshsetPtr() [5/7]

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

#include <src/interfaces/MeshsetsManager.hpp>

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.
#define CHKERR
Inline error check.
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'm', 3 > m
Interface for managing meshsets containing materials and boundary conditions.
Parameters
reg_exp_name
Returns
std::vector<const CubitMeshSets *>

Definition at line 673 of file MeshsetsManager.cpp.

673 {
674 std::vector<const CubitMeshSets *> vec_ptr;
675 CHK_MOAB_THROW(getCubitMeshsetPtr(reg_exp_name, vec_ptr),
676 "Error in getting meshsets by name");
677 return vec_ptr;
678}

◆ getCubitMeshsetPtr() [6/7]

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

#include <src/interfaces/MeshsetsManager.hpp>

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

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

Definition at line 656 of file MeshsetsManager.cpp.

658 {
660 auto r =
661 cubitMeshsets.get<CubitMeshsetMaskedType_mi_tag>().equal_range(BLOCKSET);
662 for (; r.first != r.second; ++r.first) {
663 const auto name = r.first->getName();
664 if (std::regex_match(name, reg_exp_name)) {
665 vec_ptr.push_back(&*r.first);
666 }
667 }
668 sortMeshsets(vec_ptr);
670}

◆ getCubitMeshsetPtr() [7/7]

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

#include <src/interfaces/MeshsetsManager.hpp>

get cubit meshset

Definition at line 617 of file MeshsetsManager.cpp.

618 {
619 Interface &m_field = cOre;
621 auto miit = cubitMeshsets.get<CubitMeshsets_name>().lower_bound(name);
622 auto hi_miit = cubitMeshsets.get<CubitMeshsets_name>().upper_bound(name);
623 if (std::distance(miit, hi_miit) == 0) {
624 SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
625 "meshset name <%s> is not there", name.c_str());
626 }
627 if (std::distance(miit, hi_miit) > 1) {
628 SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
629 "more that one meshser of that name <%s>", name.c_str());
630 }
631 *cubit_meshset_ptr = &*miit;
633}

◆ getEnd() [1/3]

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

#include <src/interfaces/MeshsetsManager.hpp>

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 261 of file MeshsetsManager.hpp.

261 {
262 return cubitMeshsets.end();
263 }

◆ getEnd() [2/3]

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

#include <src/interfaces/MeshsetsManager.hpp>

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 373 of file MeshsetsManager.hpp.

373 {
374 return cubitMeshsets.get<CubitMeshsets_name>().upper_bound(name);
375 }

◆ getEnd() [3/3]

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

#include <src/interfaces/MeshsetsManager.hpp>

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 300 of file MeshsetsManager.hpp.

300 {
301 return cubitMeshsets.get<CubitMeshsetType_mi_tag>().upper_bound(
302 cubit_bc_type);
303 }

◆ 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

#include <src/interfaces/MeshsetsManager.hpp>

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 680 of file MeshsetsManager.cpp.

682 {
683 Interface &m_field = cOre;
684 moab::Interface &moab = m_field.get_moab();
686 auto miit =
687 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
688 boost::make_tuple(msId, cubit_bc_type));
689 if (miit !=
690 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
691 CHKERR miit->getMeshsetIdEntitiesByDimension(moab, dimension, entities,
692 recursive);
693 } else {
694 SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
695 "msId = %d is not there", msId);
696 }
698}

◆ getEntitiesByDimension() [2/2]

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

#include <src/interfaces/MeshsetsManager.hpp>

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 700 of file MeshsetsManager.cpp.

702 {
703 Interface &m_field = cOre;
704 moab::Interface &moab = m_field.get_moab();
706 auto miit =
707 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
708 boost::make_tuple(ms_id, cubit_bc_type));
709 if (miit !=
710 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
711 CHKERR miit->getMeshsetIdEntitiesByDimension(moab, entities, recursive);
712 } else {
713 SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
714 "ms_id = %d is not there", ms_id);
715 }
717}

◆ getMeshset()

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

#include <src/interfaces/MeshsetsManager.hpp>

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
mesh_cut.cpp.

Definition at line 719 of file MeshsetsManager.cpp.

721 {
722 Interface &m_field = cOre;
724 auto miit =
725 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
726 boost::make_tuple(ms_id, cubit_bc_type));
727 if (miit !=
728 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
729 meshset = miit->meshset;
730 } else {
731 SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
732 "ms_id = %d is not there", ms_id);
733 }
735}

◆ getMeshsetsByType()

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

#include <src/interfaces/MeshsetsManager.hpp>

get all CUBIT meshsets by CUBIT type

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

Definition at line 753 of file MeshsetsManager.cpp.

754 {
756 auto miit =
757 cubitMeshsets.get<CubitMeshsetType_mi_tag>().lower_bound(cubit_bc_type);
758 auto hi_miit =
759 cubitMeshsets.get<CubitMeshsetType_mi_tag>().upper_bound(cubit_bc_type);
760 for (; miit != hi_miit; miit++) {
761 meshsets.insert(miit->meshset);
762 }
764}