/home/runner/work/kynema/kynema/kynema/src/utilities/netcdf/time_series_writer.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/utilities/netcdf/time_series_writer.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
time_series_writer.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <span>
4#include <string>
5#include <vector>
6
7#include "netcdf_file.hpp"
8
9namespace kynema::util {
10
15public:
22 explicit TimeSeriesWriter(const std::string& file_path, bool create = true);
23
32 const std::string& variable_name, size_t timestep, std::span<const double> values
33 );
34
43 const std::string& variable_name, size_t timestep, const double& value
44 );
45
47 [[nodiscard]] const NetCdfFile& GetFile() const;
48
50 void Close() { this->file_.Close(); }
51
53 void Open() { this->file_.Open(); }
54
55private:
56 NetCdfFile file_;
57 int time_dim_;
58};
59
60} // namespace kynema::util
Definition netcdf_file.hpp:18
void Close()
Manually flushes and closes the NetCDF file.
Definition netcdf_file.cpp:42
void Open()
Manually (re)opens the NetCDF file in write mode.
Definition netcdf_file.cpp:50
Class for writing time-series data to NetCDF file.
Definition time_series_writer.hpp:14
void Close()
Manually close the underlying NetCDF file.
Definition time_series_writer.hpp:50
const NetCdfFile & GetFile() const
Get the NetCDF file object.
Definition time_series_writer.cpp:52
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.
Definition time_series_writer.cpp:17
void Open()
Manually (re)open the underlying NetCDF file.
Definition time_series_writer.hpp:53
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.
Definition time_series_writer.cpp:46
Definition aerodyn_inflow.hpp:14