v0.12.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 (const MOFEMuuid &uuid, 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 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
template<class IFACE >
MoFEMErrorCode registerInterface (const MOFEMuuid &uuid, bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE , bool VERIFY = false>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, IFACE *&iface) const
 Get interface by uuid and return reference to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface refernce to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()=default
 
template<>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, UnknownInterface *&iface) const
 

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...
 
- 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.

Definition at line 119 of file MeshsetsManager.hpp.

Constructor & Destructor Documentation

◆ MeshsetsManager()

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

Definition at line 46 of file MeshsetsManager.cpp.

47  : cOre(const_cast<Core &>(core)) {
48 
49  if (!LogManager::checkIfChannelExist("MeshsetMngWorld")) {
50  auto core_log = logging::core::get();
51 
52  core_log->add_sink(
53  LogManager::createSink(LogManager::getStrmWorld(), "MeshsetMngWorld"));
54  core_log->add_sink(
55  LogManager::createSink(LogManager::getStrmSync(), "MeshsetMngSync"));
56  core_log->add_sink(
57  LogManager::createSink(LogManager::getStrmSelf(), "MeshsetMngSelf"));
58 
59  LogManager::setLog("MeshsetMngWorld");
60  LogManager::setLog("MeshsetMngSync");
61  LogManager::setLog("MeshsetMngSelf");
62 
63  MOFEM_LOG_TAG("MeshsetMngWorld", "MeshsetMng");
64  MOFEM_LOG_TAG("MeshsetMngSync", "MeshsetMng");
65  MOFEM_LOG_TAG("MeshsetMngSelf", "MeshsetMng");
66  }
67 
68  MOFEM_LOG("MeshsetMngWorld", Sev::noisy) << "Mashset manager created";
69 }
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
Definition: LogManager.cpp:368
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:312
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:343
CoreTmp< 0 > Core
Definition: Core.hpp:1124
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
Definition: LogManager.cpp:283
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Definition: LogManager.cpp:327
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
Definition: LogManager.cpp:331
static bool checkIfChannelExist(const std::string channel)
Check if channel exist.
Definition: LogManager.cpp:378
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
Definition: LogManager.cpp:323

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

375  {
376  Interface &m_field = cOre;
377  moab::Interface &moab = m_field.get_moab();
379  auto cit =
380  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
381  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
382  if (cit ==
383  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
384  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
385  "Cannot find Cubit meshset with id: %d", ms_id);
386  }
387  EntityHandle meshset = cit->getMeshset();
388  CHKERR moab.add_entities(meshset, ents, nb_ents);
389 
391 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:421
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:124
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:491
#define CHKERR
Inline error check.
Definition: definitions.h:610
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1954
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

Definition at line 353 of file MeshsetsManager.cpp.

354  {
355  Interface &m_field = cOre;
356  moab::Interface &moab = m_field.get_moab();
358  auto cit =
359  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
360  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
361  if (cit ==
362  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
363  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
364  "Cannot find Cubit meshset with id: %d", ms_id);
365  }
366  EntityHandle meshset = cit->getMeshset();
367  CHKERR moab.add_entities(meshset, ents);
368 
370 }

◆ broadcastMeshsets()

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

Boradcats meshsets.

Parameters
verb
Returns
MoFEMErrorCode

Definition at line 113 of file MeshsetsManager.cpp.

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

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

608  {
609  auto miit =
610  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
611  boost::make_tuple(ms_id, cubit_bc_type));
612  if (miit !=
613  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
614  Interface &m_field = cOre;
615  return m_field.get_moab().contains_entities(miit->meshset, entities,
616  num_entities, operation_type);
617  } else
618  return false;
619 }
moab::Interface & get_moab()
Definition: Core.hpp:335

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

71  {
73  cubitMeshsets.clear();
75 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:522
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:515

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

490  {
491  Interface &m_field = cOre;
492  moab::Interface &moab = m_field.get_moab();
494  auto miit =
495  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().find(
496  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
497  if (miit ==
498  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().end()) {
499  if (bh & MF_EXIST) {
500  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
501  "meshset not found", ms_id);
502  } else {
504  }
505  }
506  EntityHandle meshset = miit->getMeshset();
507  cubitMeshsets.get<Composite_Cubit_msId_And_MeshSetType_mi_tag>().erase(miit);
508  CHKERR moab.delete_entities(&meshset, 1);
509 
511 }
@ MF_EXIST
Definition: definitions.h:193

◆ get_bhTag()

Tag MoFEM::MeshsetsManager::get_bhTag ( ) const

get tag handle used to store "id" of BLOCKSET

Definition at line 164 of file MeshsetsManager.hpp.

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

169 { return bhTag_header; }

◆ get_meshsets_manager_ptr() [1/2]

MeshsetsManager* MoFEM::MeshsetsManager::get_meshsets_manager_ptr ( )

return pointer to meshset manager

Definition at line 174 of file MeshsetsManager.hpp.

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

179 { return this; }

◆ get_nsTag()

Tag MoFEM::MeshsetsManager::get_nsTag ( ) const

get tag handle used to store "id" of NODESET

Definition at line 144 of file MeshsetsManager.hpp.

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

154 { return nsTag_data; }

◆ get_ssTag()

Tag MoFEM::MeshsetsManager::get_ssTag ( ) const

get tag handle used to store "id" of SIDESET

Definition at line 149 of file MeshsetsManager.hpp.

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

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

792  {
793  return configFileOptionsPtr;
794  }
boost::shared_ptr< boost::program_options::options_description > configFileOptionsPtr
config file options

◆ getMeshsetsMultindex()

CubitMeshSet_multiIndex& MoFEM::MeshsetsManager::getMeshsetsMultindex ( )

Definition at line 244 of file MeshsetsManager.hpp.

244  {
245  return cubitMeshsets;
246  }

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

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

◆ initialiseDatabaseFromMesh()

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

\brier initialize container form data on mesh

Returns
[description]

Definition at line 77 of file MeshsetsManager.cpp.

77  {
78  Interface &m_field = cOre;
80  CHKERR readMeshsets(verb);
81  if (brodcastMeshsets)
83 
84  for (auto &m : cubitMeshsets) {
85  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << m;
86  }
87 
89 }
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 817 of file MeshsetsManager.hpp.

818  {
820  const MoFEM::Interface &m_field = cOre;
821  const moab::Interface &moab = m_field.get_moab();
823  CHKERR it->getBcDataStructure(data);
824  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
825  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
826  int tets, tris, edges, nodes, prisms, quads;
827  CHKERR moab.get_number_entities_by_type(it->meshset, MBTET, tets, true);
828  CHKERR moab.get_number_entities_by_type(it->meshset, MBTRI, tris, true);
829  CHKERR moab.get_number_entities_by_type(it->meshset, MBEDGE, edges, true);
830  CHKERR moab.get_number_entities_by_type(it->meshset, MBVERTEX, nodes, true);
831  CHKERR moab.get_number_entities_by_type(it->meshset, MBPRISM, prisms, true);
832  CHKERR moab.get_number_entities_by_type(it->meshset, MBQUAD, quads, true);
833  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << "name " << it->getName();
834  MOFEM_LOG("MeshsetMngWorld", Sev::inform)
835  << "msId " << it->getMeshsetId() << " nb. tets " << tets;
836  MOFEM_LOG("MeshsetMngWorld", Sev::inform)
837  << "msId " << it->getMeshsetId() << " nb. prisms " << prisms;
838  MOFEM_LOG("MeshsetMngWorld", Sev::inform)
839  << "msId " << it->getMeshsetId() << " nb. quads " << quads;
840  MOFEM_LOG("MeshsetMngWorld", Sev::inform)
841  << "msId " << it->getMeshsetId() << " nb. tris " << tris;
842  MOFEM_LOG("MeshsetMngWorld", Sev::inform)
843  << "msId " << it->getMeshsetId() << " nb. edges " << edges;
844  MOFEM_LOG("MeshsetMngWorld", Sev::inform)
845  << "msId " << it->getMeshsetId() << " nb. nodes " << nodes;
846  }
848 }
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
Deprecated interface functions.

◆ printDisplacementSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printDisplacementSet ( ) const

print meshsets with displacement boundary conditions data structure

Definition at line 225 of file MeshsetsManager.cpp.

225  {
226  DisplacementCubitBcData mydata;
228  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
230 }
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

Definition at line 239 of file MeshsetsManager.cpp.

239  {
240  ForceCubitBcData mydata;
242  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
244 }

◆ printHeatFluxSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printHeatFluxSet ( ) const

print meshsets with heat flux boundary conditions data structure

Definition at line 253 of file MeshsetsManager.cpp.

253  {
254  HeatFluxCubitBcData mydata;
256  CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
258 }

◆ printMaterialsSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printMaterialsSet ( ) const

print meshsets with material data structure set on it

Definition at line 260 of file MeshsetsManager.cpp.

260  {
262  const Interface &m_field = cOre;
263  const moab::Interface &moab = m_field.get_moab();
265  (*this), BLOCKSET | MAT_ELASTICSET, it)) {
266  Mat_Elastic data;
267  CHKERR it->getAttributeDataStructure(data);
268  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
269  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
270  Range tets;
271  CHKERR moab.get_entities_by_type(it->meshset, MBTET, tets, true);
272  MOFEM_LOG("MeshsetMngWorld", Sev::inform)
273  << "MAT_ELATIC msId " << it->getMeshsetId() << " nb. tets "
274  << tets.size();
275  }
276 
278  m_field, BLOCKSET | MAT_THERMALSET, it)) {
279  Mat_Thermal data;
280  CHKERR it->getAttributeDataStructure(data);
281  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
282  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
283  }
284 
286  m_field, BLOCKSET | MAT_MOISTURESET, it)) {
287  Mat_Moisture data;
288  CHKERR it->getAttributeDataStructure(data);
289  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
290  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
291  }
293 }
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
Definition: definitions.h:234
@ MAT_THERMALSET
block name is "MAT_THERMAL"
Definition: definitions.h:236
@ MAT_MOISTURESET
block name is "MAT_MOISTURE"
Definition: definitions.h:238

◆ printPressureSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printPressureSet ( ) const

print meshsets with pressure boundary conditions data structure

Definition at line 232 of file MeshsetsManager.cpp.

232  {
233  PressureCubitBcData mydata;
235  CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
237 }

◆ printTemperatureSet()

MoFEMErrorCode MoFEM::MeshsetsManager::printTemperatureSet ( ) const

print meshsets with temperature boundary conditions data structure

Definition at line 246 of file MeshsetsManager.cpp.

246  {
247  TemperatureCubitBcData mydata;
249  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
251 }

◆ query_interface()

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

Implements MoFEM::UnknownInterface.

Definition at line 34 of file MeshsetsManager.cpp.

35  {
37  *iface = NULL;
38  if (uuid == IDD_MOFEMMeshsetsManager) {
39  *iface = const_cast<MeshsetsManager *>(this);
41  }
42  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown interface");
44 }
static const MOFEMuuid IDD_MOFEMMeshsetsManager
MeshsetsManager(const MoFEM::Core &core)

◆ readMeshsets()

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

Boradcats meshsets.

Parameters
verb
Returns
MoFEMErrorCode

Definition at line 91 of file MeshsetsManager.cpp.

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

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

1297  {
1298 
1300  MoFEM::Interface &m_field = cOre;
1301  moab::Interface &moab = m_field.get_moab();
1302  Range entities;
1303  CHKERR getEntitiesByDimension(ms_id, cubit_bc_type, dim, entities, recursive);
1304  EntityHandle meshset;
1305  CHKERR moab.create_meshset(MESHSET_SET, meshset);
1306  CHKERR moab.add_entities(meshset, entities);
1307  CHKERR moab.write_file(file_name.c_str(), file_type.c_str(), options.c_str(),
1308  &meshset, 1);
1309  CHKERR moab.delete_entities(&meshset, 1);
1311 }
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

Definition at line 1279 of file MeshsetsManager.cpp.

1282  {
1283 
1285  MoFEM::Interface &m_field = cOre;
1286  const CubitMeshSets *cubit_meshset_ptr;
1287  CHKERR getCubitMeshsetPtr(ms_id, cubit_bc_type, &cubit_meshset_ptr);
1288  EntityHandle meshset = cubit_meshset_ptr->getMeshset();
1289  CHKERR m_field.get_moab().write_file(file_name.c_str(), file_type.c_str(),
1290  options.c_str(), &meshset, 1);
1292 }
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

Definition at line 394 of file MeshsetsManager.cpp.

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

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

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

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

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

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

1255  {
1256  Interface &m_field = cOre;
1257  PetscBool flg_file;
1258  char meshset_file_name[255] = "config_file.cfg";
1260  CHKERR PetscOptionsBegin(m_field.get_comm(), "", "Set meshsets form file",
1261  "none");
1262  CHKERR PetscOptionsString("-meshsets_config", "meshsets config file name",
1263  "", "add_cubit_meshsets.in", meshset_file_name, 255,
1264  &flg_file);
1265  if (flg_file == PETSC_TRUE) {
1266  ifstream f(meshset_file_name);
1267  if (!f.good()) {
1268  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1269  "File configuring meshsets ( %s ) can not be open\n",
1270  meshset_file_name);
1271  }
1272  CHKERR setMeshsetFromFile(string(meshset_file_name));
1273  }
1274  ierr = PetscOptionsEnd();
1275  CHKERRG(ierr);
1277 }
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:558
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
const int N
Definition: speed_test.cpp:3
Parameters
file_nameconfig file
Returns
error code

◆ updateAllMeshsetsByEntitiesChildren()

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

Definition at line 1314 of file MeshsetsManager.cpp.

1314  {
1316  BitRefManager *bit_mng = cOre.getInterface<BitRefManager>();
1317  for (_IT_CUBITMESHSETS_FOR_LOOP_((*this), iit)) {
1318  EntityHandle meshset = iit->getMeshset();
1319  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1320  MBVERTEX, true);
1321  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1322  MBEDGE, true);
1323  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1324  MBTRI, true);
1325  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1326  MBTET, true);
1327  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1328  MBPRISM, true);
1329  }
1331 }
#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
Iterator that loops over all the Cubit MeshSets in a moFEM field.
MoFEMErrorCode getInterface(const MOFEMuuid &uuid, IFACE *&iface) const
Get interface by uuid and return reference to pointer of interface.

Member Data Documentation

◆ bhTag

Tag MoFEM::MeshsetsManager::bhTag
protected

Definition at line 806 of file MeshsetsManager.hpp.

◆ bhTag_header

Tag MoFEM::MeshsetsManager::bhTag_header
protected

Definition at line 807 of file MeshsetsManager.hpp.

◆ brodcastMeshsets

bool MoFEM::MeshsetsManager::brodcastMeshsets = true
static

if true meshsets are synchrinised between processors

Definition at line 798 of file MeshsetsManager.hpp.

◆ configFileOptionsPtr

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

config file options

Definition at line 812 of file MeshsetsManager.hpp.

◆ cOre

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

Definition at line 124 of file MeshsetsManager.hpp.

◆ cubitMeshsets

CubitMeshSet_multiIndex MoFEM::MeshsetsManager::cubitMeshsets
protected

cubit meshsets

Definition at line 810 of file MeshsetsManager.hpp.

◆ nsTag

Tag MoFEM::MeshsetsManager::nsTag
protected

Definition at line 802 of file MeshsetsManager.hpp.

◆ nsTag_data

Tag MoFEM::MeshsetsManager::nsTag_data
protected

Definition at line 804 of file MeshsetsManager.hpp.

◆ ssTag

Tag MoFEM::MeshsetsManager::ssTag
protected

Definition at line 803 of file MeshsetsManager.hpp.

◆ ssTag_data

Tag MoFEM::MeshsetsManager::ssTag_data
protected

Definition at line 805 of file MeshsetsManager.hpp.


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