/home/runner/work/kynema/kynema/kynema/src/system/beams/calculate_inertial_quadrature_point_values.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/system/beams/calculate_inertial_quadrature_point_values.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
calculate_inertial_quadrature_point_values.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <KokkosBatched_Copy_Decl.hpp>
4#include <Kokkos_Core.hpp>
5
13
14namespace kynema::beams {
15
16template <typename DeviceType>
18 template <typename ValueType>
19 using View = Kokkos::View<ValueType, DeviceType>;
20 template <typename ValueType>
22 template <typename ValueType>
23 using LeftView = Kokkos::View<ValueType, Kokkos::LayoutLeft, DeviceType>;
24 template <typename ValueType>
26
27 size_t element;
28
36
42
44 void operator()(size_t qp) const {
45 using Kokkos::ALL;
46 using Kokkos::Array;
47 using Kokkos::subview;
48 using CopyMatrix = KokkosBatched::SerialCopy<>;
49 using CopyVector = KokkosBatched::SerialCopy<KokkosBatched::Trans::NoTranspose, 1>;
50
51 const auto r0_data = Array<double, 4>{
52 qp_r0(element, qp, 0), qp_r0(element, qp, 1), qp_r0(element, qp, 2),
53 qp_r0(element, qp, 3)
54 };
55 auto r_data = Array<double, 4>{};
61
72
73 const auto r0 = ConstView<double[4]>(r0_data.data());
74 const auto r = View<double[4]>(r_data.data());
75 const auto xr = View<double[4]>(xr_data.data());
76 const auto u_ddot = View<double[3]>(u_ddot_data.data());
77 const auto omega = View<double[3]>(omega_data.data());
78 const auto omega_dot = View<double[3]>(omega_dot_data.data());
79
80 const auto eta = View<double[3]>(eta_data.data());
81 const auto eta_tilde = View<double[3][3]>(eta_tilde_data.data());
82 const auto rho = View<double[3][3]>(rho_data.data());
85 const auto FI = View<double[6]>(FI_data.data());
86 const auto FG = View<double[6]>(FG_data.data());
87 const auto Mstar = View<double[6][6]>(Mstar_data.data());
88 const auto Muu = View<double[6][6]>(Muu_data.data());
89 const auto Guu = View<double[6][6]>(Guu_data.data());
90 const auto Kuu = View<double[6][6]>(Kuu_data.data());
91
92 CopyMatrix::invoke(subview(qp_Mstar, element, qp, ALL, ALL), Mstar);
96 );
97
100
101 const auto mass = Muu(0, 0);
102 masses::CalculateEta<DeviceType>(Muu, eta);
104 masses::CalculateRho<DeviceType>(Muu, rho);
105
108
111 );
113
116 );
119 );
120
121 CopyVector::invoke(FI, subview(qp_Fi, qp, ALL));
122 CopyVector::invoke(FG, subview(qp_Fg, qp, ALL));
123 CopyMatrix::invoke(Muu, subview(qp_Muu, qp, ALL, ALL));
124 CopyMatrix::invoke(Guu, subview(qp_Guu, qp, ALL, ALL));
125 CopyMatrix::invoke(Kuu, subview(qp_Kuu, qp, ALL, ALL));
126 }
127};
128
129} // namespace kynema::beams
Definition beam_quadrature.hpp:16
KOKKOS_INLINE_FUNCTION void QuaternionCompose(const Quaternion1 &q1, const Quaternion2 &q2, QuaternionN &qn)
Composes (i.e. multiplies) two quaternions and stores the result in a third quaternion.
Definition quaternion_operations.hpp:204
KOKKOS_INLINE_FUNCTION void VecTilde(const VectorType &vector, const MatrixType &matrix)
Converts a 3x1 vector to a 3x3 skew-symmetric matrix and returns the result.
Definition vector_operations.hpp:11
Definition calculate_inertial_quadrature_point_values.hpp:17
Kokkos::View< ValueType, DeviceType > View
Definition calculate_inertial_quadrature_point_values.hpp:19
typename View< ValueType >::const_type ConstView
Definition calculate_inertial_quadrature_point_values.hpp:21
View< double *[6]> qp_Fg
Definition calculate_inertial_quadrature_point_values.hpp:38
View< double *[6][6]> qp_Guu
Definition calculate_inertial_quadrature_point_values.hpp:40
ConstView< double **[6][6]> qp_Mstar
Definition calculate_inertial_quadrature_point_values.hpp:32
typename LeftView< ValueType >::const_type ConstLeftView
Definition calculate_inertial_quadrature_point_values.hpp:25
ConstView< double *[6]> node_u_ddot
Definition calculate_inertial_quadrature_point_values.hpp:35
View< double *[6][6]> qp_Muu
Definition calculate_inertial_quadrature_point_values.hpp:39
View< double *[6]> qp_Fi
Definition calculate_inertial_quadrature_point_values.hpp:37
ConstView< double[3]> gravity
Definition calculate_inertial_quadrature_point_values.hpp:30
size_t element
Definition calculate_inertial_quadrature_point_values.hpp:27
ConstView< double **[4]> qp_r0
Definition calculate_inertial_quadrature_point_values.hpp:31
View< double *[6][6]> qp_Kuu
Definition calculate_inertial_quadrature_point_values.hpp:41
ConstView< double *[6]> node_u_dot
Definition calculate_inertial_quadrature_point_values.hpp:34
ConstLeftView< double ** > shape_interp
Definition calculate_inertial_quadrature_point_values.hpp:29
ConstView< double *[7]> node_u
Definition calculate_inertial_quadrature_point_values.hpp:33
KOKKOS_FUNCTION void operator()(size_t qp) const
Definition calculate_inertial_quadrature_point_values.hpp:44
Kokkos::View< ValueType, Kokkos::LayoutLeft, DeviceType > LeftView
Definition calculate_inertial_quadrature_point_values.hpp:23
static KOKKOS_FUNCTION void invoke(const ConstLeftView< double * > &shape_interp, const ConstView< double *[7]> &node_u, const ConstView< double *[6]> &node_u_dot, const ConstView< double *[6]> &node_u_ddot, const View< double[4]> &r, const View< double[3]> &u_ddot, const View< double[3]> &omega, const View< double[3]> &omega_dot)
Definition interpolate_to_quadrature_point_for_inertia.hpp:19
static KOKKOS_FUNCTION void invoke(double mass, const ConstView< double[3]> &gravity, const ConstView< double[3][3]> &eta_tilde, const View< double[6]> &FG)
Definition calculate_gravity_force.hpp:15
static KOKKOS_FUNCTION void invoke(double mass, const ConstView< double[3]> &omega, const ConstView< double[3]> &eta, const ConstView< double[3][3]> &rho, const ConstView< double[3][3]> &omega_tilde, const Kokkos::View< double[6][6], DeviceType > &Guu)
Definition calculate_gyroscopic_matrix.hpp:20
static KOKKOS_FUNCTION void invoke(double mass, const ConstView< double[3]> &u_ddot, const ConstView< double[3]> &omega, const ConstView< double[3]> &omega_dot, const ConstView< double[3]> &eta, const ConstView< double[3][3]> &rho, const ConstView< double[3][3]> &omega_tilde, const ConstView< double[3][3]> &omega_dot_tilde, const View< double[6][6]> &Kuu)
Definition calculate_inertia_stiffness_matrix.hpp:19
static KOKKOS_FUNCTION void invoke(double mass, const ConstView< double[3]> &u_ddot, const ConstView< double[3]> &omega, const ConstView< double[3]> &omega_dot, const ConstView< double[3]> &eta, const ConstView< double[3][3]> &eta_tilde, const ConstView< double[3][3]> &rho, const ConstView< double[3][3]> &omega_tilde, const ConstView< double[3][3]> &omega_dot_tilde, const View< double[6]> &FI)
Definition calculate_inertial_force.hpp:16
static KOKKOS_FUNCTION void invoke(const ConstView< double[4]> &xr, const ConstView< double[6][6]> &Cstar, const View< double[6][6]> &Cuu)
Definition rotate_section_matrix.hpp:17