Saras
Finite Difference Solver for Fluid Dynamics Simulations
|
Class for all the global variables and functions related to writing output data of the solver. More...
#include "lib/io/writer.h"
Public Member Functions | |
writer (const grid &mesh, std::vector< field > &wFields) | |
Constructor of the writer class. More... | |
void | writeTarang (real time) |
Function to write solution file in HDF5 format in parallel in the same manner as TARANG. More... | |
void | writeSolution (real time) |
Function to write solution file in HDF5 format in parallel. More... | |
void | writeRestart (real time) |
Function to write restart file in HDF5 format in parallel. More... | |
Class for all the global variables and functions related to writing output data of the solver.
The computational data from the solver is written in HDF5 format in a .h5 file. The class allows for both collocated and staggered grid data to be written in separate output files.
Constructor of the writer class.
The constructor initializes the variables and parameters for parallel file writing through HDF5
mesh | is a const reference to the global data contained in the grid class |
wField | is a vector of sfields to be written |
Initialize the common global and local limits for file writing
Create output directory if it doesn't exist
void writer::writeRestart | ( | real | time | ) |
Function to write restart file in HDF5 format in parallel.
It opens the restart file in the output folder and all the processors write in parallel into the file. Unlike solution writing, the data is not interpolated and is written as is. The restart file is overwritten with each call to this function.
time | is a real value containing the time to be added as metadata to the restart file |
void writer::writeSolution | ( | real | time | ) |
Function to write solution file in HDF5 format in parallel.
It opens a file in the output folder and all the processors write in parallel into the file Before writing however, all the data is interpolated into the cell centers for ease of post-processing.
time | is a real value containing the time to be used for naming the file |
void writer::writeTarang | ( | real | time | ) |
Function to write solution file in HDF5 format in parallel in the same manner as TARANG.
TARANG writes solution files in folders within the output folder. This totally defeats the purpose of HDF5 data format and makes data processing more cumbersome. However, in the interest of maintaining backward compatibility, this feature is being added to Saras. Before writing the file, all the data is interpolated into the cell centers for ease of post-processing.
time | is a real value containing the time to be used for naming the file |