v0.8.23
Public Member Functions | Public Attributes | Friends | List of all members
MoFEM::CubitMeshSets Struct Reference

this struct keeps basic methods for moab meshset about material and boundary conditions More...

#include <src/multi_indices/BCMultiIndices.hpp>

Collaboration diagram for MoFEM::CubitMeshSets:
[legend]

Public Member Functions

 CubitMeshSets (Interface &moab, const EntityHandle _meshset)
 
 CubitMeshSets (Interface &moab, const CubitBCType _cubit_bc_type, const int _msId)
 
int getMeshsetId () const
 get meshset id as it set in preprocessing software More...
 
CubitBCType getBcType () const
 get type of meshset More...
 
EntityHandle getMeshset () const
 get bc meshset More...
 
unsigned long int getBcTypeULong () const
 get bc meshset type More...
 
unsigned long int getMaksedBcTypeULong () const
 get meshset type and mask More...
 
unsigned int getMeshsetEntitiesDimension () const
 Get the meshset entities dimension. More...
 
MoFEMErrorCode getMeshsetIdEntitiesByDimension (Interface &moab, const int dimension, Range &entities, const bool recursive=false) const
 get entities form meshset More...
 
MoFEMErrorCode getMeshsetIdEntitiesByDimension (Interface &moab, Range &entities, const bool recursive=false) const
 get entities form meshset More...
 
MoFEMErrorCode getMeshsetIdEntitiesByType (Interface &moab, const EntityType type, Range &entities, const bool recursive=false) const
 get entities by type More...
 
MoFEMErrorCode getTypeFromBcData (const std::vector< char > &bc_data, CubitBCType &type) const
 Function that returns the CubitBCType type of the contents of bc_data. More...
 
MoFEMErrorCode getTypeFromBcData (CubitBCType &type) const
 Function that returns the CubitBCType type of the contents of bc_data. More...
 
MoFEMErrorCode getBcData (std::vector< char > &bc_data) const
 get bc_data vector from MoFEM database More...
 
MoFEMErrorCode getBlockHeaderData (std::vector< unsigned int > &material_data) const
 get block_headers vector from MoFEM database More...
 
MoFEMErrorCode printBlockHeaderData (std::ostream &os) const
 print material_data int stream given by os More...
 
MoFEMErrorCode printBcData (std::ostream &os) const
 print bc_data int stream given by os More...
 
MoFEMErrorCode getTypeFromName (const std::string &name, CubitBCType &type) const
 Function that returns the CubitBCType type of the block name, sideset name etc. More...
 
MoFEMErrorCode getTypeFromName (CubitBCType &type) const
 Function that returns the CubitBCType type of the block name, sideset name etc. More...
 
MoFEMErrorCode getAttributes (std::vector< double > &attributes) const
 get Cubit block attributes More...
 
MoFEMErrorCode setAttributes (moab::Interface &moab, const std::vector< double > &attributes)
 cet Cubit block attributes More...
 
MoFEMErrorCode printAttributes (std::ostream &os) const
 print the attributes vector More...
 
std::string getName () const
 get name of block, sideset etc. (this is set in Cubit block properties) More...
 
MoFEMErrorCode printName (std::ostream &os) const
 print name of block, sideset etc. (this is set in Cubit setting properties) More...
 
template<class ATTRIBUTE_TYPE >
MoFEMErrorCode getAttributeDataStructure (ATTRIBUTE_TYPE &data) const
 fill data structure with data saved on meshset More...
 
template<class ATTRIBUTE_TYPE >
MoFEMErrorCode setAttributeDataStructure (const ATTRIBUTE_TYPE &data)
 fill meshset data with data on structure More...
 
template<class CUBIT_BC_DATA_TYPE >
MoFEMErrorCode getBcDataStructure (CUBIT_BC_DATA_TYPE &data) const
 
template<class CUBIT_BC_DATA_TYPE >
MoFEMErrorCode setBcDataStructure (CUBIT_BC_DATA_TYPE &data)
 
MoFEMErrorCode getTagsHanlders (Interface &moab)
 

Public Attributes

EntityHandle meshset
 
CubitBCType cubitBcType
 
std::vector< Tag > tag_handles
 vector of tag handles to types of data passed from cubit More...
 
intmsId
 cubit meshset ID More...
 
char * tag_bc_data
 
int tag_bc_size
 
unsigned inttag_block_header_data
 
doubletag_block_attributes
 
int tag_block_attributes_size
 
char * tagName
 
const CubitBCType meshsets_mask
 
Tag nsTag
 
Tag ssTag
 
Tag nsTag_data
 
Tag ssTag_data
 
Tag bhTag
 
Tag bhTag_header
 
Tag thBlockAttribs
 
Tag entityNameTag
 

Friends

std::ostream & operator<< (std::ostream &os, const CubitMeshSets &e)
 

Detailed Description

this struct keeps basic methods for moab meshset about material and boundary conditions

Definition at line 29 of file BCMultiIndices.hpp.

Constructor & Destructor Documentation

◆ CubitMeshSets() [1/2]

MoFEM::CubitMeshSets::CubitMeshSets ( Interface moab,
const EntityHandle  _meshset 
)

◆ CubitMeshSets() [2/2]

MoFEM::CubitMeshSets::CubitMeshSets ( Interface moab,
const CubitBCType  _cubit_bc_type,
const int  _msId 
)

Member Function Documentation

◆ getAttributeDataStructure()

template<class ATTRIBUTE_TYPE >
MoFEMErrorCode MoFEM::CubitMeshSets::getAttributeDataStructure ( ATTRIBUTE_TYPE &  data) const

fill data structure with data saved on meshset

Definition at line 275 of file BCMultiIndices.hpp.

275  {
277 
278  if ((cubitBcType & data.getType()).none()) {
279  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
280  "attributes are not for ATTRIBUTE_TYPE structure");
281  }
282  std::vector<double> attributes;
283  ierr = getAttributes(attributes);
284  CHKERRG(ierr);
285  ierr = data.fill_data(attributes);
286  CHKERRG(ierr);
288  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:543
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507
MoFEMErrorCode getAttributes(std::vector< double > &attributes) const
get Cubit block attributes

◆ getAttributes()

MoFEMErrorCode MoFEM::CubitMeshSets::getAttributes ( std::vector< double > &  attributes) const

get Cubit block attributes

Parameters
attributesis the vector where the block attribute data will be stored

Definition at line 289 of file BCMultiIndices.cpp.

289  {
291  attributes.resize(tag_block_attributes_size);
292  if (tag_block_attributes_size > 0) {
293  copy(&tag_block_attributes[0],
294  &tag_block_attributes[tag_block_attributes_size], attributes.begin());
295  }
297 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

◆ getBcData()

MoFEMErrorCode MoFEM::CubitMeshSets::getBcData ( std::vector< char > &  bc_data) const

get bc_data vector from MoFEM database

Parameters
bc_datais the in/out vector were bc_data will be stored

Definition at line 177 of file BCMultiIndices.cpp.

177  {
179  bc_data.resize(tag_bc_size);
180  copy(&tag_bc_data[0], &tag_bc_data[tag_bc_size], bc_data.begin());
182 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

◆ getBcDataStructure()

template<class CUBIT_BC_DATA_TYPE >
MoFEMErrorCode MoFEM::CubitMeshSets::getBcDataStructure ( CUBIT_BC_DATA_TYPE &  data) const

Definition at line 308 of file BCMultiIndices.hpp.

308  {
310 
311  if ((cubitBcType & data.tYpe).none()) {
312  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
313  "bc_data are not for CUBIT_BC_DATA_TYPE structure");
314  }
315  std::vector<char> bc_data;
316  getBcData(bc_data);
317  ierr = data.fill_data(bc_data);
318  CHKERRG(ierr);
320  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:543
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507
MoFEMErrorCode getBcData(std::vector< char > &bc_data) const
get bc_data vector from MoFEM database

◆ getBcType()

CubitBCType MoFEM::CubitMeshSets::getBcType ( ) const

get type of meshset

Deprecated:
use getMeshsetId() instead

See CubitBC for set of types of meshsets.

Returns
meshset type

Definition at line 66 of file BCMultiIndices.hpp.

66 { return cubitBcType; }

◆ getBcTypeULong()

unsigned long int MoFEM::CubitMeshSets::getBcTypeULong ( ) const

get bc meshset type

Returns
return type as unsigned int

Definition at line 78 of file BCMultiIndices.hpp.

78  {
79  return cubitBcType.to_ulong();
80  }

◆ getBlockHeaderData()

MoFEMErrorCode MoFEM::CubitMeshSets::getBlockHeaderData ( std::vector< unsigned int > &  material_data) const

get block_headers vector from MoFEM database

Parameters
material_datais the in/out vector were the material data will be stored

Definition at line 184 of file BCMultiIndices.cpp.

185  {
187  material_data.resize(3);
189  material_data.begin());
191 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406
unsigned int * tag_block_header_data

◆ getMaksedBcTypeULong()

unsigned long int MoFEM::CubitMeshSets::getMaksedBcTypeULong ( ) const

get meshset type and mask

Returns
type is returned as unsigned integer

Definition at line 86 of file BCMultiIndices.hpp.

86  {
87  return (cubitBcType & meshsets_mask).to_ulong();
88  }
const CubitBCType meshsets_mask

◆ getMeshset()

EntityHandle MoFEM::CubitMeshSets::getMeshset ( ) const

get bc meshset

Returns
meshset entity handle

Definition at line 72 of file BCMultiIndices.hpp.

72 { return meshset; }

◆ getMeshsetEntitiesDimension()

unsigned int MoFEM::CubitMeshSets::getMeshsetEntitiesDimension ( ) const

Get the meshset entities dimension.

Note
If dimension is -1, then dimension for meshset ins undetermined.
Returns
unsigned int

Definition at line 97 of file BCMultiIndices.hpp.

97  {
99  return tag_block_header_data[2];
100  else
101  return -1;
102  }
unsigned int * tag_block_header_data

◆ getMeshsetId()

int MoFEM::CubitMeshSets::getMeshsetId ( ) const

get meshset id as it set in preprocessing software

Returns
id of meshset

Definition at line 53 of file BCMultiIndices.hpp.

53 { return *msId; }
int * msId
cubit meshset ID

◆ getMeshsetIdEntitiesByDimension() [1/2]

MoFEMErrorCode MoFEM::CubitMeshSets::getMeshsetIdEntitiesByDimension ( Interface moab,
const int  dimension,
Range &  entities,
const bool  recursive = false 
) const

get entities form meshset

Parameters
moabmoab instance
dimensiondimension of entities
entitiesrange of returned entities
recursivetrue if meshset should be searched recursively
Returns
error code

◆ getMeshsetIdEntitiesByDimension() [2/2]

MoFEMErrorCode MoFEM::CubitMeshSets::getMeshsetIdEntitiesByDimension ( Interface moab,
Range &  entities,
const bool  recursive = false 
) const

get entities form meshset

Use if meshset have predefined dimension

Parameters
moabmoab instance
entitiesrange of returned entities
recursivetrue if meshset should be searched recursively
Returns
error code

◆ getMeshsetIdEntitiesByType()

MoFEMErrorCode MoFEM::CubitMeshSets::getMeshsetIdEntitiesByType ( Interface moab,
const EntityType  type,
Range &  entities,
const bool  recursive = false 
) const

get entities by type

Parameters
moabmoab instance
typetype of entity
entitiesreturned entities
recursivetrue if meshset should be searched recursively
Returns
error code

Definition at line 163 of file BCMultiIndices.cpp.

165  {
167  rval = moab.get_entities_by_type(meshset, type, entities, recursive);
168  if (rval != MB_SUCCESS) {
169  std::ostringstream ss;
170  ss << "bc set " << *this << std::endl;
171  PetscPrintf(PETSC_COMM_WORLD, ss.str().c_str());
172  }
173  CHKERR rval;
175 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:84
#define CHKERR
Inline error check.
Definition: definitions.h:595
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

◆ getName()

std::string MoFEM::CubitMeshSets::getName ( ) const

get name of block, sideset etc. (this is set in Cubit block properties)

Block Name Conventions:

Materials are defined with block names starting with MAT_ e.g. MAT_ELASTIC_abcd, MAT_FRACTcdef etc. Solution procedures are defined with block names starting with SOL_ e.g. SOL_ELASTIC_xx, SOL_NLELASTICxx, SOL_FRACTabcd etc.

List of materials/solution procedures

Block name / Number of attributes / (1) Attribute 1, (2) Attribute 2 etc.

MAT_ELASTIC / 10 / (1) Young's modulus (2) Poisson's ratio (3) User attribute 8 ... (10) User attribute 8

MAT_ELASTIC_TRANSISO / 5 / (1) Young's modulus in xy plane (Ep) (2) Young's modulus in z-direction (Ez) (3) Poisson's ratio in xy plane (vp) (4) Poisson's ratio in z-direction (vpz) (5) Shear modulus in z-direction (Gzp)

MAT_INTERF / 1 / (1) Elastic modulus multiplier

To be extended as appropriate

Definition at line 215 of file BCMultiIndices.cpp.

215  {
216  if (tagName != nullptr) {
217  return std::string(tagName);
218  } else {
219  return "NoNameSet";
220  }
221 }

◆ getTagsHanlders()

MoFEMErrorCode MoFEM::CubitMeshSets::getTagsHanlders ( Interface moab)

Definition at line 22 of file BCMultiIndices.cpp.

22  {
24  CHKERR moab.tag_get_handle(DIRICHLET_SET_TAG_NAME, nsTag);
25  CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME, ssTag);
26  CHKERR moab.tag_get_handle(
27  (std::string(DIRICHLET_SET_TAG_NAME) + "__BC_DATA").c_str(), nsTag_data);
28  CHKERR moab.tag_get_handle(
29  (std::string(NEUMANN_SET_TAG_NAME) + "__BC_DATA").c_str(), ssTag_data);
30  CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME, bhTag);
31  CHKERR moab.tag_get_handle(BLOCK_HEADER, bhTag_header);
32  CHKERR moab.tag_get_handle(BLOCK_ATTRIBUTES, thBlockAttribs);
33  CHKERR moab.tag_get_handle(NAME_TAG_NAME, entityNameTag);
35 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
#define CHKERR
Inline error check.
Definition: definitions.h:595
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

◆ getTypeFromBcData() [1/2]

MoFEMErrorCode MoFEM::CubitMeshSets::getTypeFromBcData ( const std::vector< char > &  bc_data,
CubitBCType type 
) const

Function that returns the CubitBCType type of the contents of bc_data.

Definition at line 232 of file BCMultiIndices.cpp.

233  {
235 
236  // See CubitBCType in common.hpp
237  if (bc_data.size() == 0) {
239  }
240 
241  if (strcmp(&bc_data[0], "Displacement") == 0)
242  type |= DISPLACEMENTSET;
243  else if (strcmp(&bc_data[0], "Force") == 0)
244  type |= FORCESET;
245  else if (strcmp(&bc_data[0], "Velocity") == 0)
246  type |= VELOCITYSET;
247  else if (strcmp(&bc_data[0], "Acceleration") == 0)
248  type |= ACCELERATIONSET;
249  else if (strcmp(&bc_data[0], "Temperature") == 0)
250  type |= TEMPERATURESET;
251  else if (strcmp(&bc_data[0], "Pressure") == 0)
252  type |= PRESSURESET;
253  else if (strcmp(&bc_data[0], "HeatFlux") == 0)
254  type |= HEATFLUXSET;
255  else if (strcmp(&bc_data[0], "cfd_bc") == 0)
256  type |= INTERFACESET;
257  else
258  type |= UNKNOWNNAME;
259 
261 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

◆ getTypeFromBcData() [2/2]

MoFEMErrorCode MoFEM::CubitMeshSets::getTypeFromBcData ( CubitBCType type) const

Function that returns the CubitBCType type of the contents of bc_data.

Definition at line 262 of file BCMultiIndices.cpp.

262  {
264  std::vector<char> bc_data;
265  CHKERR getBcData(bc_data);
266  CHKERR getTypeFromBcData(bc_data, type);
268 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
#define CHKERR
Inline error check.
Definition: definitions.h:595
MoFEMErrorCode getTypeFromBcData(const std::vector< char > &bc_data, CubitBCType &type) const
Function that returns the CubitBCType type of the contents of bc_data.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406
MoFEMErrorCode getBcData(std::vector< char > &bc_data) const
get bc_data vector from MoFEM database

◆ getTypeFromName() [1/2]

MoFEMErrorCode MoFEM::CubitMeshSets::getTypeFromName ( const std::string &  name,
CubitBCType type 
) const

Function that returns the CubitBCType type of the block name, sideset name etc.

Definition at line 327 of file BCMultiIndices.cpp.

328  {
330  // See CubitBCType in common.hpp
331  if (name.compare(0, 11, "MAT_ELASTIC") == 0) {
332  type |= MAT_ELASTICSET;
333  } else if (name.compare(0, 11, "MAT_THERMAL") == 0) {
334  type |= MAT_THERMALSET;
335  } else if (name.compare(0, 12, "MAT_MOISTURE") == 0) {
336  type |= MAT_MOISTURESET;
337  } else if (name.compare(0, 10, "MAT_INTERF") == 0) {
338  type |= MAT_INTERFSET;
339  } else if (name.compare(0, 11, "BODY_FORCES") == 0) {
340  type |= BODYFORCESSET;
341  }
342  // To be extended as appropriate
343  else {
344  type |= UNKNOWNNAME;
345  }
347 }
block name is "MAT_MOISTURE"
Definition: definitions.h:225
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
block name is "MAT_THERMAL"
Definition: definitions.h:223
block name is "BODY_FORCES"
Definition: definitions.h:224
block name is "MAT_ELASTIC"
Definition: definitions.h:221
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

◆ getTypeFromName() [2/2]

MoFEMErrorCode MoFEM::CubitMeshSets::getTypeFromName ( CubitBCType type) const

Function that returns the CubitBCType type of the block name, sideset name etc.

Definition at line 349 of file BCMultiIndices.cpp.

349  {
351  std::string name = getName();
352  CHKERR getTypeFromName(name, type);
354 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
MoFEMErrorCode getTypeFromName(const std::string &name, CubitBCType &type) const
Function that returns the CubitBCType type of the block name, sideset name etc.
std::string getName() const
get name of block, sideset etc. (this is set in Cubit block properties)
#define CHKERR
Inline error check.
Definition: definitions.h:595
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

◆ printAttributes()

MoFEMErrorCode MoFEM::CubitMeshSets::printAttributes ( std::ostream &  os) const

print the attributes vector

f.e. it->printAttributes(cout), i.e. printing to standard output f.e. it->printAttributes(std::cerr), i.e. printing to standard error output

Definition at line 313 of file BCMultiIndices.cpp.

313  {
315  std::vector<double> attributes;
316  CHKERR getAttributes(attributes);
317  os << std::endl;
318  os << "Block attributes" << std::endl;
319  os << "----------------" << std::endl;
320  for (unsigned int ii = 0; ii < attributes.size(); ii++) {
321  os << "attr. no: " << ii + 1 << " value: " << attributes[ii] << std::endl;
322  }
323  os << std::endl;
325 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
MoFEMErrorCode getAttributes(std::vector< double > &attributes) const
get Cubit block attributes
#define CHKERR
Inline error check.
Definition: definitions.h:595
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

◆ printBcData()

MoFEMErrorCode MoFEM::CubitMeshSets::printBcData ( std::ostream &  os) const

print bc_data int stream given by os

f.e. it->printBcData(cout), i.e. printing to standard output f.e. it->printBcData(std::cerr), i.e. printing to standard error output

Definition at line 270 of file BCMultiIndices.cpp.

270  {
272  std::vector<char> bc_data;
273  CHKERR getBcData(bc_data);
274  os << "bc_data = ";
275  std::vector<char>::iterator vit = bc_data.begin();
276  for (; vit != bc_data.end(); vit++) {
277  os << std::hex << (int)((unsigned char)*vit) << " ";
278  }
279  os << ": ";
280  vit = bc_data.begin();
281  for (; vit != bc_data.end(); vit++) {
282  os << *vit;
283  }
284  os << std::endl;
286 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
#define CHKERR
Inline error check.
Definition: definitions.h:595
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406
MoFEMErrorCode getBcData(std::vector< char > &bc_data) const
get bc_data vector from MoFEM database

◆ printBlockHeaderData()

MoFEMErrorCode MoFEM::CubitMeshSets::printBlockHeaderData ( std::ostream &  os) const

print material_data int stream given by os

f.e. it->print_Cubit_material_data(cout), i.e. printing to standard output f.e. it->print_Cubit_material_data(std::cerr), i.e. printing to standard error output

Definition at line 193 of file BCMultiIndices.cpp.

193  {
195  if (tag_block_header_data != nullptr) {
196  std::vector<unsigned int> material_data;
197  getBlockHeaderData(material_data);
198  os << "block_header_data = ";
199  std::vector<unsigned int>::iterator vit = material_data.begin();
200  for (; vit != material_data.end(); vit++) {
201  os << std::hex << (int)((unsigned int)*vit) << " ";
202  }
203  os << ": ";
204  vit = material_data.begin();
205  for (; vit != material_data.end(); vit++) {
206  os << *vit;
207  }
208  os << std::endl;
209  } else {
210  os << "no block header data" << std::endl;
211  }
213 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
MoFEMErrorCode getBlockHeaderData(std::vector< unsigned int > &material_data) const
get block_headers vector from MoFEM database
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406
unsigned int * tag_block_header_data

◆ printName()

MoFEMErrorCode MoFEM::CubitMeshSets::printName ( std::ostream &  os) const

print name of block, sideset etc. (this is set in Cubit setting properties)

e.g. it->printName(cout), i.e. printing to standard output e.g it->printName(std::cerr), i.e. printing to standard error output

Definition at line 223 of file BCMultiIndices.cpp.

223  {
225  std::string name = getName();
226  os << std::endl;
227  os << "Block name: " << name << std::endl;
229 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
std::string getName() const
get name of block, sideset etc. (this is set in Cubit block properties)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

◆ setAttributeDataStructure()

template<class ATTRIBUTE_TYPE >
MoFEMErrorCode MoFEM::CubitMeshSets::setAttributeDataStructure ( const ATTRIBUTE_TYPE &  data)

fill meshset data with data on structure

Definition at line 294 of file BCMultiIndices.hpp.

294  {
296 
297  if ((cubitBcType & data.getType()).none()) {
298  SETERRQ(PETSC_COMM_SELF, 1,
299  "attributes are not for ATTRIBUTE_TYPE structure");
300  }
301  double *ptr = const_cast<double *>(tag_block_attributes);
302  ierr = data.set_data(ptr, 8 * tag_block_attributes_size);
303  CHKERRG(ierr);
305  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:543
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507

◆ setAttributes()

MoFEMErrorCode MoFEM::CubitMeshSets::setAttributes ( moab::Interface &  moab,
const std::vector< double > &  attributes 
)

cet Cubit block attributes

Parameters
attributesis the vector where the block attribute data will be stored

Definition at line 300 of file BCMultiIndices.cpp.

301  {
302 
304  int tag_size[] = {(int)attributes.size()};
305  void const *tag_data[] = {&*attributes.begin()};
306  CHKERR moab.tag_set_by_ptr(thBlockAttribs, &meshset, 1, tag_data, tag_size);
307  CHKERR moab.tag_get_by_ptr(thBlockAttribs, &meshset, 1,
308  (const void **)&tag_block_attributes,
311 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
#define CHKERR
Inline error check.
Definition: definitions.h:595
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

◆ setBcDataStructure()

template<class CUBIT_BC_DATA_TYPE >
MoFEMErrorCode MoFEM::CubitMeshSets::setBcDataStructure ( CUBIT_BC_DATA_TYPE &  data)

Definition at line 323 of file BCMultiIndices.hpp.

323  {
325 
326  char *ptr = const_cast<char *>(tag_bc_data);
327  ierr = data.set_data(ptr, tag_bc_size);
328  CHKERRG(ierr);
330  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:543
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CubitMeshSets e 
)
friend

Definition at line 356 of file BCMultiIndices.cpp.

356  {
357  // get name of cubit meshset
358  std::ostringstream ss;
359  unsigned jj = 0;
360  while (1 << jj != LASTSET_BC) {
361  const CubitBCType jj_bc_type = 1 << jj;
362  if ((e.cubitBcType & jj_bc_type).any()) {
363  string bc_type_name;
364  ss << " " << string(CubitBCNames[jj + 1]);
365  }
366  ++jj;
367  }
368 
369  // push data to stream
370  os << "meshset " << e.meshset << " type" << ss.str();
371  if (e.msId != nullptr)
372  os << " msId " << *(e.msId);
373  if (e.tagName != nullptr) {
374  os << " name " << e.getName();
375  }
376  if (e.tag_block_header_data != nullptr) {
377  os << " block header: ";
378  os << " blockCol = " << e.tag_block_header_data[0];
379  os << " blockMat = " << e.tag_block_header_data[1];
380  os << " blockDimension = " << e.tag_block_header_data[2];
381  }
382  return os;
383 }
std::bitset< 32 > CubitBCType
Definition: Types.hpp:63
static const char *const CubitBCNames[]
Names of types of sets and boundary conditions.
Definition: definitions.h:237

Member Data Documentation

◆ bhTag

Tag MoFEM::CubitMeshSets::bhTag

Definition at line 334 of file BCMultiIndices.hpp.

◆ bhTag_header

Tag MoFEM::CubitMeshSets::bhTag_header

Definition at line 334 of file BCMultiIndices.hpp.

◆ cubitBcType

CubitBCType MoFEM::CubitMeshSets::cubitBcType

type of meshset from cubit NodeSet, BlockSet, SideSet and more

Definition at line 32 of file BCMultiIndices.hpp.

◆ entityNameTag

Tag MoFEM::CubitMeshSets::entityNameTag

Definition at line 334 of file BCMultiIndices.hpp.

◆ meshset

EntityHandle MoFEM::CubitMeshSets::meshset

Definition at line 31 of file BCMultiIndices.hpp.

◆ meshsets_mask

const CubitBCType MoFEM::CubitMeshSets::meshsets_mask

Definition at line 43 of file BCMultiIndices.hpp.

◆ msId

int* MoFEM::CubitMeshSets::msId

cubit meshset ID

Definition at line 36 of file BCMultiIndices.hpp.

◆ nsTag

Tag MoFEM::CubitMeshSets::nsTag

Definition at line 334 of file BCMultiIndices.hpp.

◆ nsTag_data

Tag MoFEM::CubitMeshSets::nsTag_data

Definition at line 334 of file BCMultiIndices.hpp.

◆ ssTag

Tag MoFEM::CubitMeshSets::ssTag

Definition at line 334 of file BCMultiIndices.hpp.

◆ ssTag_data

Tag MoFEM::CubitMeshSets::ssTag_data

Definition at line 334 of file BCMultiIndices.hpp.

◆ tag_bc_data

char* MoFEM::CubitMeshSets::tag_bc_data

Definition at line 37 of file BCMultiIndices.hpp.

◆ tag_bc_size

int MoFEM::CubitMeshSets::tag_bc_size

Definition at line 38 of file BCMultiIndices.hpp.

◆ tag_block_attributes

double* MoFEM::CubitMeshSets::tag_block_attributes

Definition at line 40 of file BCMultiIndices.hpp.

◆ tag_block_attributes_size

int MoFEM::CubitMeshSets::tag_block_attributes_size

Definition at line 41 of file BCMultiIndices.hpp.

◆ tag_block_header_data

unsigned int* MoFEM::CubitMeshSets::tag_block_header_data

Definition at line 39 of file BCMultiIndices.hpp.

◆ tag_handles

std::vector<Tag> MoFEM::CubitMeshSets::tag_handles

vector of tag handles to types of data passed from cubit

Definition at line 35 of file BCMultiIndices.hpp.

◆ tagName

char* MoFEM::CubitMeshSets::tagName

Definition at line 42 of file BCMultiIndices.hpp.

◆ thBlockAttribs

Tag MoFEM::CubitMeshSets::thBlockAttribs

Definition at line 334 of file BCMultiIndices.hpp.


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