v0.8.20
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 326 of file MaterialBlocks.hpp.

Constructor & Destructor Documentation

◆ Block_BodyForces()

MoFEM::Block_BodyForces::Block_BodyForces ( )

Definition at line 347 of file MaterialBlocks.hpp.

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

Member Function Documentation

◆ __attribute__()

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

body forces

Definition at line 331 of file MaterialBlocks.hpp.

331  {
332  double density; ///< material density
333  double acceleration_x; ///< acceleration X
334  double acceleration_y; ///< acceleration Y
335  double acceleration_z; ///< acceleration Z
336  double User4; // User attribute 4
337  double User5; // User attribute 5
338  double User6; // User attribute 6
339  double User7; // User attribute 7
340  double User8; // User attribute 8
341  };

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

349  {
351  if (attributes.size() < minNumberOfAtributes) {
352  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
353  "Material density and/or acceleration is not defined. (top tip: "
354  "check number of THERMAL block atributes)");
355  }
356  if (8 * attributes.size() > sizeof(data)) {
357  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
358  "data inconsistency, please review the number of material "
359  "properties defined");
360  }
361  bzero(&data, sizeof(data));
362  memcpy(&data, &attributes[0], 8 * attributes.size());
364  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
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 345 of file MaterialBlocks.hpp.

345 { 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 344 of file MaterialBlocks.hpp.

344 { 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 365 of file MaterialBlocks.hpp.

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

Friends And Related Function Documentation

◆ operator<<

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

Print Mat_Elastic data.

Definition at line 666 of file BCMultiIndices.cpp.

666  {
667  os << std::endl << "Block Body Forces" << std::endl;
668  os << "-------------------" << std::endl;
669  os << "density = " << e.data.density << std::endl;
670  os << "acceleration_x = " << e.data.acceleration_x << std::endl;
671  os << "acceleration_y = " << e.data.acceleration_y << std::endl;
672  os << "acceleration_z = " << e.data.acceleration_z << std::endl;
673  os << "User attribute 4 = " << e.data.User4 << std::endl;
674  os << "User attribute 5 = " << e.data.User5 << std::endl;
675  os << "User attribute 6 = " << e.data.User6 << std::endl;
676  os << "User attribute 7 = " << e.data.User7 << std::endl;
677  os << "User attribute 8 = " << e.data.User8 << std::endl << std::endl;
678  return os;
679 }

Member Data Documentation

◆ data

_data_ MoFEM::Block_BodyForces::data

Definition at line 341 of file MaterialBlocks.hpp.


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