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

Definition of the force bc data structure. More...

#include <src/multi_indices/BCData.hpp>

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

Public Member Functions

struct __attribute__ ((packed)) _data_
 
std::size_t getSizeOfData () const
 get data structure size More...
 
const void * getDataPtr () const
 get pointer to data structure More...
 
 ForceCubitBcData ()
 
MoFEMErrorCode fill_data (const std::vector< char > &bc_data)
 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::GenericCubitBcData
virtual const CubitBCTypegetType () const
 get data type More...
 
 GenericCubitBcData (const CubitBCType type)
 
virtual ~GenericCubitBcData ()
 

Public Attributes

_data_ data
 
- Public Attributes inherited from MoFEM::GenericCubitBcData
const CubitBCType tYpe
 Type of boundary condition. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const ForceCubitBcData &e)
 Print force bc data. More...
 

Detailed Description

Definition of the force bc data structure.

Examples:
cubit_bc_test.cpp.

Definition at line 147 of file BCData.hpp.

Constructor & Destructor Documentation

◆ ForceCubitBcData()

MoFEM::ForceCubitBcData::ForceCubitBcData ( )

Definition at line 166 of file BCData.hpp.

166  :
168  bzero(&data,sizeof(data));
169  }
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:76

Member Function Documentation

◆ __attribute__()

struct MoFEM::ForceCubitBcData::__attribute__ ( (packed)  )

Definition at line 148 of file BCData.hpp.

148  {
149  char name[5]; //< 5 characters for "Force"
150  char zero[3]; //< 3 zeros
151  double value1; //< Force magnitude
152  double value2; //< Moment magnitude
153  double value3; //< X-component of force direction vector
154  double value4; //< Y-component of force direction vector
155  double value5; //< Z-component of force direction vector
156  double value6; //< X-component of moment direction vector
157  double value7; //< Y-component of moment direction vector
158  double value8; //< Z-component of moment direction vector
159  char zero2; // 0
160  };

◆ fill_data()

MoFEMErrorCode MoFEM::ForceCubitBcData::fill_data ( const std::vector< char > &  bc_data)
virtual

get data from structure

Parameters
attributesvector of doubles
Returns
error code

Reimplemented from MoFEM::GenericCubitBcData.

Definition at line 171 of file BCData.hpp.

171  {
173  //Fill data
174  if(bc_data.size()!=sizeof(data)) SETERRQ(PETSC_COMM_SELF,1,"data inconsistency");
175  memcpy(&data, &bc_data[0], sizeof(data));
177  }
#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

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 164 of file BCData.hpp.

164 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 163 of file BCData.hpp.

163 { return sizeof(_data_); }

◆ set_data()

MoFEMErrorCode MoFEM::ForceCubitBcData::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::GenericCubitBcData.

Definition at line 179 of file BCData.hpp.

179  {
181  if(size!=sizeof(data)) {
182  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
183  }
184  memcpy(tag_ptr, &data, size);
186  }
#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 ForceCubitBcData e 
)
friend

Print force bc data.

Definition at line 440 of file BCMultiIndices.cpp.

440  {
441  os << "\n";
442  os << "F o r c e \n \n";
443  os << "Force magnitude: " << e.data.value1 << "\n";
444  os << "Moment magnitude: " << e.data.value2 << "\n";
445  os << "Force direction vector (X-component): " << e.data.value3 << "\n";
446  os << "Force direction vector (Y-component): " << e.data.value4 << "\n";
447  os << "Force direction vector (Z-component): " << e.data.value5 << "\n";
448  os << "Moment direction vector (X-component): " << e.data.value6 << "\n";
449  os << "Moment direction vector (Y-component): " << e.data.value7 << "\n";
450  os << "Moment direction vector (Z-component): " << e.data.value8 << "\n \n";
451  return os;
452 }

Member Data Documentation

◆ data

_data_ MoFEM::ForceCubitBcData::data

Definition at line 160 of file BCData.hpp.


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