v0.9.1
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 257 of file BCData.hpp.

Constructor & Destructor Documentation

◆ AccelerationCubitBcData()

MoFEM::AccelerationCubitBcData::AccelerationCubitBcData ( )

Definition at line 284 of file BCData.hpp.

285  bzero(&data, sizeof(data));
286  }
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:78

Member Function Documentation

◆ __attribute__()

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

Definition at line 258 of file BCData.hpp.

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

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

288  {
290  // Fill data
291  if (bc_data.size() != sizeof(data))
292  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
293  memcpy(&data, &bc_data[0], sizeof(data));
295  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:506
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 282 of file BCData.hpp.

282 { 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 281 of file BCData.hpp.

281 { 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 297 of file BCData.hpp.

297  {
299  if (size != sizeof(data)) {
300  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
301  }
302  memcpy(tag_ptr, &data, size);
304  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:506
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513

Friends And Related Function Documentation

◆ operator<<

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

Print acceleration bc data.

Definition at line 116 of file BCData.cpp.

116  {
117  os << "\n";
118  os << "A c c e l e r a t i o n \n \n";
119  if (e.data.flag1 == 1)
120  os << "Acceleration magnitude (X-Translation): " << e.data.value1 << "\n";
121  else
122  os << "Acceleration magnitude (X-Translation): N/A"
123  << "\n";
124  if (e.data.flag2 == 1)
125  os << "Acceleration magnitude (Y-Translation): " << e.data.value2 << "\n";
126  else
127  os << "Acceleration magnitude (Y-Translation): N/A"
128  << "\n";
129  if (e.data.flag3 == 1)
130  os << "Acceleration magnitude (Z-Translation): " << e.data.value3 << "\n";
131  else
132  os << "Acceleration magnitude (Z-Translation): N/A"
133  << "\n";
134  if (e.data.flag4 == 1)
135  os << "Acceleration magnitude (X-Rotation): " << e.data.value4 << "\n";
136  else
137  os << "Acceleration magnitude (X-Rotation): N/A"
138  << "\n";
139  if (e.data.flag5 == 1)
140  os << "Acceleration magnitude (Y-Rotation): " << e.data.value5 << "\n";
141  else
142  os << "Acceleration magnitude (Y-Rotation): N/A"
143  << "\n";
144  if (e.data.flag6 == 1)
145  os << "Acceleration magnitude (Z-Rotation): " << e.data.value6 << "\n \n";
146  else
147  os << "Acceleration magnitude (Z-Rotation): N/A"
148  << "\n \n";
149  return os;
150 }

Member Data Documentation

◆ data

_data_ MoFEM::AccelerationCubitBcData::data

Definition at line 277 of file BCData.hpp.


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