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",
134 const bool recursive)
const {
137 moab.get_entities_by_dimension(
meshset, dimension, entities, recursive);
138 if (
rval != MB_SUCCESS) {
139 std::ostringstream ss;
140 ss <<
"bc set " << *
this << std::endl;
141 PetscPrintf(PETSC_COMM_WORLD, ss.str().c_str());
152 entities, recursive);
164 const bool recursive)
const {
167 if (
rval != MB_SUCCESS) {
168 std::ostringstream ss;
169 ss <<
"bc set " << *
this << std::endl;
170 PetscPrintf(PETSC_COMM_WORLD, ss.str().c_str());
184 std::vector<unsigned int> &material_data)
const {
186 material_data.resize(3);
194 std::vector<unsigned int> material_data;
196 os <<
"block_header_data = ";
197 std::vector<unsigned int>::iterator vit = material_data.begin();
198 for (; vit != material_data.end(); vit++) {
199 os << std::hex << (
int)((
unsigned int)*vit) <<
" ";
202 vit = material_data.begin();
203 for (; vit != material_data.end(); vit++) {
208 os <<
"no block header data" << std::endl;
225 os <<
"Block name: " << name << std::endl;
235 if (bc_data.size() == 0) {
242 if (strcmp(&bc_data[0],
"Displacement") == 0)
244 else if (strcmp(&bc_data[0],
"Force") == 0)
246 else if (strcmp(&bc_data[0],
"Velocity") == 0)
248 else if (strcmp(&bc_data[0],
"Acceleration") == 0)
250 else if (strcmp(&bc_data[0],
"Temperature") == 0)
252 else if (strcmp(&bc_data[0],
"Pressure") == 0)
254 else if (strcmp(&bc_data[0],
"HeatFlux") == 0)
256 else if (strcmp(&bc_data[0],
"cfd_bc") == 0)
265 std::vector<char> bc_data;
273 std::vector<char> bc_data;
276 std::vector<char>::iterator vit = bc_data.begin();
277 for (; vit != bc_data.end(); vit++) {
278 os << std::hex << (
int)((
unsigned char)*vit) <<
" ";
281 vit = bc_data.begin();
282 for (; vit != bc_data.end(); vit++) {
302 const std::vector<double> &attributes) {
305 int tag_size[] = {(
int)attributes.size()};
306 void const *tag_data[] = {&*attributes.begin()};
316 std::vector<double> attributes;
319 os <<
"Block attributes" << std::endl;
320 os <<
"----------------" << std::endl;
321 for (
unsigned int ii = 0; ii < attributes.size(); ii++) {
322 os <<
"attr. no: " << ii + 1 <<
" value: " << attributes[ii] << std::endl;
335 if (name.compare(0, 11,
"MAT_ELASTIC") == 0) {
337 }
else if (name.compare(0, 11,
"MAT_THERMAL") == 0) {
339 }
else if (name.compare(0, 12,
"MAT_MOISTURE") == 0) {
341 }
else if (name.compare(0, 10,
"MAT_INTERF") == 0) {
343 }
else if (name.compare(0, 11,
"BODY_FORCES") == 0) {
362 std::ostringstream ss;
374 os <<
"meshset " << e.
meshset <<
" type" << ss.str();
375 if (e.
msId !=
nullptr)
376 os <<
" msId " << *(e.
msId);
381 os <<
" block header: ";
393 nAme.resize(NAME_TAG_SIZE);
404 nAme.resize(NAME_TAG_SIZE);
452 THROW_MESSAGE(
"You have to have NODESET or SIDESET to apply BC data on it");