v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
MoFEM::VelocityCubitBcData Struct Reference

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

#include <src/multi_indices/BCData.hpp>

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

Detailed Description

Definition of the velocity bc data structure.

Examples
cubit_bc_test.cpp.

Definition at line 185 of file BCData.hpp.

Constructor & Destructor Documentation

◆ VelocityCubitBcData()

MoFEM::VelocityCubitBcData::VelocityCubitBcData ( )
inline

Definition at line 211 of file BCData.hpp.

212 bzero(&data, sizeof(data));
213 }
@ VELOCITYSET
Definition: definitions.h:153
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:63

Member Function Documentation

◆ __attribute__()

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

Definition at line 178 of file BCData.hpp.

186 {
187 char name[8]; //< 8 characters for "Velocity"
188 char pre1; //< Always zero
189 char pre2; //< pre-processing flags for modification of displacement bcs.
190 //They should not affect analysis, i.e. safe to ignore; 1:
191 //smallest combine, 2: average, 3: largest combine, 4: overwrite
192 //or no combination defined (default)
193 char flag1; //< Flag for X-Translation (0: N/A, 1: specified)
194 char flag2; //< Flag for Y-Translation (0: N/A, 1: specified)
195 char flag3; //< Flag for Z-Translation (0: N/A, 1: specified)
196 char flag4; //< Flag for X-Rotation (0: N/A, 1: specified)
197 char flag5; //< Flag for Y-Rotation (0: N/A, 1: specified)
198 char flag6; //< Flag for Z-Rotation (0: N/A, 1: specified)
199 double value1; //< Value for X-Translation
200 double value2; //< Value for Y-Translation
201 double value3; //< Value for Z-Translation
202 double value4; //< Value for X-Rotation
203 double value5; //< Value for Y-Rotation
204 double value6; //< Value for Z-Rotation
205 };

◆ fill_data()

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

215 {
217 // Fill data
218 if (bc_data.size() != sizeof(data))
219 SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
220 memcpy(&data, &bc_data[0], sizeof(data));
222 }
#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::VelocityCubitBcData::getDataPtr ( ) const
inlinevirtual

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 209 of file BCData.hpp.

209{ return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 208 of file BCData.hpp.

208{ return sizeof(_data_); }

◆ set_data()

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

224 {
226 if (size != sizeof(data)) {
227 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
228 }
229 memcpy(tag_ptr, &data, size);
231 }
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31

Friends And Related Function Documentation

◆ operator<<

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

Print velocity bc data.

Definition at line 67 of file BCData.cpp.

67 {
68 os << "\n";
69 os << "V e l o c i t y \n \n";
70 if (e.data.flag1 == 1)
71 os << "Velocity magnitude (X-Translation): " << e.data.value1 << "\n";
72 else
73 os << "Velocity magnitude (X-Translation): N/A"
74 << "\n";
75 if (e.data.flag2 == 1)
76 os << "Velocity magnitude (Y-Translation): " << e.data.value2 << "\n";
77 else
78 os << "Velocity magnitude (Y-Translation): N/A"
79 << "\n";
80 if (e.data.flag3 == 1)
81 os << "Velocity magnitude (Z-Translation): " << e.data.value3 << "\n";
82 else
83 os << "Velocity magnitude (Z-Translation): N/A"
84 << "\n";
85 if (e.data.flag4 == 1)
86 os << "Velocity magnitude (X-Rotation): " << e.data.value4 << "\n";
87 else
88 os << "Velocity magnitude (X-Rotation): N/A"
89 << "\n";
90 if (e.data.flag5 == 1)
91 os << "Velocity magnitude (Y-Rotation): " << e.data.value5 << "\n";
92 else
93 os << "Velocity magnitude (Y-Rotation): N/A"
94 << "\n";
95 if (e.data.flag6 == 1)
96 os << "Velocity magnitude (Z-Rotation): " << e.data.value6 << "\n \n";
97 else
98 os << "Velocity magnitude (Z-Rotation): N/A"
99 << "\n \n";
100 return os;
101}

Member Data Documentation

◆ data

_data_ MoFEM::VelocityCubitBcData::data

Definition at line 207 of file BCData.hpp.


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