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

Constructor & Destructor Documentation

◆ VelocityCubitBcData()

MoFEM::VelocityCubitBcData::VelocityCubitBcData ( )
inline

Definition at line 215 of file BCData.hpp.

216  bzero(&data, sizeof(data));
217  }

Member Function Documentation

◆ __attribute__()

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

Definition at line 190 of file BCData.hpp.

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

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

219  {
221  // Fill data
222  if (bc_data.size() != sizeof(data))
223  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
224  memcpy(&data, &bc_data[0], sizeof(data));
226  }

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 213 of file BCData.hpp.

213 { 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 212 of file BCData.hpp.

212 { 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 228 of file BCData.hpp.

228  {
230  if (size != sizeof(data)) {
231  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
232  }
233  memcpy(tag_ptr, &data, size);
235  }

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 209 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
MoFEM::VelocityCubitBcData::data
_data_ data
Definition: BCData.hpp:209
VELOCITYSET
@ VELOCITYSET
Definition: definitions.h:166
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