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

Definition of the heat flux bc data structure. More...

#include <src/multi_indices/BCData.hpp>

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

Detailed Description

Definition of the heat flux bc data structure.

Examples
add_cubit_meshsets.cpp, and cubit_bc_test.cpp.

Definition at line 437 of file BCData.hpp.

Constructor & Destructor Documentation

◆ HeatFluxCubitBcData()

MoFEM::HeatFluxCubitBcData::HeatFluxCubitBcData ( )

Definition at line 458 of file BCData.hpp.

459  bzero(&data, sizeof(data));
460  }
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:78

Member Function Documentation

◆ __attribute__()

struct MoFEM::HeatFluxCubitBcData::__attribute__ ( (packed)  )

Definition at line 439 of file BCData.hpp.

439  {
440  char name[8]; //< 8 characters for "HeatFlux" (no space)
441  char pre1; //< This is always zero
442  char pre2; //< 0: heat flux is not applied on thin shells (default); 1: heat
443  //flux is applied on thin shells
444  char flag1; //< 0: N/A, 1: normal heat flux case (i.e. single value, case
445  //without thin shells)
446  char flag2; //< 0: N/A, 1: Thin shell top heat flux specified
447  char flag3; //< 0: N/A, 1: Thin shell bottom heat flux specified
448  double value1; //< Heat flux value for default case (no thin shells)
449  double value2; //< Heat flux (thin shell top)
450  double value3; //< Heat flux (thin shell bottom)
451  };

◆ fill_data()

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

462  {
464  // Fill data
465  if (bc_data.size() != sizeof(data))
466  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
467  memcpy(&data, &bc_data[0], sizeof(data));
469  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:507
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:514

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 456 of file BCData.hpp.

456 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 455 of file BCData.hpp.

455 { return sizeof(_data_); }

◆ set_data()

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

471  {
473  if (size != sizeof(data)) {
474  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
475  }
476  memcpy(tag_ptr, &data, size);
478  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:507
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:514

Friends And Related Function Documentation

◆ operator<<

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

Print heat flux bc data.

Definition at line 191 of file BCData.cpp.

191  {
192  os << "\n";
193  os << "H e a t F l u x \n \n";
194  if (e.data.flag1 == 1)
195  os << "Heat flux value: " << e.data.value1 << "\n";
196  else
197  os << "Heat flux is applied on thin shells"
198  << "\n";
199  if (e.data.flag2 == 1)
200  os << "Heat flux value (thin shell top): " << e.data.value2 << "\n";
201  else
202  os << "Heat flux value (thin shell top): N/A"
203  << "\n";
204  if (e.data.flag3 == 1)
205  os << "Heat flux value (thin shell bottom): " << e.data.value3 << "\n \n";
206  else
207  os << "Heat flux value (thin shell bottom): N/A"
208  << "\n \n";
209  return os;
210 }

Member Data Documentation

◆ data

_data_ MoFEM::HeatFluxCubitBcData::data

Definition at line 451 of file BCData.hpp.


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