Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
io::FieldWriter Class Reference

A callable type that writes general grid data. More...

#include <FieldWriter.h>

Public Member Functions

void operator() (Grid3D &G, Parameters P, int nfile, const FnameTemplate &fname_template) const
 

Static Public Member Functions

static std::pair< WriterFn, std::string > try_create (int ndim, ParameterMap &pmap, const FieldInfo &field_info, bool write_h5_f32)
 

Detailed Description

A callable type that writes general grid data.

For more context, a "callable" object is sometimes called a "functor." Essentially a "callable" object carries around state and can be called like a function.

Member Function Documentation

◆ operator()()

void io::FieldWriter::operator() ( Grid3D G,
Parameters  P,
int  nfile,
const FnameTemplate fname_template 
) const

Writes the field data to disk.

Note
In case you are unaware, this overloads the "function call operator". If we have an instance, obj, then you call this method by invoking obj(G, P, nfile, fname_template). In python, this method would be called __call__

◆ try_create()

static std::pair< WriterFn, std::string > io::FieldWriter::try_create ( int  ndim,
ParameterMap pmap,
const FieldInfo field_info,
bool  write_h5_f32 
)
inlinestatic

Factory method that tries to construct a FieldWriter instance

If this is unsuccessful, the returned WriterFn will be "empty" and the string will describe the underlying issue.

Note
At the time of writing, end-users don't have a lot of control over whether this method actually gets call. Consequently, the callsite needs to make the judgement on whether or how to report errors. (We can address this in the future)

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