v0.10.0
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, heat_equation.cpp, mesh_cut.cpp, mesh_smoothing.cpp, meshset_to_vtk.cpp, prism_elements_from_surface.cpp, reaction_diffusion.cpp, simple_contact.cpp, split_sideset.cpp, unsaturated_transport.cpp, and wave_equation.cpp.

Definition at line 127 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 134 of file MeshsetsManager.hpp.

134 {}

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  "Cannot find Cubit meshset with id: %d", 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:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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  "Cannot find Cubit meshset with id: %d", 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:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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:319
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943

◆ 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:509
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516

◆ 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:485
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
#define CHKERR
Inline error check.
Definition: definitions.h:604
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ get_bhTag()

Tag MoFEM::MeshsetsManager::get_bhTag ( ) const

get tag handle used to store "id" of BLOCKSET

Definition at line 172 of file MeshsetsManager.hpp.

172 { 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 177 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 182 of file MeshsetsManager.hpp.

182 { 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 187 of file MeshsetsManager.hpp.

187 { return this; }

◆ get_nsTag()

Tag MoFEM::MeshsetsManager::get_nsTag ( ) const

get tag handle used to store "id" of NODESET

Definition at line 152 of file MeshsetsManager.hpp.

152 { 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 162 of file MeshsetsManager.hpp.

162 { return nsTag_data; }

◆ get_ssTag()

Tag MoFEM::MeshsetsManager::get_ssTag ( ) const

get tag handle used to store "id" of SIDESET

Definition at line 157 of file MeshsetsManager.hpp.

157 { 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 167 of file MeshsetsManager.hpp.

167 { 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 775 of file MeshsetsManager.hpp.

775  {
776  return configFileOptionsPtr;
777  }
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 236 of file MeshsetsManager.hpp.

236  {
237  return cubitMeshsets;
238  }
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:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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
static Index< 'p', 3 > p
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define MeshsetsManagerFunctionBegin
#define CHKERR
Inline error check.
Definition: definitions.h:604
std::bitset< 32 > CubitBCType
Definition: Types.hpp:63
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943

◆ printBcSet()

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

Definition at line 796 of file MeshsetsManager.hpp.

797  {
799  const MoFEM::Interface &m_field = cOre;
800  const moab::Interface &moab = m_field.get_moab();
802  CHKERR it->getBcDataStructure(data);
803  MOFEM_LOG("WORLD", Sev::inform) << *it;
804  MOFEM_LOG("WORLD", Sev::inform) << 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();
813  MOFEM_LOG("WORLD", Sev::inform)
814  << "msId " << it->getMeshsetId() << " nb. tets " << tets;
815  MOFEM_LOG("WORLD", Sev::inform)
816  << "msId " << it->getMeshsetId() << " nb. prisms " << prisms;
817  MOFEM_LOG("WORLD", Sev::inform)
818  << "msId " << it->getMeshsetId() << " nb. quads " << quads;
819  MOFEM_LOG("WORLD", Sev::inform)
820  << "msId " << it->getMeshsetId() << " nb. tris " << tris;
821  MOFEM_LOG("WORLD", Sev::inform)
822  << "msId " << it->getMeshsetId() << " nb. edges " << edges;
823  MOFEM_LOG("WORLD", Sev::inform)
824  << "msId " << it->getMeshsetId() << " nb. nodes " << nodes;
825  }
827 }
Deprecated interface functions.
virtual moab::Interface & get_moab()=0
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#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:604
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943

◆ 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:485
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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:485
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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:485
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#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:604
block name is "MAT_ELASTIC"
Definition: definitions.h:228
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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:485
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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:485
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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:509
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516

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

1119  {
1120 
1122  MoFEM::Interface &m_field = cOre;
1123  const CubitMeshSets *cubit_meshset_ptr;
1124  CHKERR getCubitMeshsetPtr(ms_id, cubit_bc_type, &cubit_meshset_ptr);
1125  EntityHandle meshset = cubit_meshset_ptr->getMeshset();
1126  CHKERR m_field.get_moab().write_file(file_name.c_str(), file_type.c_str(),
1127  options.c_str(), &meshset, 1);
1129 }
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:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
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:415

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

1134  {
1135 
1137  MoFEM::Interface &m_field = cOre;
1138  moab::Interface &moab = m_field.get_moab();
1139  Range entities;
1140  CHKERR getEntitiesByDimension(ms_id, cubit_bc_type, dim, entities, recursive);
1141  EntityHandle meshset;
1142  CHKERR moab.create_meshset(MESHSET_SET, meshset);
1143  CHKERR moab.add_entities(meshset, entities);
1144  CHKERR moab.write_file(file_name.c_str(), file_type.c_str(), options.c_str(),
1145  &meshset, 1);
1146  CHKERR moab.delete_entities(&meshset, 1);
1148 }
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:485
const int dim
#define CHKERR
Inline error check.
Definition: definitions.h:604
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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  "Cannot find Cubit meshset with id: %d", 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:485
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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  "Cannot find Cubit meshset with id: %d", 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:485
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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  "Cubit meshset with id 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:485
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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
[block_1009]
# Example applying material block (isotropic trans iso material)
id=2011
name=MAT_ELASTIC_TRANS_ISO
Youngp=1
Youngz=2
Poissonp=3
Poissonpz=4
Shearzp=5
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 1091 of file MeshsetsManager.cpp.

1091  {
1092  Interface &m_field = cOre;
1093  // moab::Interface &moab = m_field.get_moab();
1094  PetscBool flg_file;
1095  char meshset_file_name[255];
1097  CHKERR PetscOptionsBegin(m_field.get_comm(), "", "Set meshsets form file",
1098  "none");
1099  CHKERR PetscOptionsString("-meshsets_config", "meshsets config file name",
1100  "", "add_cubit_meshsets.in", meshset_file_name, 255,
1101  &flg_file);
1102  if (flg_file == PETSC_TRUE) {
1103  ifstream f(meshset_file_name);
1104  if (!f.good()) {
1105  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1106  "File configuring meshsets ( %s ) can not be open\n",
1107  meshset_file_name);
1108  }
1109  CHKERR setMeshsetFromFile(string(meshset_file_name));
1110  }
1111  ierr = PetscOptionsEnd();
1112  CHKERRG(ierr);
1114 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:552
MoFEMErrorCode setMeshsetFromFile()
get name of config file from line command '-meshsets_config'
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:87
#define CHKERR
Inline error check.
Definition: definitions.h:604
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ updateAllMeshsetsByEntitiesChildren()

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

Definition at line 1151 of file MeshsetsManager.cpp.

1151  {
1153  BitRefManager *bit_mng = cOre.getInterface<BitRefManager>();
1154  for (_IT_CUBITMESHSETS_FOR_LOOP_((*this), iit)) {
1155  EntityHandle meshset = iit->getMeshset();
1156  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1157  MBVERTEX, true);
1158  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1159  MBEDGE, true);
1160  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1161  MBTRI, true);
1162  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1163  MBTET, true);
1164  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1165  MBPRISM, true);
1166  }
1168 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
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:604
#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:415

Member Data Documentation

◆ bhTag

Tag MoFEM::MeshsetsManager::bhTag
protected

Definition at line 786 of file MeshsetsManager.hpp.

◆ bhTag_header

Tag MoFEM::MeshsetsManager::bhTag_header
protected

Definition at line 787 of file MeshsetsManager.hpp.

◆ configFileOptionsPtr

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

config file options

Definition at line 792 of file MeshsetsManager.hpp.

◆ cOre

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

Definition at line 132 of file MeshsetsManager.hpp.

◆ cubitMeshsets

CubitMeshSet_multiIndex MoFEM::MeshsetsManager::cubitMeshsets
protected

cubit meshsets

Definition at line 790 of file MeshsetsManager.hpp.

◆ nsTag

Tag MoFEM::MeshsetsManager::nsTag
protected

Definition at line 782 of file MeshsetsManager.hpp.

◆ nsTag_data

Tag MoFEM::MeshsetsManager::nsTag_data
protected

Definition at line 784 of file MeshsetsManager.hpp.

◆ ssTag

Tag MoFEM::MeshsetsManager::ssTag
protected

Definition at line 783 of file MeshsetsManager.hpp.

◆ ssTag_data

Tag MoFEM::MeshsetsManager::ssTag_data
protected

Definition at line 785 of file MeshsetsManager.hpp.


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