v0.14.0
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, cubit_bc_test.cpp, and EshelbianPlasticity.cpp.

Definition at line 139 of file BCData.hpp.

Constructor & Destructor Documentation

◆ ForceCubitBcData()

MoFEM::ForceCubitBcData::ForceCubitBcData ( )
inline

Definition at line 158 of file BCData.hpp.

159  bzero(&data, sizeof(data));
160  }

Member Function Documentation

◆ __attribute__()

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

Definition at line 140 of file BCData.hpp.

140  {
141  char name[5]; //< 5 characters for "Force"
142  char zero[3]; //< 3 zeros
143  double value1; //< Force magnitude
144  double value2; //< Moment magnitude
145  double value3; //< X-component of force direction vector
146  double value4; //< Y-component of force direction vector
147  double value5; //< Z-component of force direction vector
148  double value6; //< X-component of moment direction vector
149  double value7; //< Y-component of moment direction vector
150  double value8; //< Z-component of moment direction vector
151  char zero2; // 0
152  };

◆ fill_data()

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

162  {
164  // Fill data
165  if (bc_data.size() != sizeof(data))
166  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
167  memcpy(&data, &bc_data[0], sizeof(data));
169  }

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 156 of file BCData.hpp.

156 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 155 of file BCData.hpp.

155 { return sizeof(_data_); }

◆ set_data()

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

171  {
173  if (size != sizeof(data)) {
174  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
175  }
176  memcpy(tag_ptr, &data, size);
178  }

Friends And Related Function Documentation

◆ operator<<

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

Print force bc data.

Definition at line 53 of file BCData.cpp.

53  {
54  os << "\n";
55  os << "F o r c e \n \n";
56  os << "Force magnitude: " << e.data.value1 << "\n";
57  os << "Moment magnitude: " << e.data.value2 << "\n";
58  os << "Force direction vector (X-component): " << e.data.value3 << "\n";
59  os << "Force direction vector (Y-component): " << e.data.value4 << "\n";
60  os << "Force direction vector (Z-component): " << e.data.value5 << "\n";
61  os << "Moment direction vector (X-component): " << e.data.value6 << "\n";
62  os << "Moment direction vector (Y-component): " << e.data.value7 << "\n";
63  os << "Moment direction vector (Z-component): " << e.data.value8 << "\n \n";
64  return os;
65 }

Member Data Documentation

◆ data

_data_ MoFEM::ForceCubitBcData::data

Definition at line 152 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
FORCESET
@ FORCESET
Definition: definitions.h:164
MoFEM::ForceCubitBcData::data
_data_ data
Definition: BCData.hpp:152
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