/home/runner/work/kynema/kynema/kynema/src/interfaces/cfd/interface.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/interfaces/cfd/interface.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
interface.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <filesystem>
4#include <memory>
5
12#include "model/model.hpp"
13#include "solver/solver.hpp"
14#include "state/state.hpp"
16
18
22class Interface {
23public:
24 using DeviceType =
25 Kokkos::Device<Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>;
26
32 explicit Interface(const InterfaceInput& input);
33
35 [[nodiscard]] bool Step();
36
38 void SaveState();
39
41 void RestoreState();
42
48 void WriteRestart(const std::filesystem::path& filename) const;
49
55 void ReadRestart(const std::filesystem::path& filename);
56
58 void WriteOutputs() const;
59
62
65
68
71
74
77
80
83
86
89
91 std::unique_ptr<interfaces::Outputs> outputs_;
92};
93
94} // namespace kynema::interfaces::cfd
Struct to define the connectivity structure of elements, nodes, and constraints defining an Kynema pr...
Definition model.hpp:74
The main interface for controlling the CFD problem.
Definition interface.hpp:22
State< DeviceType > state_save
Kynema class state class for temporarily saving state.
Definition interface.hpp:82
State< DeviceType > state
Kynema class for storing system state.
Definition interface.hpp:67
bool Step()
Step forward in time one time step.
Definition interface.cpp:283
std::unique_ptr< interfaces::Outputs > outputs_
Optional NetCDF output writer.
Definition interface.hpp:91
Elements< DeviceType > elements
Kynema class for model elements (beams, masses, springs)
Definition interface.hpp:70
void WriteRestart(const std::filesystem::path &filename) const
Write restart file.
Definition interface.cpp:266
void SaveState()
Save state for correction step.
Definition interface.cpp:312
Solver< DeviceType > solver
Kynema class for solving the dynamic system.
Definition interface.hpp:79
size_t current_timestep_
Current timestep index.
Definition interface.hpp:88
void WriteOutputs() const
Write current state to output file if configured.
Turbine turbine
Turbine model input/output data.
Definition interface.hpp:64
void ReadRestart(const std::filesystem::path &filename)
Read restart file.
Definition interface.cpp:271
Model model
Kynema class used for model construction.
Definition interface.hpp:61
void RestoreState()
Restore state for correction step.
Definition interface.cpp:316
kynema::interfaces::HostState< DeviceType > host_state
Host local copy of State.
Definition interface.hpp:85
Kokkos::Device< Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space > DeviceType
Definition interface.hpp:25
StepParameters parameters
Kynema class containing solution parameters.
Definition interface.hpp:76
Constraints< DeviceType > constraints
Kynema class for constraints tying elements together.
Definition interface.hpp:73
Definition floating_platform.hpp:9
Container class for managing multiple constraints in a simulation.
Definition constraints.hpp:29
A container providing handle to all structural elements present in the model.
Definition elements.hpp:20
This object manages the assembly and solution of linear system arising from the generalized-alpha bas...
Definition solver.hpp:21
Container for storing the complete system state of the simulation at a given time increment.
Definition state.hpp:18
A Struct containing the paramters used to control the time stepping process.
Definition step_parameters.hpp:12
Host-side mirror of the simulation state for a given time increment.
Definition host_state.hpp:22
An object describing the configuration of the interface.
Definition interface_input.hpp:13
The top level structure defining the CFD problem.
Definition turbine.hpp:10