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

Definition of the temperature bc data structure. More...

#include <src/multi_indices/BCData.hpp>

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

Detailed Description

Definition of the temperature bc data structure.

Examples:
cubit_bc_test.cpp.

Definition at line 311 of file BCData.hpp.

Constructor & Destructor Documentation

◆ TemperatureCubitBcData()

MoFEM::TemperatureCubitBcData::TemperatureCubitBcData ( )

Definition at line 335 of file BCData.hpp.

335  :
337  bzero(&data,sizeof(data));
338  }
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:76

Member Function Documentation

◆ __attribute__()

struct MoFEM::TemperatureCubitBcData::__attribute__ ( (packed)  )

Definition at line 312 of file BCData.hpp.

312  {
313  char name[11]; //< 11 characters for "Temperature"
314  char pre1; //< This is always zero
315  char pre2; //< 0: temperature is not applied on thin shells (default); 1: temperature is applied on thin shells
316  char flag1; //< 0: N/A, 1: temperature value applied (not on thin shells)
317  char flag2; //< 0: N/A, 1: temperature applied on thin shell middle
318  char flag3; //< 0: N/A, 1: thin shell temperature gradient specified
319  char flag4; //< 0: N/A, 1: top thin shell temperature
320  char flag5; //< 0: N/A, 1: bottom thin shell temperature
321  char flag6; //< This is always zero
322  double value1; //< Temperature (default case - no thin shells)
323  double value2; //< Temperature for middle of thin shells
324  double value3; //< Temperature gradient for thin shells
325  double value4; //< Temperature for top of thin shells
326  double value5; //< Temperature for bottom of thin shells
327  double value6; //< This is always zero, i.e. ignore
328  };

◆ fill_data()

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

340  {
342  //Fill data
343  if(bc_data.size()!=sizeof(data)) SETERRQ(PETSC_COMM_SELF,1,"data inconsistency");
344  memcpy(&data, &bc_data[0], sizeof(data));
346  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 333 of file BCData.hpp.

333 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 332 of file BCData.hpp.

332 { return sizeof(_data_); }

◆ set_data()

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

348  {
350  if(size!=sizeof(data)) {
351  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
352  }
353  memcpy(tag_ptr, &data, size);
355  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490

Friends And Related Function Documentation

◆ operator<<

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

Print temperature bc data.

Definition at line 533 of file BCMultiIndices.cpp.

533  {
534  os << "\n";
535  os << "T e m p e r a t u r e \n \n";
536  if (e.data.flag1 == 1)
537  os << "Temperature: " << e.data.value1 << "\n";
538  else
539  os << "Temperature (default case): N/A"
540  << "\n";
541  if (e.data.flag2 == 1)
542  os << "Temperature (thin shell middle): " << e.data.value2 << "\n";
543  else
544  os << "Temperature (thin shell middle): N/A"
545  << "\n";
546  if (e.data.flag3 == 1)
547  os << "Temperature (thin shell gradient): " << e.data.value3 << "\n";
548  else
549  os << "Temperature (thin shell gradient): N/A"
550  << "\n";
551  if (e.data.flag4 == 1)
552  os << "Temperature (thin shell top): " << e.data.value4 << "\n";
553  else
554  os << "Temperature (thin shell top): N/A"
555  << "\n";
556  if (e.data.flag5 == 1)
557  os << "Temperature (thin shell bottom): " << e.data.value5 << "\n \n";
558  else
559  os << "Temperature (thin shell bottom): N/A"
560  << "\n \n";
561  return os;
562 }

Member Data Documentation

◆ data

_data_ MoFEM::TemperatureCubitBcData::data

Definition at line 328 of file BCData.hpp.


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