/home/runner/work/kynema/kynema/kynema/src/interfaces/node_data.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/interfaces/node_data.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
node_data.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4
5#include <Kokkos_Core.hpp>
6
7namespace kynema::interfaces {
8
9template <typename DeviceType>
10struct HostState;
11
16struct NodeData {
17 using DeviceType =
18 Kokkos::Device<Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>;
19
21 size_t id;
22
24 std::array<double, 7> position{0., 0., 0., 1., 0., 0., 0.};
25
27 std::array<double, 7> displacement{0., 0., 0., 1., 0., 0., 0.};
28
30 std::array<double, 6> velocity{0., 0., 0., 0., 0., 0.};
31
33 std::array<double, 6> acceleration{0., 0., 0., 0., 0., 0.};
34
36 std::array<double, 6> loads{0., 0., 0., 0., 0., 0.};
37
40 explicit NodeData(size_t id_) : id(id_) {}
41
43 void ClearLoads();
44
47 void GetMotion(const HostState<DeviceType>& host_state);
48
51 void SetLoads(HostState<DeviceType>& host_state) const;
52};
53
54} // namespace kynema::interfaces
Definition blade_interface.cpp:9
Host-side mirror of the simulation state for a given time increment.
Definition host_state.hpp:22
A collection of data defining the state at a given node and providing an ergonomic way to extract tha...
Definition node_data.hpp:16
Kokkos::Device< Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space > DeviceType
Definition node_data.hpp:18
NodeData(size_t id_)
Node data constructor.
Definition node_data.hpp:40
void GetMotion(const HostState< DeviceType > &host_state)
Populates node position, displacement, velocity, acceleration from state data.
Definition node_data.cpp:12
std::array< double, 6 > loads
Point loads/moment applied to node in global coordinates.
Definition node_data.hpp:36
void ClearLoads()
Set point loads and moments to zero.
Definition node_data.cpp:8
std::array< double, 6 > acceleration
Acceleration of node in global coordinates.
Definition node_data.hpp:33
std::array< double, 7 > displacement
Displacement from reference position.
Definition node_data.hpp:27
void SetLoads(HostState< DeviceType > &host_state) const
Updates the node loads in the host state.
Definition node_data.cpp:23
std::array< double, 7 > position
Absolute position of node in global coordinates.
Definition node_data.hpp:24
std::array< double, 6 > velocity
Velocity of node in global coordinates.
Definition node_data.hpp:30
size_t id
Node identifier in model.
Definition node_data.hpp:21