v0.8.16
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 222 of file BCData.hpp.

222  :
224  bzero(&data,sizeof(data));
225  }
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:76

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. They should not affect analysis, i.e. safe to ignore; 1: smallest combine, 2: average, 3: largest combine, 4: overwrite or no combination defined (default)
204  char flag1; //< Flag for X-Translation (0: N/A, 1: specified)
205  char flag2; //< Flag for Y-Translation (0: N/A, 1: specified)
206  char flag3; //< Flag for Z-Translation (0: N/A, 1: specified)
207  char flag4; //< Flag for X-Rotation (0: N/A, 1: specified)
208  char flag5; //< Flag for Y-Rotation (0: N/A, 1: specified)
209  char flag6; //< Flag for Z-Rotation (0: N/A, 1: specified)
210  double value1; //< Value for X-Translation
211  double value2; //< Value for Y-Translation
212  double value3; //< Value for Z-Translation
213  double value4; //< Value for X-Rotation
214  double value5; //< Value for Y-Rotation
215  double value6; //< Value for Z-Rotation
216  };

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

227  {
229  //Fill data
230  if(bc_data.size()!=sizeof(data)) SETERRQ(PETSC_COMM_SELF,1,"data inconsistency");
231  memcpy(&data, &bc_data[0], sizeof(data));
233  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 220 of file BCData.hpp.

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

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

235  {
237  if(size!=sizeof(data)) {
238  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
239  }
240  memcpy(tag_ptr, &data, size);
242  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490

Friends And Related Function Documentation

◆ operator<<

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

Print velocity bc data.

Definition at line 461 of file BCMultiIndices.cpp.

461  {
462  os << "\n";
463  os << "V e l o c i t y \n \n";
464  if (e.data.flag1 == 1)
465  os << "Velocity magnitude (X-Translation): " << e.data.value1 << "\n";
466  else
467  os << "Velocity magnitude (X-Translation): N/A"
468  << "\n";
469  if (e.data.flag2 == 1)
470  os << "Velocity magnitude (Y-Translation): " << e.data.value2 << "\n";
471  else
472  os << "Velocity magnitude (Y-Translation): N/A"
473  << "\n";
474  if (e.data.flag3 == 1)
475  os << "Velocity magnitude (Z-Translation): " << e.data.value3 << "\n";
476  else
477  os << "Velocity magnitude (Z-Translation): N/A"
478  << "\n";
479  if (e.data.flag4 == 1)
480  os << "Velocity magnitude (X-Rotation): " << e.data.value4 << "\n";
481  else
482  os << "Velocity magnitude (X-Rotation): N/A"
483  << "\n";
484  if (e.data.flag5 == 1)
485  os << "Velocity magnitude (Y-Rotation): " << e.data.value5 << "\n";
486  else
487  os << "Velocity magnitude (Y-Rotation): N/A"
488  << "\n";
489  if (e.data.flag6 == 1)
490  os << "Velocity magnitude (Z-Rotation): " << e.data.value6 << "\n \n";
491  else
492  os << "Velocity magnitude (Z-Rotation): N/A"
493  << "\n \n";
494  return os;
495 }

Member Data Documentation

◆ data

_data_ MoFEM::VelocityCubitBcData::data

Definition at line 216 of file BCData.hpp.


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