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),
29 auto construct = [&]() {
61 CHKERR moab.tag_get_length(*tit, tag_length);
95 : cubitBcType(cubit_bc_type), msId(nullptr), tagBcData(nullptr),
96 tagBcSize(0), tagBlockHeaderData(nullptr), tagBlockAttributes(nullptr),
97 tagBlockAttributesSize(0), tagName(nullptr),
116 PetscTraceBackErrorHandler(PETSC_COMM_WORLD, __LINE__, PETSC_FUNCTION_NAME,
118 PETSC_ERROR_INITIAL,
"Unknow meshset type",
120 PetscMPIAbortErrorHandler(PETSC_COMM_WORLD, __LINE__, PETSC_FUNCTION_NAME,
122 PETSC_ERROR_INITIAL,
"Unknown meshset type",
128 moab::Interface &moab,
const int dimension,
Range &entities,
129 const bool recursive)
const {
132 moab.get_entities_by_dimension(
meshset, dimension, entities, recursive);
133 if (
rval != MB_SUCCESS) {
134 std::ostringstream ss;
135 ss <<
"bc set " << *
this << std::endl;
136 PetscPrintf(PETSC_COMM_WORLD, ss.str().c_str());
142 moab::Interface &moab,
Range &entities,
const bool recursive)
const {
147 entities, recursive);
159 const bool recursive)
const {
161 rval = moab.get_entities_by_type(
meshset, type, entities, recursive);
162 if (
rval != MB_SUCCESS) {
163 std::ostringstream ss;
164 ss <<
"bc set " << *
this << std::endl;
165 PetscPrintf(PETSC_COMM_WORLD, ss.str().c_str());
179 std::vector<unsigned int> &material_data)
const {
181 material_data.resize(3);
189 std::vector<unsigned int> material_data;
191 os <<
"block_header_data = ";
192 std::vector<unsigned int>::iterator vit = material_data.begin();
193 for (; vit != material_data.end(); vit++) {
194 os << std::hex << (int)((
unsigned int)*vit) <<
" ";
197 vit = material_data.begin();
198 for (; vit != material_data.end(); vit++) {
203 os <<
"no block header data" << std::endl;
220 os <<
"Block name: " << name << std::endl;
230 if (bc_data.size() == 0) {
234 if (strcmp(&bc_data[0],
"Displacement") == 0)
236 else if (strcmp(&bc_data[0],
"Force") == 0)
238 else if (strcmp(&bc_data[0],
"Velocity") == 0)
240 else if (strcmp(&bc_data[0],
"Acceleration") == 0)
242 else if (strcmp(&bc_data[0],
"Temperature") == 0)
244 else if (strcmp(&bc_data[0],
"Pressure") == 0)
246 else if (strcmp(&bc_data[0],
"HeatFlux") == 0)
248 else if (strcmp(&bc_data[0],
"cfd_bc") == 0)
257 std::vector<char> bc_data;
265 std::vector<char> bc_data;
268 std::vector<char>::iterator vit = bc_data.begin();
269 for (; vit != bc_data.end(); vit++) {
270 os << std::hex << (int)((
unsigned char)*vit) <<
" ";
273 vit = bc_data.begin();
274 for (; vit != bc_data.end(); vit++) {
294 const std::vector<double> &attributes) {
297 int tag_size[] = {(int)attributes.size()};
298 void const *tag_data[] = {&*attributes.begin()};
308 std::vector<double> attributes;
311 os <<
"Block attributes" << std::endl;
312 os <<
"----------------" << std::endl;
313 for (
unsigned int ii = 0; ii < attributes.size(); ii++) {
314 os <<
"attr. no: " << ii + 1 <<
" value: " << attributes[ii] << std::endl;
324 if (name.compare(0, 11,
"MAT_ELASTIC") == 0) {
326 }
else if (name.compare(0, 11,
"MAT_THERMAL") == 0) {
328 }
else if (name.compare(0, 12,
"MAT_MOISTURE") == 0) {
330 }
else if (name.compare(0, 10,
"MAT_INTERF") == 0) {
332 }
else if (name.compare(0, 11,
"BODY_FORCES") == 0) {
351 std::ostringstream ss;
363 os <<
"meshset " << e.
meshset <<
" type" << ss.str();
364 if (e.
msId !=
nullptr)
365 os <<
" msId " << *(e.
msId);
370 os <<
" block header: ";
382 nAme.resize(NAME_TAG_SIZE);
393 nAme.resize(NAME_TAG_SIZE);
441 THROW_MESSAGE(
"You have to have NODESET or SIDESET to apply BC data on it");
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#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