NodeStateWriter Class Reference
Kynema API
A flexible multibody structural dynamics code for wind turbines
|
Loading...
Searching...
No Matches
kynema::util::NodeStateWriter Class Reference
Class for writing Kynema nodal state data to NetCDF-based output files. More...
#include <node_state_writer.hpp>
Public Member Functions | |
NodeStateWriter (const std::string &file_path, bool create, size_t num_nodes) | |
Constructor to create a NodeStateWriter object. | |
void | WriteStateDataAtTimestep (size_t timestep, const std::string &component_prefix, const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z, const std::vector< double > &i, const std::vector< double > &j, const std::vector< double > &k, const std::vector< double > &w=std::vector< double >()) const |
Writes state data for a specific timestep. | |
void | WriteDeformationDataAtTimestep (size_t timestep, const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z) const |
Write deformation data for all nodes at a timestep. | |
const NetCDFFile & | GetFile () const |
Get the NetCDF file object. | |
size_t | GetNumNodes () const |
Get the number of nodes with state data in output file. | |
Detailed Description
Class for writing Kynema nodal state data to NetCDF-based output files.
This class handles the writing of nodal state data for Kynema simulations to NetCDF format. It manages the output of:
- Position (x, y, z, w, i, j, k)
- Displacement (x, y, z, w, i, j, k)
- Velocity (x, y, z, i, j, k)
- Acceleration (x, y, z, i, j, k)
- Force (x, y, z, i, j, k)
- Deformation (x, y, z)
Each item is stored as a separate variable in the NetCDF file, organized by timestep and node index. The file structure uses an unlimited time dimension to allow for continuous writing of timesteps during simulation.
Constructor & Destructor Documentation
◆ NodeStateWriter()
kynema::util::NodeStateWriter::NodeStateWriter | ( | const std::string & | file_path, |
bool | create, | ||
size_t | num_nodes | ||
) |
Constructor to create a NodeStateWriter object.
- Parameters
-
file_path Path to the output NetCDF file create Whether to create a new file or open an existing one num_nodes Number of nodes in the simulation
Member Function Documentation
◆ GetFile()
const NetCDFFile & kynema::util::NodeStateWriter::GetFile | ( | ) | const |
Get the NetCDF file object.
◆ GetNumNodes()
size_t kynema::util::NodeStateWriter::GetNumNodes | ( | ) | const |
Get the number of nodes with state data in output file.
◆ WriteDeformationDataAtTimestep()
void kynema::util::NodeStateWriter::WriteDeformationDataAtTimestep | ( | size_t | timestep, |
const std::vector< double > & | x, | ||
const std::vector< double > & | y, | ||
const std::vector< double > & | z | ||
) | const |
Write deformation data for all nodes at a timestep.
- Parameters
-
timestep Current timestep index x Data for x component of deformation y Data for y component of deformation z Data for z component of deformation
◆ WriteStateDataAtTimestep()
void kynema::util::NodeStateWriter::WriteStateDataAtTimestep | ( | size_t | timestep, |
const std::string & | component_prefix, | ||
const std::vector< double > & | x, | ||
const std::vector< double > & | y, | ||
const std::vector< double > & | z, | ||
const std::vector< double > & | i, | ||
const std::vector< double > & | j, | ||
const std::vector< double > & | k, | ||
const std::vector< double > & | w = std::vector<double>() |
||
) | const |
Writes state data for a specific timestep.
- Parameters
-
timestep Current timestep index component_prefix Prefix for the component x Data for component 1 y Data for component 2 z Data for component 3 i Data for component 4 j Data for component 5 k Data for component 6 w Data for component 7 (optional, only used for position and displacement)
The documentation for this class was generated from the following files:
- /home/runner/work/kynema/kynema/kynema/src/utilities/netcdf/node_state_writer.hpp
- /home/runner/work/kynema/kynema/kynema/src/utilities/netcdf/node_state_writer.cpp
Generated by