v0.14.0
Public Member Functions | Public Attributes | Friends | List of all members
MoFEM::CfgCubitBcData Struct Reference

Definition of the cfd_bc data structure. More...

#include <src/multi_indices/BCData.hpp>

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

Detailed Description

Definition of the cfd_bc data structure.

Examples
cubit_bc_test.cpp.

Definition at line 480 of file BCData.hpp.

Constructor & Destructor Documentation

◆ CfgCubitBcData()

MoFEM::CfgCubitBcData::CfgCubitBcData ( )
inline

Definition at line 492 of file BCData.hpp.

493  bzero(&data, sizeof(data));
494  }

Member Function Documentation

◆ __attribute__()

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

Definition at line 481 of file BCData.hpp.

481  {
482  char name[6]; //< 6 characters for "cfd_bc"
483  char zero; //< This is always zero
484  char type; //< This is the type of cfd_bc
485  };

◆ fill_data()

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

496  {
498  // Fill data
499  if (bc_data.size() != sizeof(data))
500  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
501  memcpy(&data, &bc_data[0], sizeof(data));
503  }

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 490 of file BCData.hpp.

490 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 489 of file BCData.hpp.

489 { return sizeof(_data_); }

◆ set_data()

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

505  {
507  if (size != sizeof(data)) {
508  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
509  }
510  memcpy(tag_ptr, &data, size);
512  }

Friends And Related Function Documentation

◆ operator<<

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

Print cfd_bc data.

Definition at line 199 of file BCData.cpp.

199  {
200  os << "\n";
201  os << "CFD BC \n \n";
202  return os;
203 }

Member Data Documentation

◆ data

_data_ MoFEM::CfgCubitBcData::data
Examples
cubit_bc_test.cpp.

Definition at line 485 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
convert.type
type
Definition: convert.py:64
MoFEM::CfgCubitBcData::data
_data_ data
Definition: BCData.hpp:485
INTERFACESET
@ INTERFACESET
Definition: definitions.h:170
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