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

Definition at line 427 of file BCData.hpp.

Constructor & Destructor Documentation

◆ HeatFluxCubitBcData()

MoFEM::HeatFluxCubitBcData::HeatFluxCubitBcData ( )
inline

Definition at line 448 of file BCData.hpp.

449  bzero(&data, sizeof(data));
450  }

Member Function Documentation

◆ __attribute__()

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

Definition at line 429 of file BCData.hpp.

429  {
430  char name[8]; //< 8 characters for "HeatFlux" (no space)
431  char pre1; //< This is always zero
432  char pre2; //< 0: heat flux is not applied on thin shells (default); 1: heat
433  //flux is applied on thin shells
434  char flag1; //< 0: N/A, 1: normal heat flux case (i.e. single value, case
435  //without thin shells)
436  char flag2; //< 0: N/A, 1: Thin shell top heat flux specified
437  char flag3; //< 0: N/A, 1: Thin shell bottom heat flux specified
438  double value1; //< Heat flux value for default case (no thin shells)
439  double value2; //< Heat flux (thin shell top)
440  double value3; //< Heat flux (thin shell bottom)
441  };

◆ fill_data()

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

452  {
454  // Fill data
455  if (bc_data.size() != sizeof(data))
456  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
457  memcpy(&data, &bc_data[0], sizeof(data));
459  }

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 446 of file BCData.hpp.

446 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 445 of file BCData.hpp.

445 { return sizeof(_data_); }

◆ set_data()

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

461  {
463  if (size != sizeof(data)) {
464  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
465  }
466  memcpy(tag_ptr, &data, size);
468  }

Friends And Related Function Documentation

◆ operator<<

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

Print heat flux bc data.

Definition at line 178 of file BCData.cpp.

178  {
179  os << "\n";
180  os << "H e a t F l u x \n \n";
181  if (e.data.flag1 == 1)
182  os << "Heat flux value: " << e.data.value1 << "\n";
183  else
184  os << "Heat flux is applied on thin shells"
185  << "\n";
186  if (e.data.flag2 == 1)
187  os << "Heat flux value (thin shell top): " << e.data.value2 << "\n";
188  else
189  os << "Heat flux value (thin shell top): N/A"
190  << "\n";
191  if (e.data.flag3 == 1)
192  os << "Heat flux value (thin shell bottom): " << e.data.value3 << "\n \n";
193  else
194  os << "Heat flux value (thin shell bottom): N/A"
195  << "\n \n";
196  return os;
197 }

Member Data Documentation

◆ data

_data_ MoFEM::HeatFluxCubitBcData::data

Definition at line 441 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
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::GenericCubitBcData::GenericCubitBcData
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:67
MoFEM::HeatFluxCubitBcData::data
_data_ data
Definition: BCData.hpp:441
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
HEATFLUXSET
@ HEATFLUXSET
Definition: definitions.h:169