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

Body force data structure. More...

#include <src/multi_indices/MaterialBlocks.hpp>

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

Public Member Functions

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

Detailed Description

Body force data structure.

Definition at line 332 of file MaterialBlocks.hpp.

Constructor & Destructor Documentation

◆ Block_BodyForces()

MoFEM::Block_BodyForces::Block_BodyForces ( )

Definition at line 353 of file MaterialBlocks.hpp.

353  :
GenericAttributeData(const CubitBCType type, const unsigned int min_number_of_atributes)
block name is "BODY_FORCES"
Definition: definitions.h:222

Member Function Documentation

◆ __attribute__()

struct MoFEM::Block_BodyForces::__attribute__ ( (packed)  )

body forces

Definition at line 337 of file MaterialBlocks.hpp.

337  {
338  double density; ///< material density
339  double acceleration_x; ///< acceleration X
340  double acceleration_y; ///< acceleration Y
341  double acceleration_z; ///< acceleration Z
342  double User4; // User attribute 4
343  double User5; // User attribute 5
344  double User6; // User attribute 6
345  double User7; // User attribute 7
346  double User8; // User attribute 8
347  };

◆ fill_data()

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

356  {
358  if(attributes.size()<minNumberOfAtributes) {
359  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"Material density and/or acceleration is not defined. (top tip: check number of THERMAL block atributes)");
360  }
361  if(8*attributes.size()>sizeof(data)) {
362  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency, please review the number of material properties defined");
363  }
364  bzero(&data,sizeof(data));
365  memcpy(&data, &attributes[0],8*attributes.size());
367  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490
unsigned int minNumberOfAtributes
minimal number of attributes

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericAttributeData.

Definition at line 351 of file MaterialBlocks.hpp.

351 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericAttributeData.

Definition at line 350 of file MaterialBlocks.hpp.

350 { return sizeof(data); }

◆ set_data()

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

368  {
370  if(size>sizeof(data)) {
371  SETERRQ(PETSC_COMM_SELF,1,
372  "data inconsistency, please review the number of material properties defined");
373  }
374  memcpy(tag_ptr,&data,size);
376  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490

Friends And Related Function Documentation

◆ operator<<

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

Print Mat_Elastic data.

Definition at line 639 of file BCMultiIndices.cpp.

639  {
640  os << std::endl << "Block Body Forces" << std::endl;
641  os << "-------------------" << std::endl;
642  os << "density = " << e.data.density << std::endl;
643  os << "acceleration_x = " << e.data.acceleration_x << std::endl;
644  os << "acceleration_y = " << e.data.acceleration_y << std::endl;
645  os << "acceleration_z = " << e.data.acceleration_z << std::endl;
646  os << "User attribute 4 = " << e.data.User4 << std::endl;
647  os << "User attribute 5 = " << e.data.User5 << std::endl;
648  os << "User attribute 6 = " << e.data.User6 << std::endl;
649  os << "User attribute 7 = " << e.data.User7 << std::endl;
650  os << "User attribute 8 = " << e.data.User8 << std::endl << std::endl;
651  return os;
652 }

Member Data Documentation

◆ data

_data_ MoFEM::Block_BodyForces::data

Definition at line 347 of file MaterialBlocks.hpp.


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