v0.14.0
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 302 of file BCData.hpp.

Constructor & Destructor Documentation

◆ TemperatureCubitBcData()

MoFEM::TemperatureCubitBcData::TemperatureCubitBcData ( )
inline

Definition at line 328 of file BCData.hpp.

329 bzero(&data, sizeof(data));
330 }
@ 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 294 of file BCData.hpp.

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

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

332 {
334 // Fill data
335 if (bc_data.size() > sizeof(data))
336 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
337 "Wrong number of parameters in Cubit %d != %d", bc_data.size(),
338 sizeof(data));
339
340 // Fix for newer version of Cubit
341 if (bc_data.size() == 58) {
342 std::vector<char> new_bc_data(66, 0);
343 size_t ii = 0;
344 for (; ii != 16; ++ii)
345 new_bc_data[ii] = bc_data[ii];
346 for (; ii != bc_data.size(); ++ii)
347 new_bc_data[ii + 1] = bc_data[ii];
348 memcpy(&data, &new_bc_data[0], new_bc_data.size());
349 } else {
350 memcpy(&data, &bc_data[0], bc_data.size());
351 }
352
354 }
#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 326 of file BCData.hpp.

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

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

356 {
358 if (size != sizeof(data)) {
359 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
360 }
361 memcpy(tag_ptr, &data, size);
363 }

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


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