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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/system/beams/calculate_strain.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
calculate_strain.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <KokkosBatched_Gemv_Decl.hpp>
4#include <KokkosBlas.hpp>
5#include <Kokkos_Core.hpp>
6
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]>& x0_prime, const ConstView<double[3]>& u_prime,
19 const ConstView<double[4]>& r, const ConstView<double[4]>& r_prime,
20 const View<double[6]>& strain
21 ) {
22 using NoTranspose = KokkosBlas::Trans::NoTranspose;
23 using Default = KokkosBlas::Algo::Gemv::Default;
24 using Gemv = KokkosBlas::SerialGemv<NoTranspose, Default>;
25 using Kokkos::Array;
26
29
31 KokkosBlas::serial_axpy(-1., u_prime, R_x0_prime);
32 KokkosBlas::serial_axpy(-1., x0_prime, R_x0_prime);
33
35 auto E = View<double[3][4]>(E_data.data());
38 auto e2 = View<double[4]>{e2_data.data()};
39 Gemv::invoke(2., E, r_prime, 0., e2);
40
41 strain(0) = -R_x0_prime(0);
42 strain(1) = -R_x0_prime(1);
43 strain(2) = -R_x0_prime(2);
44 strain(3) = e2(0);
45 strain(4) = e2(1);
46 strain(5) = e2(2);
47 }
48};
49} // namespace kynema::beams
Definition beam_quadrature.hpp:16
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:120
KOKKOS_INLINE_FUNCTION void QuaternionDerivative(const Quaternion &q, const Matrix &m)
Computes the derivative of a quaternion and stores the result in a 3x4 matrix.
Definition quaternion_operations.hpp:153
Definition calculate_strain.hpp:11
Kokkos::View< ValueType, DeviceType > View
Definition calculate_strain.hpp:13
static KOKKOS_FUNCTION void invoke(const ConstView< double[3]> &x0_prime, const ConstView< double[3]> &u_prime, const ConstView< double[4]> &r, const ConstView< double[4]> &r_prime, const View< double[6]> &strain)
Definition calculate_strain.hpp:17
typename View< ValueType >::const_type ConstView
Definition calculate_strain.hpp:15