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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/state/state.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
state.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace kynema {
6
17template <typename DeviceType>
18struct State {
19 template <typename ValueType>
20 using View = Kokkos::View<ValueType, DeviceType>;
21
22 size_t time_step{0};
28
29 View<double* [7]> x0; //< Initial global position/rotation
30 View<double* [7]> x; //< Current global position/rotation
31 View<double* [6]> q_delta; //< Displacement increment
32 View<double* [7]> q_prev; //< Previous state
33 View<double* [7]> q; //< Current state
34 View<double* [6]> v; //< Velocity
35 View<double* [6]> vd; //< Acceleration
36 View<double* [6]> a; //< Algorithmic acceleration
37 View<double* [6]> f; //< External forces
38 View<double* [6][6]> tangent; //< Tangent matrix
39
40 explicit State(size_t num_system_nodes_)
44 Kokkos::view_alloc("node_freedom_allocation_table", Kokkos::WithoutInitializing),
46 ),
49 ),
51 Kokkos::view_alloc("node_freedom_map_table", Kokkos::WithoutInitializing),
53 ),
64 // Initialize q and q_prev rotation to identity
65 Kokkos::deep_copy(Kokkos::subview(this->q_prev, Kokkos::ALL, 3), 1.);
66 Kokkos::deep_copy(Kokkos::subview(this->q, Kokkos::ALL, 3), 1.);
67 }
68};
69
70} // namespace kynema
Definition calculate_constraint_output.hpp:8
Container for storing the complete system state of the simulation at a given time increment.
Definition state.hpp:18
View< double *[7]> x0
Definition state.hpp:29
View< double *[6]> v
Definition state.hpp:34
View< double *[6]> a
Definition state.hpp:36
View< double *[7]> q_prev
Definition state.hpp:32
View< double *[7]> x
Definition state.hpp:30
View< double *[6][6]> tangent
Definition state.hpp:38
View< double *[6]> q_delta
Definition state.hpp:31
View< double *[7]> q
Definition state.hpp:33
View< double *[6]> vd
Definition state.hpp:35
View< dof::FreedomSignature * > node_freedom_allocation_table
Definition state.hpp:25
View< size_t * > ID
Definition state.hpp:24
size_t time_step
Definition state.hpp:22
size_t num_system_nodes
Definition state.hpp:23
View< size_t * > active_dofs
Definition state.hpp:26
View< size_t * > node_freedom_map_table
Definition state.hpp:27
Kokkos::View< ValueType, DeviceType > View
Definition state.hpp:20
State(size_t num_system_nodes_)
Definition state.hpp:40
View< double *[6]> f
Definition state.hpp:37