v0.9.1
Public Member Functions | Public Attributes | Protected Attributes | List of all members
MoFEM::MeshsetsManager Struct Reference

Interface for managing meshsets containing materials and boundary conditions. More...

#include <src/interfaces/MeshsetsManager.hpp>

Inheritance diagram for MoFEM::MeshsetsManager:
[legend]
Collaboration diagram for MoFEM::MeshsetsManager:
[legend]

Public Member Functions

MoFEMErrorCode query_interface (const MOFEMuuid &uuid, UnknownInterface **iface) const
 
 MeshsetsManager (const MoFEM::Core &core)
 
 ~MeshsetsManager ()
 
MoFEMErrorCode getTags (int verb=-1)
 get tags handlers used on meshsets More...
 
Tag get_nsTag () const
 get tag handle used to store "id" of NODESET More...
 
Tag get_ssTag () const
 get tag handle used to store "id" of SIDESET More...
 
Tag get_nsTag_data () const
 get tag handle used to store boundary data on NODESET More...
 
Tag get_ssTag_data () const
 get tag handle used to store boundary data on SIDESET More...
 
Tag get_bhTag () const
 get tag handle used to store "id" of BLOCKSET More...
 
Tag get_bhTag_header () const
 get tag handle used to store of block set header (Used by Cubit) More...
 
MeshsetsManagerget_meshsets_manager_ptr ()
 return pointer to meshset manager More...
 
const MeshsetsManagerget_meshsets_manager_ptr () const
 return pointer to meshset manager More...
 
MoFEMErrorCode clearMap ()
 clear multi-index container More...
 
MoFEMErrorCode initialiseDatabaseFromMesh (int verb=0)
 
template<class CUBIT_BC_DATA_TYPE >
MoFEMErrorCode printBcSet (CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
 
MoFEMErrorCode printDisplacementSet () const
 print meshsets with displacement boundary conditions data structure More...
 
MoFEMErrorCode printPressureSet () const
 print meshsets with pressure boundary conditions data structure More...
 
MoFEMErrorCode printForceSet () const
 print meshsets with force boundary conditions data structure More...
 
MoFEMErrorCode printTemperatureSet () const
 print meshsets with temperature boundary conditions data structure More...
 
MoFEMErrorCode printHeatFluxSet () const
 print meshsets with heat flux boundary conditions data structure More...
 
MoFEMErrorCode printMaterialsSet () const
 print meshsets with material data structure set on it More...
 
CubitMeshSet_multiIndexgetMeshsetsMultindex ()
 
CubitMeshSet_multiIndex::iterator 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 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 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 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 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 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 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 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 checkMeshset (const int ms_id, const CubitBCType cubit_bc_type) const
 check for CUBIT Id and CUBIT type More...
 
bool checkMeshset (const string name, int *const number_of_meshsets_ptr=NULL) const
 check if meshset of given name exist More...
 
MoFEMErrorCode addMeshset (const CubitBCType cubit_bc_type, const int ms_id, const std::string name="")
 add cubit meshset More...
 
MoFEMErrorCode addEntitiesToMeshset (const CubitBCType cubit_bc_type, const int ms_id, const Range &ents)
 add entities to cubit meshset More...
 
MoFEMErrorCode addEntitiesToMeshset (const CubitBCType cubit_bc_type, const int ms_id, const EntityHandle *ents, const int nb_ents)
 add entities to cubit meshset More...
 
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 More...
 
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 More...
 
MoFEMErrorCode setBcData (const CubitBCType cubit_bc_type, const int ms_id, const GenericCubitBcData &data)
 set boundary data structure to meshset More...
 
MoFEMErrorCode deleteMeshset (const CubitBCType cubit_bc_type, const int ms_id, const MoFEMTypes bh=MF_EXIST)
 delete cubit meshset More...
 
MoFEMErrorCode getCubitMeshsetPtr (const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
 get cubit meshset More...
 
MoFEMErrorCode getCubitMeshsetPtr (const string name, const CubitMeshSets **cubit_meshset_ptr) const
 get cubit meshset More...
 
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 dimensionNodeset 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. More...
 
MoFEMErrorCode 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. More...
 
MoFEMErrorCode getMeshset (const int ms_id, const unsigned int cubit_bc_type, EntityHandle &meshset) const
 get meshset from CUBIT Id and CUBIT type More...
 
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. More...
 
MoFEMErrorCode getMeshsetsByType (const unsigned int cubit_bc_type, Range &meshsets) const
 get all CUBIT meshsets by CUBIT type More...
 
MoFEMErrorCode setMeshsetFromFile (const string file_name, const bool clean_file_options=true)
 add blocksets reading config file More...
 
MoFEMErrorCode setMeshsetFromFile ()
 get name of config file from line command '-meshsets_config' More...
 
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 More...
 
MoFEMErrorCode saveMeshsetToFile (const int ms_id, const unsigned int cubit_bc_type, const int dim, const std::string file_name="out_meshset.vtk", const bool recursive=false, const std::string file_type="VTK", const std::string options="") const
 save cubit meshset entities on the moab mesh More...
 
boost::shared_ptr< boost::program_options::options_description > & getConfigFileOptionsPtr ()
 Get config file options, use with care. More...
 
MoFEMErrorCode updateAllMeshsetsByEntitiesChildren (const BitRefLevel &bit)
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (const MOFEMuuid &uuid, bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE , bool VERIFY = false>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, IFACE *&iface) const
 Get interface by uuid and return reference to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface refernce to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()=default
 
virtual MoFEMErrorCode getLibVersion (Version &version) const
 Get library version. More...
 
virtual const MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version) const
 Get database major version. More...
 
virtual MoFEMErrorCode getInterfaceVersion (Version &version) const
 Get database major version. More...
 
template<>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, UnknownInterface *&iface) const
 

Public Attributes

MoFEM::CorecOre
 

Protected Attributes

Tag nsTag
 
Tag ssTag
 
Tag nsTag_data
 
Tag ssTag_data
 
Tag bhTag
 
Tag bhTag_header
 
CubitMeshSet_multiIndex cubitMeshsets
 cubit meshsets More...
 
boost::shared_ptr< boost::program_options::options_description > configFileOptionsPtr
 config file options More...
 

Additional Inherited Members

- Protected Member Functions inherited from MoFEM::UnknownInterface
boost::typeindex::type_index getClassIdx (const MOFEMuuid &uid) const
 Get type name for interface Id. More...
 
MOFEMuuid getUId (const boost::typeindex::type_index &class_idx) const
 Get interface Id for class name. More...
 

Detailed Description

Interface for managing meshsets containing materials and boundary conditions.

Examples
add_blockset.cpp, add_cubit_meshsets.cpp, cell_forces.cpp, cubit_bc_test.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, mesh_cut.cpp, mesh_smoothing.cpp, meshset_to_vtk.cpp, prism_elements_from_surface.cpp, reaction_diffusion_equation.cpp, simple_contact.cpp, split_sideset.cpp, and unsaturated_transport.cpp.

Definition at line 125 of file MeshsetsManager.hpp.

Constructor & Destructor Documentation

◆ MeshsetsManager()

MoFEM::MeshsetsManager::MeshsetsManager ( const MoFEM::Core core)

Definition at line 44 of file MeshsetsManager.cpp.

45  : cOre(const_cast<Core &>(core)) {}

◆ ~MeshsetsManager()

MoFEM::MeshsetsManager::~MeshsetsManager ( )

Definition at line 132 of file MeshsetsManager.hpp.

132 {}

Member Function Documentation

◆ addEntitiesToMeshset() [1/2]

MoFEMErrorCode MoFEM::MeshsetsManager::addEntitiesToMeshset ( const CubitBCType  cubit_bc_type,
const int  ms_id,
const Range &  ents 
)

add entities to cubit meshset

Parameters
cubit_bc_typetype of meshset, f.e. NODESET, SIDESET or BLOCKSET
ms_idid of meshset
entsentities to add
Returns
error code
Examples
mesh_cut.cpp.

Definition at line 247 of file MeshsetsManager.cpp.

248  {
249  Interface &m_field = cOre;
250  moab::Interface &moab = m_field.get_moab();
252  auto cit =
253  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
254  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
255  if (cit ==
256  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
257  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
258  "such cubit meshset is already there", ms_id);
259  }
260  EntityHandle meshset = cit->getMeshset();
261  CHKERR moab.add_entities(meshset, ents);
262 
264 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
#define CHKERR
Inline error check.
Definition: definitions.h:602
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ addEntitiesToMeshset() [2/2]

MoFEMErrorCode MoFEM::MeshsetsManager::addEntitiesToMeshset ( const CubitBCType  cubit_bc_type,
const int  ms_id,
const EntityHandle ents,
const int  nb_ents 
)

add entities to cubit meshset

Parameters
cubit_bc_typetype of meshset, f.e. NODESET, SIDESET or BLOCKSET
ms_idid of meshset
entspointer to entities array
nb_entsnumber of entities in array
Returns
error code

Definition at line 267 of file MeshsetsManager.cpp.

269  {
270  Interface &m_field = cOre;
271  moab::Interface &moab = m_field.get_moab();
273  auto cit =
274  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
275  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
276  if (cit ==
277  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
278  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
279  "such cubit meshset is already there", ms_id);
280  }
281  EntityHandle meshset = cit->getMeshset();
282  CHKERR moab.add_entities(meshset, ents, nb_ents);
283 
285 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
#define CHKERR
Inline error check.
Definition: definitions.h:602
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ checkIfMeshsetContainsEntities()

bool MoFEM::MeshsetsManager::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.

Parameters
ms_id
cubit_bc_type
entities
num_entities
operation_type
Returns
true
false

Definition at line 491 of file MeshsetsManager.cpp.

493  {
494  auto miit =
495  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
496  boost::make_tuple(ms_id, cubit_bc_type));
497  if (miit !=
498  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
499  Interface &m_field = cOre;
500  return m_field.get_moab().contains_entities(miit->meshset, entities,
501  num_entities, operation_type);
502  } else
503  return false;
504 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
moab::Interface & get_moab()
Definition: Core.hpp:266
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879

◆ checkMeshset()

bool MoFEM::MeshsetsManager::checkMeshset ( const string  name,
int *const  number_of_meshsets_ptr = NULL 
) const

check if meshset of given name exist

Parameters
namename of meshset
Returns
error code

◆ clearMap()

MoFEMErrorCode MoFEM::MeshsetsManager::clearMap ( )

clear multi-index container

Returns
error code

Definition at line 47 of file MeshsetsManager.cpp.

47  {
49  cubitMeshsets.clear();
51 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:507
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:514

◆ deleteMeshset()

MoFEMErrorCode MoFEM::MeshsetsManager::deleteMeshset ( const CubitBCType  cubit_bc_type,
const int  ms_id,
const MoFEMTypes  bh = MF_EXIST 
)

delete cubit meshset

Parameters
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
ms_idid of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT

Definition at line 373 of file MeshsetsManager.cpp.

375  {
376  Interface &m_field = cOre;
377  moab::Interface &moab = m_field.get_moab();
379  auto miit =
380  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
381  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
382  if (miit ==
383  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
384  if (bh & MF_EXIST) {
385  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
386  "meshset not found", ms_id);
387  } else {
389  }
390  }
391  EntityHandle meshset = miit->getMeshset();
392  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().erase(miit);
393  CHKERR moab.delete_entities(&meshset, 1);
394 
396 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:514
#define CHKERR
Inline error check.
Definition: definitions.h:602
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ get_bhTag()

Tag MoFEM::MeshsetsManager::get_bhTag ( ) const

get tag handle used to store "id" of BLOCKSET

Definition at line 170 of file MeshsetsManager.hpp.

170 { return bhTag; }

◆ get_bhTag_header()

Tag MoFEM::MeshsetsManager::get_bhTag_header ( ) const

get tag handle used to store of block set header (Used by Cubit)

Definition at line 175 of file MeshsetsManager.hpp.

◆ get_meshsets_manager_ptr() [1/2]

MeshsetsManager* MoFEM::MeshsetsManager::get_meshsets_manager_ptr ( )

return pointer to meshset manager

Definition at line 180 of file MeshsetsManager.hpp.

180 { return this; }

◆ get_meshsets_manager_ptr() [2/2]

const MeshsetsManager* MoFEM::MeshsetsManager::get_meshsets_manager_ptr ( ) const

return pointer to meshset manager

Definition at line 185 of file MeshsetsManager.hpp.

185 { return this; }

◆ get_nsTag()

Tag MoFEM::MeshsetsManager::get_nsTag ( ) const

get tag handle used to store "id" of NODESET

Definition at line 150 of file MeshsetsManager.hpp.

150 { return nsTag; }

◆ get_nsTag_data()

Tag MoFEM::MeshsetsManager::get_nsTag_data ( ) const

get tag handle used to store boundary data on NODESET

Definition at line 160 of file MeshsetsManager.hpp.

160 { return nsTag_data; }

◆ get_ssTag()

Tag MoFEM::MeshsetsManager::get_ssTag ( ) const

get tag handle used to store "id" of SIDESET

Definition at line 155 of file MeshsetsManager.hpp.

155 { return ssTag; }

◆ get_ssTag_data()

Tag MoFEM::MeshsetsManager::get_ssTag_data ( ) const

get tag handle used to store boundary data on SIDESET

Definition at line 165 of file MeshsetsManager.hpp.

165 { return ssTag_data; }

◆ getConfigFileOptionsPtr()

boost::shared_ptr<boost::program_options::options_description>& MoFEM::MeshsetsManager::getConfigFileOptionsPtr ( )

Get config file options, use with care.

Returns
error code

Definition at line 759 of file MeshsetsManager.hpp.

759  {
760  return configFileOptionsPtr;
761  }
boost::shared_ptr< boost::program_options::options_description > configFileOptionsPtr
config file options

◆ getMeshsetsMultindex()

CubitMeshSet_multiIndex& MoFEM::MeshsetsManager::getMeshsetsMultindex ( )
Examples
meshset_to_vtk.cpp, and split_sideset.cpp.

Definition at line 234 of file MeshsetsManager.hpp.

234  {
235  return cubitMeshsets;
236  }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets

◆ getTags()

MoFEMErrorCode MoFEM::MeshsetsManager::getTags ( int  verb = -1)

get tags handlers used on meshsets

On meshsets range of tags in set. Depending on tag type and data on that tag type of meshset could be determined. This function get hanldes to tags.

Most of the tags are followinf convention used by MoAB or Cubit and other meshing softwares, f.e. gmesh.

Definition at line 77 of file MeshsetsManager.cpp.

77  {
79  Interface &m_field = cOre;
80  moab::Interface &moab = m_field.get_moab();
81  int default_val = -1;
82  CHKERR moab.tag_get_handle(DIRICHLET_SET_TAG_NAME, 1, MB_TYPE_INTEGER, nsTag,
83  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
84 
85  CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME, 1, MB_TYPE_INTEGER, ssTag,
86  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
87 
88  const int def_bc_data_len = 0;
89  std::string tag_name = std::string(DIRICHLET_SET_TAG_NAME) + "__BC_DATA";
90  CHKERR moab.tag_get_handle(
91  tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE, nsTag_data,
92  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
93 
94  tag_name = std::string(NEUMANN_SET_TAG_NAME) + "__BC_DATA";
95  CHKERR moab.tag_get_handle(
96  tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE, ssTag_data,
97  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
98 
99  CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME, 1, MB_TYPE_INTEGER, bhTag,
100  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
101 
102  std::vector<unsigned int> def_uint_zero(3, 0);
103  CHKERR moab.tag_get_handle(
104  BLOCK_HEADER, 3 * sizeof(unsigned int), MB_TYPE_INTEGER, bhTag_header,
105  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_uint_zero[0]);
106 
107  Tag block_attribs;
108  int def_Block_Attributes_length = 0;
109  CHKERR moab.tag_get_handle(
110  BLOCK_ATTRIBUTES, def_Block_Attributes_length, MB_TYPE_DOUBLE,
111  block_attribs, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN, NULL);
112 
113  Tag entity_name_tag;
114  CHKERR moab.tag_get_handle(NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
115  entity_name_tag, MB_TAG_SPARSE | MB_TAG_CREAT);
116 
118 }
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
#define CHKERR
Inline error check.
Definition: definitions.h:602
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ initialiseDatabaseFromMesh()

MoFEMErrorCode MoFEM::MeshsetsManager::initialiseDatabaseFromMesh ( int  verb = 0)

\brier initialize container form data on mesh

Returns
[description]

Definition at line 53 of file MeshsetsManager.cpp.

53  {
54  Interface &m_field = cOre;
55  moab::Interface &moab = m_field.get_moab();
57  Range meshsets;
58  CHKERR moab.get_entities_by_type(0, MBENTITYSET, meshsets, false);
59  for (Range::iterator mit = meshsets.begin(); mit != meshsets.end(); mit++) {
60  // check if meshset is cubit meshset
61  CubitMeshSets base_meshset(moab, *mit);
62  if ((base_meshset.cubitBcType & CubitBCType(NODESET | SIDESET | BLOCKSET))
63  .any()) {
64  std::pair<CubitMeshSet_multiIndex::iterator, bool> p =
65  cubitMeshsets.insert(base_meshset);
66  if (!p.second)
67  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
68  "meshset not inserted");
69 
70  if (verb > QUIET)
71  MOFEM_LOG("WORLD", Sev::inform) << "read cubit " << base_meshset;
72  }
73  }
75 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
virtual moab::Interface & get_moab()=0
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:292
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
#define MeshsetsManagerFunctionBegin
#define CHKERR
Inline error check.
Definition: definitions.h:602
std::bitset< 32 > CubitBCType
Definition: Types.hpp:62
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879

◆ printBcSet()

template<class CUBIT_BC_DATA_TYPE >
MoFEMErrorCode MoFEM::MeshsetsManager::printBcSet ( CUBIT_BC_DATA_TYPE &  data,
unsigned long int  type 
) const

Definition at line 780 of file MeshsetsManager.hpp.

781  {
783  const MoFEM::Interface &m_field = cOre;
784  const moab::Interface &moab = m_field.get_moab();
786  CHKERR it->getBcDataStructure(data);
787  MOFEM_LOG("WORLD", Sev::inform) << *it;
788  MOFEM_LOG("WORLD", Sev::inform) << data;
789  int tets, tris, edges, nodes, prisms, quads;
790  CHKERR moab.get_number_entities_by_type(it->meshset, MBTET, tets, true);
791  CHKERR moab.get_number_entities_by_type(it->meshset, MBTRI, tris, true);
792  CHKERR moab.get_number_entities_by_type(it->meshset, MBEDGE, edges, true);
793  CHKERR moab.get_number_entities_by_type(it->meshset, MBVERTEX, nodes, true);
794  CHKERR moab.get_number_entities_by_type(it->meshset, MBPRISM, prisms, true);
795  CHKERR moab.get_number_entities_by_type(it->meshset, MBQUAD, quads, true);
796  MOFEM_LOG("WORLD", Sev::inform) << "name " << it->getName();
797  MOFEM_LOG("WORLD", Sev::inform)
798  << "msId " << it->getMeshsetId() << " nb. tets " << tets;
799  MOFEM_LOG("WORLD", Sev::inform)
800  << "msId " << it->getMeshsetId() << " nb. prisms " << prisms;
801  MOFEM_LOG("WORLD", Sev::inform)
802  << "msId " << it->getMeshsetId() << " nb. quads " << quads;
803  MOFEM_LOG("WORLD", Sev::inform)
804  << "msId " << it->getMeshsetId() << " nb. tris " << tris;
805  MOFEM_LOG("WORLD", Sev::inform)
806  << "msId " << it->getMeshsetId() << " nb. edges " << edges;
807  MOFEM_LOG("WORLD", Sev::inform)
808  << "msId " << it->getMeshsetId() << " nb. nodes " << nodes;
809  }
811 }
Deprecated interface functions.
virtual moab::Interface & get_moab()=0
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:292
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
#define MeshsetsManagerFunctionBegin
#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 CHKERR
Inline error check.
Definition: definitions.h:602
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879

◆ printDisplacementSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printDisplacementSet ( ) const

print meshsets with displacement boundary conditions data structure

Examples
cell_forces.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, and simple_contact.cpp.

Definition at line 120 of file MeshsetsManager.cpp.

120  {
121  DisplacementCubitBcData mydata;
123  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
125 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
#define CHKERR
Inline error check.
Definition: definitions.h:602
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ printForceSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printForceSet ( ) const

print meshsets with force boundary conditions data structure

Examples
cell_forces.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, and simple_contact.cpp.

Definition at line 134 of file MeshsetsManager.cpp.

134  {
135  ForceCubitBcData mydata;
137  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
139 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
#define CHKERR
Inline error check.
Definition: definitions.h:602
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ printHeatFluxSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printHeatFluxSet ( ) const

print meshsets with heat flux boundary conditions data structure

Definition at line 148 of file MeshsetsManager.cpp.

148  {
149  HeatFluxCubitBcData mydata;
151  CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
153 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
#define CHKERR
Inline error check.
Definition: definitions.h:602
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ printMaterialsSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printMaterialsSet ( ) const

print meshsets with material data structure set on it

Examples
cell_forces.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, and simple_contact.cpp.

Definition at line 155 of file MeshsetsManager.cpp.

155  {
157  const Interface &m_field = cOre;
158  const moab::Interface &moab = m_field.get_moab();
160  (*this), BLOCKSET | MAT_ELASTICSET, it)) {
161  Mat_Elastic data;
162  CHKERR it->getAttributeDataStructure(data);
163  MOFEM_LOG("WORLD", Sev::inform) << *it;
164  MOFEM_LOG("WORLD", Sev::inform) << data;
165  Range tets;
166  CHKERR moab.get_entities_by_type(it->meshset, MBTET, tets, true);
167  MOFEM_LOG("WORLD", Sev::inform) << "MAT_ELATIC msId " << it->getMeshsetId()
168  << " nb. tets " << tets.size();
169  }
170 
172  m_field, BLOCKSET | MAT_THERMALSET, it)) {
173  Mat_Thermal data;
174  CHKERR it->getAttributeDataStructure(data);
175  MOFEM_LOG("WORLD", Sev::inform) << *it;
176  MOFEM_LOG("WORLD", Sev::inform) << data;
177  }
178 
180  m_field, BLOCKSET | MAT_MOISTURESET, it)) {
181  Mat_Moisture data;
182  CHKERR it->getAttributeDataStructure(data);
183  MOFEM_LOG("WORLD", Sev::inform) << *it;
184  MOFEM_LOG("WORLD", Sev::inform) << data;
185  }
187 }
block name is "MAT_MOISTURE"
Definition: definitions.h:232
virtual moab::Interface & get_moab()=0
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:292
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
block name is "MAT_THERMAL"
Definition: definitions.h:230
#define CHKERR
Inline error check.
Definition: definitions.h:602
block name is "MAT_ELASTIC"
Definition: definitions.h:228
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ printPressureSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printPressureSet ( ) const

print meshsets with pressure boundary conditions data structure

Definition at line 127 of file MeshsetsManager.cpp.

127  {
128  PressureCubitBcData mydata;
130  CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
132 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
#define CHKERR
Inline error check.
Definition: definitions.h:602
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ printTemperatureSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printTemperatureSet ( ) const

print meshsets with temperature boundary conditions data structure

Definition at line 141 of file MeshsetsManager.cpp.

141  {
142  TemperatureCubitBcData mydata;
144  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
146 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
#define CHKERR
Inline error check.
Definition: definitions.h:602
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ query_interface()

MoFEMErrorCode MoFEM::MeshsetsManager::query_interface ( const MOFEMuuid uuid,
UnknownInterface **  iface 
) const
virtual

Implements MoFEM::UnknownInterface.

Definition at line 32 of file MeshsetsManager.cpp.

33  {
35  *iface = NULL;
36  if (uuid == IDD_MOFEMMeshsetsManager) {
37  *iface = const_cast<MeshsetsManager *>(this);
39  }
40  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown interface");
42 }
static const MOFEMuuid IDD_MOFEMMeshsetsManager
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:507
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:514

◆ saveMeshsetToFile() [1/2]

MoFEMErrorCode MoFEM::MeshsetsManager::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

Parameters
ms_idid of the cubit meshset (NODESET SIDESET BLOCKSET)
cubit_bc_typetype of a cubit mesheset
file_nameoptional name for the file
file_typeoptional file type for moab (VTK MOAB)
optionsoptional parameters for moab writer (PARALLEL=WRITE_PART)
Returns
MoFEMErrorCode
Examples
meshset_to_vtk.cpp.

Definition at line 1076 of file MeshsetsManager.cpp.

1079  {
1080 
1082  MoFEM::Interface &m_field = cOre;
1083  const CubitMeshSets *cubit_meshset_ptr;
1084  CHKERR getCubitMeshsetPtr(ms_id, cubit_bc_type, &cubit_meshset_ptr);
1085  EntityHandle meshset = cubit_meshset_ptr->getMeshset();
1086  CHKERR m_field.get_moab().write_file(file_name.c_str(), file_type.c_str(),
1087  options.c_str(), &meshset, 1, nullptr,
1088  0);
1090 }
Deprecated interface functions.
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
#define CHKERR
Inline error check.
Definition: definitions.h:602
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ saveMeshsetToFile() [2/2]

MoFEMErrorCode MoFEM::MeshsetsManager::saveMeshsetToFile ( const int  ms_id,
const unsigned int  cubit_bc_type,
const int  dim,
const std::string  file_name = "out_meshset.vtk",
const bool  recursive = false,
const std::string  file_type = "VTK",
const std::string  options = "" 
) const

save cubit meshset entities on the moab mesh

Parameters
ms_idid of the cubit meshset
cubit_bc_typetype of a cubit mesheset (NODESET SIDESET BLOCKSET)
dimdimension of the entities
file_nameoptional name for the file
file_typeoptional file type for moab (VTK MOAB)
optionsoptional parameters for moab writer (PARALLEL=WRITE_PART)
Returns
MoFEMErrorCode

Definition at line 1092 of file MeshsetsManager.cpp.

1095  {
1096 
1098  MoFEM::Interface &m_field = cOre;
1099  moab::Interface &moab = m_field.get_moab();
1100  Range entities;
1101  CHKERR getEntitiesByDimension(ms_id, cubit_bc_type, dim, entities, recursive);
1102  EntityHandle meshset;
1103  CHKERR moab.create_meshset(MESHSET_SET, meshset);
1104  CHKERR moab.add_entities(meshset, entities);
1105  CHKERR moab.write_file(file_name.c_str(), file_type.c_str(), options.c_str(),
1106  &meshset, 1, nullptr, 0);
1107  CHKERR moab.delete_entities(&meshset, 1);
1109 }
Deprecated interface functions.
virtual moab::Interface & get_moab()=0
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 dimensionNodeset can contain nodes,...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
const int dim
#define CHKERR
Inline error check.
Definition: definitions.h:602
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ setAtributes()

MoFEMErrorCode MoFEM::MeshsetsManager::setAtributes ( const CubitBCType  cubit_bc_type,
const int  ms_id,
const std::vector< double > &  attributes,
const std::string  name = "" 
)

set attributes to cubit meshset

Parameters
cubit_bc_typetype of meshset, see CubitBC, i.e. BLOCKSET, NODESET, SIDESET
ms_idid of meshset
attributesattributes
Returns
error code
Examples
add_cubit_meshsets.cpp.

Definition at line 288 of file MeshsetsManager.cpp.

290  {
291  Interface &m_field = cOre;
292  moab::Interface &moab = m_field.get_moab();
294  auto cit =
295  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
296  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
297  if (cit ==
298  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
299  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
300  "such cubit meshset is already there", ms_id);
301  }
302  if (name.size() > 0) {
303  bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
304  CubitMeshSets_change_name(moab, name));
305  if (!success) {
306  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
307  "name to cubit meshset can not be set");
308  }
309  }
310  bool success =
311  cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
312  CubitMeshSets_change_attributes(moab, attributes));
313  if (!success)
314  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
315  "modification unsuccessful");
317 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ setAtributesByDataStructure()

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

set (material) data structure to cubit meshset

Parameters
cubit_bc_typetype of meshset, see CubitBC, i.e. BLOCKSET, NODESET, SIDESET
ms_idid of meshset
attributesattributes
Returns
error code
Examples
add_cubit_meshsets.cpp.

Definition at line 319 of file MeshsetsManager.cpp.

321  {
322  Interface &m_field = cOre;
323  moab::Interface &moab = m_field.get_moab();
325  auto cit =
326  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
327  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
328  if (cit ==
329  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
330  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
331  "such cubit meshset is already there", ms_id);
332  }
333  if (name.size() > 0) {
334  bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
335  CubitMeshSets_change_name(moab, name));
336  if (!success) {
337  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
338  "name to cubit meshset can not be set");
339  }
340  }
341  bool success = cubitMeshsets.modify(
342  cubitMeshsets.project<0>(cit),
343  CubitMeshSets_change_attributes_data_structure(moab, data));
344  if (!success)
345  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
346  "modification unsuccessful");
348 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ setBcData()

MoFEMErrorCode MoFEM::MeshsetsManager::setBcData ( const CubitBCType  cubit_bc_type,
const int  ms_id,
const GenericCubitBcData data 
)

set boundary data structure to meshset

Parameters
cubit_bc_typetype of meshset, see CubitBC, i.e. BLOCKSET, NODESET, SIDESET
ms_idid of meshset
datadata structure
Returns
error code
Examples
add_cubit_meshsets.cpp.

Definition at line 350 of file MeshsetsManager.cpp.

352  {
353  Interface &m_field = cOre;
354  moab::Interface &moab = m_field.get_moab();
356  auto cit =
357  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
358  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
359  if (cit ==
360  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
361  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
362  "such cubit meshset is already there", ms_id);
363  }
364  bool success =
365  cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
366  CubitMeshSets_change_bc_data_structure(moab, data));
367  if (!success)
368  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
369  "modification unsuccessful");
371 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ setMeshsetFromFile() [1/2]

MoFEMErrorCode MoFEM::MeshsetsManager::setMeshsetFromFile ( const string  file_name,
const bool  clean_file_options = true 
)

add blocksets reading config file

Example of config file

[block_1001]
# Example applying attributes to blockset
id=2001
user1=1.0 # attribute value 1
user2=2.0 # you can set up to 10 attributes (if needed could be easily
extended to more, let us know)
user3=3.0
[block_1002]
# Example applying material block (isotropic elastic material)
id=2002
name=MAT_ELASTIC
young=10
poisson=0.25
thermalexpansion=0
[block_1003]
# Example applying displacement constrains
id=2003
# Each flag means that boundary consition on displacements is set.
disp_flag1=1 # Setting constrains in x- direction
disp_flag2=1 # Setting constrains in y- direction
disp_flag3=1 # Setting constrains in z- direction
disp_flag4=1 # Setting constrains on rotation over x- axis
disp_flag5=1 # Setting constrains on rotation over y- axis
disp_flag6=1 # Setting constrains on rotation over z-axis
disp_ux=1 # value of disp in x- direction
disp_uy=2
disp_uz=3
disp_rx=4 # value of rotation in y-direction
disp_ry=5
disp_rz=6
# Note above values could be interpreted differently if needed.
[block_1004]
# Example applying force boundary conditions
id=2004
force_magnitude=1
moment_magnitude=1
force_fx=1
force_fy=1
force_fz=1
moment_mx=1
moment_my=1
moment_mz=1
[block_1005]
# Example applying pressure boundary conditions
id=2005
pressure_flag2=1 # 0: Pressure is interpreted as pure pressure 1:
pressure is interpreted as total force
pressure_magnitude=1
# Example applying temperature boundary conditions
[block_1006]
id=2006
temperature_flag1=1 # 0: N/A, 1: temperature value applied
temperature_t=1
[block_1007]
id=2007
heatflux_flag1=1 # 0: N/A, 1: heat flux applied
heatflux_magnitude=1
[block_1008]
# Example applying material block (isotropic thermal material)
id=2008
name=MAT_THERMAL # Hast to be set for Thermal Mat
conductivity=1
capacity=1
[block_1009]
# Example applying interface
id=2009
interface_type=1
[block_1010]
# Example applying material block for interface element
id=2010
name=MAT_INTERF
interface_alpha = 1
interface_beta = 0
interface_ft = 1
interface_Gf = 1
Parameters
file_nameconfig file
Returns
error code
Examples
add_cubit_meshsets.cpp, meshset_to_vtk.cpp, and unsaturated_transport.cpp.

◆ setMeshsetFromFile() [2/2]

MoFEMErrorCode MoFEM::MeshsetsManager::setMeshsetFromFile ( )

get name of config file from line command '-meshsets_config'

Returns
error code

Option is "-meshsets_config file_name.cfg"

Definition at line 1051 of file MeshsetsManager.cpp.

1051  {
1052  Interface &m_field = cOre;
1053  // moab::Interface &moab = m_field.get_moab();
1054  PetscBool flg_file;
1055  char meshset_file_name[255];
1057  CHKERR PetscOptionsBegin(m_field.get_comm(), "", "Set meshsets form file",
1058  "none");
1059  CHKERR PetscOptionsString("-meshsets_config", "meshsets config file name",
1060  "", "add_cubit_meshsets.in", meshset_file_name, 255,
1061  &flg_file);
1062  if (flg_file == PETSC_TRUE) {
1063  ifstream f(meshset_file_name);
1064  if (!f.good()) {
1065  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1066  "File configuring meshsets ( %s ) can not be open\n",
1067  meshset_file_name);
1068  }
1069  CHKERR setMeshsetFromFile(string(meshset_file_name));
1070  }
1071  ierr = PetscOptionsEnd();
1072  CHKERRG(ierr);
1074 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:550
MoFEMErrorCode setMeshsetFromFile()
get name of config file from line command '-meshsets_config'
#define CHKERR
Inline error check.
Definition: definitions.h:602
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ updateAllMeshsetsByEntitiesChildren()

MoFEMErrorCode MoFEM::MeshsetsManager::updateAllMeshsetsByEntitiesChildren ( const BitRefLevel bit)

Definition at line 1112 of file MeshsetsManager.cpp.

1112  {
1114  BitRefManager *bit_mng = cOre.getInterface<BitRefManager>();
1115  for (_IT_CUBITMESHSETS_FOR_LOOP_((*this), iit)) {
1116  EntityHandle meshset = iit->getMeshset();
1117  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1118  MBVERTEX, true);
1119  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1120  MBEDGE, true);
1121  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1122  MBTRI, true);
1123  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1124  MBTET, true);
1125  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1126  MBPRISM, true);
1127  }
1129 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
MoFEMErrorCode getInterface(const MOFEMuuid &uuid, IFACE *&iface) const
Get interface by uuid and return reference to pointer of interface.
#define CHKERR
Inline error check.
Definition: definitions.h:602
#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
Iterator that loops over all the Cubit MeshSets in a moFEM field.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

Member Data Documentation

◆ bhTag

Tag MoFEM::MeshsetsManager::bhTag
protected

Definition at line 770 of file MeshsetsManager.hpp.

◆ bhTag_header

Tag MoFEM::MeshsetsManager::bhTag_header
protected

Definition at line 771 of file MeshsetsManager.hpp.

◆ configFileOptionsPtr

boost::shared_ptr<boost::program_options::options_description> MoFEM::MeshsetsManager::configFileOptionsPtr
protected

config file options

Definition at line 776 of file MeshsetsManager.hpp.

◆ cOre

MoFEM::Core& MoFEM::MeshsetsManager::cOre

Definition at line 130 of file MeshsetsManager.hpp.

◆ cubitMeshsets

CubitMeshSet_multiIndex MoFEM::MeshsetsManager::cubitMeshsets
protected

cubit meshsets

Definition at line 774 of file MeshsetsManager.hpp.

◆ nsTag

Tag MoFEM::MeshsetsManager::nsTag
protected

Definition at line 766 of file MeshsetsManager.hpp.

◆ nsTag_data

Tag MoFEM::MeshsetsManager::nsTag_data
protected

Definition at line 768 of file MeshsetsManager.hpp.

◆ ssTag

Tag MoFEM::MeshsetsManager::ssTag
protected

Definition at line 767 of file MeshsetsManager.hpp.

◆ ssTag_data

Tag MoFEM::MeshsetsManager::ssTag_data
protected

Definition at line 769 of file MeshsetsManager.hpp.


The documentation for this struct was generated from the following files: