PLUTO  4.2
 All Data Structures Files Functions Variables Enumerations Macros Pages
write_data.c File Reference

Main output driver. More...

#include "pluto.h"


void WriteData (const Data *d, Output *output, Grid *grid)
void GetCGSUnits (double *u)

Detailed Description

WriteData() is the main driver for writing data arrays in any of the available formats (binary, VTK, HDF5, etc...).

This function also updates the corresponding .out file associated with the output data format.

A. Mignone (
G. Muscianisi (
Aug 24, 2012

Function Documentation

void GetCGSUnits ( double *  u)

Compute an array of c.g.s units

[in]uan array containing the c.g.s units of the primitive variables, e.g., u[RHO] will be in gr/cm^3, u[VX1] will be in cm/s, etc...
void WriteData ( const Data d,
Output output,
Grid grid 

Write data to disk using any of the available formats.

[in]dpointer to PLUTO Data structre
[in]outputthe output structure corresponding to a given format
[in]gridpointer to an array of Grid structures
  • DBL output: Double-precision data files can be written using single or multiple file mode.
    • for single file, serial: we open the file just once before the main variable loop, dump variables and then close.
    • for single file, parallel the distributed array descriptor sz is different for cell-centered or staggered data type and we thus have to open and close the file after each variable has been dumped.
    • when writing multiple files we open, write to and close the file one each loop cycle.
      In all cases, the pointer to the data array that has to be written must be cast into (void *) and the starting index of the array must be zero.
  • VTK output: in order to enable parallel writing, files must be closed and opened again for scalars, since the distributed array descriptors used by ArrayLib (Float_Vect) and (float) are different. This is done using the AL_Get_offset() and AL_Set_offset() functions.