p4est 2.8.6
p4est is a software library for parallel adaptive mesh refinement.
|
Create a new p4est object by adding individual quadrants in order. More...
#include <p4est.h>
Go to the source code of this file.
Typedefs | |
typedef struct p4est_build | p4est_build_t |
Context object for building a new p4est from individual quadrants. | |
Functions | |
p4est_build_t * | p4est_build_new (p4est_t *from, size_t data_size, p4est_init_t init_fn, void *user_pointer) |
Allocate a context for building a new forest. More... | |
void | p4est_build_init_add (p4est_build_t *build, p4est_init_t add_init_fn) |
Set a dedicated initialization callback for manually added quadrants. More... | |
int | p4est_build_add (p4est_build_t *build, p4est_topidx_t which_tree, p4est_quadrant_t *quadrant) |
This function is usable from a p4est_search_local_t callback. More... | |
p4est_t * | p4est_build_complete (p4est_build_t *build) |
Finalize the construction of the new forest after adding quadrants. More... | |
Create a new p4est object by adding individual quadrants in order.
This can for example be driven by running p4est_search_local. This allows to create a heavily coarsened forest in one pass. It is also legal to add more highly refined quadrants.
The only rules are to respect the original partition boundary and to add non-overlapping quadrants in Morton order.
int p4est_build_add | ( | p4est_build_t * | build, |
p4est_topidx_t | which_tree, | ||
p4est_quadrant_t * | quadrant | ||
) |
This function is usable from a p4est_search_local_t callback.
It can also be used outside of a search context using proper care.
It may be called multiple times in order of trees and then quadrants. The quadrant added in each call must fit entirely into the current tree. This means that inner nodes of the tree may not be legal to pass in here. It is safest to call this function only on leaves of the original tree. However, other calls are possible if subsequent quadrants do not overlap.
It is legal to call this function twice with the same quadrant. In this case the second call does nothing.
[in,out] | build | The building context must be passed through. |
[in] | which_tree | The tree number is passed from the search callback. |
[in] | quadrant | The quadrant is passed from the search callback. |
p4est_t * p4est_build_complete | ( | p4est_build_t * | build | ) |
Finalize the construction of the new forest after adding quadrants.
[in,out] | build | The building context will be deallocated inside. |
void p4est_build_init_add | ( | p4est_build_t * | build, |
p4est_init_t | add_init_fn | ||
) |
Set a dedicated initialization callback for manually added quadrants.
[in,out] | build | The building context at any stage. |
[in] | add_init_fn | Henceforth used for quadrants added by p4est_build_add. NULL leaves the quadrant data uninitialized. |
p4est_build_t * p4est_build_new | ( | p4est_t * | from, |
size_t | data_size, | ||
p4est_init_t | init_fn, | ||
void * | user_pointer | ||
) |
Allocate a context for building a new forest.
[in] | from | This forest is used as a template for creation. |
[in] | data_size | Data size of the created forest, may be zero. |
[in] | init_fn | This functions is called for created quadrants, added manually by p4est_build_add or by the internal completion of the subtrees. It may be overridden for added quadrants by p4est_build_init_add. NULL leaves the quadrant data uninitialized. |
[in] | user_pointer | Registered into the newly built forest. |