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

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

#include <src/multi_indices/BCData.hpp>

Inheritance diagram for MoFEM::DisplacementCubitBcData:
[legend]
Collaboration diagram for MoFEM::DisplacementCubitBcData:
[legend]

Public Member Functions

struct __attribute__ ((packed)) _data_
 attributes of DisplacementCubitBcData More...
 
std::size_t getSizeOfData () const
 get data structure size More...
 
const void * getDataPtr () const
 get pointer to data structure More...
 
 DisplacementCubitBcData ()
 
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 DisplacementCubitBcData &e)
 Print displacement bc data. More...
 

Detailed Description

Definition of the displacement bc data structure.

Examples
add_cubit_meshsets.cpp, adolc_plasticity.cpp, cubit_bc_test.cpp, dynamic_first_order_con_law.cpp, EshelbianPlasticity.cpp, plastic.cpp, seepage.cpp, and thermo_elastic.cpp.

Definition at line 76 of file BCData.hpp.

Constructor & Destructor Documentation

◆ DisplacementCubitBcData()

MoFEM::DisplacementCubitBcData::DisplacementCubitBcData ( )
inline

Definition at line 106 of file BCData.hpp.

107  bzero(&data, sizeof(data));
108  }

Member Function Documentation

◆ __attribute__()

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

attributes of DisplacementCubitBcData

Definition at line 80 of file BCData.hpp.

80  {
81  char name[12]; //< 12 characters for "Displacement"
82  char pre1; //< Always zero
83  char pre2; //< pre-processing flags for modification of displacement bcs.
84  //They should not affect analysis, i.e. safe to ignore; 1:
85  //smallest combine, 2: average, 3: largest combine, 4: overwrite
86  //or no combination defined (default)
87  char flag1; //< Flag for X-Translation (0: N/A, 1: specified)
88  char flag2; //< Flag for Y-Translation (0: N/A, 1: specified)
89  char flag3; //< Flag for Z-Translation (0: N/A, 1: specified)
90  char flag4; //< Flag for X-Rotation (0: N/A, 1: specified)
91  char flag5; //< Flag for Y-Rotation (0: N/A, 1: specified)
92  char flag6; //< Flag for Z-Rotation (0: N/A, 1: specified)
93  double value1; //< Value for X-Translation
94  double value2; //< Value for Y-Translation
95  double value3; //< Value for Z-Translation
96  double value4; //< Value for X-Rotation
97  double value5; //< Value for Y-Rotation
98  double value6; //< Value for Z-Rotation
99  };

◆ fill_data()

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

110  {
112  // Fill data
113  if (bc_data.size() != sizeof(data))
114  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
115  "data inconsistency %ld != %ld", bc_data.size(), sizeof(data));
116  memcpy(&data, &bc_data[0], sizeof(data));
118  }

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 104 of file BCData.hpp.

104 { return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 103 of file BCData.hpp.

103 { return sizeof(_data_); }

◆ set_data()

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

120  {
122  if (size != sizeof(data)) {
123  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
124  }
125  memcpy(tag_ptr, &data, size);
127  }

Friends And Related Function Documentation

◆ operator<<

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

Print displacement bc data.

Definition at line 10 of file BCData.cpp.

10  {
11  os << "\n";
12  os << "D i s p l a c e m e n t \n \n";
13  os << "Flag for X-Translation (0/1): " << (int)e.data.flag1 << "\n";
14  os << "Flag for Y-Translation (0/1): " << (int)e.data.flag2 << "\n";
15  os << "Flag for Z-Translation (0/1): " << (int)e.data.flag3 << "\n";
16  os << "Flag for X-Rotation (0/1): " << (int)e.data.flag4 << "\n";
17  os << "Flag for Y-Rotation (0/1): " << (int)e.data.flag5 << "\n";
18  os << "Flag for Z-Rotation (0/1): " << (int)e.data.flag6 << "\n \n";
19 
20  if (e.data.flag1 == 1)
21  os << "Displacement magnitude (X-Translation): " << e.data.value1 << "\n";
22  else
23  os << "Displacement magnitude (X-Translation): N/A"
24  << "\n";
25  if (e.data.flag2 == 1)
26  os << "Displacement magnitude (Y-Translation): " << e.data.value2 << "\n";
27  else
28  os << "Displacement magnitude (Y-Translation): N/A"
29  << "\n";
30  if (e.data.flag3 == 1)
31  os << "Displacement magnitude (Z-Translation): " << e.data.value3 << "\n";
32  else
33  os << "Displacement magnitude (Z-Translation): N/A"
34  << "\n";
35  if (e.data.flag4 == 1)
36  os << "Displacement magnitude (X-Rotation): " << e.data.value4 << "\n";
37  else
38  os << "Displacement magnitude (X-Rotation): N/A"
39  << "\n";
40  if (e.data.flag5 == 1)
41  os << "Displacement magnitude (Y-Rotation): " << e.data.value5 << "\n";
42  else
43  os << "Displacement magnitude (Y-Rotation): N/A"
44  << "\n";
45  if (e.data.flag6 == 1)
46  os << "Displacement magnitude (Z-Rotation): " << e.data.value6 << "\n \n";
47  else
48  os << "Displacement magnitude (Z-Rotation): N/A"
49  << "\n \n";
50  return os;
51 }

Member Data Documentation

◆ data

_data_ MoFEM::DisplacementCubitBcData::data
Examples
add_cubit_meshsets.cpp.

Definition at line 99 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:460
DISPLACEMENTSET
@ DISPLACEMENTSET
Definition: definitions.h:163
MoFEM::DisplacementCubitBcData::data
_data_ data
Definition: BCData.hpp:99
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
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:453
convert.int
int
Definition: convert.py:64