32#ifndef __MESHSETSMANAGER_HPP__
33#define __MESHSETSMANAGER_HPP__
37typedef CubitMeshSet_multiIndex::index<CubitMeshsetType_mi_tag>::type
40typedef CubitMeshSet_multiIndex::index<CubitMeshsetMaskedType_mi_tag>::type
43typedef CubitMeshSet_multiIndex::index<CubitMeshsets_name>::type
46typedef CubitMeshSet_multiIndex::index<CubitMeshsetType_mi_tag>::type
57#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT) \
58 CubitMeshSet_multiIndex::iterator IT = \
59 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(); \
60 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(); \
72#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, \
74 CubitMeshsetByType::iterator IT = \
75 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(CUBITBCTYPE); \
76 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(CUBITBCTYPE); \
94#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, \
96 CubitMeshsetByMask::iterator IT = \
97 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBySetTypeBegin( \
99 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getBySetTypeEnd( \
117#define _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_(MESHSET_MANAGER, NAME, IT) \
118 CubitMeshsetByName::iterator IT = \
119 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(NAME); \
120 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(NAME); \
326 std::size_t *cleared_names =
nullptr,
327 std::size_t *cleared_attributes =
nullptr,
328 const bool clear_names =
true,
329 const bool clear_attributes =
true);
370 template <
class CUBIT_BC_DATA_TYPE>
372 unsigned long int type)
const;
454 inline CubitMeshSet_multiIndex::iterator
getBegin()
const {
468 CubitMeshSet_multiIndex::iterator
getEnd()
const {
486 inline CubitMeshsetByType::iterator
506 inline CubitMeshsetByType::iterator
507 getEnd(
const unsigned int cubit_bc_type)
const {
524 inline CubitMeshsetByMask::iterator
542 inline CubitMeshsetByMask::iterator
562 inline CubitMeshsetByName::iterator
getBegin(
const std::string &name)
const {
580 inline CubitMeshsetByName::iterator
getEnd(
const std::string &name)
const {
613 int *
const number_of_meshsets_ptr = NULL)
const;
629 const std::string name =
"");
651 const int ms_id,
const Range &ents);
685 const std::vector<double> &attributes,
686 const std::string name =
"");
689 const std::string &name);
693 const std::vector<double> &attributes,
694 const std::string name =
"") {
696 std::vector<double>(attributes), name);
716 const std::string name =
"");
782 std::vector<const CubitMeshSets *> &vec_ptr)
const;
791 std::vector<const CubitMeshSets *>
815 std::vector<const CubitMeshSets *> &vec_ptr)
const;
858 std::vector<const CubitMeshSets *>
884 const unsigned int cubit_bc_type,
885 const int dimension,
Range &entities,
886 const bool recursive =
true)
const;
905 const unsigned int cubit_bc_type,
907 const bool recursive =
true)
const;
932 const int ms_id,
const unsigned int cubit_bc_type,
934 const int operation_type = moab::Interface::INTERSECT);
944 Range &meshsets)
const;
1099 const bool clean_file_options =
true);
1128 const std::string file_name =
"out_meshset.vtk",
1129 const std::string file_type =
"VTK",
1130 const std::string options =
"")
const;
1144 const int ms_id,
const unsigned int cubit_bc_type,
const int dim,
1145 const std::string file_name =
"out_meshset.vtk",
1146 const bool recursive =
false,
const std::string file_type =
"VTK",
1147 const std::string options =
"")
const;
1153 inline boost::shared_ptr<boost::program_options::options_description> &
1169 static void sortMeshsets(std::vector<const CubitMeshSets *> &vec_ptr);
1181 boost::shared_ptr<boost::program_options::options_description>
1186template <
class CUBIT_BC_DATA_TYPE>
1188 unsigned long int type)
const {
1191 const moab::Interface &moab = m_field.
get_moab();
1193 CHKERR it->getBcDataStructure(data);
1194 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << *it;
1195 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << data;
1196 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) <<
"name " << it->getName();
1197 for (EntityType
t = MBVERTEX;
t != MBENTITYSET; ++
t) {
1199 CHKERR moab.get_number_entities_by_type(it->meshset,
t, nb,
true);
1201 MOFEM_LOG(
"MeshsetMngSync", Sev::inform)
1202 <<
"msId " << it->getMeshsetId() <<
" number of "
1203 << moab::CN::EntityTypeName(
t) <<
" " << nb;
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
MoFEMErrorCode deleteMeshset(const CubitBCType cubit_bc_type, const int ms_id, const MoFEMTypes bh=MF_EXIST)
delete cubit meshset
#define MOFEM_LOG(channel, severity)
Log.
MoFEMErrorCode printForceSet() const
Print meshsets with force boundary conditions.
CubitMeshsetByType::iterator getEnd(const unsigned int cubit_bc_type) const
get begin iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYP...
CubitMeshsetByName::iterator getEnd(const std::string &name) const
get begin iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_BY_SET_TYPE_F...
MoFEMErrorCode getMeshset(const int ms_id, const unsigned int cubit_bc_type, EntityHandle &meshset) const
get meshset from CUBIT Id and CUBIT type
MoFEMErrorCode setBcData(const CubitBCType cubit_bc_type, const int ms_id, const GenericCubitBcData &data)
Set boundary condition data for meshset.
MoFEMErrorCode broadcastMeshsets(int verb=DEFAULT_VERBOSITY)
Broadcast meshsets across MPI processes.
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=DEFAULT_VERBOSITY)
Initialize container from mesh data.
MoFEMErrorCode clearMap()
Clear the multi-index container.
MoFEMErrorCode setAttributes(const CubitBCType cubit_bc_type, const int ms_id, const std::vector< double > &attributes, const std::string name="")
Set attributes for CUBIT meshset.
MoFEMErrorCode addEntitiesToMeshset(const CubitBCType cubit_bc_type, const int ms_id, const Range &ents)
Add entities to CUBIT meshset.
bool checkMeshset(const int ms_id, const CubitBCType cubit_bc_type) const
Check for CUBIT meshset by ID and type.
MoFEMErrorCode discardBlocksetConfiguration(std::size_t *cleared_names=nullptr, std::size_t *cleared_attributes=nullptr, const bool clear_names=true, const bool clear_attributes=true)
Remove imported BLOCKSET names and/or attributes from the mesh.
CubitMeshSet_multiIndex::iterator getBegin() const
get begin iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_TYPE_FOR_LOOP...
MoFEMErrorCode printPressureSet() const
Print meshsets with pressure boundary conditions.
MoFEMErrorCode printMaterialsSet() const
Print meshsets with material properties.
CubitMeshsetByMask::iterator getBySetTypeEnd(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_...
MoFEMErrorCode setMeshsetFromFile()
Load meshset configuration from command line specified file.
MoFEMErrorCode addMeshset(const CubitBCType cubit_bc_type, const int ms_id, const std::string name="")
Add CUBIT meshset to manager.
CubitMeshsetByName::iterator getBegin(const std::string &name) const
get begin iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_BY_SET_TYPE_F...
MoFEMErrorCode getMeshsetsByType(const unsigned int cubit_bc_type, Range &meshsets) const
get all CUBIT meshsets by CUBIT type
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
CubitMeshsetByType::iterator getBegin(const unsigned int cubit_bc_type) const
get begin iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYP...
MoFEMErrorCode 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 readMeshsets(int verb=DEFAULT_VERBOSITY)
Read meshsets from mesh database.
MoFEMErrorCode printHeatFluxSet() const
Print meshsets with heat flux boundary conditions.
MoFEMErrorCode printTemperatureSet() const
Print meshsets with temperature boundary conditions.
MoFEMErrorCode getTags(int verb=-1)
Get tag handles used on meshsets.
MoFEMErrorCode setAttributesByDataStructure(const CubitBCType cubit_bc_type, const int ms_id, const GenericAttributeData &data, const std::string name="")
Set attributes using data structure.
CubitMeshsetByMask::iterator 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_...
MoFEMErrorCode printDisplacementSet() const
Print meshsets with displacement boundary conditions.
CubitMeshSet_multiIndex::iterator getEnd() const
get begin iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_TYPE_FOR_LOOP...
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< 32 > CubitBCType
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
CubitMeshSet_multiIndex::index< CubitMeshsetType_mi_tag >::type CubitMeshsetById
CubitMeshSet_multiIndex::index< CubitMeshsetMaskedType_mi_tag >::type CubitMeshsetByMask
CubitMeshSet_multiIndex::index< CubitMeshsets_name >::type CubitMeshsetByName
multi_index_container< CubitMeshSets, indexed_by< hashed_unique< tag< Meshset_mi_tag >, member< CubitMeshSets, EntityHandle, &CubitMeshSets::meshset > >, ordered_non_unique< tag< CubitMeshsetType_mi_tag >, const_mem_fun< CubitMeshSets, unsigned long int, &CubitMeshSets::getBcTypeULong > >, ordered_non_unique< tag< CubitMeshsetMaskedType_mi_tag >, const_mem_fun< CubitMeshSets, unsigned long int, &CubitMeshSets::getMaskedBcTypeULong > >, ordered_non_unique< tag< CubitMeshsets_name >, const_mem_fun< CubitMeshSets, std::string, &CubitMeshSets::getName > >, hashed_unique< tag< Composite_Cubit_msId_And_MeshsetType_mi_tag >, composite_key< CubitMeshSets, const_mem_fun< CubitMeshSets, int, &CubitMeshSets::getMeshsetId >, const_mem_fun< CubitMeshSets, unsigned long int, &CubitMeshSets::getMaskedBcTypeULong > > > > > CubitMeshSet_multiIndex
Stores data about meshsets (see CubitMeshSets) storing data about boundary conditions,...
CubitMeshSet_multiIndex::index< CubitMeshsetType_mi_tag >::type CubitMeshsetByType
constexpr double t
plate stiffness
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
this struct keeps basic methods for moab meshset about material and boundary conditions
MultiIndex Tag for field id.
Deprecated interface functions.
Generic attribute data structure.
Generic bc data structure.
Interface for managing meshsets containing materials and boundary conditions.
MoFEMErrorCode addBitToMeshsetType(const CubitBCType cubit_bc_type, const int ms_id, const CubitBCType type_bit)
MoFEMErrorCode saveMeshsetToFile(const int ms_id, const unsigned int cubit_bc_type, const std::string file_name="out_meshset.vtk", const std::string file_type="VTK", const std::string options="") const
save cubit meshset entities on the moab mesh
const MeshsetsManager * get_meshsets_manager_ptr() const
return pointer to meshset manager
Tag get_bhTag() const
get tag handle used to store "id" of BLOCKSET
DEPRECATED auto setAtributesByDataStructure(const CubitBCType cubit_bc_type, const int ms_id, const GenericAttributeData &data, const std::string name="")
MeshsetsManager * get_meshsets_manager_ptr()
return pointer to meshset manager
DEPRECATED auto setAtributes(const CubitBCType cubit_bc_type, const int ms_id, const std::vector< double > &attributes, const std::string name="")
bool checkIfMeshsetContainsEntities(const int ms_id, const unsigned int cubit_bc_type, const EntityHandle *entities, int num_entities, const int operation_type=moab::Interface::INTERSECT)
Check if meshset constains entities.
static void sortMeshsets(std::vector< const CubitMeshSets * > &vec_ptr)
MoFEMErrorCode setName(const CubitBCType cubit_bc_type, const int ms_id, const std::string &name)
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Query interface for MeshsetsManager.
MoFEMErrorCode updateAllMeshsetsByEntitiesChildren(const BitRefLevel &bit)
Update all blocksets, sidesets and node sets.
boost::shared_ptr< boost::program_options::options_description > & getConfigFileOptionsPtr()
Get config file options, use with care.
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
CubitMeshSet_multiIndex & getMeshsetsMultindex()
Tag get_bhTag_header() const
get tag handle used to store of block set header (Used by Cubit)
Tag get_nsTag() const
get tag handle used to store "id" of NODESET
Tag get_nsTag_data() const
get tag handle used to store boundary data on NODESET
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
virtual ~MeshsetsManager()=default
static bool broadcastMeshsetsOn
Tag get_ssTag_data() const
get tag handle used to store boundary data on SIDESET
Tag get_ssTag() const
get tag handle used to store "id" of SIDESET
MoFEM::Core & cOre
Reference to MoFEM Core interface.
boost::shared_ptr< boost::program_options::options_description > configFileOptionsPtr
config file options
base class for all interface classes