v0.13.1
Loading...
Searching...
No Matches
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 MoFEMErrorCode fill_data (const std::vector< char > &bc_data)
 get data from structure More...
 
virtual MoFEMErrorCode set_data (void *tag_ptr, unsigned int size) const
 set data on structure More...
 
virtual std::size_t getSizeOfData () const =0
 get data structure size More...
 
virtual const void * getDataPtr () const =0
 get pointer to data structure More...
 
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 301 of file BCData.hpp.

Constructor & Destructor Documentation

◆ TemperatureCubitBcData()

MoFEM::TemperatureCubitBcData::TemperatureCubitBcData ( )
inline

Definition at line 327 of file BCData.hpp.

328 bzero(&data, sizeof(data));
329 }
@ TEMPERATURESET
Definition: definitions.h:155
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:63

Member Function Documentation

◆ __attribute__()

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

Definition at line 293 of file BCData.hpp.

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

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

331 {
333 // Fill data
334 if (bc_data.size() > sizeof(data))
335 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
336 "Wrong number of parameters in Cubit %d != %d", bc_data.size(),
337 sizeof(data));
338
339 // Fix for newer version of Cubit
340 if (bc_data.size() == 58) {
341 std::vector<char> new_bc_data(66, 0);
342 size_t ii = 0;
343 for (; ii != 16; ++ii)
344 new_bc_data[ii] = bc_data[ii];
345 for (; ii != bc_data.size(); ++ii)
346 new_bc_data[ii + 1] = bc_data[ii];
347 memcpy(&data, &new_bc_data[0], new_bc_data.size());
348 } else {
349 memcpy(&data, &bc_data[0], bc_data.size());
350 }
351
353 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 325 of file BCData.hpp.

325{ 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 324 of file BCData.hpp.

324{ 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 355 of file BCData.hpp.

355 {
357 if (size != sizeof(data)) {
358 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
359 }
360 memcpy(tag_ptr, &data, size);
362 }

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


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