/home/runner/work/kynema/kynema/kynema/src/state/calculate_displacement.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/state/calculate_displacement.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
calculate_displacement.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4
6
7namespace kynema::state {
8
13template <typename DeviceType>
15 template <typename ValueType>
16 using View = Kokkos::View<ValueType, DeviceType>;
17 template <typename ValueType>
19
20 double h;
24
26 void operator()(int node) const {
27 using Kokkos::Array;
28
29 for (auto component = 0; component < 3; ++component) {
30 q(node, component) = q_prev(node, component) + h * q_delta(node, component);
31 }
32
33 auto delta_data =
34 Array<double, 3>{h * q_delta(node, 3), h * q_delta(node, 4), h * q_delta(node, 5)};
35 auto delta = View<double[3]>{delta_data.data()};
36
40 auto quat_prev_data =
41 Array<double, 4>{q_prev(node, 3), q_prev(node, 4), q_prev(node, 5), q_prev(node, 6)};
46
47 for (auto component = 0; component < 4; ++component) {
48 q(node, component + 3) = quat_new(component);
49 }
50 }
51};
52
53} // namespace kynema::state
KOKKOS_INLINE_FUNCTION void QuaternionCompose(const Quaternion1 &q1, const Quaternion2 &q2, QuaternionN &qn)
Composes (i.e. multiplies) two quaternions and stores the result in a third quaternion.
Definition quaternion_operations.hpp:204
KOKKOS_INLINE_FUNCTION void RotationVectorToQuaternion(const Vector &phi, const Quaternion &quaternion)
Returns a 4-D quaternion from provided 3-D rotation vector, i.e. the exponential map.
Definition quaternion_operations.hpp:231
Definition calculate_displacement.hpp:7
A Kernel for applying the computed change in state (displacement) to the previous state to get an est...
Definition calculate_displacement.hpp:14
View< double *[7]> q
Definition calculate_displacement.hpp:23
Kokkos::View< ValueType, DeviceType > View
Definition calculate_displacement.hpp:16
typename View< ValueType >::const_type ConstView
Definition calculate_displacement.hpp:18
ConstView< double *[7]> q_prev
Definition calculate_displacement.hpp:22
double h
Definition calculate_displacement.hpp:20
KOKKOS_FUNCTION void operator()(int node) const
Definition calculate_displacement.hpp:26
ConstView< double *[6]> q_delta
Definition calculate_displacement.hpp:21