11 CHKERR moab.tag_get_handle(DIRICHLET_SET_TAG_NAME,
nsTag);
12 CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME,
ssTag);
13 CHKERR moab.tag_get_handle(
14 (std::string(DIRICHLET_SET_TAG_NAME) +
"__BC_DATA").c_str(),
nsTag_data);
15 CHKERR moab.tag_get_handle(
16 (std::string(NEUMANN_SET_TAG_NAME) +
"__BC_DATA").c_str(),
ssTag_data);
17 CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME,
bhTag);
24 : meshset(meshset), cubitBcType(
UNKNOWNSET), msId(nullptr),
25 tagBcData(nullptr), tagBcSize(0), tagBlockHeaderData(nullptr),
26 tagBlockAttributes(nullptr), tagBlockAttributesSize(0), tagName(nullptr),
58 CHKERR moab.tag_get_length(*tit, tag_length);
87 : cubitBcType(cubit_bc_type), msId(nullptr), tagBcData(nullptr),
88 tagBcSize(0), tagBlockHeaderData(nullptr), tagBlockAttributes(nullptr),
89 tagBlockAttributesSize(0), tagName(nullptr),
108 PetscTraceBackErrorHandler(PETSC_COMM_WORLD, __LINE__, PETSC_FUNCTION_NAME,
110 PETSC_ERROR_INITIAL,
"Unknow meshset type",
112 PetscMPIAbortErrorHandler(PETSC_COMM_WORLD, __LINE__, PETSC_FUNCTION_NAME,
114 PETSC_ERROR_INITIAL,
"Unknown meshset type",
120 moab::Interface &moab,
const int dimension,
Range &entities,
121 const bool recursive)
const {
124 moab.get_entities_by_dimension(
meshset, dimension, entities, recursive);
125 if (
rval != MB_SUCCESS) {
126 std::ostringstream ss;
127 ss <<
"bc set " << *
this << std::endl;
128 PetscPrintf(PETSC_COMM_WORLD, ss.str().c_str());
134 moab::Interface &moab,
Range &entities,
const bool recursive)
const {
139 entities, recursive);
151 const bool recursive)
const {
153 rval = moab.get_entities_by_type(
meshset, type, entities, recursive);
154 if (
rval != MB_SUCCESS) {
155 std::ostringstream ss;
156 ss <<
"bc set " << *
this << std::endl;
157 PetscPrintf(PETSC_COMM_WORLD, ss.str().c_str());
171 std::vector<unsigned int> &material_data)
const {
173 material_data.resize(3);
181 std::vector<unsigned int> material_data;
183 os <<
"block_header_data = ";
184 std::vector<unsigned int>::iterator vit = material_data.begin();
185 for (; vit != material_data.end(); vit++) {
186 os << std::hex << (int)((
unsigned int)*vit) <<
" ";
189 vit = material_data.begin();
190 for (; vit != material_data.end(); vit++) {
195 os <<
"no block header data" << std::endl;
212 os <<
"Block name: " << name << std::endl;
222 if (bc_data.size() == 0) {
226 if (strcmp(&bc_data[0],
"Displacement") == 0)
228 else if (strcmp(&bc_data[0],
"Force") == 0)
230 else if (strcmp(&bc_data[0],
"Velocity") == 0)
232 else if (strcmp(&bc_data[0],
"Acceleration") == 0)
234 else if (strcmp(&bc_data[0],
"Temperature") == 0)
236 else if (strcmp(&bc_data[0],
"Pressure") == 0)
238 else if (strcmp(&bc_data[0],
"HeatFlux") == 0)
240 else if (strcmp(&bc_data[0],
"cfd_bc") == 0)
249 std::vector<char> bc_data;
257 std::vector<char> bc_data;
260 std::vector<char>::iterator vit = bc_data.begin();
261 for (; vit != bc_data.end(); vit++) {
262 os << std::hex << (int)((
unsigned char)*vit) <<
" ";
265 vit = bc_data.begin();
266 for (; vit != bc_data.end(); vit++) {
286 const std::vector<double> &attributes) {
289 int tag_size[] = {(int)attributes.size()};
290 void const *tag_data[] = {&*attributes.begin()};
300 std::vector<double> attributes;
303 os <<
"Block attributes" << std::endl;
304 os <<
"----------------" << std::endl;
305 for (
unsigned int ii = 0; ii < attributes.size(); ii++) {
306 os <<
"attr. no: " << ii + 1 <<
" value: " << attributes[ii] << std::endl;
316 if (name.compare(0, 11,
"MAT_ELASTIC") == 0) {
318 }
else if (name.compare(0, 11,
"MAT_THERMAL") == 0) {
320 }
else if (name.compare(0, 12,
"MAT_MOISTURE") == 0) {
322 }
else if (name.compare(0, 10,
"MAT_INTERF") == 0) {
324 }
else if (name.compare(0, 11,
"BODY_FORCES") == 0) {
343 std::ostringstream ss;
355 os <<
"meshset " << e.
meshset <<
" type" << ss.str();
356 if (e.
msId !=
nullptr)
357 os <<
" msId " << *(e.
msId);
362 os <<
" block header: ";
374 nAme.resize(NAME_TAG_SIZE);
385 nAme.resize(NAME_TAG_SIZE);
433 THROW_MESSAGE(
"You have to have NODESET or SIDESET to apply BC data on it");
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ BODYFORCESSET
block name is "BODY_FORCES"
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
@ MAT_THERMALSET
block name is "MAT_THERMAL"
@ MAT_MOISTURESET
block name is "MAT_MOISTURE"
@ MOFEM_DATA_INCONSISTENCY
static const char *const CubitBCNames[]
Names of types of sets and boundary conditions.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< 32 > CubitBCType
implementation of Data Operators for Forces and Sources
std::ostream & operator<<(std::ostream &os, const EntitiesFieldData::EntData &e)
void operator()(CubitMeshSets &e)
void operator()(CubitMeshSets &e)
const GenericAttributeData & aTtr
const std::vector< double > & aTtr
void operator()(CubitMeshSets &e)
void operator()(CubitMeshSets &e)
const GenericCubitBcData & bcData
void operator()(CubitMeshSets &e)
this struct keeps basic methods for moab meshset about material and boundary conditions
MoFEMErrorCode getAttributes(std::vector< double > &attributes) const
get Cubit block attributes
double * tagBlockAttributes
MoFEMErrorCode getBcData(std::vector< char > &bc_data) const
get bc_data vector from MoFEM database
MoFEMErrorCode printName(std::ostream &os) const
print name of block, sideset etc. (this is set in Cubit setting properties)
MoFEMErrorCode printAttributes(std::ostream &os) const
print the attributes vector
unsigned int * tagBlockHeaderData
MoFEMErrorCode getTypeFromName(const std::string &name, CubitBCType &type) const
Function that returns the CubitBCType type of the block name, sideset name etc.
MoFEMErrorCode setBcDataStructure(CUBIT_BC_DATA_TYPE &data)
CubitMeshSets(Interface &moab, const EntityHandle meshset)
MoFEMErrorCode setAttributes(moab::Interface &moab, const std::vector< double > &attributes)
cet Cubit block attributes
MoFEMErrorCode getBlockHeaderData(std::vector< unsigned int > &material_data) const
get block_headers vector from MoFEM database
MoFEMErrorCode printBcData(std::ostream &os) const
print bc_data int stream given by os
MoFEMErrorCode getMeshsetIdEntitiesByDimension(Interface &moab, const int dimension, Range &entities, const bool recursive=false) const
get entities form meshset
std::string getName() const
get name of block, sideset etc. (this is set in Cubit block properties)
std::vector< Tag > tag_handles
vector of tag handles to types of data passed from cubit
MoFEMErrorCode setAttributeDataStructure(const ATTRIBUTE_TYPE &data)
fill meshset data with data on structure
MoFEMErrorCode getTagsHandlers(Interface &moab)
int * msId
cubit meshset ID
int tagBlockAttributesSize
MoFEMErrorCode getMeshsetIdEntitiesByType(Interface &moab, const EntityType type, Range &entities, const bool recursive=false) const
get entities by type
MoFEMErrorCode getTypeFromBcData(const std::vector< char > &bc_data, CubitBCType &type) const
Function that returns the CubitBCType type of the contents of bc_data.
MoFEMErrorCode printBlockHeaderData(std::ostream &os) const
print material_data int stream given by os
virtual const void * getDataPtr() const =0
get pointer to data structure
virtual std::size_t getSizeOfData() const =0
get data structure size
virtual const void * getDataPtr() const =0
get pointer to data structure
virtual std::size_t getSizeOfData() const =0
get data structure size