v0.8.20
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...
 
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 ()
 
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:
cell_forces.cpp, cubit_bc_test.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, mesh_cut.cpp, mesh_smoothing.cpp, split_sideset.cpp, and unsaturated_transport.cpp.

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

124 {}

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

260  {
261  Interface &m_field = cOre;
262  moab::Interface &moab = m_field.get_moab();
264  auto cit =
265  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
266  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
267  if (cit ==
268  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
269  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
270  "such cubit meshset is already there", ms_id);
271  }
272  EntityHandle meshset = cit->getMeshset();
273  CHKERR moab.add_entities(meshset, ents);
274 
276 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

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

281  {
282  Interface &m_field = cOre;
283  moab::Interface &moab = m_field.get_moab();
285  auto cit =
286  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
287  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
288  if (cit ==
289  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
290  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
291  "such cubit meshset is already there", ms_id);
292  }
293  EntityHandle meshset = cit->getMeshset();
294  CHKERR moab.add_entities(meshset, ents, nb_ents);
295 
297 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

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

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

387  {
388  Interface &m_field = cOre;
389  moab::Interface &moab = m_field.get_moab();
391  auto miit =
392  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
393  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
394  if (miit ==
395  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
396  if (bh & MF_EXIST) {
397  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
398  "meshset not found", ms_id);
399  } else {
401  }
402  }
403  EntityHandle meshset = miit->getMeshset();
404  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().erase(miit);
405  CHKERR moab.delete_entities(&meshset, 1);
406 
408 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ get_bhTag()

Tag MoFEM::MeshsetsManager::get_bhTag ( ) const

get tag handle used to store "id" of BLOCKSET

Definition at line 162 of file MeshsetsManager.hpp.

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

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

177 { return this; }

◆ get_nsTag()

Tag MoFEM::MeshsetsManager::get_nsTag ( ) const

get tag handle used to store "id" of NODESET

Definition at line 142 of file MeshsetsManager.hpp.

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

152 { return nsTag_data; }

◆ get_ssTag()

Tag MoFEM::MeshsetsManager::get_ssTag ( ) const

get tag handle used to store "id" of SIDESET

Definition at line 147 of file MeshsetsManager.hpp.

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

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

772  {
773  return configFileOptionsPtr;
774  }
boost::shared_ptr< boost::program_options::options_description > configFileOptionsPtr
config file options

◆ getMeshsetsMultindex()

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

Definition at line 263 of file MeshsetsManager.hpp.

263  {
264  return cubitMeshsets;
265  }
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 81 of file MeshsetsManager.cpp.

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

◆ initialiseDatabaseFromMesh()

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

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  std::ostringstream ss;
72  ss << "read cubit " << base_meshset << std::endl;
73  // PetscSynchronizedPrintf(comm,ss.str().c_str());
74  PetscPrintf(m_field.get_comm(), ss.str().c_str());
75  }
76  }
77  }
79 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define CHKERR
Inline error check.
Definition: definitions.h:594
std::bitset< 32 > CubitBCType
Definition: Types.hpp:63
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ printBcSet()

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

Definition at line 192 of file MeshsetsManager.hpp.

193  {
194 
196  try {
197  const MoFEM::Interface &m_field = cOre;
198  const moab::Interface &moab = m_field.get_moab();
199  for (_IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_((*this), type, it)) {
200  ierr = it->getBcDataStructure(data);
201  CHKERRG(ierr);
202  std::ostringstream ss;
203  ss << *it << std::endl;
204  ss << data << std::endl;
205  Range tets, tris, edges, nodes;
206  rval = moab.get_entities_by_type(it->meshset, MBTET, tets, true);
208  rval = moab.get_entities_by_type(it->meshset, MBTRI, tris, true);
210  rval = moab.get_entities_by_type(it->meshset, MBEDGE, edges, true);
212  rval = moab.get_entities_by_type(it->meshset, MBVERTEX, nodes, true);
214  ss << "name " << it->getName() << std::endl;
215  ss << "msId " << it->getMeshsetId() << " nb. tets " << tets.size()
216  << std::endl;
217  ss << "msId " << it->getMeshsetId() << " nb. tris " << tris.size()
218  << std::endl;
219  ss << "msId " << it->getMeshsetId() << " nb. edges " << edges.size()
220  << std::endl;
221  ss << "msId " << it->getMeshsetId() << " nb. nodes " << nodes.size()
222  << std::endl;
223  ss << std::endl;
224  PetscPrintf(m_field.get_comm(), ss.str().c_str());
225  }
226  } catch (MoFEMException const &e) {
227  SETERRQ(PETSC_COMM_SELF, e.errorCode, e.errorMessage);
228  }
230  }
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:513
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:542
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:84
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
virtual MPI_Comm & get_comm() const =0

◆ printDisplacementSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printDisplacementSet ( ) const

print meshsets with displacement boundary conditions data structure

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

Definition at line 124 of file MeshsetsManager.cpp.

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

◆ printForceSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printForceSet ( ) const

print meshsets with force boundary conditions data structure

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

Definition at line 138 of file MeshsetsManager.cpp.

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

◆ printHeatFluxSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printHeatFluxSet ( ) const

print meshsets with heat flux boundary conditions data structure

Definition at line 152 of file MeshsetsManager.cpp.

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

◆ printMaterialsSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printMaterialsSet ( ) const

print meshsets with material data structure set on it

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

Definition at line 159 of file MeshsetsManager.cpp.

159  {
161  const Interface &m_field = cOre;
162  const moab::Interface &moab = m_field.get_moab();
164  (*this), BLOCKSET | MAT_ELASTICSET, it)) {
165  Mat_Elastic data;
166  CHKERR it->getAttributeDataStructure(data);
167  std::ostringstream ss;
168  ss << *it << std::endl;
169  ss << data;
170  Range tets;
171  CHKERR moab.get_entities_by_type(it->meshset, MBTET, tets, true);
172 
173  ss << "MAT_ELATIC msId " << it->getMeshsetId() << " nb. tets "
174  << tets.size() << std::endl;
175  ss << std::endl;
176  PetscPrintf(m_field.get_comm(), ss.str().c_str());
177  }
178 
180  m_field, BLOCKSET | MAT_THERMALSET, it)) {
181  Mat_Thermal data;
182  CHKERR it->getAttributeDataStructure(data);
183  std::ostringstream ss;
184  ss << *it << std::endl;
185  ss << data;
186  PetscPrintf(m_field.get_comm(), ss.str().c_str());
187  }
188 
190  m_field, BLOCKSET | MAT_MOISTURESET, it)) {
191  Mat_Moisture data;
192  CHKERR it->getAttributeDataStructure(data);
193  std::ostringstream ss;
194  ss << *it << std::endl;
195  ss << data;
196  PetscPrintf(m_field.get_comm(), ss.str().c_str());
197  }
199 }
block name is "MAT_MOISTURE"
Definition: definitions.h:224
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#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:222
#define CHKERR
Inline error check.
Definition: definitions.h:594
block name is "MAT_ELASTIC"
Definition: definitions.h:220
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ printPressureSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printPressureSet ( ) const

print meshsets with pressure boundary conditions data structure

Definition at line 131 of file MeshsetsManager.cpp.

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

◆ printTemperatureSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printTemperatureSet ( ) const

print meshsets with temperature boundary conditions data structure

Definition at line 145 of file MeshsetsManager.cpp.

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

◆ 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:499
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
MeshsetsManager(const MoFEM::Core &core)

◆ 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

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 }
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:475
#define CHKERR
Inline error check.
Definition: definitions.h:594
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:405

◆ 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 }
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:475
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ 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

Definition at line 300 of file MeshsetsManager.cpp.

302  {
303  Interface &m_field = cOre;
304  moab::Interface &moab = m_field.get_moab();
306  auto cit =
307  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
308  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
309  if (cit ==
310  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
311  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
312  "such cubit meshset is already there", ms_id);
313  }
314  if (name.size() > 0) {
315  bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
316  CubitMeshSets_change_name(moab, name));
317  if (!success) {
318  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
319  "name to cubit meshset can not be set");
320  }
321  }
322  bool success =
323  cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
324  CubitMeshSets_change_attributes(moab, attributes));
325  if (!success)
326  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
327  "modification unsuccessful");
329 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ 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

Definition at line 331 of file MeshsetsManager.cpp.

333  {
334  Interface &m_field = cOre;
335  moab::Interface &moab = m_field.get_moab();
337  auto cit =
338  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
339  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
340  if (cit ==
341  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
342  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
343  "such cubit meshset is already there", ms_id);
344  }
345  if (name.size() > 0) {
346  bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
347  CubitMeshSets_change_name(moab, name));
348  if (!success) {
349  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
350  "name to cubit meshset can not be set");
351  }
352  }
353  bool success = cubitMeshsets.modify(
354  cubitMeshsets.project<0>(cit),
355  CubitMeshSets_change_attributes_data_structure(moab, data));
356  if (!success)
357  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
358  "modification unsuccessful");
360 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ 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

Definition at line 362 of file MeshsetsManager.cpp.

364  {
365  Interface &m_field = cOre;
366  moab::Interface &moab = m_field.get_moab();
368  auto cit =
369  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
370  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
371  if (cit ==
372  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
373  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
374  "such cubit meshset is already there", ms_id);
375  }
376  bool success =
377  cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
378  CubitMeshSets_change_bc_data_structure(moab, data));
379  if (!success)
380  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
381  "modification unsuccessful");
383 }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ 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:
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:475
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:542
MoFEMErrorCode setMeshsetFromFile()
get name of config file from line command &#39;-meshsets_config&#39;
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ 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:475
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:594
#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:405

Member Data Documentation

◆ bhTag

Tag MoFEM::MeshsetsManager::bhTag
protected

Definition at line 783 of file MeshsetsManager.hpp.

◆ bhTag_header

Tag MoFEM::MeshsetsManager::bhTag_header
protected

Definition at line 784 of file MeshsetsManager.hpp.

◆ configFileOptionsPtr

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

config file options

Definition at line 789 of file MeshsetsManager.hpp.

◆ cOre

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

Definition at line 122 of file MeshsetsManager.hpp.

◆ cubitMeshsets

CubitMeshSet_multiIndex MoFEM::MeshsetsManager::cubitMeshsets
protected

cubit meshsets

Definition at line 787 of file MeshsetsManager.hpp.

◆ nsTag

Tag MoFEM::MeshsetsManager::nsTag
protected

Definition at line 779 of file MeshsetsManager.hpp.

◆ nsTag_data

Tag MoFEM::MeshsetsManager::nsTag_data
protected

Definition at line 781 of file MeshsetsManager.hpp.

◆ ssTag

Tag MoFEM::MeshsetsManager::ssTag
protected

Definition at line 780 of file MeshsetsManager.hpp.

◆ ssTag_data

Tag MoFEM::MeshsetsManager::ssTag_data
protected

Definition at line 782 of file MeshsetsManager.hpp.


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