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

Constructor & Destructor Documentation

◆ VelocityCubitBcData()

MoFEM::VelocityCubitBcData::VelocityCubitBcData ( )

Definition at line 225 of file BCData.hpp.

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

Member Function Documentation

◆ __attribute__()

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

Definition at line 200 of file BCData.hpp.

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

◆ fill_data()

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

229  {
231  // Fill data
232  if (bc_data.size() != sizeof(data))
233  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
234  memcpy(&data, &bc_data[0], sizeof(data));
236  }
#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::VelocityCubitBcData::getDataPtr ( ) const
virtual

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 223 of file BCData.hpp.

223 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 222 of file BCData.hpp.

222 { return sizeof(_data_); }

◆ set_data()

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

238  {
240  if (size != sizeof(data)) {
241  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
242  }
243  memcpy(tag_ptr, &data, size);
245  }
#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 VelocityCubitBcData e 
)
friend

Print velocity bc data.

Definition at line 80 of file BCData.cpp.

80  {
81  os << "\n";
82  os << "V e l o c i t y \n \n";
83  if (e.data.flag1 == 1)
84  os << "Velocity magnitude (X-Translation): " << e.data.value1 << "\n";
85  else
86  os << "Velocity magnitude (X-Translation): N/A"
87  << "\n";
88  if (e.data.flag2 == 1)
89  os << "Velocity magnitude (Y-Translation): " << e.data.value2 << "\n";
90  else
91  os << "Velocity magnitude (Y-Translation): N/A"
92  << "\n";
93  if (e.data.flag3 == 1)
94  os << "Velocity magnitude (Z-Translation): " << e.data.value3 << "\n";
95  else
96  os << "Velocity magnitude (Z-Translation): N/A"
97  << "\n";
98  if (e.data.flag4 == 1)
99  os << "Velocity magnitude (X-Rotation): " << e.data.value4 << "\n";
100  else
101  os << "Velocity magnitude (X-Rotation): N/A"
102  << "\n";
103  if (e.data.flag5 == 1)
104  os << "Velocity magnitude (Y-Rotation): " << e.data.value5 << "\n";
105  else
106  os << "Velocity magnitude (Y-Rotation): N/A"
107  << "\n";
108  if (e.data.flag6 == 1)
109  os << "Velocity magnitude (Z-Rotation): " << e.data.value6 << "\n \n";
110  else
111  os << "Velocity magnitude (Z-Rotation): N/A"
112  << "\n \n";
113  return os;
114 }

Member Data Documentation

◆ data

_data_ MoFEM::VelocityCubitBcData::data

Definition at line 219 of file BCData.hpp.


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