v0.8.17
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 
)

Definition at line 47 of file BCMultiIndices.cpp.

48  : meshset(_meshset), cubitBcType(UNKNOWNSET), msId(NULL), tag_bc_data(NULL),
52 
54  CHKERRABORT(PETSC_COMM_WORLD, ierr);
55  CHKERR moab.tag_get_tags_on_entity(meshset, tag_handles);
56  std::vector<Tag>::iterator tit = tag_handles.begin();
57  for (; tit != tag_handles.end(); tit++) {
58  if (*tit == nsTag || *tit == ssTag || *tit == bhTag) {
59  CHKERR moab.tag_get_by_ptr(*tit, &meshset, 1, (const void **)&msId);
60  }
61  if (*tit == nsTag) {
62  if (*msId != -1) {
64  }
65  }
66  if (*tit == ssTag) {
67  if (*msId != -1) {
69  }
70  }
71  if (*tit == bhTag) {
72  if (*msId != -1) {
74  }
75  }
76  if ((*tit == nsTag_data) || (*tit == ssTag_data)) {
77  CHKERR moab.tag_get_by_ptr(*tit, &meshset, 1, (const void **)&tag_bc_data,
78  &tag_bc_size);
79 
81  if (ierr > 0)
82  THROW_MESSAGE("unrecognized bc_data type");
83  }
84  if (*tit == bhTag_header) {
85  int tag_length;
86  CHKERR moab.tag_get_length(*tit, tag_length);
87  CHKERR moab.tag_get_by_ptr(*tit, &meshset, 1,
88  (const void **)&tag_block_header_data);
89  if (tag_block_header_data[1] > 0)
91  }
92  if (*tit == thBlockAttribs) {
93  CHKERR moab.tag_get_by_ptr(*tit, &meshset, 1,
94  (const void **)&tag_block_attributes,
96  }
97  if (*tit == entityNameTag) {
98  CHKERR moab.tag_get_by_ptr(entityNameTag, &meshset, 1,
99  (const void **)&tagName);
100 
102  if (ierr > 0)
103  THROW_MESSAGE("unrecognized Cubit name type");
104  }
105  }
106 
107  // If BC set has name, unset UNKNOWNNAME
108  if (cubitBcType.to_ulong() &
111  if ((cubitBcType & CubitBCType(UNKNOWNNAME)).any()) {
113  }
114  }
115 }
const CubitBCType meshsets_mask
MoFEMErrorCode getTagsHanlders(Interface &moab)
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:610
std::vector< Tag > tag_handles
vector of tag handles to types of data passed from cubit
std::bitset< 32 > CubitBCType
Definition: Common.hpp:200
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getTypeFromName(const std::string &name, CubitBCType &type) const
Function that returns the CubitBCType type of the block name, sideset name etc.
#define CHKERR
Inline error check.
Definition: definitions.h:586
MoFEMErrorCode getTypeFromBcData(const std::vector< char > &bc_data, CubitBCType &type) const
Function that returns the CubitBCType type of the contents of bc_data.
unsigned int * tag_block_header_data
int * msId
cubit meshset ID

◆ CubitMeshSets() [2/2]

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

Definition at line 116 of file BCMultiIndices.cpp.

118  : cubitBcType(_cubit_bc_type), msId(NULL), tag_bc_data(NULL),
122 
124  CHKERRABORT(PETSC_COMM_WORLD, ierr);
125  CHKERR moab.create_meshset(MESHSET_SET | MESHSET_TRACK_OWNER, meshset);
126  switch (cubitBcType.to_ulong()) {
127  case NODESET:
128  CHKERR moab.tag_set_data(nsTag, &meshset, 1, &_ms_id);
129  CHKERR moab.tag_get_by_ptr(nsTag, &meshset, 1, (const void **)&msId);
130  break;
131  case SIDESET:
132  CHKERR moab.tag_set_data(ssTag, &meshset, 1, &_ms_id);
133  CHKERR moab.tag_get_by_ptr(ssTag, &meshset, 1, (const void **)&msId);
134  break;
135  case BLOCKSET:
136  CHKERR moab.tag_set_data(bhTag, &meshset, 1, &_ms_id);
137  CHKERR moab.tag_get_by_ptr(bhTag, &meshset, 1, (const void **)&msId);
138  break;
139  default: {
140  PetscTraceBackErrorHandler(PETSC_COMM_WORLD, __LINE__, PETSC_FUNCTION_NAME,
141  __FILE__, MOFEM_DATA_INCONSISTENCY,
142  PETSC_ERROR_INITIAL, "Unknow meshset type",
143  PETSC_NULL);
144  PetscMPIAbortErrorHandler(PETSC_COMM_WORLD, __LINE__, PETSC_FUNCTION_NAME,
145  __FILE__, MOFEM_DATA_INCONSISTENCY,
146  PETSC_ERROR_INITIAL, "Unknown meshset type",
147  PETSC_NULL);
148  }
149  }
150 }
const CubitBCType meshsets_mask
MoFEMErrorCode getTagsHanlders(Interface &moab)
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
#define CHKERR
Inline error check.
Definition: definitions.h:586
unsigned int * tag_block_header_data
int * msId
cubit meshset ID

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:491
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:534
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
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 308 of file BCMultiIndices.cpp.

308  {
310  attributes.resize(tag_block_attributes_size);
311  if (tag_block_attributes_size > 0) {
312  copy(&tag_block_attributes[0],
313  &tag_block_attributes[tag_block_attributes_size], attributes.begin());
314  }
316 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

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

196  {
198  bc_data.resize(tag_bc_size);
199  copy(&tag_bc_data[0], &tag_bc_data[tag_bc_size], bc_data.begin());
201 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

◆ 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:491
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:534
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
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 203 of file BCMultiIndices.cpp.

204  {
206  material_data.resize(3);
208  material_data.begin());
210 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404
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

Definition at line 151 of file BCMultiIndices.cpp.

153  {
155  rval =
156  moab.get_entities_by_dimension(meshset, dimension, entities, recursive);
157  if (rval != MB_SUCCESS) {
158  std::ostringstream ss;
159  ss << "bc set " << *this << std::endl;
160  PetscPrintf(PETSC_COMM_WORLD, ss.str().c_str());
161  }
162  CHKERR rval;
164 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Common.hpp:78
#define CHKERR
Inline error check.
Definition: definitions.h:586
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

◆ 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

Definition at line 166 of file BCMultiIndices.cpp.

167  {
169  if ((cubitBcType & CubitBCType(BLOCKSET)).any()) {
170  if (tag_block_header_data != NULL) {
172  entities, recursive);
173  } else {
174  SETERRQ(PETSC_COMM_SELF, 1, "dimension unknown");
175  }
176  }
177  if ((cubitBcType & CubitBCType(NODESET)).any()) {
178  return getMeshsetIdEntitiesByDimension(moab, 0, entities, recursive);
179  }
181 }
MoFEMErrorCode getMeshsetIdEntitiesByDimension(Interface &moab, const int dimension, Range &entities, const bool recursive=false) const
get entities form meshset
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
std::bitset< 32 > CubitBCType
Definition: Common.hpp:200
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404
unsigned int * tag_block_header_data

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

184  {
186  rval = moab.get_entities_by_type(meshset, type, entities, recursive);
187  if (rval != MB_SUCCESS) {
188  std::ostringstream ss;
189  ss << "bc set " << *this << std::endl;
190  PetscPrintf(PETSC_COMM_WORLD, ss.str().c_str());
191  }
192  CHKERR rval;
194 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Common.hpp:78
#define CHKERR
Inline error check.
Definition: definitions.h:586
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

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

234  {
235  if (tagName != NULL) {
236  return std::string(tagName);
237  } else {
238  return "NoNameSet";
239  }
240 }

◆ getTagsHanlders()

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

Definition at line 33 of file BCMultiIndices.cpp.

33  {
35  CHKERR moab.tag_get_handle(DIRICHLET_SET_TAG_NAME, nsTag);
36  CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME, ssTag);
37  CHKERR moab.tag_get_handle(
38  (std::string(DIRICHLET_SET_TAG_NAME) + "__BC_DATA").c_str(), nsTag_data);
39  CHKERR moab.tag_get_handle(
40  (std::string(NEUMANN_SET_TAG_NAME) + "__BC_DATA").c_str(), ssTag_data);
41  CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME, bhTag);
42  CHKERR moab.tag_get_handle(BLOCK_HEADER, bhTag_header);
43  CHKERR moab.tag_get_handle(BLOCK_ATTRIBUTES, thBlockAttribs);
44  CHKERR moab.tag_get_handle(NAME_TAG_NAME, entityNameTag);
46 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
#define CHKERR
Inline error check.
Definition: definitions.h:586
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

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

252  {
254 
255  // See CubitBCType in common.hpp
256  if (bc_data.size() == 0) {
258  }
259 
260  if (strcmp(&bc_data[0], "Displacement") == 0)
261  type |= DISPLACEMENTSET;
262  else if (strcmp(&bc_data[0], "Force") == 0)
263  type |= FORCESET;
264  else if (strcmp(&bc_data[0], "Velocity") == 0)
265  type |= VELOCITYSET;
266  else if (strcmp(&bc_data[0], "Acceleration") == 0)
267  type |= ACCELERATIONSET;
268  else if (strcmp(&bc_data[0], "Temperature") == 0)
269  type |= TEMPERATURESET;
270  else if (strcmp(&bc_data[0], "Pressure") == 0)
271  type |= PRESSURESET;
272  else if (strcmp(&bc_data[0], "HeatFlux") == 0)
273  type |= HEATFLUXSET;
274  else if (strcmp(&bc_data[0], "cfd_bc") == 0)
275  type |= INTERFACESET;
276  else
277  type |= UNKNOWNNAME;
278 
280 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

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

281  {
283  std::vector<char> bc_data;
284  CHKERR getBcData(bc_data);
285  CHKERR getTypeFromBcData(bc_data, type);
287 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
#define CHKERR
Inline error check.
Definition: definitions.h:586
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:404
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 346 of file BCMultiIndices.cpp.

347  {
349  // See CubitBCType in common.hpp
350  if (name.compare(0, 11, "MAT_ELASTIC") == 0) {
351  type |= MAT_ELASTICSET;
352  } else if (name.compare(0, 11, "MAT_THERMAL") == 0) {
353  type |= MAT_THERMALSET;
354  } else if (name.compare(0, 12, "MAT_MOISTURE") == 0) {
355  type |= MAT_MOISTURESET;
356  } else if (name.compare(0, 10, "MAT_INTERF") == 0) {
357  type |= MAT_INTERFSET;
358  } else if (name.compare(0, 11, "BODY_FORCES") == 0) {
359  type |= BODYFORCESSET;
360  }
361  // To be extended as appropriate
362  else {
363  type |= UNKNOWNNAME;
364  }
366 }
block name is "MAT_MOISTURE"
Definition: definitions.h:223
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
block name is "MAT_THERMAL"
Definition: definitions.h:221
block name is "BODY_FORCES"
Definition: definitions.h:222
block name is "MAT_ELASTIC"
Definition: definitions.h:219
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

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

368  {
370  std::string name = getName();
371  CHKERR getTypeFromName(name, type);
373 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
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:586
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

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

332  {
334  std::vector<double> attributes;
335  CHKERR getAttributes(attributes);
336  os << std::endl;
337  os << "Block attributes" << std::endl;
338  os << "----------------" << std::endl;
339  for (unsigned int ii = 0; ii < attributes.size(); ii++) {
340  os << "attr. no: " << ii + 1 << " value: " << attributes[ii] << std::endl;
341  }
342  os << std::endl;
344 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
MoFEMErrorCode getAttributes(std::vector< double > &attributes) const
get Cubit block attributes
#define CHKERR
Inline error check.
Definition: definitions.h:586
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

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

289  {
291  std::vector<char> bc_data;
292  CHKERR getBcData(bc_data);
293  os << "bc_data = ";
294  std::vector<char>::iterator vit = bc_data.begin();
295  for (; vit != bc_data.end(); vit++) {
296  os << std::hex << (int)((unsigned char)*vit) << " ";
297  }
298  os << ": ";
299  vit = bc_data.begin();
300  for (; vit != bc_data.end(); vit++) {
301  os << *vit;
302  }
303  os << std::endl;
305 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
#define CHKERR
Inline error check.
Definition: definitions.h:586
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404
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 212 of file BCMultiIndices.cpp.

212  {
214  if (tag_block_header_data != NULL) {
215  std::vector<unsigned int> material_data;
216  getBlockHeaderData(material_data);
217  os << "block_header_data = ";
218  std::vector<unsigned int>::iterator vit = material_data.begin();
219  for (; vit != material_data.end(); vit++) {
220  os << std::hex << (int)((unsigned int)*vit) << " ";
221  }
222  os << ": ";
223  vit = material_data.begin();
224  for (; vit != material_data.end(); vit++) {
225  os << *vit;
226  }
227  os << std::endl;
228  } else {
229  os << "no block header data" << std::endl;
230  }
232 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
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:404
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 242 of file BCMultiIndices.cpp.

242  {
244  std::string name = getName();
245  os << std::endl;
246  os << "Block name: " << name << std::endl;
248 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
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:404

◆ 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:491
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:534
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

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

320  {
321 
323  int tag_size[] = {(int)attributes.size()};
324  void const *tag_data[] = {&*attributes.begin()};
325  CHKERR moab.tag_set_by_ptr(thBlockAttribs, &meshset, 1, tag_data, tag_size);
326  CHKERR moab.tag_get_by_ptr(thBlockAttribs, &meshset, 1,
327  (const void **)&tag_block_attributes,
330 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
#define CHKERR
Inline error check.
Definition: definitions.h:586
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

◆ 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:491
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:534
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 375 of file BCMultiIndices.cpp.

375  {
376  // get name of cubit meshset
377  std::ostringstream ss;
378  unsigned jj = 0;
379  while (1 << jj != LASTSET_BC) {
380  const CubitBCType jj_bc_type = 1 << jj;
381  if ((e.cubitBcType & jj_bc_type).any()) {
382  string bc_type_name;
383  ss << " " << string(CubitBCNames[jj + 1]);
384  }
385  ++jj;
386  }
387 
388  // push data to stream
389  os << "meshset " << e.meshset << " type" << ss.str();
390  if (e.msId != NULL)
391  os << " msId " << *(e.msId);
392  if (e.tagName != NULL) {
393  os << " name " << e.getName();
394  }
395  if (e.tag_block_header_data != NULL) {
396  os << " block header: ";
397  os << " blockCol = " << e.tag_block_header_data[0];
398  os << " blockMat = " << e.tag_block_header_data[1];
399  os << " blockDimension = " << e.tag_block_header_data[2];
400  }
401  return os;
402 }
std::bitset< 32 > CubitBCType
Definition: Common.hpp:200
static const char *const CubitBCNames[]
Names of types of sets and boundary conditions.
Definition: definitions.h:235

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: