v0.13.1
Loading...
Searching...
No Matches
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 MoFEMErrorCode fill_data (const std::vector< char > &bc_data)
 get data from structure More...
 
virtual MoFEMErrorCode set_data (void *tag_ptr, unsigned int size) const
 set data on structure More...
 
virtual std::size_t getSizeOfData () const =0
 get data structure size More...
 
virtual const void * getDataPtr () const =0
 get pointer to data structure More...
 
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 134 of file BCData.hpp.

Constructor & Destructor Documentation

◆ ForceCubitBcData()

MoFEM::ForceCubitBcData::ForceCubitBcData ( )
inline

Definition at line 153 of file BCData.hpp.

154 bzero(&data, sizeof(data));
155 }
@ FORCESET
Definition: definitions.h:151
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:63

Member Function Documentation

◆ __attribute__()

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

Definition at line 126 of file BCData.hpp.

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

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

157 {
159 // Fill data
160 if (bc_data.size() != sizeof(data))
161 SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
162 memcpy(&data, &bc_data[0], sizeof(data));
164 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 151 of file BCData.hpp.

151{ 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 150 of file BCData.hpp.

150{ 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 166 of file BCData.hpp.

166 {
168 if (size != sizeof(data)) {
169 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
170 }
171 memcpy(tag_ptr, &data, size);
173 }
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31

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


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