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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/state/update_global_position.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
update_global_position.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
23
25 void operator()(int node) const {
26 using Kokkos::Array;
27 using Kokkos::make_pair;
28 using Kokkos::subview;
29
30 // Calculate global position
31 x(node, 0) = x0(node, 0) + q(node, 0);
32 x(node, 1) = x0(node, 1) + q(node, 1);
33 x(node, 2) = x0(node, 2) + q(node, 2);
34
35 // Calculate global orientation
37 const auto node_x = View<double[4]>{node_x_data.data()};
39 subview(q, node, make_pair(3, 7)), subview(x0, node, make_pair(3, 7)), node_x
40 );
41 x(node, 3) = node_x(0);
42 x(node, 4) = node_x(1);
43 x(node, 5) = node_x(2);
44 x(node, 6) = node_x(3);
45 }
46};
47
48} // 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
Definition calculate_displacement.hpp:7
A Kernel to update the absolute position of each node based on the solver's current state and the ini...
Definition update_global_position.hpp:14
ConstView< double *[7]> q
Definition update_global_position.hpp:20
Kokkos::View< ValueType, DeviceType > View
Definition update_global_position.hpp:16
ConstView< double *[7]> x0
Definition update_global_position.hpp:21
View< double *[7]> x
Definition update_global_position.hpp:22
typename View< ValueType >::const_type ConstView
Definition update_global_position.hpp:18
KOKKOS_FUNCTION void operator()(int node) const
Definition update_global_position.hpp:25