v0.16.3
Loading...
Searching...
No Matches
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
 
std::size_t getSizeOfData () const
 get data structure size
 
const void * getDataPtr () const
 get pointer to data structure
 
 Mat_Thermal ()
 
MoFEMErrorCode fill_data (const std::vector< double > &attributes)
 get data from structure
 
MoFEMErrorCode set_data (void *tag_ptr, unsigned int size) const
 set data on structure
 
- Public Member Functions inherited from MoFEM::GenericAttributeData
virtual const CubitBCType & getType () const
 get data type
 
virtual unsigned int getMinMumberOfAtributes () const
 get minimal number of attributes which blockset has to have
 
 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)
 
unsigned int minNumberOfAtributes
 minimal number of attributes
 

Friends

std::ostream & operator<< (std::ostream &os, const Mat_Thermal &e)
 Print Mat_Elastic data.
 

Detailed Description

Thermal material data structure.

Examples
mofem/atom_tests/add_cubit_meshsets.cpp.

Definition at line 201 of file MaterialBlocks.hpp.

Constructor & Destructor Documentation

◆ Mat_Thermal()

MoFEM::Mat_Thermal::Mat_Thermal ( )
inline

Definition at line 223 of file MaterialBlocks.hpp.

224 bzero(&data, sizeof(data));
225 }
@ MAT_THERMALSET
block name is "MAT_THERMAL"
GenericAttributeData(const CubitBCType type, const unsigned int min_number_of_atributes)

Member Function Documentation

◆ __attribute__()

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

thermal block attributes

< Thermal conductivity

< Heat Capacity

Definition at line 195 of file MaterialBlocks.hpp.

206 {
207 double Conductivity; ///< Thermal conductivity
208 double HeatCapacity; ///< Heat Capacity
209 double User2; // User attribute 2
210 double User3; // User attribute 3
211 double User4; // User attribute 4
212 double User5; // User attribute 5
213 double User6; // User attribute 6
214 double User7; // User attribute 7
215 double User8; // User attribute 8
216 double User9; // User attribute 9
217 };

◆ fill_data()

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

227 {
229 if (attributes.size() < minNumberOfAtributes) {
230 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
231 "Thermal conductivity is not defined. (top tip: check number of "
232 "THERMAL block atributes)");
233 }
234 if (8 * attributes.size() > sizeof(data)) {
235 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
236 "data inconsistency, please review the number of material "
237 "properties defined");
238 }
239 bzero(&data, sizeof(data));
240 memcpy(&data, &attributes[0], 8 * attributes.size());
242 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
unsigned int minNumberOfAtributes
minimal number of attributes

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericAttributeData.

Definition at line 221 of file MaterialBlocks.hpp.

221{ return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericAttributeData.

Definition at line 220 of file MaterialBlocks.hpp.

220{ return sizeof(data); }

◆ set_data()

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

243 {
245 if (size > sizeof(data)) {
246 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
247 "data inconsistency, please review the number of material "
248 "properties defined");
249 }
250 memcpy(tag_ptr, &data, size);
252 }

Friends And Related Symbol Documentation

◆ operator<<

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

Print Mat_Elastic data.

Definition at line 57 of file MaterialBlocks.cpp.

57 {
58 os << std::endl << "Material Properties" << std::endl;
59 os << "-------------------" << std::endl;
60 os << "Conductivity = " << e.data.Conductivity << std::endl;
61 os << "User attribute 1 = " << e.data.HeatCapacity << std::endl;
62 os << "User attribute 2 = " << e.data.User2 << std::endl;
63 os << "User attribute 3 = " << e.data.User3 << std::endl;
64 os << "User attribute 4 = " << e.data.User4 << std::endl;
65 os << "User attribute 5 = " << e.data.User5 << std::endl;
66 os << "User attribute 6 = " << e.data.User6 << std::endl;
67 os << "User attribute 7 = " << e.data.User7 << std::endl;
68 os << "User attribute 8 = " << e.data.User8 << std::endl << std::endl;
69 return os;
70}

Member Data Documentation

◆ data

_data_ MoFEM::Mat_Thermal::data

Definition at line 219 of file MaterialBlocks.hpp.


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