v0.9.1
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 316 of file BCData.hpp.

Constructor & Destructor Documentation

◆ TemperatureCubitBcData()

MoFEM::TemperatureCubitBcData::TemperatureCubitBcData ( )

Definition at line 342 of file BCData.hpp.

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

Member Function Documentation

◆ __attribute__()

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

Definition at line 317 of file BCData.hpp.

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

◆ 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 346 of file BCData.hpp.

346  {
348  // Fill data
349  if (bc_data.size() > sizeof(data))
350  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
351  "Wrong number of parameters in Cubit %d != %d", bc_data.size(),
352  sizeof(data));
353 
354  // Fix for newer version of Cubit
355  if (bc_data.size() == 58) {
356  std::vector<char> new_bc_data(66, 0);
357  size_t ii = 0;
358  for (; ii != 16; ++ii)
359  new_bc_data[ii] = bc_data[ii];
360  for (; ii != bc_data.size(); ++ii)
361  new_bc_data[ii + 1] = bc_data[ii];
362  memcpy(&data, &new_bc_data[0], new_bc_data.size());
363  } else {
364  memcpy(&data, &bc_data[0], bc_data.size());
365  }
366 
368  }
#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::TemperatureCubitBcData::getDataPtr ( ) const
virtual

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 340 of file BCData.hpp.

340 { 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 339 of file BCData.hpp.

339 { 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 370 of file BCData.hpp.

370  {
372  if (size != sizeof(data)) {
373  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
374  }
375  memcpy(tag_ptr, &data, size);
377  }
#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 TemperatureCubitBcData e 
)
friend

Print temperature bc data.

Definition at line 152 of file BCData.cpp.

152  {
153  os << "\n";
154  os << "T e m p e r a t u r e \n \n";
155  if (e.data.flag1 == 1)
156  os << "Temperature: " << e.data.value1 << "\n";
157  else
158  os << "Temperature (default case): N/A"
159  << "\n";
160  if (e.data.flag2 == 1)
161  os << "Temperature (thin shell middle): " << e.data.value2 << "\n";
162  else
163  os << "Temperature (thin shell middle): N/A"
164  << "\n";
165  if (e.data.flag3 == 1)
166  os << "Temperature (thin shell gradient): " << e.data.value3 << "\n";
167  else
168  os << "Temperature (thin shell gradient): N/A"
169  << "\n";
170  if (e.data.flag4 == 1)
171  os << "Temperature (thin shell top): " << e.data.value4 << "\n";
172  else
173  os << "Temperature (thin shell top): N/A"
174  << "\n";
175  if (e.data.flag5 == 1)
176  os << "Temperature (thin shell bottom): " << e.data.value5 << "\n \n";
177  else
178  os << "Temperature (thin shell bottom): N/A"
179  << "\n \n";
180  return os;
181 }

Member Data Documentation

◆ data

_data_ MoFEM::TemperatureCubitBcData::data

Definition at line 335 of file BCData.hpp.


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