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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/system/beams/calculate_Quu.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
calculate_Quu.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
8namespace kynema::beams {
9
10template <typename DeviceType>
12 template <typename ValueType>
13 using View = Kokkos::View<ValueType, DeviceType>;
14 template <typename ValueType>
16
18 const ConstView<double[6][6]>& Cuu, const ConstView<double[3][3]>& x0pupSS,
19 const ConstView<double[3][3]>& N_tilde, const View<double[6][6]>& Quu
20 ) {
21 using NoTranspose = KokkosBatched::Trans::NoTranspose;
22 using Transpose = KokkosBatched::Trans::Transpose;
23 using Default = KokkosBatched::Algo::Gemm::Default;
24 using GemmNN = KokkosBatched::SerialGemm<NoTranspose, NoTranspose, Default>;
25 using GemmTN = KokkosBatched::SerialGemm<Transpose, NoTranspose, Default>;
26 using Kokkos::Array;
27 using Kokkos::make_pair;
28 using Kokkos::subview;
29
30 auto m1 = Array<double, 9>{};
31 auto M1 = View<double[3][3]>(m1.data());
32 auto C11 = subview(Cuu, make_pair(0, 3), make_pair(0, 3));
33 KokkosBlas::SerialSet::invoke(0., Quu);
34 KokkosBlas::serial_axpy(1., N_tilde, M1);
35 GemmNN::invoke(1., C11, x0pupSS, -1., M1);
36 auto Quu_22 = subview(Quu, make_pair(3, 6), make_pair(3, 6));
37 GemmTN::invoke(1., x0pupSS, M1, 0., Quu_22);
38 }
39};
40} // namespace kynema::beams
Definition beam_quadrature.hpp:16
Definition calculate_Quu.hpp:11
static KOKKOS_FUNCTION void invoke(const ConstView< double[6][6]> &Cuu, const ConstView< double[3][3]> &x0pupSS, const ConstView< double[3][3]> &N_tilde, const View< double[6][6]> &Quu)
Definition calculate_Quu.hpp:17
Kokkos::View< ValueType, DeviceType > View
Definition calculate_Quu.hpp:13
typename View< ValueType >::const_type ConstView
Definition calculate_Quu.hpp:15