v0.8.20
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...
 
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 261 of file BCMultiIndices.hpp.

261  {
263 
264  if ((cubitBcType & data.getType()).none()) {
265  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
266  "attributes are not for ATTRIBUTE_TYPE structure");
267  }
268  std::vector<double> attributes;
269  ierr = getAttributes(attributes);
270  CHKERRG(ierr);
271  ierr = data.fill_data(attributes);
272  CHKERRG(ierr);
274  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:542
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
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 296 of file BCMultiIndices.cpp.

296  {
298  attributes.resize(tag_block_attributes_size);
299  if (tag_block_attributes_size > 0) {
300  copy(&tag_block_attributes[0],
301  &tag_block_attributes[tag_block_attributes_size], attributes.begin());
302  }
304 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ 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 184 of file BCMultiIndices.cpp.

184  {
186  bc_data.resize(tag_bc_size);
187  copy(&tag_bc_data[0], &tag_bc_data[tag_bc_size], bc_data.begin());
189 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ getBcDataStructure()

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

Definition at line 294 of file BCMultiIndices.hpp.

294  {
296 
297  if ((cubitBcType & data.tYpe).none()) {
298  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
299  "bc_data are not for CUBIT_BC_DATA_TYPE structure");
300  }
301  std::vector<char> bc_data;
302  getBcData(bc_data);
303  ierr = data.fill_data(bc_data);
304  CHKERRG(ierr);
306  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:542
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
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 integer

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 191 of file BCMultiIndices.cpp.

192  {
194  material_data.resize(3);
196  material_data.begin());
198 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405
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; }

◆ 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 170 of file BCMultiIndices.cpp.

172  {
174  rval = moab.get_entities_by_type(meshset, type, entities, recursive);
175  if (rval != MB_SUCCESS) {
176  std::ostringstream ss;
177  ss << "bc set " << *this << std::endl;
178  PetscPrintf(PETSC_COMM_WORLD, ss.str().c_str());
179  }
180  CHKERR rval;
182 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:84
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ 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 222 of file BCMultiIndices.cpp.

222  {
223  if (tagName != NULL) {
224  return std::string(tagName);
225  } else {
226  return "NoNameSet";
227  }
228 }

◆ 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:475
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ 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 239 of file BCMultiIndices.cpp.

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

◆ 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 269 of file BCMultiIndices.cpp.

269  {
271  std::vector<char> bc_data;
272  CHKERR getBcData(bc_data);
273  CHKERR getTypeFromBcData(bc_data, type);
275 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define CHKERR
Inline error check.
Definition: definitions.h:594
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:405
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 334 of file BCMultiIndices.cpp.

335  {
337  // See CubitBCType in common.hpp
338  if (name.compare(0, 11, "MAT_ELASTIC") == 0) {
339  type |= MAT_ELASTICSET;
340  } else if (name.compare(0, 11, "MAT_THERMAL") == 0) {
341  type |= MAT_THERMALSET;
342  } else if (name.compare(0, 12, "MAT_MOISTURE") == 0) {
343  type |= MAT_MOISTURESET;
344  } else if (name.compare(0, 10, "MAT_INTERF") == 0) {
345  type |= MAT_INTERFSET;
346  } else if (name.compare(0, 11, "BODY_FORCES") == 0) {
347  type |= BODYFORCESSET;
348  }
349  // To be extended as appropriate
350  else {
351  type |= UNKNOWNNAME;
352  }
354 }
block name is "MAT_MOISTURE"
Definition: definitions.h:224
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
block name is "MAT_THERMAL"
Definition: definitions.h:222
block name is "BODY_FORCES"
Definition: definitions.h:223
block name is "MAT_ELASTIC"
Definition: definitions.h:220
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ 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 356 of file BCMultiIndices.cpp.

356  {
358  std::string name = getName();
359  CHKERR getTypeFromName(name, type);
361 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
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:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ 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 320 of file BCMultiIndices.cpp.

320  {
322  std::vector<double> attributes;
323  CHKERR getAttributes(attributes);
324  os << std::endl;
325  os << "Block attributes" << std::endl;
326  os << "----------------" << std::endl;
327  for (unsigned int ii = 0; ii < attributes.size(); ii++) {
328  os << "attr. no: " << ii + 1 << " value: " << attributes[ii] << std::endl;
329  }
330  os << std::endl;
332 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
MoFEMErrorCode getAttributes(std::vector< double > &attributes) const
get Cubit block attributes
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ 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 277 of file BCMultiIndices.cpp.

277  {
279  std::vector<char> bc_data;
280  CHKERR getBcData(bc_data);
281  os << "bc_data = ";
282  std::vector<char>::iterator vit = bc_data.begin();
283  for (; vit != bc_data.end(); vit++) {
284  os << std::hex << (int)((unsigned char)*vit) << " ";
285  }
286  os << ": ";
287  vit = bc_data.begin();
288  for (; vit != bc_data.end(); vit++) {
289  os << *vit;
290  }
291  os << std::endl;
293 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405
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 200 of file BCMultiIndices.cpp.

200  {
202  if (tag_block_header_data != NULL) {
203  std::vector<unsigned int> material_data;
204  getBlockHeaderData(material_data);
205  os << "block_header_data = ";
206  std::vector<unsigned int>::iterator vit = material_data.begin();
207  for (; vit != material_data.end(); vit++) {
208  os << std::hex << (int)((unsigned int)*vit) << " ";
209  }
210  os << ": ";
211  vit = material_data.begin();
212  for (; vit != material_data.end(); vit++) {
213  os << *vit;
214  }
215  os << std::endl;
216  } else {
217  os << "no block header data" << std::endl;
218  }
220 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
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:405
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 230 of file BCMultiIndices.cpp.

230  {
232  std::string name = getName();
233  os << std::endl;
234  os << "Block name: " << name << std::endl;
236 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
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:405

◆ setAttributeDataStructure()

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

fill meshset data with data on structure

Definition at line 280 of file BCMultiIndices.hpp.

280  {
282 
283  if ((cubitBcType & data.getType()).none()) {
284  SETERRQ(PETSC_COMM_SELF, 1,
285  "attributes are not for ATTRIBUTE_TYPE structure");
286  }
287  double *ptr = const_cast<double *>(tag_block_attributes);
288  ierr = data.set_data(ptr, 8 * tag_block_attributes_size);
289  CHKERRG(ierr);
291  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:542
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506

◆ 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 307 of file BCMultiIndices.cpp.

308  {
309 
311  int tag_size[] = {(int)attributes.size()};
312  void const *tag_data[] = {&*attributes.begin()};
313  CHKERR moab.tag_set_by_ptr(thBlockAttribs, &meshset, 1, tag_data, tag_size);
314  CHKERR moab.tag_get_by_ptr(thBlockAttribs, &meshset, 1,
315  (const void **)&tag_block_attributes,
318 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ setBcDataStructure()

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

Definition at line 309 of file BCMultiIndices.hpp.

309  {
311 
312  char *ptr = const_cast<char *>(tag_bc_data);
313  ierr = data.set_data(ptr, tag_bc_size);
314  CHKERRG(ierr);
316  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:542
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 363 of file BCMultiIndices.cpp.

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

Member Data Documentation

◆ bhTag

Tag MoFEM::CubitMeshSets::bhTag

Definition at line 320 of file BCMultiIndices.hpp.

◆ bhTag_header

Tag MoFEM::CubitMeshSets::bhTag_header

Definition at line 320 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 320 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 320 of file BCMultiIndices.hpp.

◆ nsTag_data

Tag MoFEM::CubitMeshSets::nsTag_data

Definition at line 320 of file BCMultiIndices.hpp.

◆ ssTag

Tag MoFEM::CubitMeshSets::ssTag

Definition at line 320 of file BCMultiIndices.hpp.

◆ ssTag_data

Tag MoFEM::CubitMeshSets::ssTag_data

Definition at line 320 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 320 of file BCMultiIndices.hpp.


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