Outputs Class Reference

Kynema API: kynema::interfaces::Outputs Class Reference
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
kynema::interfaces::Outputs Class Reference

Handles writing state data to disk as simulation outputs and provides a means for post-processing e.g. visualization. More...

#include <outputs.hpp>

Public Types

using DeviceType = Kokkos::Device< Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space >
 

Public Member Functions

 Outputs (const std::string &output_file, size_t num_nodes, const std::string &time_series_file="", const std::vector< std::string > &enabled_state_prefixes={"x", "u", "v", "a", "f"}, size_t buffer_size=util::NodeStateWriter::kDefaultBufferSize)
 Constructor taking an output file and location.
 
std::unique_ptr< util::NodeStateWriter > & GetOutputWriter ()
 Gets a reference to the NodeStateWriter for direct usage.
 
std::unique_ptr< util::TimeSeriesWriter > & GetTimeSeriesWriter ()
 Gets a reference to the TimeSeriesWriter for direct usage.
 
void WriteNodeOutputsAtTimestep (const HostState< DeviceType > &host_state, size_t timestep)
 Write node state outputs to NetCDF file at specified timestep.
 
void WriteValueAtTimestep (size_t timestep, const std::string &name, double value)
 Write rotor time-series data at specified timestep.
 
void Close ()
 Manually close the underlying NetCDF files.
 
void Open ()
 Manually (re)open the underlying NetCDF files.
 

Detailed Description

Handles writing state data to disk as simulation outputs and provides a means for post-processing e.g. visualization.

Member Typedef Documentation

◆ DeviceType

using kynema::interfaces::Outputs::DeviceType = Kokkos::Device<Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>

Constructor & Destructor Documentation

◆ Outputs()

kynema::interfaces::Outputs::Outputs ( const std::string &  output_file,
size_t  num_nodes,
const std::string &  time_series_file = "",
const std::vector< std::string > &  enabled_state_prefixes = {"x", "u", "v", "a", "f"},
size_t  buffer_size = util::NodeStateWriter::kDefaultBufferSize 
)

Constructor taking an output file and location.

Parameters
output_filename of the output file
num_nodesnumber of nodes to be written to the file
time_series_fileoptional name of the file with time-series data (empty string = no time series will be written)
enabled_state_prefixeswhich state component prefixes to enable for writing (default: all states i.e. {"x", "u", "v", "a", "f"})
buffer_sizenumber of timesteps to buffer before auto-flush (default: 0 = no buffering)

Member Function Documentation

◆ Close()

void kynema::interfaces::Outputs::Close ( )

Manually close the underlying NetCDF files.

◆ GetOutputWriter()

std::unique_ptr< util::NodeStateWriter > & kynema::interfaces::Outputs::GetOutputWriter ( )

Gets a reference to the NodeStateWriter for direct usage.

◆ GetTimeSeriesWriter()

std::unique_ptr< util::TimeSeriesWriter > & kynema::interfaces::Outputs::GetTimeSeriesWriter ( )

Gets a reference to the TimeSeriesWriter for direct usage.

◆ Open()

void kynema::interfaces::Outputs::Open ( )

Manually (re)open the underlying NetCDF files.

◆ WriteNodeOutputsAtTimestep()

void kynema::interfaces::Outputs::WriteNodeOutputsAtTimestep ( const HostState< DeviceType > &  host_state,
size_t  timestep 
)

Write node state outputs to NetCDF file at specified timestep.

Parameters
host_statean updated host_state object with the current state loaded
timestepThe timestep number to write data to

◆ WriteValueAtTimestep()

void kynema::interfaces::Outputs::WriteValueAtTimestep ( size_t  timestep,
const std::string &  name,
double  value 
)

Write rotor time-series data at specified timestep.

Parameters
timestepThe timestep number to write data to
nameThe name of the variable to write (e.g., "azimuth_angle", "rotor_speed")
valueThe current value of the variable

The documentation for this class was generated from the following files:
  • /home/runner/work/kynema/kynema/kynema/src/interfaces/outputs.hpp
  • /home/runner/work/kynema/kynema/kynema/src/interfaces/outputs.cpp