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

Thermal material data structure. More...

#include <src/multi_indices/MaterialBlocks.hpp>

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

Public Member Functions

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

Detailed Description

Thermal material data structure.

Definition at line 224 of file MaterialBlocks.hpp.

Constructor & Destructor Documentation

◆ Mat_Thermal()

MoFEM::Mat_Thermal::Mat_Thermal ( )

Definition at line 246 of file MaterialBlocks.hpp.

246  :
248  bzero(&data,sizeof(data));
249  }
GenericAttributeData(const CubitBCType type, const unsigned int min_number_of_atributes)
block name is "MAT_THERMAL"
Definition: definitions.h:238

Member Function Documentation

◆ __attribute__()

struct MoFEM::Mat_Thermal::__attribute__ ( (packed)  )

thermal block attributes

Definition at line 229 of file MaterialBlocks.hpp.

229  {
230  double Conductivity; ///< Thermal conductivity
231  double HeatCapacity; ///< Heat Capacity
232  double User2; // User attribute 2
233  double User3; // User attribute 3
234  double User4; // User attribute 4
235  double User5; // User attribute 5
236  double User6; // User attribute 6
237  double User7; // User attribute 7
238  double User8; // User attribute 8
239  double User9; // User attribute 9
240  };

◆ fill_data()

MoFEMErrorCode MoFEM::Mat_Thermal::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 251 of file MaterialBlocks.hpp.

251  {
253  if(attributes.size()<minNumberOfAtributes) {
254  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"Thermal conductivity is not defined. (top tip: check number of THERMAL block atributes)");
255  }
256  if(8*attributes.size()>sizeof(data)) {
257  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency, please review the number of material properties defined");
258  }
259  bzero(&data,sizeof(data));
260  memcpy(&data, &attributes[0],8*attributes.size());
262  }
#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_Thermal::getDataPtr ( ) const
virtual

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericAttributeData.

Definition at line 244 of file MaterialBlocks.hpp.

244 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericAttributeData.

Definition at line 243 of file MaterialBlocks.hpp.

243 { return sizeof(data); }

◆ set_data()

MoFEMErrorCode MoFEM::Mat_Thermal::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 263 of file MaterialBlocks.hpp.

263  {
265  if(size>sizeof(data)) {
266  SETERRQ(
267  PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency, please review the number of material properties defined");
268  }
269  memcpy(tag_ptr,&data,size);
271  }
#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_Thermal e 
)
friend

Print Mat_Elastic data.

Definition at line 604 of file BCMultiIndices.cpp.

605  {
606  os << std::endl << "Material Properties" << std::endl;
607  os << "-------------------" << std::endl;
608  os << "Conductivity = " << e.data.Conductivity << std::endl;
609  os << "User attribute 1 = " << e.data.HeatCapacity << std::endl;
610  os << "User attribute 2 = " << e.data.User2 << std::endl;
611  os << "User attribute 3 = " << e.data.User3 << std::endl;
612  os << "User attribute 4 = " << e.data.User4 << std::endl;
613  os << "User attribute 5 = " << e.data.User5 << std::endl;
614  os << "User attribute 6 = " << e.data.User6 << std::endl;
615  os << "User attribute 7 = " << e.data.User7 << std::endl;
616  os << "User attribute 8 = " << e.data.User8 << std::endl << std::endl;
617  return os;
618  }

Member Data Documentation

◆ data

_data_ MoFEM::Mat_Thermal::data

Definition at line 240 of file MaterialBlocks.hpp.


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