/home/runner/work/kynema/kynema/kynema/src/utilities/netcdf/netcdf_file.hpp Source File
|
Kynema API
A flexible multibody structural dynamics code for wind turbines
|
Loading...
Searching...
No Matches
netcdf_file.hpp
Go to the documentation of this file.
89 void AddAttribute(const std::string& var_name, const std::string& attr_name, double value) const;
Definition netcdf_file.hpp:18
NetCdfFile(NetCdfFile &&)=delete
void Close()
Manually flushes and closes the NetCDF file.
Definition netcdf_file.cpp:42
NetCdfFile & operator=(NetCdfFile &&)=delete
int AddVariable(const std::string &name, std::span< const int > dim_ids) const
Adds a variable to the NetCDF file.
NetCdfFile & operator=(const NetCdfFile &)=delete
void ReadVariableAt(const std::string &name, std::span< const size_t > start, std::span< const size_t > count, float *data) const
Reads data from a variable at specific indices in the NetCDF file.
Definition netcdf_file.cpp:326
int GetVariableId(const std::string &name) const
Returns the variable ID for a given variable name.
Definition netcdf_file.cpp:260
std::vector< size_t > GetShape(const std::string &var_name) const
Gets the shape (dimension lengths) of a variable in the NetCDF file.
Definition netcdf_file.cpp:288
int AddDimension(const std::string &name, size_t length) const
Adds a dimension to the NetCDF file.
Definition netcdf_file.cpp:59
void Open()
Manually (re)opens the NetCDF file in write mode.
Definition netcdf_file.cpp:50
void ReadVariableWithStride(const std::string &name, std::span< const size_t > start, std::span< const size_t > count, std::span< const ptrdiff_t > stride, float *data) const
Reads data from a variable with specified stride in the NetCDF file.
Definition netcdf_file.cpp:355
size_t GetDimensionLength(int dim_id) const
Gets the length of a dimension in the NetCDF file.
Definition netcdf_file.cpp:278
void SetChunking(const std::string &var_name, std::span< const size_t > chunk_sizes) const
Configures chunking for a NetCDF variable to optimize I/O and compression performance.
Definition netcdf_file.cpp:239
size_t GetNumberOfDimensions(const std::string &var_name) const
Gets the number of dimensions of a variable in the NetCDF file.
Definition netcdf_file.cpp:268
void ReadVariable(const std::string &name, float *data) const
Reads data from a variable in the NetCDF file.
Definition netcdf_file.cpp:305
void WriteVariable(const std::string &name, std::span< const float > data) const
Writes data to a variable in the NetCDF file.
Definition netcdf_file.cpp:161
int GetDimensionId(const std::string &name) const
Returns the dimension ID for a given dimension name.
Definition netcdf_file.cpp:252
~NetCdfFile()
Destructor to close the NetCDF file.
Definition netcdf_file.cpp:34
void AddAttribute(const std::string &var_name, const std::string &attr_name, float value) const
Adds an attribute to a variable in the NetCDF file.
Definition netcdf_file.cpp:120
int GetNetCDFId() const
Returns the NetCDF file ID.
Definition netcdf_file.cpp:248
void Sync() const
Synchronizes (flushes) the NetCDF file to disk.
Definition netcdf_file.cpp:38
void WriteVariableAt(const std::string &name, std::span< const size_t > start, std::span< const size_t > count, std::span< const float > data) const
Writes data to a variable at specific indices in the NetCDF file.
Definition netcdf_file.cpp:193
NetCdfFile(const NetCdfFile &)=delete
Explicitly prevent copying and moving – rule of 5.
Definition aerodyn_inflow.hpp:14
Generated by