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

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