/home/runner/work/kynema/kynema/kynema/src/system/springs/calculate_stiffness_matrix.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/system/springs/calculate_stiffness_matrix.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
calculate_stiffness_matrix.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::springs {
11
12template <typename DeviceType>
14 template <typename ValueType>
15 using View = Kokkos::View<ValueType, DeviceType>;
16 template <typename ValueType>
18
20 double c1, double c2, const ConstView<double[3]>& r, double l, const View<double[3][3]>& a
21 ) {
22 using NoTranspose = KokkosBatched::Trans::NoTranspose;
23 using GemmDefault = KokkosBatched::Algo::Gemm::Default;
24 using Gemm = KokkosBatched::SerialGemm<NoTranspose, NoTranspose, GemmDefault>;
25
26 auto r_tilde_data = Kokkos::Array<double, 9>{};
28
29 const double diag_term = c1 - c2 * l * l;
30 a(0, 0) = diag_term;
31 a(1, 1) = diag_term;
32 a(2, 2) = diag_term;
33
35 Gemm::invoke(-c2, r_tilde, r_tilde, 1., a);
36 }
37};
38} // namespace kynema::springs
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:11
Definition calculate_distance_components.hpp:5
Definition calculate_stiffness_matrix.hpp:13
typename View< ValueType >::const_type ConstView
Definition calculate_stiffness_matrix.hpp:17
Kokkos::View< ValueType, DeviceType > View
Definition calculate_stiffness_matrix.hpp:15
static KOKKOS_FUNCTION void invoke(double c1, double c2, const ConstView< double[3]> &r, double l, const View< double[3][3]> &a)
Definition calculate_stiffness_matrix.hpp:19