v0.14.0
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 247 of file BCData.hpp.

Constructor & Destructor Documentation

◆ AccelerationCubitBcData()

MoFEM::AccelerationCubitBcData::AccelerationCubitBcData ( )
inline

Definition at line 274 of file BCData.hpp.

275  bzero(&data, sizeof(data));
276  }

Member Function Documentation

◆ __attribute__()

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

Definition at line 248 of file BCData.hpp.

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

◆ fill_data()

MoFEMErrorCode MoFEM::AccelerationCubitBcData::fill_data ( const std::vector< char > &  bc_data)
inlinevirtual

get data from structure

Parameters
attributesvector of doubles
Returns
error code

Reimplemented from MoFEM::GenericCubitBcData.

Definition at line 278 of file BCData.hpp.

278  {
280  // Fill data
281  if (bc_data.size() != sizeof(data))
282  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
283  memcpy(&data, &bc_data[0], sizeof(data));
285  }

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 272 of file BCData.hpp.

272 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 271 of file BCData.hpp.

271 { return sizeof(_data_); }

◆ set_data()

MoFEMErrorCode MoFEM::AccelerationCubitBcData::set_data ( void *  tag_ptr,
unsigned int  size 
) const
inlinevirtual

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 287 of file BCData.hpp.

287  {
289  if (size != sizeof(data)) {
290  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
291  }
292  memcpy(tag_ptr, &data, size);
294  }

Friends And Related Function Documentation

◆ operator<<

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

Print acceleration bc data.

Definition at line 103 of file BCData.cpp.

103  {
104  os << "\n";
105  os << "A c c e l e r a t i o n \n \n";
106  if (e.data.flag1 == 1)
107  os << "Acceleration magnitude (X-Translation): " << e.data.value1 << "\n";
108  else
109  os << "Acceleration magnitude (X-Translation): N/A"
110  << "\n";
111  if (e.data.flag2 == 1)
112  os << "Acceleration magnitude (Y-Translation): " << e.data.value2 << "\n";
113  else
114  os << "Acceleration magnitude (Y-Translation): N/A"
115  << "\n";
116  if (e.data.flag3 == 1)
117  os << "Acceleration magnitude (Z-Translation): " << e.data.value3 << "\n";
118  else
119  os << "Acceleration magnitude (Z-Translation): N/A"
120  << "\n";
121  if (e.data.flag4 == 1)
122  os << "Acceleration magnitude (X-Rotation): " << e.data.value4 << "\n";
123  else
124  os << "Acceleration magnitude (X-Rotation): N/A"
125  << "\n";
126  if (e.data.flag5 == 1)
127  os << "Acceleration magnitude (Y-Rotation): " << e.data.value5 << "\n";
128  else
129  os << "Acceleration magnitude (Y-Rotation): N/A"
130  << "\n";
131  if (e.data.flag6 == 1)
132  os << "Acceleration magnitude (Z-Rotation): " << e.data.value6 << "\n \n";
133  else
134  os << "Acceleration magnitude (Z-Rotation): N/A"
135  << "\n \n";
136  return os;
137 }

Member Data Documentation

◆ data

_data_ MoFEM::AccelerationCubitBcData::data

Definition at line 267 of file BCData.hpp.


The documentation for this struct was generated from the following file:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
ACCELERATIONSET
@ ACCELERATIONSET
Definition: definitions.h:167
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::GenericCubitBcData::GenericCubitBcData
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:67
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
MoFEM::AccelerationCubitBcData::data
_data_ data
Definition: BCData.hpp:267