v0.13.1
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 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 DisplacementCubitBcData &e)
 Print displacement bc data. More...
 

Detailed Description

Definition of the displacement bc data structure.

Examples
add_cubit_meshsets.cpp, and cubit_bc_test.cpp.

Definition at line 87 of file BCData.hpp.

Constructor & Destructor Documentation

◆ DisplacementCubitBcData()

MoFEM::DisplacementCubitBcData::DisplacementCubitBcData ( )

Definition at line 117 of file BCData.hpp.

118 bzero(&data, sizeof(data));
119 }
@ DISPLACEMENTSET
Definition: definitions.h:163
GenericCubitBcData(const CubitBCType type)
Definition: BCData.hpp:78

Member Function Documentation

◆ __attribute__()

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

attributes of DisplacementCubitBcData

Definition at line 80 of file BCData.hpp.

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

◆ fill_data()

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

121 {
123 // Fill data
124 if (bc_data.size() != sizeof(data))
125 SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
126 memcpy(&data, &bc_data[0], sizeof(data));
128 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453

◆ getDataPtr()

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

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericCubitBcData.

Definition at line 115 of file BCData.hpp.

115{ return &data; }

◆ getSizeOfData()

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

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericCubitBcData.

Definition at line 114 of file BCData.hpp.

114{ return sizeof(_data_); }

◆ set_data()

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

130 {
132 if (size != sizeof(data)) {
133 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
134 }
135 memcpy(tag_ptr, &data, size);
137 }
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:44

Friends And Related Function Documentation

◆ operator<<

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

Print displacement bc data.

Definition at line 23 of file BCData.cpp.

23 {
24 os << "\n";
25 os << "D i s p l a c e m e n t \n \n";
26 os << "Flag for X-Translation (0/1): " << (int)e.data.flag1 << "\n";
27 os << "Flag for Y-Translation (0/1): " << (int)e.data.flag2 << "\n";
28 os << "Flag for Z-Translation (0/1): " << (int)e.data.flag3 << "\n";
29 os << "Flag for X-Rotation (0/1): " << (int)e.data.flag4 << "\n";
30 os << "Flag for Y-Rotation (0/1): " << (int)e.data.flag5 << "\n";
31 os << "Flag for Z-Rotation (0/1): " << (int)e.data.flag6 << "\n \n";
32
33 if (e.data.flag1 == 1)
34 os << "Displacement magnitude (X-Translation): " << e.data.value1 << "\n";
35 else
36 os << "Displacement magnitude (X-Translation): N/A"
37 << "\n";
38 if (e.data.flag2 == 1)
39 os << "Displacement magnitude (Y-Translation): " << e.data.value2 << "\n";
40 else
41 os << "Displacement magnitude (Y-Translation): N/A"
42 << "\n";
43 if (e.data.flag3 == 1)
44 os << "Displacement magnitude (Z-Translation): " << e.data.value3 << "\n";
45 else
46 os << "Displacement magnitude (Z-Translation): N/A"
47 << "\n";
48 if (e.data.flag4 == 1)
49 os << "Displacement magnitude (X-Rotation): " << e.data.value4 << "\n";
50 else
51 os << "Displacement magnitude (X-Rotation): N/A"
52 << "\n";
53 if (e.data.flag5 == 1)
54 os << "Displacement magnitude (Y-Rotation): " << e.data.value5 << "\n";
55 else
56 os << "Displacement magnitude (Y-Rotation): N/A"
57 << "\n";
58 if (e.data.flag6 == 1)
59 os << "Displacement magnitude (Z-Rotation): " << e.data.value6 << "\n \n";
60 else
61 os << "Displacement magnitude (Z-Rotation): N/A"
62 << "\n \n";
63 return os;
64}

Member Data Documentation

◆ data

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

Definition at line 112 of file BCData.hpp.


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