p4est
1.0
|
Routines for printing a forest and associated fields to vtk format. More...
Go to the source code of this file.
Functions | |
void | p4est_vtk_write_file (p4est_t *p4est, p4est_geometry_t *geom, const char *filename) |
This writes out the p4est in VTK format. | |
void | p4est_vtk_write_all (p4est_t *p4est, p4est_geometry_t *geom, double scale, int write_tree, int write_level, int write_rank, int wrap_rank, int num_scalars, int num_vectors, const char *filename,...) |
This writes out the p4est and any number of point fields in VTK format. | |
int | p4est_vtk_write_header (p4est_t *p4est, p4est_geometry_t *geom, double scale, int write_tree, int write_level, int write_rank, int wrap_rank, const char *point_scalars, const char *point_vectors, const char *filename) |
This will write the header of the vtu file. | |
int | p4est_vtk_write_point_scalar (p4est_t *p4est, p4est_geometry_t *geom, const char *filename, const char *scalar_name, const double *values) |
This will write a scalar field to the vtu file. | |
int | p4est_vtk_write_point_vector (p4est_t *p4est, p4est_geometry_t *geom, const char *filename, const char *vector_name, const double *values) |
This will write a 3-vector field to the vtu file. | |
int | p4est_vtk_write_footer (p4est_t *p4est, const char *filename) |
This will write the footer of the vtu file. |
Routines for printing a forest and associated fields to vtk format.
void p4est_vtk_write_all | ( | p4est_t * | p4est, |
p4est_geometry_t * | geom, | ||
double | scale, | ||
int | write_tree, | ||
int | write_level, | ||
int | write_rank, | ||
int | wrap_rank, | ||
int | num_scalars, | ||
int | num_vectors, | ||
const char * | filename, | ||
... | |||
) |
This writes out the p4est and any number of point fields in VTK format.
This is a convenience function that will abort if there is a file error.
[in] | p4est | The p4est to be written. |
[in] | geom | A p4est_geometry_t structure or NULL for identity. |
[in] | scale | Double value between 0 and 1 to scale each quadrant. |
[in] | write_tree | Include the tree id as output field. |
[in] | write_level | Include the tree levels as output field. |
[in] | write_rank | Include the MPI rank as output field. |
[in] | wrap_tree | The MPI rank is written module wrap_tree, or 0. |
filename | First part of the name, see p4est_vtk_write_file. | |
num_scalars | Number of scalar fields to write. | |
num_vectors | Number of vector fields to write. |
The variable arguments need to be pairs of (fieldname, fieldvalues) where the scalars come first, then the vectors.
void p4est_vtk_write_file | ( | p4est_t * | p4est, |
p4est_geometry_t * | geom, | ||
const char * | filename | ||
) |
This writes out the p4est in VTK format.
This is a convenience function for the special case of writing out the tree id and MPI rank only. One file is written per MPI rank, and one meta file on rank 0. This function will abort if there is a file error.
[in] | p4est | The p4est to be written. |
[in] | geom | A p4est_geometry_t structure or NULL for identity. |
[in] | filename | The first part of the file name which will have the MPI rank appended to it: The output file will be filename_rank.vtu, and the meta file filename.pvtu). |
int p4est_vtk_write_footer | ( | p4est_t * | p4est, |
const char * | filename | ||
) |
This will write the footer of the vtu file.
Writing a VTK file is split into a couple of routines. The allows there to be an arbitrary number of fields. To write out two fields the calling sequence would be something like
p4est_vtk_write_header(p4est, ..., "output"); p4est_vtk_write_footer(p4est, "output");
p4est | The p4est to be written. |
filename | The first part of the name which will have the proc number appended to it (i.e., the output file will be filename_procNum.vtu). |
int p4est_vtk_write_header | ( | p4est_t * | p4est, |
p4est_geometry_t * | geom, | ||
double | scale, | ||
int | write_tree, | ||
int | write_level, | ||
int | write_rank, | ||
int | wrap_rank, | ||
const char * | point_scalars, | ||
const char * | point_vectors, | ||
const char * | filename | ||
) |
This will write the header of the vtu file.
Writing a VTK file is split into a couple of routines. The allows there to be an arbitrary number of fields. The calling sequence would be something like
p4est_vtk_write_header(p4est, geom, 1., 1, 1, 0, "output"); p4est_vtk_write_point_scalar (...); ... p4est_vtk_write_footer(p4est, "output");
p4est | The p4est to be written. |
geom | A p4est_geometry_t structure or NULL for identity. |
scale | The relative length factor of the quadrants. Use 1.0 to fit quadrants exactly, less to create gaps. |
write_tree | Boolean to determine if the tree id should be output. |
write_level | Boolean to determine if the tree levels should be output. |
write_rank | Boolean to determine if the MPI rank should be output. |
wrap_rank | Number to wrap around the rank with a modulo operation. Can be 0 for no wrapping. |
point_scalars | Comma-separated list of point scalar fields, or NULL. |
point_vectors | Comma-separated list of point vector fields, or NULL. |
filename | The first part of the name which will have the proc number appended to it (i.e., the output file will be filename_procNum.vtu). |
int p4est_vtk_write_point_scalar | ( | p4est_t * | p4est, |
p4est_geometry_t * | geom, | ||
const char * | filename, | ||
const char * | scalar_name, | ||
const double * | values | ||
) |
This will write a scalar field to the vtu file.
It is good practice to make sure that the scalar field also exists in the comma separated string point_scalars passed to p4est_vtk_write_header
.
Writing a VTK file is split into a couple of routines. The allows there to be an arbitrary number of fields.
p4est | The p4est to be written. |
geom | A p4est_geometry_t structure or NULL for identity. |
filename | The first part of the name which will have the proc number appended to it (i.e., the output file will be filename_procNum.vtu). |
scalar_name | The name of the scalar field. |
values | The point values that will be written. |
int p4est_vtk_write_point_vector | ( | p4est_t * | p4est, |
p4est_geometry_t * | geom, | ||
const char * | filename, | ||
const char * | vector_name, | ||
const double * | values | ||
) |
This will write a 3-vector field to the vtu file.
It is good practice to make sure that the vector field also exists in the comma separated string point_vectors passed to p4est_vtk_write_header
.
Writing a VTK file is split into a couple of routines. The allows there to be an arbitrary number of fields.
p4est | The p4est to be written. |
geom | A p4est_geometry_t structure or NULL for identity. |
filename | The first part of the name which will have the proc number appended to it (i.e., the output file will be filename_procNum.vtu). |
vector_name | The name of the vector field. |
values | The point values that will be written. |