v0.13.1
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
MoFEM::PressureCubitBcData Struct Reference

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

#include <src/multi_indices/BCData.hpp>

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

Detailed Description

Definition of the pressure bc data structure.

Examples
add_cubit_meshsets.cpp, and cubit_bc_test.cpp.

Definition at line 374 of file BCData.hpp.

Constructor & Destructor Documentation

◆ PressureCubitBcData()

MoFEM::PressureCubitBcData::PressureCubitBcData ( )
inline

Definition at line 389 of file BCData.hpp.

390 bzero(&data, sizeof(data));
391 }
@ PRESSURESET
Definition: definitions.h:152
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:63

Member Function Documentation

◆ __attribute__()

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

Definition at line 366 of file BCData.hpp.

375 {
376 char name[8]; //< 8 characters for "Pressure"
377 char flag1; //< This is always zero
378 char flag2; //< 0: Pressure is interpreted as pure pressure 1: pressure is
379 //interpreted as total force
380 double value1; //< Pressure value
381 char zero; //< This is always zero
382 };

◆ fill_data()

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

393 {
395 // Fill data
396 if (bc_data.size() != sizeof(data)) {
397 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
398 }
399 memcpy(&data, &bc_data[0], sizeof(data));
401 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
#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::PressureCubitBcData::getDataPtr ( ) const
inlinevirtual

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 387 of file BCData.hpp.

387{ return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 386 of file BCData.hpp.

386{ return sizeof(_data_); }

◆ set_data()

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

403 {
405 if (size != sizeof(data)) {
406 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
407 }
408 memcpy(tag_ptr, &data, size);
410 }

Friends And Related Function Documentation

◆ operator<<

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

Print pressure bc data.

Definition at line 170 of file BCData.cpp.

170 {
171 os << "\n";
172 os << "P r e s s u r e \n \n";
173 os << "Pressure flag2: " << (int)e.data.flag2 << "\n";
174 os << "Pressure value: " << e.data.value1 << "\n \n";
175 return os;
176}

Member Data Documentation

◆ data

_data_ MoFEM::PressureCubitBcData::data
Examples
add_cubit_meshsets.cpp.

Definition at line 384 of file BCData.hpp.


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