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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/interfaces/constraint_data.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
constraint_data.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <cstddef>
5
6#include <Kokkos_Core.hpp>
7
8namespace kynema::interfaces {
9
10template <typename DeviceType>
11struct HostConstraints;
12
17 using DeviceType =
18 Kokkos::Device<Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>;
19
21 size_t id;
22
24 std::array<double, 6> inputs{0., 0., 0., 0., 0., 0.};
25
27 std::array<double, 3> outputs{0., 0., 0.};
28
30 std::array<double, 6> loads{0., 0., 0., 0., 0., 0.};
31
34 explicit ConstraintData(size_t id_) : id(id_) {}
35
38 void GetLoads(const HostConstraints<DeviceType>& host_constraints);
39
42 void GetOutputs(const HostConstraints<DeviceType>& host_constraints);
43
46 void SetInputs(HostConstraints<DeviceType>& host_constraints) const;
47};
48
49} // namespace kynema::interfaces
Definition blade_interface.cpp:9
A wrapper around the Constraint ID of a given constraint.
Definition constraint_data.hpp:16
ConstraintData(size_t id_)
Constraint data constructor.
Definition constraint_data.hpp:34
void GetLoads(const HostConstraints< DeviceType > &host_constraints)
Populates constraint Loads from state data.
Definition constraint_data.cpp:9
void GetOutputs(const HostConstraints< DeviceType > &host_constraints)
Populates constraint outputs from state data.
Definition constraint_data.cpp:15
std::array< double, 3 > outputs
Constraint outputs.
Definition constraint_data.hpp:27
void SetInputs(HostConstraints< DeviceType > &host_constraints) const
Sets the constraint inputs in the host constraints.
Definition constraint_data.cpp:21
Kokkos::Device< Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space > DeviceType
Definition constraint_data.hpp:18
std::array< double, 6 > inputs
Constraint inputs.
Definition constraint_data.hpp:24
std::array< double, 6 > loads
Point loads/moment applied by constraint in global coordinates.
Definition constraint_data.hpp:30
size_t id
Constraint identifier in model.
Definition constraint_data.hpp:21
Host-side mirror of the constraint input, output, and loads for a given time increment.
Definition host_constraints.hpp:21