NodeStateWriter Class Reference

Kynema API: kynema::util::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 NetCDFFileGetFile () 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_pathPath to the output NetCDF file
createWhether to create a new file or open an existing one
num_nodesNumber 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
timestepCurrent timestep index
xData for x component of deformation
yData for y component of deformation
zData 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
timestepCurrent timestep index
component_prefixPrefix for the component
xData for component 1
yData for component 2
zData for component 3
iData for component 4
jData for component 5
kData for component 6
wData for component 7 (optional, only used for position and displacement)

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