v0.13.1
Public Member Functions | Public Attributes | Static 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 (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 
 MeshsetsManager (const MoFEM::Core &core)
 
virtual ~MeshsetsManager ()=default
 
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=DEFAULT_VERBOSITY)
 
MoFEMErrorCode readMeshsets (int verb=DEFAULT_VERBOSITY)
 Boradcats meshsets. More...
 
MoFEMErrorCode broadcastMeshsets (int verb=DEFAULT_VERBOSITY)
 Boradcats meshsets. More...
 
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 getCubitMeshsetPtr (const std::regex reg_exp_name, std::vector< const CubitMeshSets * > &vec_ptr) const
 Get vector of poointer to blocksets with name satisfying regular expression. 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 dimension 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, 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
virtual MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const =0
 
template<class IFACE >
MoFEMErrorCode registerInterface (bool error_if_registration_failed=true)
 Register 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
 

Public Attributes

MoFEM::CorecOre
 

Static Public Attributes

static bool brodcastMeshsets = true
 

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

- Static Public Member Functions inherited from MoFEM::UnknownInterface
static MoFEMErrorCode getLibVersion (Version &version)
 Get library version. More...
 
static MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version)
 Get database major version. More...
 
static MoFEMErrorCode setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
 Get database major version. More...
 
static MoFEMErrorCode getInterfaceVersion (Version &version)
 Get database major version. 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, free_surface.cpp, heat_equation.cpp, mesh_cut.cpp, mesh_smoothing.cpp, meshset_to_vtk.cpp, photon_diffusion.cpp, prism_elements_from_surface.cpp, reaction_diffusion.cpp, simple_contact.cpp, split_sideset.cpp, and unsaturated_transport.cpp.

Definition at line 114 of file MeshsetsManager.hpp.

Constructor & Destructor Documentation

◆ MeshsetsManager()

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

Definition at line 40 of file MeshsetsManager.cpp.

41 : cOre(const_cast<Core &>(core)) {
42
43 if (!LogManager::checkIfChannelExist("MeshsetMngWorld")) {
44 auto core_log = logging::core::get();
45
46 core_log->add_sink(
48 core_log->add_sink(
50 core_log->add_sink(
52
53 LogManager::setLog("MeshsetMngWorld");
54 LogManager::setLog("MeshsetMngSync");
55 LogManager::setLog("MeshsetMngSelf");
56
57 MOFEM_LOG_TAG("MeshsetMngWorld", "MeshsetMng");
58 MOFEM_LOG_TAG("MeshsetMngSync", "MeshsetMng");
59 MOFEM_LOG_TAG("MeshsetMngSelf", "MeshsetMng");
60 }
61
62 MOFEM_LOG("MeshsetMngWorld", Sev::noisy) << "Mashset manager created";
63}
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
Definition: LogManager.cpp:364
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:311
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:342
CoreTmp< 0 > Core
Definition: Core.hpp:1096
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
Definition: LogManager.cpp:279
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Definition: LogManager.cpp:323
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
Definition: LogManager.cpp:327
static bool checkIfChannelExist(const std::string channel)
Check if channel exist.
Definition: LogManager.cpp:374
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
Definition: LogManager.cpp:319

◆ ~MeshsetsManager()

virtual MoFEM::MeshsetsManager::~MeshsetsManager ( )
virtualdefault

Member Function Documentation

◆ addEntitiesToMeshset() [1/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 367 of file MeshsetsManager.cpp.

369 {
370 Interface &m_field = cOre;
371 moab::Interface &moab = m_field.get_moab();
373 auto cit =
374 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
375 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
376 if (cit ==
377 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
378 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
379 "Cannot find Cubit meshset with id: %d", ms_id);
380 }
381 EntityHandle meshset = cit->getMeshset();
382 CHKERR moab.add_entities(meshset, ents, nb_ents);
383
385}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:44
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
#define CHKERR
Inline error check.
Definition: definitions.h:548
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1965
virtual moab::Interface & get_moab()=0
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets

◆ addEntitiesToMeshset() [2/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 347 of file MeshsetsManager.cpp.

348 {
349 Interface &m_field = cOre;
350 moab::Interface &moab = m_field.get_moab();
352 auto cit =
353 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
354 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
355 if (cit ==
356 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
357 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
358 "Cannot find Cubit meshset with id: %d", ms_id);
359 }
360 EntityHandle meshset = cit->getMeshset();
361 CHKERR moab.add_entities(meshset, ents);
362
364}

◆ broadcastMeshsets()

MoFEMErrorCode MoFEM::MeshsetsManager::broadcastMeshsets ( int  verb = DEFAULT_VERBOSITY)

Boradcats meshsets.

Parameters
verb
Returns
MoFEMErrorCode

Definition at line 107 of file MeshsetsManager.cpp.

107 {
108 Interface &m_field = cOre;
109 moab::Interface &moab = m_field.get_moab();
111
112 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab, MYPCOMM_INDEX);
113 if (pcomm == NULL)
114 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
115 "MOAB communicator not set");
116
117 const double coords[] = {0, 0, 0};
118
119 auto set_tags_dummy_node = [&](const EntityHandle dummy_node,
120 const EntityHandle meshset) {
122 std::vector<Tag> tag_handles;
123 CHKERR moab.tag_get_tags_on_entity(meshset, tag_handles);
124 for (auto th : tag_handles) {
125 void *data[1];
126 int tag_size;
127 CHKERR moab.tag_get_by_ptr(th, &meshset, 1, (const void **)data,
128 &tag_size);
129 CHKERR moab.tag_set_by_ptr(th, &dummy_node, 1, data, &tag_size);
130 }
132 };
133
134 for (int from_proc = 0; from_proc < pcomm->size(); ++from_proc) {
135
136 Range r_dummy_nodes;
137
138 if (from_proc == pcomm->rank()) {
139 std::vector<EntityHandle> dummy_nodes(cubitMeshsets.size(), 0);
140 int i = 0;
141 for (auto &m : cubitMeshsets) {
142 CHKERR moab.create_vertex(coords, dummy_nodes[i]);
143 CHKERR set_tags_dummy_node(dummy_nodes[i], m.getMeshset());
144 ++i;
145 }
146 r_dummy_nodes.insert_list(dummy_nodes.begin(), dummy_nodes.end());
147 }
148
149 CHKERR pcomm->broadcast_entities(from_proc, r_dummy_nodes, false, true);
150
151 for (auto dummy_node : r_dummy_nodes) {
152 EntityHandle m;
153 CHKERR moab.create_meshset(MESHSET_SET, m);
154 CHKERR set_tags_dummy_node(m, dummy_node);
155
156 CubitMeshSets broadcast_block(moab, m);
157 if ((broadcast_block.cubitBcType &
159 .any()) {
160 auto p = cubitMeshsets.insert(broadcast_block);
161 if (!p.second) {
162 CHKERR moab.delete_entities(&m, 1);
163 } else {
164 MOFEM_LOG("MeshsetMngSelf", Sev::noisy)
165 << "broadcast " << broadcast_block;
166 }
167 }
168 }
169
170 CHKERR moab.delete_entities(r_dummy_nodes);
171 }
172
174}
static Index< 'p', 3 > p
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:228
@ NODESET
Definition: definitions.h:159
@ SIDESET
Definition: definitions.h:160
@ BLOCKSET
Definition: definitions.h:161
FTensor::Index< 'i', SPACE_DIM > i
std::bitset< 32 > CubitBCType
Definition: Types.hpp:63
FTensor::Index< 'm', 3 > m

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

618 {
619 auto miit =
620 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
621 boost::make_tuple(ms_id, cubit_bc_type));
622 if (miit !=
623 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
624 Interface &m_field = cOre;
625 return m_field.get_moab().contains_entities(miit->meshset, entities,
626 num_entities, operation_type);
627 } else
628 return false;
629}
moab::Interface & get_moab()
Definition: Core.hpp:334

◆ 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

Definition at line 301 of file MeshsetsManager.cpp.

302 {
303 auto miit = cubitMeshsets.get<CubitMeshsets_name>().lower_bound(name);
304 auto hi_miit = cubitMeshsets.get<CubitMeshsets_name>().upper_bound(name);
305 if (std::distance(miit, hi_miit) == 0) {
306 return false;
307 }
308 if (number_of_meshsets_ptr) {
309 *number_of_meshsets_ptr = std::distance(miit, hi_miit);
310 }
311 return true;
312}

◆ clearMap()

MoFEMErrorCode MoFEM::MeshsetsManager::clearMap ( )

clear multi-index container

Returns
error code

Definition at line 65 of file MeshsetsManager.cpp.

65 {
67 cubitMeshsets.clear();
69}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453

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

484 {
485 Interface &m_field = cOre;
486 moab::Interface &moab = m_field.get_moab();
488 auto miit =
489 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
490 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
491 if (miit ==
492 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
493 if (bh & MF_EXIST) {
494 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
495 "meshset not found", ms_id);
496 } else {
498 }
499 }
500 EntityHandle meshset = miit->getMeshset();
501 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().erase(miit);
502 CHKERR moab.delete_entities(&meshset, 1);
503
505}
@ MF_EXIST
Definition: definitions.h:113

◆ get_bhTag()

Tag MoFEM::MeshsetsManager::get_bhTag ( ) const

get tag handle used to store "id" of BLOCKSET

Definition at line 159 of file MeshsetsManager.hpp.

159{ 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 164 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 169 of file MeshsetsManager.hpp.

169{ 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 174 of file MeshsetsManager.hpp.

174{ return this; }

◆ get_nsTag()

Tag MoFEM::MeshsetsManager::get_nsTag ( ) const

get tag handle used to store "id" of NODESET

Definition at line 139 of file MeshsetsManager.hpp.

139{ 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 149 of file MeshsetsManager.hpp.

◆ get_ssTag()

Tag MoFEM::MeshsetsManager::get_ssTag ( ) const

get tag handle used to store "id" of SIDESET

Definition at line 144 of file MeshsetsManager.hpp.

144{ 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 154 of file MeshsetsManager.hpp.

◆ 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 804 of file MeshsetsManager.hpp.

804 {
806 }
boost::shared_ptr< boost::program_options::options_description > configFileOptionsPtr
config file options

◆ getMeshsetsMultindex()

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

Definition at line 239 of file MeshsetsManager.hpp.

239 {
240 return cubitMeshsets;
241 }

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

176 {
178 Interface &m_field = cOre;
179 moab::Interface &moab = m_field.get_moab();
180 int default_val = -1;
181 CHKERR moab.tag_get_handle(DIRICHLET_SET_TAG_NAME, 1, MB_TYPE_INTEGER, nsTag,
182 MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
183
184 CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME, 1, MB_TYPE_INTEGER, ssTag,
185 MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
186
187 const int def_bc_data_len = 0;
188 std::string tag_name = std::string(DIRICHLET_SET_TAG_NAME) + "__BC_DATA";
189 CHKERR moab.tag_get_handle(
190 tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE, nsTag_data,
191 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
192
193 tag_name = std::string(NEUMANN_SET_TAG_NAME) + "__BC_DATA";
194 CHKERR moab.tag_get_handle(
195 tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE, ssTag_data,
196 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
197
198 CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME, 1, MB_TYPE_INTEGER, bhTag,
199 MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
200
201 std::vector<unsigned int> def_uint_zero(3, 0);
202 CHKERR moab.tag_get_handle(
203 BLOCK_HEADER, 3 * sizeof(unsigned int), MB_TYPE_INTEGER, bhTag_header,
204 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_uint_zero[0]);
205
206 Tag block_attribs;
207 int def_Block_Attributes_length = 0;
208 CHKERR moab.tag_get_handle(
209 BLOCK_ATTRIBUTES, def_Block_Attributes_length, MB_TYPE_DOUBLE,
210 block_attribs, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN, NULL);
211
212 Tag entity_name_tag;
213 CHKERR moab.tag_get_handle(NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
214 entity_name_tag, MB_TAG_SPARSE | MB_TAG_CREAT);
215
217}

◆ initialiseDatabaseFromMesh()

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

\brier initialize container form data on mesh

Returns
[description]

Definition at line 71 of file MeshsetsManager.cpp.

71 {
72 Interface &m_field = cOre;
74 CHKERR readMeshsets(verb);
77
78 for (auto &m : cubitMeshsets) {
79 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << m;
80 }
81
83}
MoFEMErrorCode broadcastMeshsets(int verb=DEFAULT_VERBOSITY)
Boradcats meshsets.
MoFEMErrorCode readMeshsets(int verb=DEFAULT_VERBOSITY)
Boradcats meshsets.

◆ printBcSet()

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

Definition at line 828 of file MeshsetsManager.hpp.

829 {
831 const MoFEM::Interface &m_field = cOre;
832 const moab::Interface &moab = m_field.get_moab();
834 CHKERR it->getBcDataStructure(data);
835 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
836 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
837 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << "name " << it->getName();
838 for (EntityType t = MBVERTEX; t != MBENTITYSET; ++t) {
839 int nb;
840 CHKERR moab.get_number_entities_by_type(it->meshset, t, nb, true);
841 MOFEM_LOG("MeshsetMngWorld", Sev::inform)
842 << "msId " << it->getMeshsetId() << " number of "
843 << moab::CN::EntityTypeName(t) << " " << nb;
844 }
845 }
847}
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
constexpr double t
plate stiffness
Definition: plate.cpp:76
Deprecated interface functions.

◆ printDisplacementSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printDisplacementSet ( ) const

print meshsets with displacement boundary conditions data structure

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

Definition at line 219 of file MeshsetsManager.cpp.

219 {
220 DisplacementCubitBcData mydata;
222 CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
224}
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const

◆ printForceSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printForceSet ( ) const

print meshsets with force boundary conditions data structure

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

Definition at line 233 of file MeshsetsManager.cpp.

233 {
234 ForceCubitBcData mydata;
236 CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
238}

◆ printHeatFluxSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printHeatFluxSet ( ) const

print meshsets with heat flux boundary conditions data structure

Definition at line 247 of file MeshsetsManager.cpp.

247 {
248 HeatFluxCubitBcData mydata;
250 CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
252}

◆ printMaterialsSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printMaterialsSet ( ) const

print meshsets with material data structure set on it

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

Definition at line 254 of file MeshsetsManager.cpp.

254 {
256 const Interface &m_field = cOre;
257 const moab::Interface &moab = m_field.get_moab();
259 (*this), BLOCKSET | MAT_ELASTICSET, it)) {
260 Mat_Elastic data;
261 CHKERR it->getAttributeDataStructure(data);
262 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
263 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
264 Range tets;
265 CHKERR moab.get_entities_by_dimension(it->meshset, 3, tets, true);
266 MOFEM_LOG("MeshsetMngWorld", Sev::inform)
267 << "MAT_ELATIC msId " << it->getMeshsetId() << " nb. volumes "
268 << tets.size();
269 }
270
272 m_field, BLOCKSET | MAT_THERMALSET, it)) {
273 Mat_Thermal data;
274 CHKERR it->getAttributeDataStructure(data);
275 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
276 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
277 }
278
280 m_field, BLOCKSET | MAT_MOISTURESET, it)) {
281 Mat_Moisture data;
282 CHKERR it->getAttributeDataStructure(data);
283 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
284 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
285 }
287}
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
Definition: definitions.h:172
@ MAT_THERMALSET
block name is "MAT_THERMAL"
Definition: definitions.h:174
@ MAT_MOISTURESET
block name is "MAT_MOISTURE"
Definition: definitions.h:176

◆ printPressureSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printPressureSet ( ) const

print meshsets with pressure boundary conditions data structure

Definition at line 226 of file MeshsetsManager.cpp.

226 {
227 PressureCubitBcData mydata;
229 CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
231}

◆ printTemperatureSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printTemperatureSet ( ) const

print meshsets with temperature boundary conditions data structure

Definition at line 240 of file MeshsetsManager.cpp.

240 {
241 TemperatureCubitBcData mydata;
243 CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
245}

◆ query_interface()

MoFEMErrorCode MoFEM::MeshsetsManager::query_interface ( boost::typeindex::type_index  type_index,
UnknownInterface **  iface 
) const
virtual

Implements MoFEM::UnknownInterface.

Definition at line 34 of file MeshsetsManager.cpp.

35 {
36 *iface = const_cast<MeshsetsManager *>(this);
37 return 0;
38}
MeshsetsManager(const MoFEM::Core &core)

◆ readMeshsets()

MoFEMErrorCode MoFEM::MeshsetsManager::readMeshsets ( int  verb = DEFAULT_VERBOSITY)

Boradcats meshsets.

Parameters
verb
Returns
MoFEMErrorCode

Definition at line 85 of file MeshsetsManager.cpp.

85 {
86 Interface &m_field = cOre;
87 moab::Interface &moab = m_field.get_moab();
89
90 Range meshsets;
91 CHKERR moab.get_entities_by_type(0, MBENTITYSET, meshsets, false);
92 for (auto m : meshsets) {
93 // check if meshset is cubit meshset
94 CubitMeshSets block(moab, m);
95 if ((block.cubitBcType & CubitBCType(NODESET | SIDESET | BLOCKSET)).any()) {
96 auto p = cubitMeshsets.insert(block);
97 if (!p.second)
98 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
99 "meshset not inserted");
100 MOFEM_LOG("MeshsetMngSelf", Sev::noisy) << "read " << block;
101 }
102 }
103
105}

◆ saveMeshsetToFile() [1/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 1304 of file MeshsetsManager.cpp.

1307 {
1308
1310 MoFEM::Interface &m_field = cOre;
1311 moab::Interface &moab = m_field.get_moab();
1312 Range entities;
1313 CHKERR getEntitiesByDimension(ms_id, cubit_bc_type, dim, entities, recursive);
1314 EntityHandle meshset;
1315 CHKERR moab.create_meshset(MESHSET_SET, meshset);
1316 CHKERR moab.add_entities(meshset, entities);
1317 CHKERR moab.write_file(file_name.c_str(), file_type.c_str(), options.c_str(),
1318 &meshset, 1);
1319 CHKERR moab.delete_entities(&meshset, 1);
1321}
const int dim
MoFEMErrorCode getEntitiesByDimension(const int ms_id, const unsigned int cubit_bc_type, const int dimension, Range &entities, const bool recursive=true) const
get entities from CUBIT/meshset of a particular entity dimension

◆ saveMeshsetToFile() [2/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 1289 of file MeshsetsManager.cpp.

1292 {
1293
1295 MoFEM::Interface &m_field = cOre;
1296 const CubitMeshSets *cubit_meshset_ptr;
1297 CHKERR getCubitMeshsetPtr(ms_id, cubit_bc_type, &cubit_meshset_ptr);
1298 EntityHandle meshset = cubit_meshset_ptr->getMeshset();
1299 CHKERR m_field.get_moab().write_file(file_name.c_str(), file_type.c_str(),
1300 options.c_str(), &meshset, 1);
1302}
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset

◆ 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
nameset name to blockset
Returns
error code
Examples
add_cubit_meshsets.cpp.

Definition at line 388 of file MeshsetsManager.cpp.

390 {
391 Interface &m_field = cOre;
392 moab::Interface &moab = m_field.get_moab();
394 auto cit =
395 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
396 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
397 if (cit ==
398 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
399 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
400 "Cannot find Cubit meshset with id: %d", ms_id);
401 }
402 if (name.size() > 0) {
403 bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
404 CubitMeshSets_change_name(moab, name));
405 if (!success) {
406 SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
407 "name to cubit meshset can not be set");
408 }
409 }
410 bool success =
411 cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
412 CubitMeshSets_change_attributes(moab, attributes));
413 if (!success)
414 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
415 "modification unsuccessful");
416
417 std::ostringstream ss;
418 ss << "Block " << cit->getName();
419 ss << " Add attr: ";
420 for (unsigned int ii = 0; ii != attributes.size(); ii++) {
421 ss << attributes[ii] << " ";
422 }
423 MOFEM_LOG("MeshsetMngSelf", Sev::noisy) << ss.str();
424
426}
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:47

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

430 {
431 Interface &m_field = cOre;
432 moab::Interface &moab = m_field.get_moab();
434 auto cit =
435 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
436 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
437 if (cit ==
438 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
439 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
440 "Cannot find Cubit meshset with id: %d", ms_id);
441 }
442 if (name.size() > 0) {
443 bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
444 CubitMeshSets_change_name(moab, name));
445 if (!success) {
446 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
447 "name to cubit meshset can not be set");
448 }
449 }
450 bool success = cubitMeshsets.modify(
451 cubitMeshsets.project<0>(cit),
452 CubitMeshSets_change_attributes_data_structure(moab, data));
453 if (!success)
454 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
455 "modification unsuccessful");
457}

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

461 {
462 Interface &m_field = cOre;
463 moab::Interface &moab = m_field.get_moab();
465 auto cit =
466 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().find(
467 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
468 if (cit ==
469 cubitMeshsets.get<Composite_Cubit_msId_And_MeshsetType_mi_tag>().end()) {
470 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
471 "Cubit meshset with id is already there", ms_id);
472 }
473 bool success =
474 cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
475 CubitMeshSets_change_bc_data_structure(moab, data));
476 if (!success)
477 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
478 "modification unsuccessful");
480}

◆ setMeshsetFromFile() [1/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 1265 of file MeshsetsManager.cpp.

1265 {
1266 Interface &m_field = cOre;
1267 PetscBool flg_file;
1268 char meshset_file_name[255] = "config_file.cfg";
1270 CHKERR PetscOptionsBegin(m_field.get_comm(), "", "Set meshsets form file",
1271 "none");
1272 CHKERR PetscOptionsString("-meshsets_config", "meshsets config file name",
1273 "", "add_cubit_meshsets.in", meshset_file_name, 255,
1274 &flg_file);
1275 if (flg_file == PETSC_TRUE) {
1276 ifstream f(meshset_file_name);
1277 if (!f.good()) {
1278 SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1279 "File configuring meshsets ( %s ) can not be open\n",
1280 meshset_file_name);
1281 }
1282 CHKERR setMeshsetFromFile(string(meshset_file_name));
1283 }
1284 ierr = PetscOptionsEnd();
1285 CHKERRG(ierr);
1287}
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:496
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:87
MoFEMErrorCode setMeshsetFromFile()
get name of config file from line command '-meshsets_config'

◆ setMeshsetFromFile() [2/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
[SET_ATTR_foo]
# Example set atttributes to block name "foo"
number_of_attributes=3
user1=1
user2=2
user3=3
double A
double flux
impulse magnitude
const int N
Definition: speed_test.cpp:3
Parameters
file_nameconfig file
Returns
error code
Examples
add_cubit_meshsets.cpp, meshset_to_vtk.cpp, and unsaturated_transport.cpp.

◆ updateAllMeshsetsByEntitiesChildren()

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

Definition at line 1324 of file MeshsetsManager.cpp.

1324 {
1326 BitRefManager *bit_mng = cOre.getInterface<BitRefManager>();
1327 for (_IT_CUBITMESHSETS_FOR_LOOP_((*this), iit)) {
1328 EntityHandle meshset = iit->getMeshset();
1329 for (EntityType t = MBVERTEX; t != MBENTITYSET; ++t)
1330 CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset, t,
1331 true);
1332 }
1334}
#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
Iterator that loops over all the Cubit MeshSets in a moFEM field.
auto bit
set bit
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.

Member Data Documentation

◆ bhTag

Tag MoFEM::MeshsetsManager::bhTag
protected

Definition at line 818 of file MeshsetsManager.hpp.

◆ bhTag_header

Tag MoFEM::MeshsetsManager::bhTag_header
protected

Definition at line 819 of file MeshsetsManager.hpp.

◆ brodcastMeshsets

bool MoFEM::MeshsetsManager::brodcastMeshsets = true
static

if true meshsets are synchrinised between processors

Definition at line 810 of file MeshsetsManager.hpp.

◆ configFileOptionsPtr

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

config file options

Definition at line 824 of file MeshsetsManager.hpp.

◆ cOre

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

Definition at line 119 of file MeshsetsManager.hpp.

◆ cubitMeshsets

CubitMeshSet_multiIndex MoFEM::MeshsetsManager::cubitMeshsets
protected

cubit meshsets

Definition at line 822 of file MeshsetsManager.hpp.

◆ nsTag

Tag MoFEM::MeshsetsManager::nsTag
protected

Definition at line 814 of file MeshsetsManager.hpp.

◆ nsTag_data

Tag MoFEM::MeshsetsManager::nsTag_data
protected

Definition at line 816 of file MeshsetsManager.hpp.

◆ ssTag

Tag MoFEM::MeshsetsManager::ssTag
protected

Definition at line 815 of file MeshsetsManager.hpp.

◆ ssTag_data

Tag MoFEM::MeshsetsManager::ssTag_data
protected

Definition at line 817 of file MeshsetsManager.hpp.


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