v0.15.0
Loading...
Searching...
No Matches
MoFEM::DisplacementCubitBcDataWithRotation Struct Reference

A specialized version of DisplacementCubitBcData that includes an additional rotation offset. More...

#include "src/boundary_conditions/EssentialDisplacementCubitBcData.hpp"

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

Public Member Functions

 DisplacementCubitBcDataWithRotation ()
 
- Public Member Functions inherited from MoFEM::DisplacementCubitBcData
struct __attribute__ ((packed)) _data_
 attributes of DisplacementCubitBcData
 
std::size_t getSizeOfData () const
 get data structure size
 
const void * getDataPtr () const
 get pointer to data structure
 
 DisplacementCubitBcData ()
 
MoFEMErrorCode fill_data (const std::vector< char > &bc_data)
 get data from structure
 
MoFEMErrorCode set_data (void *tag_ptr, unsigned int size) const
 set data on structure
 
- Public Member Functions inherited from MoFEM::GenericCubitBcData
virtual const CubitBCTypegetType () const
 get data type
 
 GenericCubitBcData (const CubitBCType type)
 
virtual ~GenericCubitBcData ()
 

Static Public Member Functions

static FTensor::Tensor1< double, 3 > GetRotDisp (const FTensor::Tensor1< double, 3 > &angles, FTensor::Tensor1< double, 3 > coordinates, FTensor::Tensor1< double, 3 > offset=FTensor::Tensor1< double, 3 >{ 0., 0., 0.})
 Calculates the rotated displacement given the rotation angles, coordinates, and an optional offset.
 

Public Attributes

std::array< double, 3 > rotOffset
 
- Public Attributes inherited from MoFEM::DisplacementCubitBcData
_data_ data
 
- Public Attributes inherited from MoFEM::GenericCubitBcData
const CubitBCType tYpe
 Type of boundary condition.
 

Detailed Description

A specialized version of DisplacementCubitBcData that includes an additional rotation offset.

DisplacementCubitBcDataWithRotation extends the DisplacementCubitBcData structure with a rotation offset and a method to calculate the rotated displacement given the rotation angles and coordinates.

Definition at line 24 of file EssentialDisplacementCubitBcData.hpp.

Constructor & Destructor Documentation

◆ DisplacementCubitBcDataWithRotation()

MoFEM::DisplacementCubitBcDataWithRotation::DisplacementCubitBcDataWithRotation ( )
inline

Definition at line 27 of file EssentialDisplacementCubitBcData.hpp.

Member Function Documentation

◆ GetRotDisp()

static FTensor::Tensor1< double, 3 > MoFEM::DisplacementCubitBcDataWithRotation::GetRotDisp ( const FTensor::Tensor1< double, 3 > & angles,
FTensor::Tensor1< double, 3 > coordinates,
FTensor::Tensor1< double, 3 > offset = FTensor::Tensor1<double, 3>{ 0., 0., 0.} )
inlinestatic

Calculates the rotated displacement given the rotation angles, coordinates, and an optional offset.

Parameters
anglesA FTensor::Tensor1 containing the rotation angles.
coordinatesA FTensor::Tensor1 containing the coordinates.
offsetAn optional FTensor::Tensor1 containing the offset (default is {0., 0., 0.}).
Returns
FTensor::Tensor1<double, 3> representing the rotated displacement.

Definition at line 40 of file EssentialDisplacementCubitBcData.hpp.

42 {
43 0., 0., 0.}) {
44
45 FTensor::Index<'i', 3> i;
46 FTensor::Index<'j', 3> j;
47 FTensor::Index<'k', 3> k;
48
49 FTensor::Tensor1<double, 3> rotated_displacement;
50 rotated_displacement(i) = 0;
51
52 auto get_rotation = [&](auto &omega) {
53 FTensor::Tensor2<double, 3, 3> rotation_matrix;
54
56 rotation_matrix(i, j) = kronecker_delta(i, j);
57
58 const double angle = sqrt(omega(i) * omega(i));
59 if (std::abs(angle) < std::numeric_limits<double>::epsilon())
60 return rotation_matrix;
61
63 t_omega(i, j) = FTensor::levi_civita<double>(i, j, k) * omega(k);
64 const double a = sin(angle) / angle;
65 const double sin_squared = sin(angle / 2.) * sin(angle / 2.);
66 const double b = 2. * sin_squared / (angle * angle);
67 rotation_matrix(i, j) += a * t_omega(i, j);
68 rotation_matrix(i, j) += b * t_omega(i, k) * t_omega(k, j);
69
70 return rotation_matrix;
71 };
72
73 auto rotation = get_rotation(angles);
74 FTensor::Tensor1<double, 3> coordinate_distance;
75 coordinate_distance(i) = offset(i) - coordinates(i);
76 rotated_displacement(i) =
77 coordinate_distance(i) - rotation(j, i) * coordinate_distance(j);
78
79 return rotated_displacement;
80 }
constexpr double a
Kronecker Delta class.
constexpr double omega
Save field DOFS on vertices/tags.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.

Member Data Documentation

◆ rotOffset

std::array<double, 3> MoFEM::DisplacementCubitBcDataWithRotation::rotOffset

Definition at line 26 of file EssentialDisplacementCubitBcData.hpp.


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