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

Elastic material data structure. More...

#include <src/multi_indices/MaterialBlocks.hpp>

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

Public Member Functions

struct __attribute__ ((packed)) _data_
 block tag data structute More...
 
std::size_t getSizeOfData () const
 get data structure size More...
 
const void * getDataPtr () const
 get pointer to data structure More...
 
 Mat_Elastic ()
 
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 &e)
 Print Mat_Elastic data. More...
 

Detailed Description

Elastic material data structure.

Examples:
cubit_bc_test.cpp.

Definition at line 157 of file MaterialBlocks.hpp.

Constructor & Destructor Documentation

◆ Mat_Elastic()

MoFEM::Mat_Elastic::Mat_Elastic ( )

Definition at line 179 of file MaterialBlocks.hpp.

179  :
181  bzero(&data,sizeof(data));
182  };
GenericAttributeData(const CubitBCType type, const unsigned int min_number_of_atributes)
block name is "MAT_ELASTIC"
Definition: definitions.h:236

Member Function Documentation

◆ __attribute__()

struct MoFEM::Mat_Elastic::__attribute__ ( (packed)  )

block tag data structute

Definition at line 162 of file MaterialBlocks.hpp.

162  {
163  double Young; ///< Young's modulus
164  double Poisson; ///< Poisson's ratio
165  double ThermalExpansion; ///< Thermal expansion
166  double User1; // User attribute 2 // For some models is reserved for density
167  double User2; // User attribute 3
168  double User3; // User attribute 4
169  double User4; // User attribute 5
170  double User5; // User attribute 6
171  double User6; // User attribute 7
172  double User7; // User attribute 8
173  };

◆ fill_data()

MoFEMErrorCode MoFEM::Mat_Elastic::fill_data ( const std::vector< double > &  attributes)
virtual

get data from structure

Parameters
attributesvector of doubles
Returns
error code

Reimplemented from MoFEM::GenericAttributeData.

Definition at line 184 of file MaterialBlocks.hpp.

184  {
186  if(attributes.size()<minNumberOfAtributes) {
187  SETERRQ2(
188  PETSC_COMM_SELF,
190  "Young modulus and/or Poisson ratio is not defined. (top tip: check number of ELASTIC block attributes) %d !< %d",
191  attributes.size(),minNumberOfAtributes
192  );
193  }
194  if(8*attributes.size()>sizeof(data)) {
195  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency, please review the number of material properties defined");
196  }
197  bzero(&data,sizeof(data));
198  memcpy(&data, &attributes[0],8*attributes.size());
200  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
unsigned int minNumberOfAtributes
minimal number of attributes

◆ getDataPtr()

const void* MoFEM::Mat_Elastic::getDataPtr ( ) const
virtual

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericAttributeData.

Definition at line 177 of file MaterialBlocks.hpp.

177 { return &data; }

◆ getSizeOfData()

std::size_t MoFEM::Mat_Elastic::getSizeOfData ( ) const
virtual

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericAttributeData.

Definition at line 176 of file MaterialBlocks.hpp.

176 { return sizeof(data); };

◆ set_data()

MoFEMErrorCode MoFEM::Mat_Elastic::set_data ( void *  tag_ptr,
unsigned int  size 
) const
virtual

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 201 of file MaterialBlocks.hpp.

201  {
203  if(size>sizeof(data)) {
204  SETERRQ(
205  PETSC_COMM_SELF,
207  "data inconsistency, please review the number of material properties defined"
208  );
209  }
210  memcpy(tag_ptr,&data,size);
212  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528

Friends And Related Function Documentation

◆ operator<<

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

Print Mat_Elastic data.

Definition at line 569 of file BCMultiIndices.cpp.

570  {
571  os << std::endl << "Material Properties" << std::endl;
572  os << "-------------------" << std::endl;
573  os << "Young's modulus = " << e.data.Young << std::endl;
574  os << "Poisson's ratio = " << e.data.Poisson << std::endl;
575  os << "Thermal expansion = " << e.data.ThermalExpansion << std::endl;
576  os << "User attribute 1 = " << e.data.User1 << std::endl;
577  os << "User attribute 2 = " << e.data.User2 << std::endl;
578  os << "User attribute 3 = " << e.data.User3 << std::endl;
579  os << "User attribute 4 = " << e.data.User4 << std::endl;
580  os << "User attribute 5 = " << e.data.User5 << std::endl;
581  os << "User attribute 6 = " << e.data.User6 << std::endl;
582  os << "User attribute 7 = " << e.data.User7 << std::endl << std::endl;
583  return os;
584  }

Member Data Documentation

◆ data

_data_ MoFEM::Mat_Elastic::data

Definition at line 173 of file MaterialBlocks.hpp.


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