v0.8.4
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 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:
cubit_bc_test.cpp.

Definition at line 367 of file BCData.hpp.

Constructor & Destructor Documentation

◆ PressureCubitBcData()

MoFEM::PressureCubitBcData::PressureCubitBcData ( )

Definition at line 381 of file BCData.hpp.

381  :
383  bzero(&data,sizeof(data));
384  }
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:76

Member Function Documentation

◆ __attribute__()

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

Definition at line 368 of file BCData.hpp.

368  {
369  char name[8]; //< 8 characters for "Pressure"
370  char flag1; //< This is always zero
371  char flag2; //< 0: Pressure is interpreted as pure pressure 1: pressure is interpreted as total force
372  double value1; //< Pressure value
373  char zero; //< This is always zero
374  };

◆ fill_data()

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

386  {
388  //Fill data
389  if(bc_data.size()!=sizeof(data)) {
390  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
391  }
392  memcpy(&data, &bc_data[0], sizeof(data));
394  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 379 of file BCData.hpp.

379 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 378 of file BCData.hpp.

378 { return sizeof(_data_); }

◆ set_data()

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

396  {
398  if(size!=sizeof(data)) {
399  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
400  }
401  memcpy(tag_ptr, &data, size);
403  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528

Friends And Related Function Documentation

◆ operator<<

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

Print pressure bc data.

Definition at line 523 of file BCMultiIndices.cpp.

523  {
524  os << "\n";
525  os << "P r e s s u r e \n \n";
526  os << "Pressure flag2: " << (int)e.data.flag2 << "\n";
527  os << "Pressure value: " << e.data.value1 << "\n \n";
528  return os;
529 }

Member Data Documentation

◆ data

_data_ MoFEM::PressureCubitBcData::data

Definition at line 374 of file BCData.hpp.


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