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

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

#include <src/multi_indices/BCData.hpp>

Inheritance diagram for MoFEM::AccelerationCubitBcData:
[legend]
Collaboration diagram for MoFEM::AccelerationCubitBcData:
[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...
 
 AccelerationCubitBcData ()
 
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 AccelerationCubitBcData &e)
 Print acceleration bc data. More...
 

Detailed Description

Definition of the acceleration bc data structure.

Examples:
cubit_bc_test.cpp.

Definition at line 254 of file BCData.hpp.

Constructor & Destructor Documentation

◆ AccelerationCubitBcData()

MoFEM::AccelerationCubitBcData::AccelerationCubitBcData ( )

Definition at line 278 of file BCData.hpp.

278  :
280  bzero(&data,sizeof(data));
281  }
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:76

Member Function Documentation

◆ __attribute__()

struct MoFEM::AccelerationCubitBcData::__attribute__ ( (packed)  )

Definition at line 255 of file BCData.hpp.

255  {
256  char name[12]; //< 12 characters for "Acceleration"
257  char pre1; //< Always zero
258  char pre2; //< pre-processing flags for modification of displacement bcs. They should not affect analysis, i.e. safe to ignore; 1: smallest combine, 2: average, 3: largest combine, 4: overwrite or no combination defined (default)
259  char flag1; //< Flag for X-Translation (0: N/A, 1: specified)
260  char flag2; //< Flag for Y-Translation (0: N/A, 1: specified)
261  char flag3; //< Flag for Z-Translation (0: N/A, 1: specified)
262  char flag4; //< Flag for X-Rotation (0: N/A, 1: specified)
263  char flag5; //< Flag for Y-Rotation (0: N/A, 1: specified)
264  char flag6; //< Flag for Z-Rotation (0: N/A, 1: specified)
265  double value1; //< Value for X-Translation
266  double value2; //< Value for Y-Translation
267  double value3; //< Value for Z-Translation
268  double value4; //< Value for X-Rotation
269  double value5; //< Value for Y-Rotation
270  double value6; //< Value for Z-Rotation
271  };

◆ fill_data()

MoFEMErrorCode MoFEM::AccelerationCubitBcData::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 283 of file BCData.hpp.

283  {
285  //Fill data
286  if(bc_data.size()!=sizeof(data)) SETERRQ(PETSC_COMM_SELF,1,"data inconsistency");
287  memcpy(&data, &bc_data[0], sizeof(data));
289  }
#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

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 276 of file BCData.hpp.

276 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 275 of file BCData.hpp.

275 { return sizeof(_data_); }

◆ set_data()

MoFEMErrorCode MoFEM::AccelerationCubitBcData::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 291 of file BCData.hpp.

291  {
293  if(size!=sizeof(data)) {
294  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
295  }
296  memcpy(tag_ptr, &data, size);
298  }
#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 AccelerationCubitBcData e 
)
friend

Print acceleration bc data.

Definition at line 478 of file BCMultiIndices.cpp.

478  {
479  os << "\n";
480  os << "A c c e l e r a t i o n \n \n";
481  if (e.data.flag1 == 1)
482  os << "Acceleration magnitude (X-Translation): " << e.data.value1 << "\n";
483  else os << "Acceleration magnitude (X-Translation): N/A" << "\n";
484  if (e.data.flag2 == 1)
485  os << "Acceleration magnitude (Y-Translation): " << e.data.value2 << "\n";
486  else os << "Acceleration magnitude (Y-Translation): N/A" << "\n";
487  if (e.data.flag3 == 1)
488  os << "Acceleration magnitude (Z-Translation): " << e.data.value3 << "\n";
489  else os << "Acceleration magnitude (Z-Translation): N/A" << "\n";
490  if (e.data.flag4 == 1)
491  os << "Acceleration magnitude (X-Rotation): " << e.data.value4 << "\n";
492  else os << "Acceleration magnitude (X-Rotation): N/A" << "\n";
493  if (e.data.flag5 == 1)
494  os << "Acceleration magnitude (Y-Rotation): " << e.data.value5 << "\n";
495  else os << "Acceleration magnitude (Y-Rotation): N/A" << "\n";
496  if (e.data.flag6 == 1)
497  os << "Acceleration magnitude (Z-Rotation): " << e.data.value6 << "\n \n";
498  else os << "Acceleration magnitude (Z-Rotation): N/A" << "\n \n";
499  return os;
500 }

Member Data Documentation

◆ data

_data_ MoFEM::AccelerationCubitBcData::data

Definition at line 271 of file BCData.hpp.


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