v0.13.1
Loading...
Searching...
No Matches
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 MoFEMErrorCode fill_data (const std::vector< char > &bc_data)
 get data from structure More...
 
virtual MoFEMErrorCode set_data (void *tag_ptr, unsigned int size) const
 set data on structure More...
 
virtual std::size_t getSizeOfData () const =0
 get data structure size More...
 
virtual const void * getDataPtr () const =0
 get pointer to data structure More...
 
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 242 of file BCData.hpp.

Constructor & Destructor Documentation

◆ AccelerationCubitBcData()

MoFEM::AccelerationCubitBcData::AccelerationCubitBcData ( )
inline

Definition at line 269 of file BCData.hpp.

270 bzero(&data, sizeof(data));
271 }
@ ACCELERATIONSET
Definition: definitions.h:154
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:63

Member Function Documentation

◆ __attribute__()

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

Definition at line 234 of file BCData.hpp.

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

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

273 {
275 // Fill data
276 if (bc_data.size() != sizeof(data))
277 SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
278 memcpy(&data, &bc_data[0], sizeof(data));
280 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 267 of file BCData.hpp.

267{ 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 266 of file BCData.hpp.

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

282 {
284 if (size != sizeof(data)) {
285 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
286 }
287 memcpy(tag_ptr, &data, size);
289 }
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31

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


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