19 #ifndef __MESHSETSMANAGER_HPP__
20 #define __MESHSETSMANAGER_HPP__
22 #define MeshsetsManagerFunctionBegin \
24 MOFEM_LOG_CHANNEL("WORLD"); \
25 MOFEM_LOG_CHANNEL("SYNC"); \
26 MOFEM_LOG_FUNCTION(); \
27 MOFEM_LOG_TAG("WORLD", "MeshsetsManager"); \
28 MOFEM_LOG_TAG("SYNC", "MeshsetsManager");
54 #define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT) \
55 CubitMeshSet_multiIndex::iterator IT = \
56 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(); \
57 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(); \
69 #define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, \
71 CubitMeshsetByType::iterator IT = \
72 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(CUBITBCTYPE); \
73 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(CUBITBCTYPE); \
91 #define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, \
93 CubitMeshsetByMask::iterator IT = \
94 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBySetTypeBegin( \
96 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getBySetTypeEnd( \
114 #define _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_(MESHSET_MANAGER, NAME, IT) \
115 CubitMeshsetByName::iterator IT = \
116 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(NAME); \
117 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(NAME); \
201 template <
class CUBIT_BC_DATA_TYPE>
203 unsigned long int type)
const;
250 inline CubitMeshSet_multiIndex::iterator
getBegin()
const {
264 CubitMeshSet_multiIndex::iterator
getEnd()
const {
282 inline CubitMeshsetByType::iterator
301 inline CubitMeshsetByType::iterator
302 getEnd(
const unsigned int cubit_bc_type)
const {
318 inline CubitMeshsetByMask::iterator
336 inline CubitMeshsetByMask::iterator
356 inline CubitMeshsetByName::iterator
getBegin(
const std::string &name)
const {
374 inline CubitMeshsetByName::iterator
getEnd(
const std::string &name)
const {
396 int *
const number_of_meshsets_ptr = NULL)
const;
409 const std::string name =
"");
419 const int ms_id,
const Range &ents);
430 const int ms_id,
const EntityHandle *ents,
442 const std::vector<double> &attributes,
443 const std::string name =
"");
456 const std::string name =
"");
522 const unsigned int cubit_bc_type,
523 const int dimension, Range &entities,
524 const bool recursive =
true)
const;
543 const unsigned int cubit_bc_type,
545 const bool recursive =
true)
const;
556 EntityHandle &meshset)
const;
570 const int ms_id,
const unsigned int cubit_bc_type,
571 const EntityHandle *entities,
int num_entities,
572 const int operation_type = moab::Interface::INTERSECT);
582 Range &meshsets)
const;
726 const bool clean_file_options =
true);
749 const std::string file_name =
"out_meshset.vtk",
750 const std::string file_type =
"VTK",
751 const std::string options =
"")
const;
765 const int ms_id,
const unsigned int cubit_bc_type,
const int dim,
766 const std::string file_name =
"out_meshset.vtk",
767 const bool recursive =
false,
const std::string file_type =
"VTK",
768 const std::string options =
"")
const;
774 inline boost::shared_ptr<boost::program_options::options_description> &
791 boost::shared_ptr<boost::program_options::options_description>
795 template <
class CUBIT_BC_DATA_TYPE>
797 unsigned long int type)
const {
802 CHKERR it->getBcDataStructure(data);
805 int tets, tris, edges, nodes, prisms, quads;
806 CHKERR moab.get_number_entities_by_type(it->meshset, MBTET, tets,
true);
807 CHKERR moab.get_number_entities_by_type(it->meshset, MBTRI, tris,
true);
808 CHKERR moab.get_number_entities_by_type(it->meshset, MBEDGE, edges,
true);
809 CHKERR moab.get_number_entities_by_type(it->meshset, MBVERTEX, nodes,
true);
810 CHKERR moab.get_number_entities_by_type(it->meshset, MBPRISM, prisms,
true);
811 CHKERR moab.get_number_entities_by_type(it->meshset, MBQUAD, quads,
true);
812 MOFEM_LOG(
"WORLD", Sev::inform) <<
"name " << it->getName();
814 <<
"msId " << it->getMeshsetId() <<
" nb. tets " << tets;
816 <<
"msId " << it->getMeshsetId() <<
" nb. prisms " << prisms;
818 <<
"msId " << it->getMeshsetId() <<
" nb. quads " << quads;
820 <<
"msId " << it->getMeshsetId() <<
" nb. tris " << tris;
822 <<
"msId " << it->getMeshsetId() <<
" nb. edges " << edges;
824 <<
"msId " << it->getMeshsetId() <<
" nb. nodes " << nodes;
#define MeshsetsManagerFunctionBegin
@ MESHSETSMANAGER_INTERFACE
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MOFEM_LOG(channel, severity)
Log.
SeverityLevel
Severity levels.
CubitMeshsetByType::iterator 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...
CubitMeshsetByName::iterator getEnd(const std::string &name) const
get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_BY_SET_TYPE_FO...
MoFEMErrorCode getMeshset(const int ms_id, const unsigned int cubit_bc_type, EntityHandle &meshset) const
get meshset from CUBIT Id and CUBIT type
bool checkMeshset(const int ms_id, const CubitBCType cubit_bc_type) const
check for CUBIT Id and CUBIT type
CubitMeshSet_multiIndex::iterator getBegin() const
get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_TYPE_FOR_LOOP(...
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
CubitMeshsetByMask::iterator 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_F...
MoFEMErrorCode addMeshset(const CubitBCType cubit_bc_type, const int ms_id, const std::string name="")
add cubit meshset
CubitMeshsetByName::iterator getBegin(const std::string &name) const
get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_BY_SET_TYPE_FO...
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 mehset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYPE...
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
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_...
CubitMeshSet_multiIndex::iterator getEnd() const
get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_TYPE_FOR_LOOP(...
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< BITINTERFACEUID_SIZE > BitIntefaceId
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
static const MOFEMuuid IDD_MOFEMMeshsetsManager
CubitMeshSet_multiIndex::index< CubitMeshSets_name >::type CubitMeshsetByName
CubitMeshSet_multiIndex::index< CubitMeshSets_mi_tag >::type CubitMeshsetByType
multi_index_container< CubitMeshSets, indexed_by< hashed_unique< tag< Meshset_mi_tag >, member< CubitMeshSets, EntityHandle, &CubitMeshSets::meshset > >, ordered_non_unique< tag< CubitMeshSets_mi_tag >, const_mem_fun< CubitMeshSets, unsigned long int, &CubitMeshSets::getBcTypeULong > >, ordered_non_unique< tag< CubitMeshSets_mask_meshset_mi_tag >, const_mem_fun< CubitMeshSets, unsigned long int, &CubitMeshSets::getMaksedBcTypeULong > >, 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::getMaksedBcTypeULong > > > > > CubitMeshSet_multiIndex
Stores data about meshsets (see CubitMeshSets) storing data about boundary conditions,...
CubitMeshSet_multiIndex::index< CubitMeshSets_mask_meshset_mi_tag >::type CubitMeshsetByMask
CubitMeshSet_multiIndex::index< CubitMeshSets_mi_tag >::type CubitMeshsetById
DeprecatedCoreInterface Interface
virtual moab::Interface & get_moab()=0
MultiIndex Tag for field id.
this struct keeps basic methods for moab meshset about material and boundary conditions
Deprecated interface functions.
Generic attribute data structure.
Generic bc data structure.
MoFEM interface unique ID.
Interface for managing meshsets containing materials and boundary conditions.
bool checkMeshset(const string name, int *const number_of_meshsets_ptr=NULL) const
check if meshset of given name exist
MeshsetsManager(const MoFEM::Core &core)
MoFEMErrorCode printForceSet() const
print meshsets with force boundary conditions data structure
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
MoFEMErrorCode setBcData(const CubitBCType cubit_bc_type, const int ms_id, const GenericCubitBcData &data)
set boundary data structure to meshset
Tag get_bhTag() const
get tag handle used to store "id" of BLOCKSET
MoFEMErrorCode setAtributes(const CubitBCType cubit_bc_type, const int ms_id, const std::vector< double > &attributes, const std::string name="")
set attributes to cubit meshset
MoFEMErrorCode deleteMeshset(const CubitBCType cubit_bc_type, const int ms_id, const MoFEMTypes bh=MF_EXIST)
delete cubit meshset
MoFEMErrorCode clearMap()
clear multi-index container
MoFEMErrorCode addEntitiesToMeshset(const CubitBCType cubit_bc_type, const int ms_id, const Range &ents)
add entities to cubit meshset
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.
const MeshsetsManager * get_meshsets_manager_ptr() const
return pointer to meshset manager
MoFEMErrorCode updateAllMeshsetsByEntitiesChildren(const BitRefLevel &bit)
MoFEMErrorCode printPressureSet() const
print meshsets with pressure boundary conditions data structure
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
MoFEMErrorCode printMaterialsSet() const
print meshsets with material data structure set on it
MoFEMErrorCode setMeshsetFromFile()
get name of config file from line command '-meshsets_config'
MoFEMErrorCode setMeshsetFromFile(const string file_name, const bool clean_file_options=true)
add blocksets reading config file
MoFEMErrorCode setAtributesByDataStructure(const CubitBCType cubit_bc_type, const int ms_id, const GenericAttributeData &data, const std::string name="")
set (material) data structure to cubit meshset
MeshsetsManager * get_meshsets_manager_ptr()
return pointer to meshset manager
Tag get_bhTag_header() const
get tag handle used to store of block set header (Used by Cubit)
CubitMeshSet_multiIndex & getMeshsetsMultindex()
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
MoFEMErrorCode printHeatFluxSet() const
print meshsets with heat flux boundary conditions data structure
boost::shared_ptr< boost::program_options::options_description > & getConfigFileOptionsPtr()
Get config file options, use with care.
MoFEMErrorCode printTemperatureSet() const
print meshsets with temperature boundary conditions data structure
MoFEMErrorCode query_interface(const MOFEMuuid &uuid, UnknownInterface **iface) const
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
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=0)
MoFEMErrorCode getTags(int verb=-1)
get tags handlers used on meshsets
boost::shared_ptr< boost::program_options::options_description > configFileOptionsPtr
config file options
MoFEMErrorCode printDisplacementSet() const
print meshsets with displacement boundary conditions data structure
base class for all interface classes