Navigation

Operators and Keywords

Function List:

C++ API

Function File: fpl_vtk_write_field (basename, mesh, nodedata, celldata, endfile)

Output data field in serial XML-VTK UnstructuredGrid format.

basename is a string containing the base-name of the (vtu) file where the data will be saved.

mesh is a PDE-tool like mesh, like the ones generated by the "msh" package.

nodedata and celldata are (Ndata x 2) cell arrays containing respectively <PointData> and <CellData> representing scalars or vectors:

  • - *data{:,1} = variable data;
  • - *data{:,2} = variable names;

endfile should be 0 if you want to add other variables to the same file, 1 otherwise.

Example:

<generate msh1, node centered field nc1, cell centered field cc1>
fpl_vtk_write_field ("example", msh1, {nc1, "temperature"}, {cc1, "density"}, 0);
<generate msh2, node centered field nc2>
fpl_vtk_write_field ("example", msh2, {nc2, "temperature"}, {}, 1);

will generate a valid XML-VTK UnstructuredGrid file.

See also: fpl_dx_write_field, fpl_dx_write_series, fpl_vtk_assemble_series.

Package: fpl