p4est 2.8.6
p4est is a software library for parallel adaptive mesh refinement.
Functions
p8est_io.h File Reference

Provide functions to serialize/deserialize a forest. More...

#include <p8est.h>
Include dependency graph for p8est_io.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

sc_array_t * p8est_deflate_quadrants (p8est_t *p8est, sc_array_t **data)
 This parallel data file format is deprecated since we plan to release an updated version of it soon. More...
 
p8est_tp8est_inflate (sc_MPI_Comm mpicomm, p8est_connectivity_t *connectivity, const p4est_gloidx_t *global_first_quadrant, const p4est_gloidx_t *pertree, sc_array_t *quadrants, sc_array_t *data, void *user_pointer)
 Create a new p4est based on serialized data. More...
 
p8est_tp8est_inflate_null (sc_MPI_Comm mpicomm, p8est_connectivity_t *connectivity, const p4est_gloidx_t *global_first_quadrant, const p4est_gloidx_t *pertree, sc_array_t *quadrants, sc_array_t *data, void *user_pointer)
 Create a new p4est based on serialized data. More...
 

Detailed Description

Provide functions to serialize/deserialize a forest.

Some are used as building blocks for p8est_load and p8est_save. Others allow for saving and loading user-defined data to a parallel file.

Furthermore, this module provides functions to write and read general data files associated with a p8est.

Function Documentation

◆ p8est_deflate_quadrants()

sc_array_t * p8est_deflate_quadrants ( p8est_t p8est,
sc_array_t **  data 
)

This parallel data file format is deprecated since we plan to release an updated version of it soon.

You can still use p8est_load and p8est_save to read and write a p8est including the connectivity and quadrant data. However, you can not read and write external mesh associated data using a p8est function if you do not use the p4est_file functions. If you still want to use the p8est_file functions you can configure with –enable-file-deprecated or use the variable enable-file-deprecated in CMake. Extract processor local quadrants' x y z level data. Optionally extracts the quadrant data as well into a separate array.

Parameters
[in]p8estThe forest is not modified.
[in,out]dataIf not NULL, pointer to a pointer that will be set to a newly allocated array with per-quadrant data. Must be NULL if p4est->data_size == 0.
Returns
An array of type p8est_qcoord_t that contains x y z level for each quadrant on this processor. The tree information is not extracted.

◆ p8est_inflate()

p8est_t * p8est_inflate ( sc_MPI_Comm  mpicomm,
p8est_connectivity_t connectivity,
const p4est_gloidx_t global_first_quadrant,
const p4est_gloidx_t pertree,
sc_array_t *  quadrants,
sc_array_t *  data,
void *  user_pointer 
)

Create a new p4est based on serialized data.

Its revision counter is set to zero. See p8est.h and p8est_communication.h for more information on parameters.

Parameters
[in]mpicommA valid MPI communicator.
[in]connectivityThis is the connectivity information that the forest is built with. Note that p4est does not take ownership of the memory.
[in]global_first_quadrantFirst global quadrant on each proc and one beyond. Copied into global_first_quadrant. Local count on rank is gfq[rank + 1] - gfq[rank].
[in]pertreeThe cumulative quadrant counts per tree.
[in]quadrantsArray as returned by p8est_deflate_quadrants.
[in]dataArray as from p8est_deflate_quadrants or NULL. The elem_size of this array informs data_size. Its elem_count equals the number of local quads.
[in]user_pointerAssign to the user_pointer member of the p4est.
Returns
The newly created p4est with a zero revision counter.

◆ p8est_inflate_null()

p8est_t * p8est_inflate_null ( sc_MPI_Comm  mpicomm,
p8est_connectivity_t connectivity,
const p4est_gloidx_t global_first_quadrant,
const p4est_gloidx_t pertree,
sc_array_t *  quadrants,
sc_array_t *  data,
void *  user_pointer 
)

Create a new p4est based on serialized data.

Its revision counter is set to zero. See p8est.h and p8est_communication.h for more information on parameters. In contrast to p8est_inflate this function indicates soft errors by returning NULL.

Parameters
[in]mpicommA valid MPI communicator.
[in]connectivityThis is the connectivity information that the forest is built with. Note that p4est does not take ownership of the memory.
[in]global_first_quadrantFirst global quadrant on each proc and one beyond. Copied into global_first_quadrant. Local count on rank is gfq[rank + 1] - gfq[rank].
[in]pertreeThe cumulative quadrant counts per tree.
[in]quadrantsArray as returned by p8est_deflate_quadrants.
[in]dataArray as from p8est_deflate_quadrants or NULL. The elem_size of this array informs data_size. Its elem_count equals the number of local quads.
[in]user_pointerAssign to the user_pointer member of the p4est.
Returns
The newly created p4est with a zero revision counter. If the created p4est would not be valid, no p4est is created and the function returns NULL.