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

Definition at line 306 of file BCData.hpp.

Constructor & Destructor Documentation

◆ TemperatureCubitBcData()

MoFEM::TemperatureCubitBcData::TemperatureCubitBcData ( )
inline

Definition at line 332 of file BCData.hpp.

333  bzero(&data, sizeof(data));
334  }

Member Function Documentation

◆ __attribute__()

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

Definition at line 307 of file BCData.hpp.

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

◆ fill_data()

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

336  {
338  // Fill data
339  if (bc_data.size() > sizeof(data))
340  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
341  "Wrong number of parameters in Cubit %d != %d", bc_data.size(),
342  sizeof(data));
343 
344  // Fix for newer version of Cubit
345  if (bc_data.size() == 58) {
346  std::vector<char> new_bc_data(66, 0);
347  size_t ii = 0;
348  for (; ii != 16; ++ii)
349  new_bc_data[ii] = bc_data[ii];
350  for (; ii != bc_data.size(); ++ii)
351  new_bc_data[ii + 1] = bc_data[ii];
352  memcpy(&data, &new_bc_data[0], new_bc_data.size());
353  } else {
354  memcpy(&data, &bc_data[0], bc_data.size());
355  }
356 
358  }

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 330 of file BCData.hpp.

330 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 329 of file BCData.hpp.

329 { return sizeof(_data_); }

◆ set_data()

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

360  {
362  if (size != sizeof(data)) {
363  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
364  }
365  memcpy(tag_ptr, &data, size);
367  }

Friends And Related Function Documentation

◆ operator<<

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

Print temperature bc data.

Definition at line 139 of file BCData.cpp.

139  {
140  os << "\n";
141  os << "T e m p e r a t u r e \n \n";
142  if (e.data.flag1 == 1)
143  os << "Temperature: " << e.data.value1 << "\n";
144  else
145  os << "Temperature (default case): N/A"
146  << "\n";
147  if (e.data.flag2 == 1)
148  os << "Temperature (thin shell middle): " << e.data.value2 << "\n";
149  else
150  os << "Temperature (thin shell middle): N/A"
151  << "\n";
152  if (e.data.flag3 == 1)
153  os << "Temperature (thin shell gradient): " << e.data.value3 << "\n";
154  else
155  os << "Temperature (thin shell gradient): N/A"
156  << "\n";
157  if (e.data.flag4 == 1)
158  os << "Temperature (thin shell top): " << e.data.value4 << "\n";
159  else
160  os << "Temperature (thin shell top): N/A"
161  << "\n";
162  if (e.data.flag5 == 1)
163  os << "Temperature (thin shell bottom): " << e.data.value5 << "\n \n";
164  else
165  os << "Temperature (thin shell bottom): N/A"
166  << "\n \n";
167  return os;
168 }

Member Data Documentation

◆ data

_data_ MoFEM::TemperatureCubitBcData::data

Definition at line 325 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:447
MoFEM::TemperatureCubitBcData::data
_data_ data
Definition: BCData.hpp:325
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
TEMPERATURESET
@ TEMPERATURESET
Definition: definitions.h:155
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:440