v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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 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 ()
 

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. More...
 

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. More...
 

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
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
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: