From 0fd1571e88f0dcd8daab1cab409ee80df61f9f8f Mon Sep 17 00:00:00 2001 From: Ole Albers Date: Tue, 15 Oct 2024 13:04:44 +0200 Subject: [PATCH 1/7] add documentation for t8_forest_leaf_face_neighbors_ext --- src/t8_forest/t8_forest_general.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/t8_forest/t8_forest_general.h b/src/t8_forest/t8_forest_general.h index 650b520ace..c76b01b1ef 100644 --- a/src/t8_forest/t8_forest_general.h +++ b/src/t8_forest/t8_forest_general.h @@ -571,6 +571,12 @@ t8_forest_leaf_face_neighbors (t8_forest_t forest, t8_locidx_t ltreeid, const t8 t8_locidx_t **pelement_indices, t8_eclass_scheme_c **pneigh_scheme, int forest_is_balanced); + + /** Like \ref t8_forest_leaf_face_neighbors but also provides information about the global neighbors and the orientaion. + * \param [out] gneigh_tree The global tree IDs of the neighbor trees. + * \param [out] orientation The face orientation is computed and stored there. + * All other parameters and behavior are identical to \ref `t8_forest_leaf_face_neighbors`. + */ void t8_forest_leaf_face_neighbors_ext (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *leaf, t8_element_t **pneighbor_leaves[], int face, int *dual_faces[], int *num_neighbors, From d349462354cd9f0d6c8e5e75195f212bc2e9790c Mon Sep 17 00:00:00 2001 From: Ole Albers Date: Tue, 15 Oct 2024 13:22:58 +0200 Subject: [PATCH 2/7] fix typos --- src/t8_forest/t8_forest_general.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/t8_forest/t8_forest_general.h b/src/t8_forest/t8_forest_general.h index c76b01b1ef..df65f7d9b1 100644 --- a/src/t8_forest/t8_forest_general.h +++ b/src/t8_forest/t8_forest_general.h @@ -571,8 +571,7 @@ t8_forest_leaf_face_neighbors (t8_forest_t forest, t8_locidx_t ltreeid, const t8 t8_locidx_t **pelement_indices, t8_eclass_scheme_c **pneigh_scheme, int forest_is_balanced); - - /** Like \ref t8_forest_leaf_face_neighbors but also provides information about the global neighbors and the orientaion. +/** Like \ref t8_forest_leaf_face_neighbors but also provides information about the global neighbors and the orientation. * \param [out] gneigh_tree The global tree IDs of the neighbor trees. * \param [out] orientation The face orientation is computed and stored there. * All other parameters and behavior are identical to \ref `t8_forest_leaf_face_neighbors`. From 06f19706eb7b352f0d3efc6014747e49731cbc64 Mon Sep 17 00:00:00 2001 From: Ole Albers <122293607+ole-alb@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:03:27 +0200 Subject: [PATCH 3/7] Update src/t8_forest/t8_forest_general.h Co-authored-by: Johannes Holke --- src/t8_forest/t8_forest_general.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/t8_forest/t8_forest_general.h b/src/t8_forest/t8_forest_general.h index df65f7d9b1..f71cd31fa1 100644 --- a/src/t8_forest/t8_forest_general.h +++ b/src/t8_forest/t8_forest_general.h @@ -572,7 +572,23 @@ t8_forest_leaf_face_neighbors (t8_forest_t forest, t8_locidx_t ltreeid, const t8 int forest_is_balanced); /** Like \ref t8_forest_leaf_face_neighbors but also provides information about the global neighbors and the orientation. - * \param [out] gneigh_tree The global tree IDs of the neighbor trees. + * \param [in] forest The forest. Must have a valid ghost layer. + * \param [in] ltreeid A local tree id. + * \param [in] leaf A leaf in tree \a ltreeid of \a forest. + * \param [out] pneighbor_leaves Unallocated on input. On output the neighbor + * leaves are stored here. + * \param [in] face The index of the face across which the face neighbors + * are searched. + * \param [out] dual_faces On output the face id's of the neighboring elements' faces. + * \param [out] num_neighbors On output the number of neighbor leaves. + * \param [out] pelement_indices Unallocated on input. On output the element indices + * of the neighbor leaves are stored here. + * 0, 1, ... num_local_el - 1 for local leaves and + * num_local_el , ... , num_local_el + num_ghosts - 1 for ghosts. + * \param [out] pneigh_scheme On output the eclass scheme of the neighbor elements. + * \param [in] forest_is_balanced True if we know that \a forest is balanced, false + * otherwise. + * \param [out] gneigh_tree The global tree IDs of the neighbor trees. * \param [out] orientation The face orientation is computed and stored there. * All other parameters and behavior are identical to \ref `t8_forest_leaf_face_neighbors`. */ From 33b26232c3e6c2e637fa956e14b4502a8efb4c03 Mon Sep 17 00:00:00 2001 From: Ole Albers <122293607+ole-alb@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:03:46 +0200 Subject: [PATCH 4/7] Update src/t8_forest/t8_forest_general.h Co-authored-by: Johannes Holke --- src/t8_forest/t8_forest_general.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/t8_forest/t8_forest_general.h b/src/t8_forest/t8_forest_general.h index f71cd31fa1..30113e5252 100644 --- a/src/t8_forest/t8_forest_general.h +++ b/src/t8_forest/t8_forest_general.h @@ -589,7 +589,9 @@ t8_forest_leaf_face_neighbors (t8_forest_t forest, t8_locidx_t ltreeid, const t8 * \param [in] forest_is_balanced True if we know that \a forest is balanced, false * otherwise. * \param [out] gneigh_tree The global tree IDs of the neighbor trees. - * \param [out] orientation The face orientation is computed and stored there. + * \param [out] orientation If not NULL on input, the face orientation is computed and stored here. + * Thus, if the face connection is an inter-tree connection the orientation of the tree-to-tree connection is stored. + * Otherwise, the value 0 is stored. * All other parameters and behavior are identical to \ref `t8_forest_leaf_face_neighbors`. */ void From e645e9f17b8289c2ba29fb2df14127c5eed48d64 Mon Sep 17 00:00:00 2001 From: Ole Albers <122293607+ole-alb@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:04:08 +0200 Subject: [PATCH 5/7] Update src/t8_forest/t8_forest_general.h Co-authored-by: Johannes Holke --- src/t8_forest/t8_forest_general.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/t8_forest/t8_forest_general.h b/src/t8_forest/t8_forest_general.h index 30113e5252..25bf4b5d16 100644 --- a/src/t8_forest/t8_forest_general.h +++ b/src/t8_forest/t8_forest_general.h @@ -593,6 +593,20 @@ t8_forest_leaf_face_neighbors (t8_forest_t forest, t8_locidx_t ltreeid, const t8 * Thus, if the face connection is an inter-tree connection the orientation of the tree-to-tree connection is stored. * Otherwise, the value 0 is stored. * All other parameters and behavior are identical to \ref `t8_forest_leaf_face_neighbors`. + * \note If there are no face neighbors, then *neighbor_leaves = NULL, num_neighbors = 0, + * and *pelement_indices = NULL on output. + * \note Currently \a forest must be balanced. + * \note \a forest must be committed before calling this function. + * + * \note Important! This routine allocates memory which must be freed. Do it like this: + * + * if (num_neighbors > 0) { + * eclass_scheme->t8_element_destroy (num_neighbors, neighbors); + * T8_FREE (pneighbor_leaves); + * T8_FREE (pelement_indices); + * T8_FREE (dual_faces); + * } + * */ void t8_forest_leaf_face_neighbors_ext (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *leaf, From b623aacd79e9c651b47540d31154d30267aa6914 Mon Sep 17 00:00:00 2001 From: Johannes Holke Date: Wed, 16 Oct 2024 15:31:56 +0200 Subject: [PATCH 6/7] White space correction --- src/t8_forest/t8_forest_general.h | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/t8_forest/t8_forest_general.h b/src/t8_forest/t8_forest_general.h index aaeaeba88f..c06b03c56b 100644 --- a/src/t8_forest/t8_forest_general.h +++ b/src/t8_forest/t8_forest_general.h @@ -571,23 +571,23 @@ t8_forest_leaf_face_neighbors (t8_forest_t forest, t8_locidx_t ltreeid, const t8 int forest_is_balanced); /** Like \ref t8_forest_leaf_face_neighbors but also provides information about the global neighbors and the orientation. - * \param [in] forest The forest. Must have a valid ghost layer. - * \param [in] ltreeid A local tree id. - * \param [in] leaf A leaf in tree \a ltreeid of \a forest. - * \param [out] pneighbor_leaves Unallocated on input. On output the neighbor - * leaves are stored here. - * \param [in] face The index of the face across which the face neighbors - * are searched. - * \param [out] dual_faces On output the face id's of the neighboring elements' faces. - * \param [out] num_neighbors On output the number of neighbor leaves. - * \param [out] pelement_indices Unallocated on input. On output the element indices - * of the neighbor leaves are stored here. - * 0, 1, ... num_local_el - 1 for local leaves and - * num_local_el , ... , num_local_el + num_ghosts - 1 for ghosts. - * \param [out] pneigh_scheme On output the eclass scheme of the neighbor elements. - * \param [in] forest_is_balanced True if we know that \a forest is balanced, false - * otherwise. - * \param [out] gneigh_tree The global tree IDs of the neighbor trees. + * \param [in] forest The forest. Must have a valid ghost layer. + * \param [in] ltreeid A local tree id. + * \param [in] leaf A leaf in tree \a ltreeid of \a forest. + * \param [out] pneighbor_leaves Unallocated on input. On output the neighbor + * leaves are stored here. + * \param [in] face The index of the face across which the face neighbors + * are searched. + * \param [out] dual_faces On output the face id's of the neighboring elements' faces. + * \param [out] num_neighbors On output the number of neighbor leaves. + * \param [out] pelement_indices Unallocated on input. On output the element indices + * of the neighbor leaves are stored here. + * 0, 1, ... num_local_el - 1 for local leaves and + * num_local_el , ... , num_local_el + num_ghosts - 1 for ghosts. + * \param [out] pneigh_scheme On output the eclass scheme of the neighbor elements. + * \param [in] forest_is_balanced True if we know that \a forest is balanced, false + * otherwise. + * \param [out] gneigh_tree The global tree IDs of the neighbor trees. * \param [out] orientation If not NULL on input, the face orientation is computed and stored here. * Thus, if the face connection is an inter-tree connection the orientation of the tree-to-tree connection is stored. * Otherwise, the value 0 is stored. From 137ac4764d835cfd11261674f53d8090453c37a4 Mon Sep 17 00:00:00 2001 From: Johannes Holke Date: Wed, 16 Oct 2024 15:33:19 +0200 Subject: [PATCH 7/7] White space correction --- src/t8_forest/t8_forest_general.h | 44 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/t8_forest/t8_forest_general.h b/src/t8_forest/t8_forest_general.h index c06b03c56b..b8aed23f6f 100644 --- a/src/t8_forest/t8_forest_general.h +++ b/src/t8_forest/t8_forest_general.h @@ -571,27 +571,27 @@ t8_forest_leaf_face_neighbors (t8_forest_t forest, t8_locidx_t ltreeid, const t8 int forest_is_balanced); /** Like \ref t8_forest_leaf_face_neighbors but also provides information about the global neighbors and the orientation. - * \param [in] forest The forest. Must have a valid ghost layer. - * \param [in] ltreeid A local tree id. - * \param [in] leaf A leaf in tree \a ltreeid of \a forest. - * \param [out] pneighbor_leaves Unallocated on input. On output the neighbor - * leaves are stored here. - * \param [in] face The index of the face across which the face neighbors - * are searched. - * \param [out] dual_faces On output the face id's of the neighboring elements' faces. - * \param [out] num_neighbors On output the number of neighbor leaves. - * \param [out] pelement_indices Unallocated on input. On output the element indices - * of the neighbor leaves are stored here. - * 0, 1, ... num_local_el - 1 for local leaves and - * num_local_el , ... , num_local_el + num_ghosts - 1 for ghosts. - * \param [out] pneigh_scheme On output the eclass scheme of the neighbor elements. - * \param [in] forest_is_balanced True if we know that \a forest is balanced, false - * otherwise. - * \param [out] gneigh_tree The global tree IDs of the neighbor trees. - * \param [out] orientation If not NULL on input, the face orientation is computed and stored here. - * Thus, if the face connection is an inter-tree connection the orientation of the tree-to-tree connection is stored. - * Otherwise, the value 0 is stored. - * All other parameters and behavior are identical to \ref `t8_forest_leaf_face_neighbors`. + * \param [in] forest The forest. Must have a valid ghost layer. + * \param [in] ltreeid A local tree id. + * \param [in] leaf A leaf in tree \a ltreeid of \a forest. + * \param [out] pneighbor_leaves Unallocated on input. On output the neighbor + * leaves are stored here. + * \param [in] face The index of the face across which the face neighbors + * are searched. + * \param [out] dual_faces On output the face id's of the neighboring elements' faces. + * \param [out] num_neighbors On output the number of neighbor leaves. + * \param [out] pelement_indices Unallocated on input. On output the element indices + * of the neighbor leaves are stored here. + * 0, 1, ... num_local_el - 1 for local leaves and + * num_local_el , ... , num_local_el + num_ghosts - 1 for ghosts. + * \param [out] pneigh_scheme On output the eclass scheme of the neighbor elements. + * \param [in] forest_is_balanced True if we know that \a forest is balanced, false + * otherwise. + * \param [out] gneigh_tree The global tree IDs of the neighbor trees. + * \param [out] orientation If not NULL on input, the face orientation is computed and stored here. + * Thus, if the face connection is an inter-tree connection the orientation of the tree-to-tree connection is stored. + * Otherwise, the value 0 is stored. + * All other parameters and behavior are identical to \ref `t8_forest_leaf_face_neighbors`. * \note If there are no face neighbors, then *neighbor_leaves = NULL, num_neighbors = 0, * and *pelement_indices = NULL on output. * \note Currently \a forest must be balanced. @@ -606,7 +606,7 @@ t8_forest_leaf_face_neighbors (t8_forest_t forest, t8_locidx_t ltreeid, const t8 * T8_FREE (dual_faces); * } * - */ + */ void t8_forest_leaf_face_neighbors_ext (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *leaf, t8_element_t **pneighbor_leaves[], int face, int *dual_faces[], int *num_neighbors,