Main output driver for fluid variables.
More...
WriteData() is the main driver for writing data arrays in any of the available formats (binary, VTK, HDF5, etc...).
- For .dbl, .flt or .vtk file formats, access to binary files is provided by the functions in bin_io.c.
- HDF5 files are handled by hdf5_io.c.
- image files are handled by write_img.c
- tabulated ascii files are handled by write_tab.c
This function also updates the corresponding .out file associated with the output data format.
- Authors
- A. Mignone (migno.nosp@m.ne@t.nosp@m.o.inf.nosp@m.n.it)
G. Muscianisi (g.mus.nosp@m.cian.nosp@m.isi@c.nosp@m.inec.nosp@m.a.it)
- Date
- Apr 15, 2021
◆ GetCGSUnits()
void GetCGSUnits |
( |
double * |
u | ) |
|
Compute an array of c.g.s units
- Parameters
-
[in] | u | an 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... |
◆ WriteData()
Write data to disk using any of the available formats.
- Parameters
-
[in] | d | pointer to PLUTO Data structre |
[in] | output | the output structure corresponding to a given format |
[in] | grid | pointer 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.
- Note
- 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.