#include <alsfvm/io/NetCDFWriter.hpp>
|
void | writeToFile (netcdf_raw_ptr file, const volume::Volume &conservedVariables, const grid::Grid &grid, const simulator::TimestepInformation ×tepInformation) |
|
std::array< netcdf_raw_ptr, 3 > | createDimensions (netcdf_raw_ptr basegroup, const volume::Volume &volume) |
|
void | writeMemory (netcdf_raw_ptr baseGroup, netcdf_raw_ptr dataset, const volume::Volume &volume, size_t memoryIndex) |
|
void | writeVolume (netcdf_raw_ptr baseGroup, const volume::Volume &volume, std::array< netcdf_raw_ptr, 3 > dimensions) |
|
std::pair< netcdf_raw_ptr, netcdf_raw_ptr > | makeDataset (netcdf_raw_ptr baseGroup, const volume::Volume &volume, size_t memoryIndex, std::array< netcdf_raw_ptr, 3 > dimensions) |
|
std::string | getFilename () |
|
void | addFileInformation (netcdf_raw_ptr file) |
| Writes basic Alsvinn info to file. More...
|
|
The netcdf writer writes to the netcdf format. This is the recommended writer to use
- Note
- can easily be read by the netcdf python package, see http://www.hydro.washington.edu/~jhamman/hydro-logic/blog/2013/10/12/plot-netcdf-data/
◆ NetCDFWriter()
alsfvm::io::NetCDFWriter::NetCDFWriter |
( |
const std::string & |
basefileName | ) |
|
Creates a new instance of the NetCDFWriter
- Parameters
-
basefileName | the base filename to use. Resulting filenames will be of the form basefileName_<timestep>.nc |
◆ ~NetCDFWriter()
virtual alsfvm::io::NetCDFWriter::~NetCDFWriter |
( |
| ) |
|
|
inlinevirtual |
Since we inherit from this class, this is the safest option (the destructor is anyway empty)
◆ addFileInformation()
void alsfvm::io::NetCDFWriter::addFileInformation |
( |
netcdf_raw_ptr |
file | ) |
|
|
protected |
Writes basic Alsvinn info to file.
◆ createDimensions()
Creates the dimensions
- Note
- Can only be called once per file!
- Parameters
-
basegroup | the file pointer to write to |
volume | will use this to get the dimensions |
◆ getFilename()
std::string alsfvm::io::NetCDFWriter::getFilename |
( |
| ) |
|
|
protected |
Creates the next filename and increments snapshot number
- Note
- should only be called once per write!
◆ makeDataset()
Creates or opens a dataset for the given volume and memory index
- Parameters
-
baseGroup | the file/group to create the dimensions in |
volume | the volume to extract the size information from |
memoryIndex | the given memoryIndex (used for the name) |
dimensions | the already created dimensions |
- Returns
- a touple where the first member is the file/group id, and the second the dataset
◆ write()
Write the volume to file This will create a variable for each volume
There will be no additioanl grid information written, this is implicit in the netcdf format
Implements alsfvm::io::Writer.
Reimplemented in alsfvm::io::NetCDFMPIWriter.
◆ writeMemory()
Writes the memory to the given memory dataset
- Parameters
-
baseGroup | the file pointer (or group pointer) |
dataset | the dataset to write to |
volume | the volume to extract the memory from (we need this to get the sizes) |
memoryIndex | the memoryIndex of the volume |
◆ writeToFile()
Writes to the opened file @note Assumes the file is in define mode
- Parameters
-
file | the filepointer |
conservedVariables | the conservedVariables to write |
grid | the underlying grid |
timestepInformation | the current timestep information |
◆ writeVolume()
Writes the volume to file
- Parameters
-
baseGroup | the baseGroup to write to |
volume | the given volume |
dimensions | already created dimensions |
◆ basefileName
const std::string alsfvm::io::NetCDFWriter::basefileName |
|
protected |
◆ snapshotNumber
size_t alsfvm::io::NetCDFWriter::snapshotNumber {0} |
|
protected |
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/alsvinn/checkouts/stable/alsfvm/include/alsfvm/io/NetCDFWriter.hpp
- /home/docs/checkouts/readthedocs.org/user_builds/alsvinn/checkouts/stable/alsfvm/src/io/NetCDFWriter.cpp