Skip to content

Commit

Permalink
p4est_algorithms: documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cburstedde committed Feb 7, 2025
1 parent 082bea2 commit 0d49cb3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
14 changes: 9 additions & 5 deletions src/p4est_algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,19 @@ SC_EXTERN_C_BEGIN;
sc_mempool_t *p4est_quadrant_mempool_new (void);

/** Alloc and initialize the user data of a valid quadrant.
* \param [in] which_tree 0-based index of this quadrant's tree.
* \param [in,out] quad The quadrant to be initialized.
* \param [in] init_fn User-supplied callback function to init data.
* \param [in,out] p4est Forest for accessing the memory pool.
* \param [in] which_tree 0-based index of this quadrant's tree.
* \param [in,out] quad The quadrant to be initialized.
* \param [in] init_fn User-supplied callback function to init data.
*/
void p4est_quadrant_init_data (p4est_t * p4est,
p4est_topidx_t which_tree,
p4est_quadrant_t * quad,
p4est_init_t init_fn);

/** Free the user data of a valid quadrant.
* \param [in,out] quad The quadrant whose data shall be freed.
* \param [in,out] p4est Forest for accessing the memory pool.
* \param [in,out] quad The quadrant whose data shall be freed.
*/
void p4est_quadrant_free_data (p4est_t * p4est,
p4est_quadrant_t * quad);
Expand Down Expand Up @@ -109,6 +111,7 @@ int p4est_tree_is_linear (p4est_tree_t * tree);
int p4est_tree_is_complete (p4est_tree_t * tree);

/** Check if a tree is sorted/linear except for diagonally outside corners.
* \param [in] tree Tree data structure of a forest.
* \param [in] check_linearity Boolean for additional check for linearity.
* \return Returns true if almost sorted/linear, false otherwise.
*/
Expand All @@ -126,6 +129,7 @@ int p4est_tree_is_almost_sorted (p4est_tree_t * tree,
* D for a descendant
* Nn for a next quadrant in the tree with no holes in between and child id n
* qn for a general quadrant whose child id is n
* \param [in] log_priority Priority for log message (see sc.h).
* \param [in] tree Any (possibly incomplete, unsorted) tree to be printed.
*/
void p4est_tree_print (int log_priority, p4est_tree_t * tree);
Expand Down Expand Up @@ -314,7 +318,7 @@ p4est_gloidx_t p4est_partition_for_coarsening (p4est_t * p4est,
* \a num_quadrants_in_proc.
*
* \param [in] rank process id where search starts
* \param [in] num_proc number of processes
* \param [in] num_procs number of processes
* \param [in] num_quadrants_in_proc number of quadrants for each process
* \return process id of a non empty process
*/
Expand Down
24 changes: 14 additions & 10 deletions src/p8est_algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,21 @@ SC_EXTERN_C_BEGIN;
sc_mempool_t *p8est_quadrant_mempool_new (void);

/** Alloc and initialize the user data of a valid quadrant.
* \param [in] which_tree 0-based index of this quadrant's tree.
* \param [in,out] quad The quadrant to be initialized.
* \param [in] init_fn User-supplied callback function to init data.
* \param [in,out] p4est Forest for accessing the memory pool.
* \param [in] which_tree 0-based index of this quadrant's tree.
* \param [in,out] quad The quadrant to be initialized.
* \param [in] init_fn User-supplied callback function to init data.
*/
void p8est_quadrant_init_data (p8est_t * p8est,
void p8est_quadrant_init_data (p8est_t * p4est,
p4est_topidx_t which_tree,
p8est_quadrant_t * quad,
p8est_init_t init_fn);

/** Free the user data of a valid quadrant.
* \param [in,out] quad The quadrant whose data shall be freed.
* \param [in,out] p4est Forest for accessing the memory pool.
* \param [in,out] quad The quadrant whose data shall be freed.
*/
void p8est_quadrant_free_data (p8est_t * p8est,
void p8est_quadrant_free_data (p8est_t * p4est,
p8est_quadrant_t * quad);

/** Computes a machine-independent checksum of a list of quadrants.
Expand Down Expand Up @@ -109,6 +111,7 @@ int p8est_tree_is_linear (p8est_tree_t * tree);
int p8est_tree_is_complete (p8est_tree_t * tree);

/** Check if a tree is sorted/linear except across edges or corners.
* \param [in] tree Tree data structure of a forest.
* \param [in] check_linearity Boolean for additional check for linearity.
* \return Returns true if almost sorted/linear, false otherwise.
*/
Expand All @@ -126,6 +129,7 @@ int p8est_tree_is_almost_sorted (p8est_tree_t * tree,
* D for a descendant
* Nn for a next quadrant in the tree with no holes in between and child id n
* qn for a general quadrant whose child id is n
* \param [in] log_priority Priority for log message (see sc.h).
* \param [in] tree Any (possibly incomplete, unsorted) tree to be printed.
*/
void p8est_tree_print (int log_priority, p8est_tree_t * tree);
Expand Down Expand Up @@ -161,7 +165,7 @@ int p8est_is_valid (p8est_t * p8est);
* reproduce those splits when \a in is balanced.
* Note: Use this version if you are using less than full balance.
*
* \param [in] p4est The p8est to work on.
* \param [in] p4est The forest to work on.
* \param [in] in A piggy-sorted linear list of quadrants.
* The piggy2->from_tree member must be set.
* \param [in,out] out A piggy-sorted subset of tree->quadrants.
Expand All @@ -170,7 +174,7 @@ int p8est_is_valid (p8est_t * p8est);
* this will be used to fill \a out.
* \param [in] inseeds The seeds that \a in generates locally.
*/
void p8est_tree_compute_overlap (p8est_t * p8est,
void p8est_tree_compute_overlap (p8est_t * p4est,
sc_array_t * in,
sc_array_t * out,
p8est_connect_type_t
Expand Down Expand Up @@ -315,7 +319,7 @@ p4est_gloidx_t p8est_partition_for_coarsening (p8est_t * p8est,
* \a num_quadrants_in_proc.
*
* \param [in] rank process id where search starts
* \param [in] num_proc number of processes
* \param [in] num_procs number of processes
* \param [in] num_quadrants_in_proc number of quadrants for each process
* \return process id of a non empty process
*/
Expand All @@ -340,7 +344,7 @@ p4est_gloidx_t p8est_partition_given (p8est_t * p8est,

/** Checks if a quadrant's face is on the boundary of the forest.
*
* \param [in] p8est The forest in which to search for \a q
* \param [in] p4est The forest in which to search for \a q
* \param [in] treeid The tree to which \a q belongs.
* \param [in] q The quadrant that is in question.
* \param [in] face The face of the quadrant that is in question.
Expand Down

0 comments on commit 0d49cb3

Please sign in to comment.