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

Transverse Isotropic material data structure. More...

#include <src/multi_indices/MaterialBlocks.hpp>

Inheritance diagram for MoFEM::Mat_Elastic_TransIso:
[legend]
Collaboration diagram for MoFEM::Mat_Elastic_TransIso:
[legend]

Public Member Functions

struct __attribute__ ((packed)) _data_
 transverse isotropic More...
 
std::size_t getSizeOfData () const
 get data structure size More...
 
const void * getDataPtr () const
 get pointer to data structure More...
 
 Mat_Elastic_TransIso ()
 
MoFEMErrorCode fill_data (const std::vector< double > &attributes)
 get data from structure More...
 
MoFEMErrorCode set_data (void *tag_ptr, unsigned int size) const
 set data on structure More...
 
- Public Member Functions inherited from MoFEM::GenericAttributeData
virtual const CubitBCTypegetType () const
 get data type More...
 
virtual unsigned int getMinMumberOfAtributes () const
 get minimal number of attributes which blockset has to have More...
 
 GenericAttributeData (const CubitBCType type, const unsigned int min_number_of_atributes)
 

Public Attributes

_data_ data
 
- Public Attributes inherited from MoFEM::GenericAttributeData
const CubitBCType tYpe
 Type of data (f.e. MAT_ELATIC) More...
 
unsigned int minNumberOfAtributes
 minimal number of attributes More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Mat_Elastic_TransIso &e)
 Print Mat_Elastic_TransIso data. More...
 

Detailed Description

Transverse Isotropic material data structure.

Examples
add_cubit_meshsets.cpp, and cubit_bc_test.cpp.

Definition at line 371 of file MaterialBlocks.hpp.

Constructor & Destructor Documentation

◆ Mat_Elastic_TransIso()

MoFEM::Mat_Elastic_TransIso::Mat_Elastic_TransIso ( )
inline

Definition at line 388 of file MaterialBlocks.hpp.

389  bzero(&data, sizeof(data));
390  }

Member Function Documentation

◆ __attribute__()

struct MoFEM::Mat_Elastic_TransIso::__attribute__ ( (packed)  )
inline

transverse isotropic

< Young's modulus in xy plane (Ep)

< Young's modulus in z-direction (Ez)

< Poisson's ratio in xy plane (vp)

< Poisson's ratio in z-direction (vpz)

< Shear modulus in z-direction (Gzp)

Definition at line 376 of file MaterialBlocks.hpp.

376  {
377  double Youngp; ///< Young's modulus in xy plane (Ep)
378  double Youngz; ///< Young's modulus in z-direction (Ez)
379  double Poissonp; ///< Poisson's ratio in xy plane (vp)
380  double Poissonpz; ///< Poisson's ratio in z-direction (vpz)
381  double Shearzp; ///< Shear modulus in z-direction (Gzp)
382  };

◆ fill_data()

MoFEMErrorCode MoFEM::Mat_Elastic_TransIso::fill_data ( const std::vector< double > &  attributes)
inlinevirtual

get data from structure

Parameters
attributesvector of doubles
Returns
error code

Reimplemented from MoFEM::GenericAttributeData.

Definition at line 392 of file MaterialBlocks.hpp.

392  {
394  // Fill data
395  if (attributes.size() < minNumberOfAtributes) {
396  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
397  "All material data not defined");
398  }
399  if (8 * attributes.size() != sizeof(data)) {
400  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
401  "data inconsistency, please review the number of material "
402  "properties defined");
403  }
404  memcpy(&data, &attributes[0], sizeof(data));
405  bzero(&data, sizeof(data));
406  memcpy(&data, &attributes[0], 8 * attributes.size());
407 
409  }

◆ getDataPtr()

const void* MoFEM::Mat_Elastic_TransIso::getDataPtr ( ) const
inlinevirtual

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericAttributeData.

Definition at line 386 of file MaterialBlocks.hpp.

386 { return &data; }

◆ getSizeOfData()

std::size_t MoFEM::Mat_Elastic_TransIso::getSizeOfData ( ) const
inlinevirtual

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericAttributeData.

Definition at line 385 of file MaterialBlocks.hpp.

385 { return sizeof(data); }

◆ set_data()

MoFEMErrorCode MoFEM::Mat_Elastic_TransIso::set_data ( void *  tag_ptr,
unsigned int  size 
) const
inlinevirtual

set data on structure

Parameters
tag_ptrpointer to tag on meshset
sizesize of data in bytes
Returns
error code

Reimplemented from MoFEM::GenericAttributeData.

Definition at line 410 of file MaterialBlocks.hpp.

410  {
412  if (size > sizeof(data)) {
413  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
414  "data inconsistency, please review the number of material "
415  "properties defined");
416  }
417  memcpy(tag_ptr, &data, size);
419  }

Friends And Related Function Documentation

◆ operator<<

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

Print Mat_Elastic_TransIso data.

Definition at line 102 of file MaterialBlocks.cpp.

102  {
103  os << std::endl << "Material Properties" << std::endl;
104  os << "-------------------" << std::endl;
105  os << "Young's modulus in xy plane (Ep) = " << e.data.Youngp << std::endl;
106  os << "Young's modulus in z-direction (Ez) = " << e.data.Youngz << std::endl;
107  os << "Poisson's ratio in xy plane (vp) = " << e.data.Poissonp
108  << std::endl;
109  os << "Poisson's ratio in z-direction (vpz) = " << e.data.Poissonpz
110  << std::endl;
111  os << "Shear modulus in z-direction (Gzp) = " << e.data.Shearzp << std::endl
112  << std::endl;
113  return os;
114 }

Member Data Documentation

◆ data

_data_ MoFEM::Mat_Elastic_TransIso::data
Examples
add_cubit_meshsets.cpp.

Definition at line 382 of file MaterialBlocks.hpp.


The documentation for this struct was generated from the following file:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MoFEM::GenericAttributeData::minNumberOfAtributes
unsigned int minNumberOfAtributes
minimal number of attributes
Definition: MaterialBlocks.hpp:52
MoFEM::Mat_Elastic_TransIso::data
_data_ data
Definition: MaterialBlocks.hpp:382
MAT_ELASTICSET
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
Definition: definitions.h:172
MoFEM::GenericAttributeData::GenericAttributeData
GenericAttributeData(const CubitBCType type, const unsigned int min_number_of_atributes)
Definition: MaterialBlocks.hpp:74
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453