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

Definition at line 379 of file BCData.hpp.

Constructor & Destructor Documentation

◆ PressureCubitBcData()

MoFEM::PressureCubitBcData::PressureCubitBcData ( )
inline

Definition at line 394 of file BCData.hpp.

395  bzero(&data, sizeof(data));
396  }

Member Function Documentation

◆ __attribute__()

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

Definition at line 380 of file BCData.hpp.

380  {
381  char name[8]; //< 8 characters for "Pressure"
382  char flag1; //< This is always zero
383  char flag2; //< 0: Pressure is interpreted as pure pressure 1: pressure is
384  //interpreted as total force
385  double value1; //< Pressure value
386  char zero; //< This is always zero
387  };

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

398  {
400  // Fill data
401  if (bc_data.size() != sizeof(data)) {
402  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
403  }
404  memcpy(&data, &bc_data[0], sizeof(data));
406  }

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 392 of file BCData.hpp.

392 { 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 391 of file BCData.hpp.

391 { 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 408 of file BCData.hpp.

408  {
410  if (size != sizeof(data)) {
411  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
412  }
413  memcpy(tag_ptr, &data, size);
415  }

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 387 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
PRESSURESET
@ PRESSURESET
Definition: definitions.h:165
MoFEM::PressureCubitBcData::data
_data_ data
Definition: BCData.hpp:387
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
convert.int
int
Definition: convert.py:64