TimeSeriesWriter Class Reference

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

Class for writing time-series data to NetCDF file. More...

#include <time_series_writer.hpp>

Public Member Functions

 TimeSeriesWriter (const std::string &file_path, bool create=true)
 Constructor to create a TimeSeriesWriter object.
 
void WriteValuesAtTimestep (const std::string &variable_name, size_t timestep, std::span< const double > values)
 Writes multiple values for a time-series variable at a specific timestep.
 
void WriteValueAtTimestep (const std::string &variable_name, size_t timestep, const double &value)
 Writes a single value for a time-series variable at a specific timestep.
 
const NetCDFFileGetFile () const
 Get the NetCDF file object.
 

Detailed Description

Class for writing time-series data to NetCDF file.

Constructor & Destructor Documentation

◆ TimeSeriesWriter()

kynema::util::TimeSeriesWriter::TimeSeriesWriter ( const std::string &  file_path,
bool  create = true 
)
explicit

Constructor to create a TimeSeriesWriter object.

Parameters
file_pathPath to the output NetCDF file
createWhether to create a new file or open an existing one

Member Function Documentation

◆ GetFile()

const NetCDFFile & kynema::util::TimeSeriesWriter::GetFile ( ) const

Get the NetCDF file object.

◆ WriteValueAtTimestep()

void kynema::util::TimeSeriesWriter::WriteValueAtTimestep ( const std::string &  variable_name,
size_t  timestep,
const double &  value 
)

Writes a single value for a time-series variable at a specific timestep.

Parameters
variable_nameName of the variable to write
timestepCurrent timestep index
valueValue to write at the current timestep

◆ WriteValuesAtTimestep()

void kynema::util::TimeSeriesWriter::WriteValuesAtTimestep ( const std::string &  variable_name,
size_t  timestep,
std::span< const double >  values 
)

Writes multiple values for a time-series variable at a specific timestep.

Parameters
variable_nameName of the variable to write
timestepCurrent timestep index
valuesVector of values to write at the current timestep

The documentation for this class was generated from the following files: