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

Linear interface data structure. More...

#include <src/multi_indices/MaterialBlocks.hpp>

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

Public Member Functions

struct __attribute__ ((packed)) _data_
 inteface More...
 
std::size_t getSizeOfData () const
 get data structure size More...
 
const void * getDataPtr () const
 get pointer to data structure More...
 
 Mat_Interf ()
 
virtual MoFEMErrorCode fill_data (const std::vector< double > &attributes)
 get data from structure More...
 
virtual MoFEMErrorCode set_data (void *tag_ptr, unsigned int size) const
 set data on structure More...
 
- Public Member Functions inherited from MoFEM::GenericAttributeData
virtual MoFEMErrorCode fill_data (const std::vector< double > &attributes)
 get data from structure More...
 
virtual MoFEMErrorCode set_data (void *tag_ptr, unsigned int size) const
 set data on structure More...
 
virtual const CubitBCTypegetType () const
 get data type More...
 
virtual unsigned int getMinMumberOfAtributes () const
 get minimal number of attributes which blockset has to have More...
 
virtual std::size_t getSizeOfData () const =0
 get data structure size More...
 
virtual const void * getDataPtr () const =0
 get pointer to data structure 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_Interf &e)
 Print Mat_Interf data. More...
 

Detailed Description

Linear interface data structure.

Examples
cubit_bc_test.cpp.

Definition at line 430 of file MaterialBlocks.hpp.

Constructor & Destructor Documentation

◆ Mat_Interf()

MoFEM::Mat_Interf::Mat_Interf ( )

Definition at line 447 of file MaterialBlocks.hpp.

448 bzero(&data, sizeof(data));
449 }
@ MAT_INTERFSET
Definition: definitions.h:160
GenericAttributeData(const CubitBCType type, const unsigned int min_number_of_atributes)

Member Function Documentation

◆ __attribute__()

struct MoFEM::Mat_Interf::__attribute__ ( (packed)  )

inteface

Definition at line 423 of file MaterialBlocks.hpp.

435 {
436 double alpha; ///< Elastic modulus multiplier
437 double beta; ///< Damage Coupling multiplier between normal and shear
438 ///< (g=sqrt(gn^2 + beta(gt1^2 + gt2^2)))
439 double ft; ///< Maximum stress of crack
440 double Gf; ///< Fracture Energy
441 };

◆ fill_data()

virtual MoFEMErrorCode MoFEM::Mat_Interf::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 451 of file MaterialBlocks.hpp.

451 {
453 // Fill data
454 if (8 * attributes.size() != sizeof(data)) {
455 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
456 "data inconsistency, please review the number of material "
457 "properties defined");
458 }
459 memcpy(&data, &attributes[0], sizeof(data));
461 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
@ 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 ...
Definition: definitions.h:440

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericAttributeData.

Definition at line 445 of file MaterialBlocks.hpp.

445{ return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericAttributeData.

Definition at line 444 of file MaterialBlocks.hpp.

444{ return sizeof(data); }

◆ set_data()

virtual MoFEMErrorCode MoFEM::Mat_Interf::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 462 of file MaterialBlocks.hpp.

462 {
464 if (size > sizeof(data)) {
465 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
466 "data inconsistency, please review the number of material "
467 "properties defined");
468 }
469 memcpy(tag_ptr, &data, size);
471 }

Friends And Related Function Documentation

◆ operator<<

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

Print Mat_Interf data.

Definition at line 116 of file MaterialBlocks.cpp.

116 {
117 os << std::endl << "Material Properties" << std::endl;
118 os << "-------------------" << std::endl;
119 os << "Elastic module = " << e.data.alpha << std::endl << std::endl;
120 os << "Damage coupling = " << e.data.beta << std::endl << std::endl;
121 os << "Strengh = " << e.data.ft << std::endl << std::endl;
122 os << "Fracture energy = " << e.data.Gf << std::endl << std::endl;
123
124 return os;
125}

Member Data Documentation

◆ data

_data_ MoFEM::Mat_Interf::data

Definition at line 443 of file MaterialBlocks.hpp.


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