v0.9.1
Public Member Functions | Public Attributes | Friends | List of all members
MoFEM::ForceCubitBcData Struct Reference

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

#include <src/multi_indices/BCData.hpp>

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

Detailed Description

Definition of the force bc data structure.

Examples
add_cubit_meshsets.cpp, and cubit_bc_test.cpp.

Definition at line 149 of file BCData.hpp.

Constructor & Destructor Documentation

◆ ForceCubitBcData()

MoFEM::ForceCubitBcData::ForceCubitBcData ( )

Definition at line 168 of file BCData.hpp.

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

Member Function Documentation

◆ __attribute__()

struct MoFEM::ForceCubitBcData::__attribute__ ( (packed)  )

Definition at line 150 of file BCData.hpp.

150  {
151  char name[5]; //< 5 characters for "Force"
152  char zero[3]; //< 3 zeros
153  double value1; //< Force magnitude
154  double value2; //< Moment magnitude
155  double value3; //< X-component of force direction vector
156  double value4; //< Y-component of force direction vector
157  double value5; //< Z-component of force direction vector
158  double value6; //< X-component of moment direction vector
159  double value7; //< Y-component of moment direction vector
160  double value8; //< Z-component of moment direction vector
161  char zero2; // 0
162  };

◆ fill_data()

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

172  {
174  // Fill data
175  if (bc_data.size() != sizeof(data))
176  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
177  memcpy(&data, &bc_data[0], sizeof(data));
179  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:507
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:514

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 166 of file BCData.hpp.

166 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 165 of file BCData.hpp.

165 { return sizeof(_data_); }

◆ set_data()

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

181  {
183  if (size != sizeof(data)) {
184  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
185  }
186  memcpy(tag_ptr, &data, size);
188  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:507
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:514

Friends And Related Function Documentation

◆ operator<<

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

Print force bc data.

Definition at line 66 of file BCData.cpp.

66  {
67  os << "\n";
68  os << "F o r c e \n \n";
69  os << "Force magnitude: " << e.data.value1 << "\n";
70  os << "Moment magnitude: " << e.data.value2 << "\n";
71  os << "Force direction vector (X-component): " << e.data.value3 << "\n";
72  os << "Force direction vector (Y-component): " << e.data.value4 << "\n";
73  os << "Force direction vector (Z-component): " << e.data.value5 << "\n";
74  os << "Moment direction vector (X-component): " << e.data.value6 << "\n";
75  os << "Moment direction vector (Y-component): " << e.data.value7 << "\n";
76  os << "Moment direction vector (Z-component): " << e.data.value8 << "\n \n";
77  return os;
78 }

Member Data Documentation

◆ data

_data_ MoFEM::ForceCubitBcData::data

Definition at line 162 of file BCData.hpp.


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