|
Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website |
Writes snapshots either every interval steps or every time_interval units of simulation time. Time-based writers also constrain the time step so that snapshots land exactly on output times.
More...
#include <data_writer.h>
Classes | |
| struct | Field |
| An output array: one scalar, or the N_DIM components of a vector (written as 3 components, zero-padded in 2D). More... | |
Public Member Functions | |
| void | init (const toml::value &input, std::vector< Data > &data, std::shared_ptr< Mesh > mesh, const std::vector< std::string > &restart_variables={}) |
| Set up from a [[write_data]] entry. | |
| bool | due (uint64_t step, rtype t) const |
| Whether a snapshot is due at this step/time. | |
| void | write (uint64_t step, rtype t, bool force=false, const RestartAttributes &attributes={}, const RestartFaces &faces={}) |
| Write a snapshot if due (or forced); restart files also store the attributes and the faces (of the owned cells; collective). | |
| rtype | next_time () const |
| Next simulation time at which a snapshot is due (infinity for step-based writers). | |
| void | resume (uint64_t step, rtype t) |
| Continue numbering and the .pvd (.xmf) series of a previous run that stopped at (step, t), whose snapshot at t was already written. | |
| std::pair< std::string, std::string > | summary () const |
| Format and the output key-value line for the run log. | |
| DataFormat | get_format () const |
| const std::string & | get_prefix () const |
| uint64_t | files_written () const |
Protected Member Functions | |
| void | write_vtu (const std::string &filename, rtype t) const |
| void | write_vtu_faces (const std::string &filename, rtype t) const |
| void | write_restart (const std::string &filename, uint64_t step, rtype t, const RestartAttributes &attributes, const RestartFaces &faces) const |
| void | write_pvd () const |
| void | write_hdf5_mesh () |
| HDF5 output: the mesh once (<prefix>_mesh.h5), then per snapshot a file of cell fields, every array in global-id order, and the XDMF indexes that let ParaView read them. | |
| void | write_hdf5 (const std::string &stem, uint64_t step, rtype t) const |
| void | write_xdmf (const std::string &stem) const |
| std::string | xdmf_grid (const std::string &stem, double t, const std::string &indent) const |
| void | resume_xdmf (rtype t) |
| void | write_pvtu (const std::string &filename, const std::string &stem) const |
| void | write_restart_distributed (const std::string &filename, uint64_t step, rtype t, const RestartAttributes &attributes, const RestartFaces &faces) const |
Protected Attributes | |
| std::string | prefix |
| uint64_t | interval = 0 |
| rtype | time_interval = 0.0 |
| uint64_t | n_written = 0 |
| rtype | t_last = -std::numeric_limits<rtype>::infinity() |
| uint64_t | step_last = std::numeric_limits<uint64_t>::max() |
| DataFormat | format |
| std::vector< Field > | fields |
| std::shared_ptr< Mesh > | mesh |
| std::vector< std::pair< rtype, std::string > > | history |
| bool | surface = false |
| std::string | geometry = "all" |
| uint64_t | n_files = 0 |
| std::vector< uint32_t > | geometry_faces |
| GlobalOrder | cell_order |
| bool | hdf5_mesh_written = false |
| uint64_t | hdf5_n_nodes = 0 |
| uint64_t | hdf5_topology_size = 0 |
Writes snapshots either every interval steps or every time_interval units of simulation time. Time-based writers also constrain the time step so that snapshots land exactly on output times.
|
inline |
|
inline |
|
inline |
| void DataWriter::init | ( | const toml::value & | input, |
| std::vector< Data > & | data, | ||
| std::shared_ptr< Mesh > | mesh, | ||
| const std::vector< std::string > & | restart_variables = {} |
||
| ) |
Set up from a [[write_data]] entry.
| restart_variables | Variables of a restart file, in order (default: CONSERVATIVE_NAMES); ignored for other formats. |
| rtype DataWriter::next_time | ( | ) | const |
Next simulation time at which a snapshot is due (infinity for step-based writers).
Continue numbering and the .pvd (.xmf) series of a previous run that stopped at (step, t), whose snapshot at t was already written.
| std::pair< std::string, std::string > DataWriter::summary | ( | ) | const |
Format and the output key-value line for the run log.
| void DataWriter::write | ( | uint64_t | step, |
| rtype | t, | ||
| bool | force = false, |
||
| const RestartAttributes & | attributes = {}, |
||
| const RestartFaces & | faces = {} |
||
| ) |
Write a snapshot if due (or forced); restart files also store the attributes and the faces (of the owned cells; collective).
|
protected |
HDF5 output: the mesh once (<prefix>_mesh.h5), then per snapshot a file of cell fields, every array in global-id order, and the XDMF indexes that let ParaView read them.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |