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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/system/beams/calculate_force_FD2.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
calculate_force_FD2.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <KokkosBlas.hpp>
4#include <KokkosBlas1_scal.hpp>
5#include <KokkosBlas1_set.hpp>
6#include <Kokkos_Core.hpp>
7
9
10namespace kynema::beams {
11
12template <typename DeviceType>
14 template <typename ValueType>
15 using View = Kokkos::View<ValueType, DeviceType>;
16 template <typename ValueType>
18
20 const ConstView<double[6][6]>& Duu, const ConstView<double[3]>& xr_prime,
21 const ConstView<double[3]>& u_prime, const ConstView<double[6]>& strain_dot,
22 const View<double[6]>& FD2
23 ) {
24 using NoTranspose = KokkosBlas::Trans::NoTranspose;
25 using Transpose = KokkosBlas::Trans::Transpose;
26 using Default = KokkosBlas::Algo::Gemv::Default;
27 using Gemv = KokkosBlas::SerialGemv<NoTranspose, Default>;
28 using GemvT = KokkosBlas::SerialGemv<Transpose, Default>;
29 using Kokkos::make_pair;
30 using Kokkos::subview;
31
32 auto xr_plus_u_prime_data = Kokkos::Array<double, 3>{};
34 for (auto component = 0; component < 3; ++component) {
36 }
37
38 auto xr_plus_u_prime_tilde_data = Kokkos::Array<double, 9>{};
40
42
43 KokkosBlas::SerialSet::invoke(0., FD2);
44
45 auto eps_kappa_sum_data = Kokkos::Array<double, 3>{};
47
48 const auto eps_dot = subview(strain_dot, make_pair(0, 3));
49 const auto kappa_dot = subview(strain_dot, make_pair(3, 6));
50
51 auto D11 = subview(Duu, make_pair(0, 3), make_pair(0, 3));
52 Gemv::invoke(1., D11, eps_dot, 0., eps_kappa_sum);
53 auto D12 = subview(Duu, make_pair(0, 3), make_pair(3, 6));
54 Gemv::invoke(1., D12, kappa_dot, 1., eps_kappa_sum);
55
56 GemvT::invoke(1., xr_plus_u_prime_tilde, eps_kappa_sum, 0., subview(FD2, make_pair(3, 6)));
57 }
58};
59
60} // 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
Definition calculate_force_FD2.hpp:13
Kokkos::View< ValueType, DeviceType > View
Definition calculate_force_FD2.hpp:15
static KOKKOS_FUNCTION void invoke(const ConstView< double[6][6]> &Duu, const ConstView< double[3]> &xr_prime, const ConstView< double[3]> &u_prime, const ConstView< double[6]> &strain_dot, const View< double[6]> &FD2)
Definition calculate_force_FD2.hpp:19
typename View< ValueType >::const_type ConstView
Definition calculate_force_FD2.hpp:17