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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/system/beams/calculate_D_D2.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
calculate_D_D2.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <KokkosBatched_Gemm_Decl.hpp>
4#include <KokkosBlas.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[3]>& xr_prime, const ConstView<double[3]>& u_prime,
21 const ConstView<double[6][6]>& D, const View<double[6][6]>& D_D2
22 ) {
23 using NoTranspose = KokkosBatched::Trans::NoTranspose;
24 using Transpose = KokkosBatched::Trans::Transpose;
25 using Default = KokkosBatched::Algo::Gemm::Default;
26 using GemmTN = KokkosBatched::SerialGemm<Transpose, NoTranspose, Default>;
27 using Kokkos::make_pair;
28 using Kokkos::subview;
29
30 KokkosBlas::SerialSet::invoke(0., D_D2);
31
32 auto xr_u_prime_data = Kokkos::Array<double, 3>{};
34 for (auto component = 0; component < 3; ++component) {
36 }
37 auto tilde_xp_up_data = Kokkos::Array<double, 9>{};
40
41 auto D11 = subview(D, make_pair(0, 3), make_pair(0, 3));
42 auto D_D2_21 = subview(D_D2, make_pair(3, 6), make_pair(0, 3));
43 GemmTN::invoke(1., tilde_xp_up, D11, 0., D_D2_21);
44
45 auto D12 = subview(D, make_pair(0, 3), make_pair(3, 6));
46 auto D_D2_22 = subview(D_D2, make_pair(3, 6), make_pair(3, 6));
47 GemmTN::invoke(1., tilde_xp_up, D12, 0., D_D2_22);
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
Definition calculate_D_D2.hpp:13
Kokkos::View< ValueType, DeviceType > View
Definition calculate_D_D2.hpp:15
typename View< ValueType >::const_type ConstView
Definition calculate_D_D2.hpp:17
static KOKKOS_FUNCTION void invoke(const ConstView< double[3]> &xr_prime, const ConstView< double[3]> &u_prime, const ConstView< double[6][6]> &D, const View< double[6][6]> &D_D2)
Definition calculate_D_D2.hpp:19