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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/system/beams/calculate_strain_dot.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
calculate_strain_dot.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <KokkosBlas.hpp>
4#include <Kokkos_Core.hpp>
5
8
9namespace kynema::beams {
10template <typename DeviceType>
12 template <typename ValueType>
13 using View = Kokkos::View<ValueType, DeviceType>;
14 template <typename ValueType>
16
18 const ConstView<double[3]>& kappa, const ConstView<double[4]>& r,
19 const ConstView<double[3]>& omega, const ConstView<double[3]>& u_dot_prime,
20 const ConstView<double[3]>& omega_prime, const ConstView<double[3]>& xr_prime,
21 const View<double[6]>& strain_dot
22 ) {
23 using NoTranspose = KokkosBlas::Trans::NoTranspose;
24 // using Transpose = KokkosBlas::Trans::Transpose;
25 using Default = KokkosBlas::Algo::Gemv::Default;
26 using Gemv = KokkosBlas::SerialGemv<NoTranspose, Default>;
27 // using GemvT = KokkosBlas::SerialGemv<Transpose, Default>;
28 using Kokkos::make_pair;
29 using Kokkos::subview;
30
31 auto omega_tilde_data = Kokkos::Array<double, 9>{};
34
35 auto r_xr_prime_data = Kokkos::Array<double, 3>{};
38
39 for (auto component = 0; component < 3; ++component) {
41 }
42 Gemv::invoke(-1., omega_tilde, r_xr_prime, 1., subview(strain_dot, make_pair(0, 3)));
43 for (auto component = 0; component < 3; ++component) {
45 }
46 Gemv::invoke(1., omega_tilde, kappa, 1., subview(strain_dot, make_pair(3, 6)));
47 }
48};
49
50} // namespace kynema::beams
Definition beam_quadrature.hpp:14
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:10
KOKKOS_INLINE_FUNCTION void RotateVectorByQuaternion(const Quaternion &q, const View1 &v, const View2 &v_rot)
Rotates provided vector by provided unit quaternion and returns the result.
Definition quaternion_operations.hpp:34
Definition calculate_strain_dot.hpp:11
typename View< ValueType >::const_type ConstView
Definition calculate_strain_dot.hpp:15
static KOKKOS_FUNCTION void invoke(const ConstView< double[3]> &kappa, const ConstView< double[4]> &r, const ConstView< double[3]> &omega, const ConstView< double[3]> &u_dot_prime, const ConstView< double[3]> &omega_prime, const ConstView< double[3]> &xr_prime, const View< double[6]> &strain_dot)
Definition calculate_strain_dot.hpp:17
Kokkos::View< ValueType, DeviceType > View
Definition calculate_strain_dot.hpp:13