10 CHKERR moab.tag_get_handle(DIRICHLET_SET_TAG_NAME,
nsTag);
11 CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME,
ssTag);
12 CHKERR moab.tag_get_handle(
13 (std::string(DIRICHLET_SET_TAG_NAME) +
"__BC_DATA").c_str(),
nsTag_data);
14 CHKERR moab.tag_get_handle(
15 (std::string(NEUMANN_SET_TAG_NAME) +
"__BC_DATA").c_str(),
ssTag_data);
16 CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME,
bhTag);
23 : meshset(meshset), cubitBcType(
UNKNOWNSET), msId(nullptr),
24 tagBcData(nullptr), tagBcSize(0), tagBlockHeaderData(nullptr),
25 tagBlockAttributes(nullptr), tagBlockAttributesSize(0), tagName(nullptr),
28 auto construct = [&]() {
65 CHKERR moab.tag_get_length(*tit, tag_length);
100 : cubitBcType(cubit_bc_type), msId(nullptr), tagBcData(nullptr),
101 tagBcSize(0), tagBlockHeaderData(nullptr), tagBlockAttributes(nullptr),
102 tagBlockAttributesSize(0), tagName(nullptr),
121 PetscTraceBackErrorHandler(PETSC_COMM_WORLD, __LINE__, PETSC_FUNCTION_NAME,
123 PETSC_ERROR_INITIAL,
"Unknow meshset type",
125 PetscMPIAbortErrorHandler(PETSC_COMM_WORLD, __LINE__, PETSC_FUNCTION_NAME,
127 PETSC_ERROR_INITIAL,
"Unknown meshset type",
133 moab::Interface &moab,
const int dimension,
Range &entities,
134 const bool recursive)
const {
137 moab.get_entities_by_dimension(
meshset, dimension, entities, recursive);
138 if (
rval != MB_SUCCESS) {
139 MOFEM_LOG(
"SELF", Sev::error) <<
"bc set " << *
this;
145 moab::Interface &moab,
Range &entities,
const bool recursive)
const {
150 entities, recursive);
161 moab::Interface &moab,
const EntityType type,
Range &entities,
162 const bool recursive)
const {
164 rval = moab.get_entities_by_type(
meshset, type, entities, recursive);
165 if (
rval != MB_SUCCESS) {
166 MOFEM_LOG(
"SELF", Sev::error) <<
"bc set " << *
this;
180 std::vector<unsigned int> &material_data)
const {
182 material_data.resize(3);
190 std::vector<unsigned int> material_data;
192 os <<
"block_header_data = ";
193 std::vector<unsigned int>::iterator vit = material_data.begin();
194 for (; vit != material_data.end(); vit++) {
195 os << std::hex << (int)((
unsigned int)*vit) <<
" ";
198 vit = material_data.begin();
199 for (; vit != material_data.end(); vit++) {
204 os <<
"no block header data" << std::endl;
221 os <<
"Block name: " << name << std::endl;
231 if (bc_data.size() == 0) {
238 if (strcmp(&bc_data[0],
"Displacement") == 0)
240 else if (strcmp(&bc_data[0],
"Force") == 0)
242 else if (strcmp(&bc_data[0],
"Velocity") == 0)
244 else if (strcmp(&bc_data[0],
"Acceleration") == 0)
246 else if (strcmp(&bc_data[0],
"Temperature") == 0)
248 else if (strcmp(&bc_data[0],
"Pressure") == 0)
250 else if (strcmp(&bc_data[0],
"HeatFlux") == 0)
252 else if (strcmp(&bc_data[0],
"cfd_bc") == 0)
261 std::vector<char> bc_data;
269 std::vector<char> bc_data;
272 std::vector<char>::iterator vit = bc_data.begin();
273 for (; vit != bc_data.end(); vit++) {
274 os << std::hex << (int)((
unsigned char)*vit) <<
" ";
277 vit = bc_data.begin();
278 for (; vit != bc_data.end(); vit++) {
298 const std::vector<double> &attributes) {
301 int tag_size[] = {(int)attributes.size()};
302 void const *tag_data[] = {&*attributes.begin()};
312 std::vector<double> attributes;
315 os <<
"Block attributes" << std::endl;
316 os <<
"----------------" << std::endl;
317 for (
unsigned int ii = 0; ii < attributes.size(); ii++) {
318 os <<
"attr. no: " << ii + 1 <<
" value: " << attributes[ii] << std::endl;
331 if (name.compare(0, 11,
"MAT_ELASTIC") == 0) {
333 }
else if (name.compare(0, 11,
"MAT_THERMAL") == 0) {
335 }
else if (name.compare(0, 12,
"MAT_MOISTURE") == 0) {
337 }
else if (name.compare(0, 10,
"MAT_INTERF") == 0) {
339 }
else if (name.compare(0, 11,
"BODY_FORCES") == 0) {
358 std::ostringstream ss;
370 os <<
"meshset " << e.
meshset <<
" type" << ss.str();
371 if (e.
msId !=
nullptr)
372 os <<
" msId " << *(e.
msId);
377 os <<
" block header: ";
389 nAme.resize(NAME_TAG_SIZE);
400 nAme.resize(NAME_TAG_SIZE);
448 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.
#define MOFEM_LOG(channel, severity)
Log.
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