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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/system/beams/calculate_system_matrix.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
calculate_system_matrix.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <KokkosBatched_Copy_Decl.hpp>
4#include <KokkosBatched_Gemm_Decl.hpp>
5#include <Kokkos_Core.hpp>
6
7namespace kynema::beams {
8
9template <typename DeviceType>
11 template <typename ValueType>
12 using View = Kokkos::View<ValueType, DeviceType>;
13 template <typename ValueType>
15
16 size_t element;
17 size_t num_nodes;
23
25 void operator()(size_t node_12) const {
26 using Kokkos::ALL;
27 using Kokkos::Array;
28 using Kokkos::subview;
29 using CopyMatrix = KokkosBatched::SerialCopy<>;
30 using NoTranspose = KokkosBatched::Trans::NoTranspose;
31 using Default = KokkosBatched::Algo::Gemm::Default;
32 using Gemm = KokkosBatched::SerialGemm<NoTranspose, NoTranspose, Default>;
33
34 const auto node_1 = node_12 / num_nodes;
35 const auto node_2 = node_12 % num_nodes;
37
41
42 const auto S = View<double[6][6]>(S_data.data());
43 const auto T = View<double[6][6]>(T_data.data());
44 const auto STpI = View<double[6][6]>(STpI_data.data());
45
46 CopyMatrix::invoke(subview(stiffness_matrix_terms, node_1, node_2, ALL, ALL), S);
47 CopyMatrix::invoke(subview(tangent, node_T, ALL, ALL), T);
48 CopyMatrix::invoke(subview(inertia_matrix_terms, node_1, node_2, ALL, ALL), STpI);
49
50 Gemm::invoke(1., S, T, 1., STpI);
51
52 CopyMatrix::invoke(STpI, subview(system_matrix_terms, element, node_1, node_2, ALL, ALL));
53 }
54};
55
56} // namespace kynema::beams
Definition beam_quadrature.hpp:16
Definition calculate_system_matrix.hpp:10
ConstView< double **[6][6]> stiffness_matrix_terms
Definition calculate_system_matrix.hpp:20
ConstView< double *[6][6]> tangent
Definition calculate_system_matrix.hpp:18
ConstView< double **[6][6]> inertia_matrix_terms
Definition calculate_system_matrix.hpp:21
KOKKOS_FUNCTION void operator()(size_t node_12) const
Definition calculate_system_matrix.hpp:25
typename View< ValueType >::const_type ConstView
Definition calculate_system_matrix.hpp:14
size_t element
Definition calculate_system_matrix.hpp:16
Kokkos::View< ValueType, DeviceType > View
Definition calculate_system_matrix.hpp:12
size_t num_nodes
Definition calculate_system_matrix.hpp:17
ConstView< size_t ** > node_state_indices
Definition calculate_system_matrix.hpp:19
View< double ***[6][6]> system_matrix_terms
Definition calculate_system_matrix.hpp:22