v0.6.20
Files | Classes | Macros | Functions
MeshsetsManager

Interface for meshsets with entities with data and boundary conditions. More...

Collaboration diagram for MeshsetsManager:

Files

file  MeshsetsManager.hpp
 MeshsetsManager interface.
 

Classes

struct  MoFEM::MeshsetsManager
 Interface for managing meshsets containing materials and boundary conditions. More...
 

Macros

#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
 Iterator that loops over all the Cubit MeshSets in a moFEM field. More...
 
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
 Iterator that loops over a specific Cubit MeshSet in a moFEM field. More...
 
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
 Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field. More...
 
#define _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_(MESHSET_MANAGER, NAME, IT)
 Iterator that loops over Cubit BlockSet having a particular name. More...
 

Functions

CubitMeshSet_multiIndex::iterator MoFEM::MeshsetsManager::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 MoFEM::MeshsetsManager::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 MoFEM::MeshsetsManager::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 MoFEM::MeshsetsManager::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 MoFEM::MeshsetsManager::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 MoFEM::MeshsetsManager::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 MoFEM::MeshsetsManager::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 MoFEM::MeshsetsManager::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 MoFEM::MeshsetsManager::checkMeshset (const int ms_id, const CubitBCType cubit_bc_type) const
 check for CUBIT Id and CUBIT type More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::addMeshset (const CubitBCType cubit_bc_type, const int ms_id, const std::string name="")
 add cubit meshset More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr (const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr)
 get cubit meshset More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr (const string name, const CubitMeshSets **cubit_meshset_ptr)
 get cubit meshset More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::getEntitiesByDimension (const int ms_id, const unsigned int cubit_bc_type, const int dimension, Range &entities, const bool recursive=false)
 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 MoFEM::MeshsetsManager::getEntitiesByDimension (const int ms_id, const unsigned int cubit_bc_type, Range &entities, const bool recursive=false)
 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 MoFEM::MeshsetsManager::getMeshset (const int ms_id, const unsigned int cubit_bc_type, EntityHandle &meshset)
 get meshset from CUBIT Id and CUBIT type More...
 
MoFEMErrorCode MoFEM::MeshsetsManager::getMeshsetsByType (const unsigned int cubit_bc_type, Range &meshsets)
 get all CUBIT meshsets by CUBIT type More...
 

Detailed Description

Interface for meshsets with entities with data and boundary conditions.

Macro Definition Documentation

◆ _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_

#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_ (   MESHSET_MANAGER,
  CUBITBCTYPE,
  IT 
)
Value:
CubitMeshsetByType::iterator IT = \
MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(CUBITBCTYPE); \
IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(CUBITBCTYPE); \
IT++

Iterator that loops over a specific Cubit MeshSet in a moFEM field.

Parameters
mFieldmoFEM Field
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
iterator
Examples:
elasticity.cpp, and simple_elasticity.cpp.

Definition at line 59 of file MeshsetsManager.hpp.

◆ _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_

#define _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_ (   MESHSET_MANAGER,
  NAME,
  IT 
)
Value:
CubitMeshsetByName::iterator IT = \
MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(NAME); \
IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(NAME); \
IT++

Iterator that loops over Cubit BlockSet having a particular name.

Parameters
MESHSET_MANAGERmeshset manager (works as well with Interface)
NAMEname
ITiterator

Example:

for(_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(mField,"SOME_BLOCK_NAME",it) {
...
}

Definition at line 105 of file MeshsetsManager.hpp.

◆ _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_

#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_ (   MESHSET_MANAGER,
  CUBITBCTYPE,
  IT 
)
Value:
CubitMeshsetByMask::iterator IT = \
MESHSET_MANAGER.get_meshsets_manager_ptr()->getBySetTypeBegin( \
CUBITBCTYPE); \
IT != \
MESHSET_MANAGER.get_meshsets_manager_ptr()->getBySetTypeEnd( \
CUBITBCTYPE); \
IT++

Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.

Parameters
MESHSET_MANAGERmeshset manager (works as well with Interface)
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
iteratorExample:
Examples:
cell_forces.cpp, cubit_bc_test.cpp, elasticity.cpp, MagneticElement.hpp, mesh_cut.cpp, unsaturated_transport.cpp, and UnsaturatedFlow.hpp.

Definition at line 81 of file MeshsetsManager.hpp.

◆ _IT_CUBITMESHSETS_FOR_LOOP_

#define _IT_CUBITMESHSETS_FOR_LOOP_ (   MESHSET_MANAGER,
  IT 
)
Value:
CubitMeshSet_multiIndex::iterator IT = \
MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(); \
IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(); \
IT++

Iterator that loops over all the Cubit MeshSets in a moFEM field.

Parameters
MESHSET_MANAGERmeshset manager (works as well with Interface)
iterator
Examples:
split_sideset.cpp, and unsaturated_transport.cpp.

Definition at line 44 of file MeshsetsManager.hpp.

Function Documentation

◆ addMeshset()

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

add cubit meshset

Parameters
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
ms_idid of the BLOCKSET/SIDESET/BLOCKSET
nameof set
Examples:
mesh_cut.cpp.

Definition at line 244 of file MeshsetsManager.cpp.

246  {
247  Interface &m_field = cOre;
248  moab::Interface &moab = m_field.get_moab();
250  if (checkMeshset(ms_id, cubit_bc_type)) {
251  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
252  "such cubit meshset is already there", ms_id);
253  }
254  try {
255  CubitMeshSets cmeshset(moab, cubit_bc_type, ms_id);
256  if ((cmeshset.cubitBcType & CubitBCType(NODESET | SIDESET | BLOCKSET))
257  .any()) {
258  std::pair<CubitMeshSet_multiIndex::iterator, bool> p =
259  cubitMeshsets.insert(cmeshset);
260  if (!p.second) {
261  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
262  "meshset not inserted");
263  }
264  if (name.size() > 0) {
265  bool success = cubitMeshsets.modify(
266  p.first, CubitMeshSets_change_name(moab, name));
267  if (!success) {
268  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
269  "name to cubit meshset can not be set");
270  }
271  }
272  }
273  } catch (MoFEMException const &e) {
274  SETERRQ(PETSC_COMM_SELF, e.errorCode, e.errorMessage);
275  }
277  }
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:515
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:521
std::bitset< 32 > CubitBCType
Definition: Common.hpp:200
bool checkMeshset(const int ms_id, const CubitBCType cubit_bc_type) const
check for CUBIT Id and CUBIT type

◆ checkMeshset()

bool MoFEM::MeshsetsManager::checkMeshset ( const int  ms_id,
const CubitBCType  cubit_bc_type 
) const

check for CUBIT Id and CUBIT type

Todo:
All cubit interface functions should be outsourced to dedicated interface
Parameters
ms_idid of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
Examples:
cell_forces.cpp, and mesh_cut.cpp.

Definition at line 215 of file MeshsetsManager.cpp.

216  {
217  CubitMeshSet_multiIndex::index<
218  Composite_Cubit_msId_And_MeshSetType_mi_tag>::type::iterator miit =
219  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
220  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
221  if (miit !=
222  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>()
223  .end()) {
224  return true;
225  }
226  return false;
227  }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets

◆ getBegin() [1/3]

CubitMeshSet_multiIndex::iterator MoFEM::MeshsetsManager::getBegin ( ) const

get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT)

for(IT_CUBITMESHSETS_FOR_LOOP(mField,it) { ... }

Definition at line 278 of file MeshsetsManager.hpp.

278  {
279  return cubitMeshsets.begin();
280  }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets

◆ getBegin() [2/3]

CubitMeshsetByType::iterator MoFEM::MeshsetsManager::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)

for(IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(mField,NODESET|DISPLACEMENTSET,it) { ... }

Parameters
typeof meshset (NODESET, SIDESET or BLOCKSET and more)

Definition at line 311 of file MeshsetsManager.hpp.

311  {
312  return cubitMeshsets.get<CubitMeshSets_mi_tag>().lower_bound(cubit_bc_type);
313  }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets

◆ getBegin() [3/3]

CubitMeshsetByName::iterator MoFEM::MeshsetsManager::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)

for(IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP(mField,NODESET|DISPLACEMENTSET,it) { ... }

Parameters
typeof meshset (NODESET, SIDESET or BLOCKSET and more)

Definition at line 384 of file MeshsetsManager.hpp.

384  {
385  return cubitMeshsets.get<CubitMeshSets_name>().lower_bound(name);
386  }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets

◆ getBySetTypeBegin()

CubitMeshsetByMask::iterator MoFEM::MeshsetsManager::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)

for(IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(mField,NODESET,it) { ... }

Parameters
typeof meshset (NODESET, SIDESET or BLOCKSET and more)

Definition at line 347 of file MeshsetsManager.hpp.

347  {
348  return cubitMeshsets.get<CubitMeshSets_mask_meshset_mi_tag>().lower_bound(
349  cubit_bc_type);
350  }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets

◆ getBySetTypeEnd()

CubitMeshsetByMask::iterator MoFEM::MeshsetsManager::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)

for(IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(mField,NODESET,it) { ... }

Parameters
typeof meshset (NODESET, SIDESET or BLOCKSET and more)

Definition at line 365 of file MeshsetsManager.hpp.

365  {
366  return cubitMeshsets.get<CubitMeshSets_mask_meshset_mi_tag>().upper_bound(
367  cubit_bc_type);
368  }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets

◆ getCubitMeshsetPtr() [1/2]

MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr ( const int  ms_id,
const CubitBCType  cubit_bc_type,
const CubitMeshSets **  cubit_meshset_ptr 
)

get cubit meshset

Definition at line 441 of file MeshsetsManager.cpp.

443  {
444  Interface &m_field = cOre;
446  CubitMeshSet_multiIndex::index<
447  Composite_Cubit_msId_And_MeshSetType_mi_tag>::type::iterator miit =
448  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
449  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
450  if (miit !=
451  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>()
452  .end()) {
453  *cubit_meshset_ptr = &*miit;
454  } else {
455  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
456  "msId = %d is not there", ms_id);
457  }
459  }
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:515
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:521

◆ getCubitMeshsetPtr() [2/2]

MoFEMErrorCode MoFEM::MeshsetsManager::getCubitMeshsetPtr ( const string  name,
const CubitMeshSets **  cubit_meshset_ptr 
)

get cubit meshset

◆ getEnd() [1/3]

CubitMeshSet_multiIndex::iterator MoFEM::MeshsetsManager::getEnd ( ) const

get begin iterator of cubit mehset of given type (instead you can use IT_CUBITMESHSETS_TYPE_FOR_LOOP(MFIELD,CUBITBCTYPE,IT)

for(IT_CUBITMESHSETS_FOR_LOOP(mField,it) { ... }

Definition at line 292 of file MeshsetsManager.hpp.

292  {
293  return cubitMeshsets.end();
294  }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets

◆ getEnd() [2/3]

CubitMeshsetByType::iterator MoFEM::MeshsetsManager::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)

for(IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP(mField,NODESET|DISPLACEMENTSET,it) { ... }

Parameters
typeof meshset (NODESET, SIDESET or BLOCKSET and more)

Definition at line 330 of file MeshsetsManager.hpp.

330  {
331  return cubitMeshsets.get<CubitMeshSets_mi_tag>().upper_bound(cubit_bc_type);
332  }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets

◆ getEnd() [3/3]

CubitMeshsetByName::iterator MoFEM::MeshsetsManager::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)

for(IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP(mField,NODESET|DISPLACEMENTSET,it) { ... }

Parameters
typeof meshset (NODESET, SIDESET or BLOCKSET and more)

Definition at line 402 of file MeshsetsManager.hpp.

402  {
403  return cubitMeshsets.get<CubitMeshSets_name>().upper_bound(name);
404  }
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets

◆ getEntitiesByDimension() [1/2]

MoFEMErrorCode MoFEM::MeshsetsManager::getEntitiesByDimension ( const int  ms_id,
const unsigned int  cubit_bc_type,
const int  dimension,
Range &  entities,
const bool  recursive = false 
)

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.

Parameters
ms_idid of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
dimensions(0 - Nodes, 1 - Edges, 2 - Faces, 3 - Volume(tetrahedral))
Rangecontaining the retrieved entities
recursiveIf true, meshsets containing meshsets are queried recursively. Returns the contents of meshsets, but not the meshsets themselves if true.
Examples:
cell_forces.cpp, and mesh_cut.cpp.

Definition at line 482 of file MeshsetsManager.cpp.

484  {
485 
486  Interface &m_field = cOre;
487  moab::Interface &moab = m_field.get_moab();
489  CubitMeshSet_multiIndex::index<
490  Composite_Cubit_msId_And_MeshSetType_mi_tag>::type::iterator miit =
491  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
492  boost::make_tuple(msId, cubit_bc_type));
493  if (miit !=
494  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>()
495  .end()) {
496  ierr = miit->getMeshsetIdEntitiesByDimension(moab, dimension, entities,
497  recursive);
498  CHKERRG(ierr);
499  } else {
500  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
501  "msId = %d is not there", msId);
502  }
504  }
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:515
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:558
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:521
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

◆ getEntitiesByDimension() [2/2]

MoFEMErrorCode MoFEM::MeshsetsManager::getEntitiesByDimension ( const int  ms_id,
const unsigned int  cubit_bc_type,
Range &  entities,
const bool  recursive = false 
)

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.

Parameters
ms_idid of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
Rangecontaining the retrieved entities related to the
recursiveIf true, meshsets containing meshsets are queried recursively. Returns the contents of meshsets, but not the meshsets themselves if true.

Definition at line 506 of file MeshsetsManager.cpp.

508  {
509  Interface &m_field = cOre;
510  moab::Interface &moab = m_field.get_moab();
512  CubitMeshSet_multiIndex::index<
513  Composite_Cubit_msId_And_MeshSetType_mi_tag>::type::iterator miit =
514  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
515  boost::make_tuple(ms_id, cubit_bc_type));
516  if (miit !=
517  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>()
518  .end()) {
519  ierr = miit->getMeshsetIdEntitiesByDimension(moab, entities, recursive);
520  CHKERRG(ierr);
521  } else {
522  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
523  "ms_id = %d is not there", ms_id);
524  }
526  }
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:515
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:558
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:521
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

◆ getMeshset()

MoFEMErrorCode MoFEM::MeshsetsManager::getMeshset ( const int  ms_id,
const unsigned int  cubit_bc_type,
EntityHandle meshset 
)

get meshset from CUBIT Id and CUBIT type

Parameters
ms_idid of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT
seeCubitBC (NODESET, SIDESET or BLOCKSET and more)
meshsetwhere to store the retrieved entities
Examples:
mesh_cut.cpp.

Definition at line 528 of file MeshsetsManager.cpp.

530  {
531  Interface &m_field = cOre;
533  CubitMeshSet_multiIndex::index<
534  Composite_Cubit_msId_And_MeshSetType_mi_tag>::type::iterator miit =
535  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
536  boost::make_tuple(ms_id, cubit_bc_type));
537  if (miit !=
538  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>()
539  .end()) {
540  meshset = miit->meshset;
541  } else {
542  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
543  "ms_id = %d is not there", ms_id);
544  }
546  }
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:515
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:521

◆ getMeshsetsByType()

MoFEMErrorCode MoFEM::MeshsetsManager::getMeshsetsByType ( const unsigned int  cubit_bc_type,
Range &  meshsets 
)

get all CUBIT meshsets by CUBIT type

Parameters
seeCubitBC (NODESET, SIDESET or BLOCKSET and more).
meshsetsis range of meshsets

Definition at line 549 of file MeshsetsManager.cpp.

550  {
552  CubitMeshsetByType::iterator miit =
553  cubitMeshsets.get<CubitMeshSets_mi_tag>().lower_bound(cubit_bc_type);
554  CubitMeshsetByType::iterator hi_miit =
555  cubitMeshsets.get<CubitMeshSets_mi_tag>().upper_bound(cubit_bc_type);
556  for (; miit != hi_miit; miit++) {
557  meshsets.insert(miit->meshset);
558  }
560  }
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:515
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:521