![]() | ![]() | ![]() | Gerris Flow Solver Reference Manual | ![]() |
---|
#include <gfs.h> #define GFS_OUTPUT_CLASS (klass) #define GFS_OUTPUT (obj) #define GFS_IS_OUTPUT (obj) GfsOutputClass; GfsOutput; GfsOutputFile; GfsOutputClass* gfs_output_class (void);void gfs_output_mute (GfsOutput *output);void gfs_output_file_close (GfsOutputFile *file); GfsOutputFile* gfs_output_file_open (constgchar *name, constgchar *mode);
This generic object is a GfsEvent which also defines where to write the data to output.
The syntax in parameter files is as follows:
[ GfsEvent ] FILE
If a C-like formatting string appears in the file name, it is interpreted as follows:
%d | is replaced with the current processor number. |
%ld | is replaced with the current time step number. |
%f | is replaced with the current physical time. |
If the simulation does not start at time zero the existing files are appended otherwise they are overwritten.
The "pipe" feature of GfsOutput can for example be used to do on-the-flight post-processing of the data stream, as in the following example:
GfsOutputPPM { istep = 1 } { ppmtoy4m -v 0 -F 24:1 | mpeg2enc -v 0 -o vorticity.mpg } { v = Vorticity }
typedef struct { GfsEvent parent; GfsOutputFile * file; gchar * format; GSList * formats; gboolean dynamic, first_call; } GfsOutput;
void gfs_output_mute (GfsOutput *output);
"Mutes" the output defined by output
, the event associated with
output
still takes place but the output itself is redirected to
/dev/null.
output : | a GfsOutput. |
void gfs_output_file_close (GfsOutputFile *file);
Decreases the reference count of file
. If it reaches zero the file
corresponding to file
is closed and file
is freed.
file : |
GfsOutputFile* gfs_output_file_open (constgchar *name, constgchar *mode);
Checks whether name
has already been opened. If it has, its
reference count is incremented and the corresponding GfsOutputFile
is returned. If it has not, it is created and opened for writing.
name : | the name of the file to open. |
mode : | the fopen mode. |
Returns : | the GfsOutputFile of file |
<<< Outputs | Time output >>> |