diff --git a/src/t8_schemes/t8_default/t8_default_hex/t8_default_hex_cxx.cxx b/src/t8_schemes/t8_default/t8_default_hex/t8_default_hex_cxx.cxx index 7fe5a8db20..4c183d0e16 100644 --- a/src/t8_schemes/t8_default/t8_default_hex/t8_default_hex_cxx.cxx +++ b/src/t8_schemes/t8_default/t8_default_hex/t8_default_hex_cxx.cxx @@ -618,14 +618,14 @@ t8_default_scheme_hex_c::t8_element_root_len (const t8_element_t *elem) const } void -t8_default_scheme_hex_c::t8_element_vertex_coords (const t8_element_t *t, +t8_default_scheme_hex_c::t8_element_vertex_coords (const t8_element_t *elem, int vertex, int coords[]) const { - const p8est_quadrant_t *q1 = (const p8est_quadrant_t *) t; + const p8est_quadrant_t *q1 = (const p8est_quadrant_t *) elem; int len; - T8_ASSERT (t8_element_is_valid (t)); + T8_ASSERT (t8_element_is_valid (elem)); T8_ASSERT (0 <= vertex && vertex < 8); /* Get the length of the quadrant */ len = P8EST_QUADRANT_LEN (q1->level); @@ -638,16 +638,17 @@ t8_default_scheme_hex_c::t8_element_vertex_coords (const t8_element_t *t, void t8_default_scheme_hex_c::t8_element_vertex_reference_coords (const - t8_element_t *t, + t8_element_t + *elem, const int vertex, double coords[]) const { - T8_ASSERT (t8_element_is_valid (t)); + T8_ASSERT (t8_element_is_valid (elem)); T8_ASSERT (0 <= vertex && vertex < 8); int coords_int[3]; - t8_element_vertex_coords (t, vertex, coords_int); + t8_element_vertex_coords (elem, vertex, coords_int); /* We divide the integer coordinates by the root length of the hex * to obtain the reference coordinates. */ diff --git a/src/t8_schemes/t8_default/t8_default_hex/t8_default_hex_cxx.hxx b/src/t8_schemes/t8_default/t8_default_hex/t8_default_hex_cxx.hxx index f209134bd8..a1eaf1c103 100644 --- a/src/t8_schemes/t8_default/t8_default_hex/t8_default_hex_cxx.hxx +++ b/src/t8_schemes/t8_default/t8_default_hex/t8_default_hex_cxx.hxx @@ -545,24 +545,24 @@ public: * elements are positioned in a cube [0,1]^(dL) with dimension d (=0,1,2,3) and * L the maximum refinement level. * All element vertices have integer coordinates in this cube. - * \param [in] t The element to be considered. + * \param [in] elem The element to be considered. * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many integers as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ - virtual void t8_element_vertex_coords (const t8_element_t *t, + virtual void t8_element_vertex_coords (const t8_element_t *elem, int vertex, int coords[]) const; /** Compute the coordinates of a given element vertex inside a reference tree * that is embedded into [0,1]^d (d = dimension). - * \param [in] t The element to be considered. + * \param [in] elem The element to be considered. * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many doubles as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ virtual void t8_element_vertex_reference_coords (const t8_element_t - *t, + *elem, const int vertex, double coords[]) const; diff --git a/src/t8_schemes/t8_default/t8_default_line/t8_default_line_cxx.cxx b/src/t8_schemes/t8_default/t8_default_line/t8_default_line_cxx.cxx index 840c7db864..b88165b248 100644 --- a/src/t8_schemes/t8_default/t8_default_line/t8_default_line_cxx.cxx +++ b/src/t8_schemes/t8_default/t8_default_line/t8_default_line_cxx.cxx @@ -346,24 +346,25 @@ t8_default_scheme_line_c::t8_element_last_descendant (const t8_element_t } void -t8_default_scheme_line_c::t8_element_vertex_coords (const t8_element_t *t, +t8_default_scheme_line_c::t8_element_vertex_coords (const t8_element_t *elem, int vertex, int coords[]) const { - T8_ASSERT (t8_element_is_valid (t)); - t8_dline_vertex_coords ((const t8_dline_t *) t, vertex, coords); + T8_ASSERT (t8_element_is_valid (elem)); + t8_dline_vertex_coords ((const t8_dline_t *) elem, vertex, coords); } void t8_default_scheme_line_c::t8_element_vertex_reference_coords (const - t8_element_t *t, + t8_element_t + *elem, const int vertex, double coords[]) const { - T8_ASSERT (t8_element_is_valid (t)); - t8_dline_vertex_ref_coords ((const t8_dline_t *) t, vertex, coords); + T8_ASSERT (t8_element_is_valid (elem)); + t8_dline_vertex_ref_coords ((const t8_dline_t *) elem, vertex, coords); } int diff --git a/src/t8_schemes/t8_default/t8_default_line/t8_default_line_cxx.hxx b/src/t8_schemes/t8_default/t8_default_line/t8_default_line_cxx.hxx index d0a605a70e..a6d6a8ffd2 100644 --- a/src/t8_schemes/t8_default/t8_default_line/t8_default_line_cxx.hxx +++ b/src/t8_schemes/t8_default/t8_default_line/t8_default_line_cxx.hxx @@ -21,7 +21,9 @@ */ /** \file t8_default_lines.h - * The default implementation for lines. + * The default implementation for lines. Interface between the + * \file t8_default_common_cxx.hxx definitions and the element type specific + * implementations in \file t8_dline_bits.h */ #ifndef T8_DEFAULT_LINE_CXX_HXX @@ -563,24 +565,24 @@ public: * elements are positioned in a cube [0,1]^(dL) with dimension d (=0,1,2,3) and * L the maximum refinement level. * All element vertices have integer coordinates in this cube. - * \param [in] t The element to be considered. - * \param [in] vertex The id of the vertex whose coordinates shall be computed. + * \param [in] elem The element to be considered. + * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many integers as the element's dimension - * whose entries will be filled with the coordinates of \a vertex. + * whose entries will be filled with the coordinates of \a vertex. */ - virtual void t8_element_vertex_coords (const t8_element_t *t, + virtual void t8_element_vertex_coords (const t8_element_t *elem, int vertex, int coords[]) const; /** Compute the coordinates of a given element vertex inside a reference tree * that is embedded into [0,1]^d (d = dimension). - * \param [in] t The element to be considered. - * \param [in] vertex The id of the vertex whose coordinates shall be computed. + * \param [in] elem The element to be considered. + * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many doubles as the element's dimension - * whose entries will be filled with the coordinates of \a vertex. + * whose entries will be filled with the coordinates of \a vertex. */ virtual void t8_element_vertex_reference_coords (const t8_element_t - *t, + *elem, const int vertex, double coords[]) const; diff --git a/src/t8_schemes/t8_default/t8_default_line/t8_dline_bits.h b/src/t8_schemes/t8_default/t8_default_line/t8_dline_bits.h index 5dea842eba..d59f3cf295 100644 --- a/src/t8_schemes/t8_default/t8_default_line/t8_dline_bits.h +++ b/src/t8_schemes/t8_default/t8_default_line/t8_dline_bits.h @@ -21,6 +21,7 @@ */ /** \file t8_dline_bits.h + * Definitions of line-specific functions. */ #ifndef T8_DLINE_BITS_H diff --git a/src/t8_schemes/t8_default/t8_default_prism/t8_default_prism_cxx.hxx b/src/t8_schemes/t8_default/t8_default_prism/t8_default_prism_cxx.hxx index 92e138d06c..10d77a0f21 100644 --- a/src/t8_schemes/t8_default/t8_default_prism/t8_default_prism_cxx.hxx +++ b/src/t8_schemes/t8_default/t8_default_prism/t8_default_prism_cxx.hxx @@ -21,7 +21,9 @@ */ /** \file t8_default_prism_cxx.hxx - * The default implementation for prism. + * The default implementation for prisms. Interface between the + * \file t8_default_common_cxx.hxx definitions and the element type specific + * implementations in \file t8_dprism_bits.h */ #ifndef T8_DEFAULT_PRISM_CXX_HXX @@ -583,13 +585,13 @@ public: /** Compute the coordinates of a given element vertex inside a reference tree * that is embedded into [0,1]^d (d = dimension). - * \param [in] t The element to be considered. + * \param [in] elem The element to be considered. * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many doubles as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ virtual void t8_element_vertex_reference_coords (const t8_element_t - *t, + *elem, const int vertex, double coords[]) const; diff --git a/src/t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.c b/src/t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.c index af351aafd8..a28d6e7d12 100644 --- a/src/t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.c +++ b/src/t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.c @@ -550,29 +550,29 @@ t8_dprism_corner_descendant (const t8_dprism_t *p, t8_dprism_t *s, } void -t8_dprism_vertex_coords (const t8_dprism_t *p, const int vertex, +t8_dprism_vertex_coords (const t8_dprism_t *elem, const int vertex, int coords[3]) { T8_ASSERT (vertex >= 0 && vertex < 6); - T8_ASSERT (p->line.level == p->tri.level); + T8_ASSERT (elem->line.level == elem->tri.level); /*Compute x and y coordinate */ - t8_dtri_compute_coords (&p->tri, vertex % 3, coords); + t8_dtri_compute_coords (&elem->tri, vertex % 3, coords); /*Compute z coordinatecoords[0] *= T8_DPRISM_ROOT_BY_DTRI_ROOT; */ - t8_dline_vertex_coords (&p->line, vertex / 3, &coords[2]); + t8_dline_vertex_coords (&elem->line, vertex / 3, &coords[2]); coords[0] /= T8_DPRISM_ROOT_BY_DTRI_ROOT; coords[1] /= T8_DPRISM_ROOT_BY_DTRI_ROOT; coords[2] /= T8_DPRISM_ROOT_BY_DLINE_ROOT; } void -t8_dprism_vertex_ref_coords (const t8_dprism_t *p, const int vertex, +t8_dprism_vertex_ref_coords (const t8_dprism_t *elem, const int vertex, double coords[3]) { int coords_int[3]; T8_ASSERT (vertex >= 0 && vertex < 6); /* Compute the integere coordinates in [0, root_len]^3 */ - t8_dprism_vertex_coords (p, vertex, coords_int); + t8_dprism_vertex_coords (elem, vertex, coords_int); /* Divide by the root length. */ coords[0] = coords_int[0] / (double) T8_DPRISM_ROOT_LEN; diff --git a/src/t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.h b/src/t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.h index d51ec49985..47780e7988 100644 --- a/src/t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.h +++ b/src/t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.h @@ -21,6 +21,7 @@ */ /** \file t8_dprism_bits.h + * Definition if prism-specific functions. */ #ifndef T8_DPRISM_BITS_H @@ -295,22 +296,22 @@ void t8_dprism_corner_descendant (const t8_dprism_t *p, int level); /** Compute the coordinates of a vertex of a prism. - * \param [in] p Input prism. - * \param [in] vertex The number of the vertex. + * \param [in] elem Input prism. + * \param [in] vertex The number of the vertex. * \param [out] coordinates An array of 3 t8_dprism_coord_t that * will be filled with the coordinates of the vertex. */ -void t8_dprism_vertex_coords (const t8_dprism_t *p, +void t8_dprism_vertex_coords (const t8_dprism_t *elem, int vertex, int coords[3]); /** Compute the reference coordinates of a vertex of a prism when the - * tree (level 0 prism) is embedded in [0,1]^3. - * \param [in] p Input prism. - * \param [in] vertex The number of the vertex. + * tree (level 0) is embedded in [0,1]^3. + * \param [in] elem Input prism. + * \param [in] vertex The number of the vertex. * \param [out] coordinates An array of 3 double that * will be filled with the reference coordinates of the vertex. */ -void t8_dprism_vertex_ref_coords (const t8_dprism_t *p, +void t8_dprism_vertex_ref_coords (const t8_dprism_t *elem, int vertex, double coords[3]); diff --git a/src/t8_schemes/t8_default/t8_default_pyramid/t8_default_pyramid_cxx.hxx b/src/t8_schemes/t8_default/t8_default_pyramid/t8_default_pyramid_cxx.hxx index 7b42716d94..b7e7c23b83 100644 --- a/src/t8_schemes/t8_default/t8_default_pyramid/t8_default_pyramid_cxx.hxx +++ b/src/t8_schemes/t8_default/t8_default_pyramid/t8_default_pyramid_cxx.hxx @@ -21,7 +21,9 @@ */ /** \file t8_default_pyramid_cxx.hxx - * The default implementation for pyramid. + * The default implementation for pyramids. Interface between the + * \file t8_default_common_cxx.hxx definitions and the element type specific + * implementations in \file t8_dpyramid_bits.h */ #ifndef T8_DEFAULT_PYRAMID_CXX_HXX @@ -602,13 +604,13 @@ public: /** Compute the coordinates of a given element vertex inside a reference tree * that is embedded into [0,1]^d (d = dimension). - * \param [in] t The element to be considered. - * \param [in] vertex The id of the vertex whose coordinates shall be computed. + * \param [in] elem The element to be considered. + * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many doubles as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ virtual void t8_element_vertex_reference_coords (const t8_element_t - *t, + *elem, const int vertex, double coords[]) const; diff --git a/src/t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.h b/src/t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.h index 28caf3ad9e..14f5e35730 100644 --- a/src/t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.h +++ b/src/t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.h @@ -20,6 +20,10 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/** \file t8_dpyramid_bits.h + * Definitions of pyramid-specific functions. + */ + #ifndef T8_DPYRAMID_BITS_H #define T8_DPYRAMID_BITS_H diff --git a/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad_cxx.cxx b/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad_cxx.cxx index b6e16435ec..15d91e4cc5 100644 --- a/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad_cxx.cxx +++ b/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad_cxx.cxx @@ -752,14 +752,14 @@ t8_default_scheme_quad_c::t8_element_root_len (const t8_element_t *elem) const } void -t8_default_scheme_quad_c::t8_element_vertex_coords (const t8_element_t *t, +t8_default_scheme_quad_c::t8_element_vertex_coords (const t8_element_t *elem, int vertex, int coords[]) const { - const p4est_quadrant_t *q1 = (const p4est_quadrant_t *) t; + const p4est_quadrant_t *q1 = (const p4est_quadrant_t *) elem; int len; - T8_ASSERT (t8_element_is_valid (t)); + T8_ASSERT (t8_element_is_valid (elem)); T8_ASSERT (0 <= vertex && vertex < 4); /* Get the length of the quadrant */ len = P4EST_QUADRANT_LEN (q1->level); @@ -771,17 +771,18 @@ t8_default_scheme_quad_c::t8_element_vertex_coords (const t8_element_t *t, void t8_default_scheme_quad_c::t8_element_vertex_reference_coords (const - t8_element_t *t, + t8_element_t + *elem, const int vertex, double coords[]) const { - T8_ASSERT (t8_element_is_valid (t)); + T8_ASSERT (t8_element_is_valid (elem)); T8_ASSERT (0 <= vertex && vertex < 4); int coords_int[2]; - t8_element_vertex_coords (t, vertex, coords_int); + t8_element_vertex_coords (elem, vertex, coords_int); /* We divide the integer coordinates by the root length of the quad * to obtain the reference coordinates. */ diff --git a/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad_cxx.hxx b/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad_cxx.hxx index a0e363bb54..46cba1eafe 100644 --- a/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad_cxx.hxx +++ b/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad_cxx.hxx @@ -578,24 +578,24 @@ public: * elements are positioned in a cube [0,1]^(dL) with dimension d (=0,1,2,3) and * L the maximum refinement level. * All element vertices have integer coordinates in this cube. - * \param [in] t The element to be considered. - * \param [in] vertex The id of the vertex whose coordinates shall be computed. + * \param [in] elem The element to be considered. + * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many integers as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ - virtual void t8_element_vertex_coords (const t8_element_t *t, + virtual void t8_element_vertex_coords (const t8_element_t *elem, int vertex, int coords[]) const; /** Compute the coordinates of a given element vertex inside a reference tree * that is embedded into [0,1]^d (d = dimension). - * \param [in] t The element to be considered. - * \param [in] vertex The id of the vertex whose coordinates shall be computed. + * \param [in] elem The element. + * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many doubles as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ virtual void t8_element_vertex_reference_coords (const t8_element_t - *t, + *elem, const int vertex, double coords[]) const; diff --git a/src/t8_schemes/t8_default/t8_default_tet/t8_default_tet_cxx.cxx b/src/t8_schemes/t8_default/t8_default_tet/t8_default_tet_cxx.cxx index b0ddfbf69e..faf2e2c39b 100644 --- a/src/t8_schemes/t8_default/t8_default_tet/t8_default_tet_cxx.cxx +++ b/src/t8_schemes/t8_default/t8_default_tet/t8_default_tet_cxx.cxx @@ -522,12 +522,12 @@ t8_default_scheme_tet_c::t8_element_root_len (const t8_element_t *elem) const } void -t8_default_scheme_tet_c::t8_element_vertex_coords (const t8_element_t *t, +t8_default_scheme_tet_c::t8_element_vertex_coords (const t8_element_t *elem, int vertex, int coords[]) const { - T8_ASSERT (t8_element_is_valid (t)); - t8_dtet_compute_coords ((const t8_default_tet_t *) t, vertex, coords); + T8_ASSERT (t8_element_is_valid (elem)); + t8_dtet_compute_coords ((const t8_default_tet_t *) elem, vertex, coords); } void @@ -545,13 +545,15 @@ t8_default_scheme_tet_c::t8_element_general_function (const t8_element_t void t8_default_scheme_tet_c::t8_element_vertex_reference_coords (const - t8_element_t *t, + t8_element_t + *elem, const int vertex, double coords[]) const { - T8_ASSERT (t8_element_is_valid (t)); - t8_dtet_compute_ref_coords ((const t8_default_tet_t *) t, vertex, coords); + T8_ASSERT (t8_element_is_valid (elem)); + t8_dtet_compute_vertex_ref_coords ((const t8_default_tet_t *) elem, vertex, + coords); } /** Returns true, if there is one element in the tree, that does not refine into 2^dim children. diff --git a/src/t8_schemes/t8_default/t8_default_tet/t8_default_tet_cxx.hxx b/src/t8_schemes/t8_default/t8_default_tet/t8_default_tet_cxx.hxx index 638288503f..d3895bd325 100644 --- a/src/t8_schemes/t8_default/t8_default_tet/t8_default_tet_cxx.hxx +++ b/src/t8_schemes/t8_default/t8_default_tet/t8_default_tet_cxx.hxx @@ -21,7 +21,9 @@ */ /** \file t8_default_tet_cxx.hxx - * The default implementation for tetrahedra. + * The default implementation for tetrahedra. Interface between the + * \file t8_default_common_cxx.hxx definitions and the element type specific + * implementations in \file t8_dtet_bits.h */ #ifndef T8_DEFAULT_TET_CXX_H @@ -547,12 +549,12 @@ public: * elements are positioned in a cube [0,1]^(dL) with dimension d (=0,1,2,3) and * L the maximum refinement level. * All element vertices have integer coordinates in this cube. - * \param [in] t The element to be considered. - * \param [in] vertex The id of the vertex whose coordinates shall be computed. + * \param [in] elem The element to be considered. + * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many integers as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ - virtual void t8_element_vertex_coords (const t8_element_t *t, + virtual void t8_element_vertex_coords (const t8_element_t *elem, const int vertex, int coords[]) const; @@ -569,13 +571,13 @@ public: /** Compute the coordinates of a given element vertex inside a reference tree * that is embedded into [0,1]^d (d = dimension). - * \param [in] t The element to be considered. - * \param [in] vertex The id of the vertex whose coordinates shall be computed. + * \param [in] elem The element to be considered. + * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many doubles as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ virtual void t8_element_vertex_reference_coords (const t8_element_t - *t, + *elem, const int vertex, double coords[]) const; diff --git a/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_bits.h b/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_bits.h index f6eb8575a9..0961eaba73 100644 --- a/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_bits.h +++ b/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_bits.h @@ -21,7 +21,7 @@ */ /** \file t8_dtet_bits.h - * TODO: Document this. + * Definitions of tet-specific functions. * TODO: Run make doxygen and grep for files. * Also document all arguments of functions. * TODO: Group the dtet_is functions together. @@ -41,26 +41,26 @@ T8_EXTERN_C_BEGIN (); * \param [out] coordinates An array of 3 t8_dtet_coord_t that * will be filled with the coordinates of the vertex. */ -void t8_dtet_compute_coords (const t8_dtet_t *t, int vertex, +void t8_dtet_compute_coords (const t8_dtet_t *elem, int vertex, t8_dtet_coord_t coordinates[3]); /** Compute the coordinates of a vertex of a tetrahedron when the * tree (level 0 tetrahedron) is embedded in [0,1]^3. - * \param [in] t Input tetrahedron. - * \param [in] vertex The number of the vertex. + * \param [in] elem Input tetrahedron. + * \param [in] vertex The number of the vertex. * \param [out] coordinates An array of 3 double that * will be filled with the reference coordinates of the vertex. */ -void t8_dtet_compute_ref_coords (const t8_dtet_t *t, - int vertex, - double coordinates[3]); +void t8_dtet_compute_vertex_ref_coords (const t8_dtet_t *elem, + int vertex, + double coordinates[3]); /** Compute the coordinates of the four vertices of a tetrahedron. - * \param [in] t Input tetrahedron. + * \param [in] elem Input tetrahedron. * \param [out] coordinates An array of 4x3 t8_dtet_coord_t that * will be filled with the coordinates of t's vertices. */ -void t8_dtet_compute_all_coords (const t8_dtet_t *t, +void t8_dtet_compute_all_coords (const t8_dtet_t *elem, t8_dtet_coord_t coordinates[4][3]); diff --git a/src/t8_schemes/t8_default/t8_default_tet/t8_dtri_to_dtet.h b/src/t8_schemes/t8_default/t8_default_tet/t8_dtri_to_dtet.h index 6a2c687e3c..cd9abd3d80 100644 --- a/src/t8_schemes/t8_default/t8_default_tet/t8_dtri_to_dtet.h +++ b/src/t8_schemes/t8_default/t8_default_tet/t8_dtri_to_dtet.h @@ -72,7 +72,7 @@ T8_EXTERN_C_BEGIN (); #define t8_dtri_ancestor t8_dtet_ancestor #define t8_dtri_compute_all_coords t8_dtet_compute_all_coords #define t8_dtri_compute_coords t8_dtet_compute_coords -#define t8_dtri_compute_ref_coords t8_dtet_compute_ref_coords +#define t8_dtri_compute_vertex_ref_coords t8_dtet_compute_vertex_ref_coords #define t8_dtri_child t8_dtet_child #define t8_dtri_childrenpv t8_dtet_childrenpv #define t8_dtri_is_familypv t8_dtet_is_familypv diff --git a/src/t8_schemes/t8_default/t8_default_tri/t8_default_tri_cxx.cxx b/src/t8_schemes/t8_default/t8_default_tri/t8_default_tri_cxx.cxx index ba1a3dff6c..4bf8fefb89 100644 --- a/src/t8_schemes/t8_default/t8_default_tri/t8_default_tri_cxx.cxx +++ b/src/t8_schemes/t8_default/t8_default_tri/t8_default_tri_cxx.cxx @@ -541,12 +541,12 @@ t8_default_scheme_tri_c::t8_element_root_len (const t8_element_t *elem) const } void -t8_default_scheme_tri_c::t8_element_vertex_coords (const t8_element_t *t, +t8_default_scheme_tri_c::t8_element_vertex_coords (const t8_element_t *elem, int vertex, int coords[]) const { - T8_ASSERT (t8_element_is_valid (t)); - t8_dtri_compute_coords ((const t8_dtri_t *) t, vertex, coords); + T8_ASSERT (t8_element_is_valid (elem)); + t8_dtri_compute_coords ((const t8_dtri_t *) elem, vertex, coords); } void @@ -564,13 +564,15 @@ t8_default_scheme_tri_c::t8_element_general_function (const t8_element_t void t8_default_scheme_tri_c::t8_element_vertex_reference_coords (const - t8_element_t *t, + t8_element_t + *elem, const int vertex, double coords[]) const { - T8_ASSERT (t8_element_is_valid (t)); - t8_dtri_compute_ref_coords ((const t8_dtri_t *) t, vertex, coords); + T8_ASSERT (t8_element_is_valid (elem)); + t8_dtri_compute_vertex_ref_coords ((const t8_dtri_t *) elem, vertex, + coords); } int diff --git a/src/t8_schemes/t8_default/t8_default_tri/t8_default_tri_cxx.hxx b/src/t8_schemes/t8_default/t8_default_tri/t8_default_tri_cxx.hxx index 186c990a73..44e0f97227 100644 --- a/src/t8_schemes/t8_default/t8_default_tri/t8_default_tri_cxx.hxx +++ b/src/t8_schemes/t8_default/t8_default_tri/t8_default_tri_cxx.hxx @@ -21,7 +21,9 @@ */ /** \file t8_default_tri.h - * The default implementation for triangles. + * The default implementation for triangles. Interface between the + * \file t8_default_common_cxx.hxx definitions and the element type specific + * implementations in \file t8_dtri_bits.h */ #ifndef T8_DEFAULT_TRI_CXX_H @@ -540,12 +542,12 @@ public: * elements are positioned in a cube [0,1]^(dL) with dimension d (=0,1,2,3) and * L the maximum refinement level. * All element vertices have integer coordinates in this cube. - * \param [in] t The element to be considered. + * \param [in] elem The element to be considered. * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many integers as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ - virtual void t8_element_vertex_coords (const t8_element_t *t, + virtual void t8_element_vertex_coords (const t8_element_t *elem, int vertex, int coords[]) const; @@ -562,13 +564,13 @@ public: /** Compute the coordinates of a given element vertex inside a reference tree * that is embedded into [0,1]^d (d = dimension). - * \param [in] t The element to be considered. - * \param [in] vertex The id of the vertex whose coordinates shall be computed. + * \param [in] elem The element to be considered. + * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many doubles as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ virtual void t8_element_vertex_reference_coords (const t8_element_t - *t, + *elem, const int vertex, double coords[]) const; diff --git a/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.c b/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.c index 05a8db2c50..eb233e5187 100644 --- a/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.c +++ b/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.c @@ -288,9 +288,31 @@ t8_dtri_ancestor (const t8_dtri_t *t, int level, t8_dtri_t *ancestor) /* Compute the coordinates of a given vertex of a triangle/tet */ void -t8_dtri_compute_coords (const t8_dtri_t *t, const int vertex, +t8_dtri_compute_coords (const t8_dtri_t *elem, const int vertex, t8_dtri_coord_t coordinates[T8_DTRI_DIM]) { + /* Calculate the vertex coordinates of a triangle/tetrahedron in + * relation to its orientation. Orientations are described here: + * https://doi.org/10.1137/15M1040049 + * 1---------------------2 + * | orientation / 2 + * | 1 / / | + * | / / | + * | / / | + * | / / | + * | / / | + * | / / | + * | / / | + * | / / orientation | + * | / / 0 | + * 0 / | + * 0--------------------1 + * + * y + * ^ + * | + * z--> x + */ t8_dtri_type_t type; int ei; #ifdef T8_DTRI_TO_DTET @@ -299,8 +321,8 @@ t8_dtri_compute_coords (const t8_dtri_t *t, const int vertex, t8_dtri_coord_t h; T8_ASSERT (0 <= vertex && vertex < T8_DTRI_FACES); - type = t->type; - h = T8_DTRI_LEN (t->level); + type = elem->type; + h = T8_DTRI_LEN (elem->level); #ifndef T8_DTRI_TO_DTET ei = type; #else @@ -308,10 +330,10 @@ t8_dtri_compute_coords (const t8_dtri_t *t, const int vertex, ej = (ei + ((type % 2 == 0) ? 2 : 1)) % 3; #endif - coordinates[0] = t->x; - coordinates[1] = t->y; + coordinates[0] = elem->x; + coordinates[1] = elem->y; #ifdef T8_DTRI_TO_DTET - coordinates[2] = t->z; + coordinates[2] = elem->z; #endif if (vertex == 0) { return; @@ -336,13 +358,13 @@ t8_dtri_compute_coords (const t8_dtri_t *t, const int vertex, } void -t8_dtri_compute_ref_coords (const t8_dtri_t *t, const int vertex, - double coordinates[T8_DTRI_DIM]) +t8_dtri_compute_vertex_ref_coords (const t8_dtri_t *elem, const int vertex, + double coordinates[T8_DTRI_DIM]) { int coords_int[T8_DTRI_DIM]; T8_ASSERT (0 <= vertex && vertex < T8_DTRI_CORNERS); - t8_dtri_compute_coords (t, vertex, coords_int); + t8_dtri_compute_coords (elem, vertex, coords_int); /* Since the integer coordinates are coordinates w.r.t to * the embedding into [0,T8_DTRI_ROOT_LEN]^d, we just need * to divide them by the root length. */ @@ -355,10 +377,32 @@ t8_dtri_compute_ref_coords (const t8_dtri_t *t, const int vertex, /* Compute the coordinates of each vertex of a triangle/tet */ void -t8_dtri_compute_all_coords (const t8_dtri_t *t, +t8_dtri_compute_all_coords (const t8_dtri_t *elem, t8_dtri_coord_t coordinates[T8_DTRI_FACES][T8_DTRI_DIM]) { + /* Calculate the vertex coordinates of a triangle/tetrahedron in + * relation to its orientation. Orientations are described here: + * https://doi.org/10.1137/15M1040049 + * 1---------------------2 + * | orientation / 2 + * | 1 / / | + * | / / | + * | / / | + * | / / | + * | / / | + * | / / | + * | / / | + * | / / orientation | + * | / / 0 | + * 0 / | + * 0--------------------1 + * + * y + * ^ + * | + * z--> x + */ t8_dtri_type_t type; int ei; #ifdef T8_DTRI_TO_DTET @@ -367,8 +411,8 @@ t8_dtri_compute_all_coords (const t8_dtri_t *t, int i; t8_dtri_coord_t h; - type = t->type; - h = T8_DTRI_LEN (t->level); + type = elem->type; + h = T8_DTRI_LEN (elem->level); #ifndef T8_DTRI_TO_DTET ei = type; #else @@ -376,10 +420,10 @@ t8_dtri_compute_all_coords (const t8_dtri_t *t, ej = (ei + ((type % 2 == 0) ? 2 : 1)) % 3; #endif - coordinates[0][0] = t->x; - coordinates[0][1] = t->y; + coordinates[0][0] = elem->x; + coordinates[0][1] = elem->y; #ifdef T8_DTRI_TO_DTET - coordinates[0][2] = t->z; + coordinates[0][2] = elem->z; #endif for (i = 0; i < T8_DTRI_DIM; i++) { coordinates[1][i] = coordinates[0][i]; @@ -403,7 +447,7 @@ t8_dtri_compute_all_coords (const t8_dtri_t *t, int ivertex; t8_dtri_coord_t coords[T8_DTRI_DIM]; for (ivertex = 0; ivertex < T8_DTRI_FACES; ivertex++) { - t8_dtri_compute_coords (t, ivertex, coords); + t8_dtri_compute_coords (elem, ivertex, coords); T8_ASSERT (coords[0] == coordinates[ivertex][0]); T8_ASSERT (coords[1] == coordinates[ivertex][1]); #ifdef T8_DTRI_TO_DTET diff --git a/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.h b/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.h index 8a7fbed63b..8dbb06d703 100644 --- a/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.h +++ b/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.h @@ -21,6 +21,7 @@ */ /** \file t8_dtri_bits.h + * Definitions of triangle-specific functions. */ #ifndef T8_DTRI_BITS_H @@ -66,32 +67,32 @@ void t8_dtri_ancestor (const t8_dtri_t *t, int level, t8_dtri_t *ancestor); /** Compute the coordinates of a vertex of a triangle. - * \param [in] t Input triangle. + * \param [in] elem Input triangle. + * \param [in] vertex The number of the vertex. * \param [out] coordinates An array of 2 t8_dtri_coord_t that - * will be filled with the coordinates of the vertex. - * \param [in] vertex The number of the vertex. + * will be filled with the coordinates of the vertex. */ -void t8_dtri_compute_coords (const t8_dtri_t *t, +void t8_dtri_compute_coords (const t8_dtri_t *elem, const int vertex, t8_dtri_coord_t coordinates[2]); /** Compute the reference coordinates of a vertex of a triangle when the * tree (level 0 triangle) is embedded in [0,1]^2. - * \param [in] t Input triangle. - * \param [in] vertex The number of the vertex. + * \param [in] elem Input triangle. + * \param [in] vertex The number of the vertex. * \param [out] coordinates An array of 2 double that * will be filled with the reference coordinates of the vertex. */ -void t8_dtri_compute_ref_coords (const t8_dtri_t *t, - const int vertex, - double coordinates[2]); +void t8_dtri_compute_vertex_ref_coords (const t8_dtri_t *elem, + const int vertex, + double coordinates[2]); /** Compute the coordinates of the four vertices of a triangle. - * \param [in] t Input triangle. + * \param [in] elem Input triangle. * \param [out] coordinates An array of 4x3 t8_dtri_coord_t that * will be filled with the coordinates of t's vertices. */ -void t8_dtri_compute_all_coords (const t8_dtri_t *t, +void t8_dtri_compute_all_coords (const t8_dtri_t *elem, t8_dtri_coord_t coordinates[3][2]); diff --git a/src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex_cxx.cxx b/src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex_cxx.cxx index 6a8aa14449..8fb279a219 100644 --- a/src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex_cxx.cxx +++ b/src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex_cxx.cxx @@ -299,8 +299,8 @@ t8_default_scheme_vertex_c::t8_element_vertex_coords (const t8_element_t /** Compute the coordinates of a given element vertex inside a reference tree * that is embedded into [0,1]^d (d = dimension). - * \param [in] t The element to be considered. - * \param [in] vertex The id of the vertex whose coordinates shall be computed. + * \param [in] elem The element. + * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many doubles as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ diff --git a/src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex_cxx.hxx b/src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex_cxx.hxx index d4e75ac344..31b85e7d57 100644 --- a/src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex_cxx.hxx +++ b/src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex_cxx.hxx @@ -21,7 +21,9 @@ */ /** \file t8_default_vertex.h - * The default implementation for vertex. + * The default implementation for vertices. Interface between the + * \file t8_default_common_cxx.hxx definitions and the element type specific + * implementations in \file t8_dvertex_bits.h */ #ifndef T8_DEFAULT_VERTEX_CXX_H @@ -591,24 +593,24 @@ public: * elements are positioned in a cube [0,1]^(dL) with dimension d (=0,1,2,3) and * L the maximum refinement level. * All element vertices have integer coordinates in this cube. - * \param [in] t The element to be considered. - * \param [in] vertex The id of the vertex whose coordinates shall be computed. + * \param [in] elem The element. + * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many integers as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ - virtual void t8_element_vertex_coords (const t8_element_t *t, + virtual void t8_element_vertex_coords (const t8_element_t *elem, int vertex, int coords[]) const; /** Compute the coordinates of a given element vertex inside a reference tree * that is embedded into [0,1]^d (d = dimension). - * \param [in] t The element to be considered. + * \param [in] elem The element. * \param [in] vertex The id of the vertex whose coordinates shall be computed. * \param [out] coords An array of at least as many doubles as the element's dimension * whose entries will be filled with the coordinates of \a vertex. */ virtual void t8_element_vertex_reference_coords (const t8_element_t - *t, + *elem, const int vertex, double coords[]) const; diff --git a/src/t8_schemes/t8_default/t8_default_vertex/t8_dvertex_bits.h b/src/t8_schemes/t8_default/t8_default_vertex/t8_dvertex_bits.h index 96bb284495..4ecdfd7d26 100644 --- a/src/t8_schemes/t8_default/t8_default_vertex/t8_dvertex_bits.h +++ b/src/t8_schemes/t8_default/t8_default_vertex/t8_dvertex_bits.h @@ -21,6 +21,7 @@ */ /** \file t8_dvertex_bits.h + * Definitions of vertex-specific functions. */ #ifndef T8_DVERTEX_BITS_H