Skip to content

Commit

Permalink
p4est_geometry: non-functional updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cburstedde committed Jul 21, 2024
1 parent a79f404 commit 24ed47f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
19 changes: 11 additions & 8 deletions src/p4est_geometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,21 @@ p4est_geometry_connectivity_X (p4est_geometry_t * geom,
p4est_topidx_t which_tree,
const double abc[3], double xyz[3])
{
P4EST_ASSERT (geom->user != NULL);
p4est_connectivity_t *connectivity = (p4est_connectivity_t *) geom->user;
P4EST_ASSERT (connectivity->tree_to_vertex != NULL);
const p4est_topidx_t *tree_to_vertex = connectivity->tree_to_vertex;
const p4est_topidx_t *ttv;
const double *v = connectivity->vertices;
double eta_x, eta_y, eta_z = 0.;
int j, k;
p4est_topidx_t vt[P4EST_CHILDREN];

P4EST_ASSERT (geom->user != NULL);
P4EST_ASSERT (connectivity->vertices != NULL);
P4EST_ASSERT (connectivity->tree_to_vertex != NULL);

/* retrieve corners of the tree */
ttv = connectivity->tree_to_vertex + which_tree * P4EST_CHILDREN;
for (k = 0; k < P4EST_CHILDREN; ++k) {
vt[k] = tree_to_vertex[which_tree * P4EST_CHILDREN + k];
vt[k] = *ttv++;
}

/* these are reference coordinates in [0, 1]**d */
Expand Down Expand Up @@ -173,7 +176,7 @@ p4est_geometry_new_connectivity (p4est_connectivity_t * conn)
/**
* Geometric coordinate transformation for icosahedron geometry.
*
* Define the geometric transformation from tree-local reference coordinates
* Define the geometric transformation from tree-local reference coordinates
* to physical space
*
* \param[in] geom associated geometry
Expand Down Expand Up @@ -340,7 +343,7 @@ p4est_geometry_new_icosahedron (p4est_connectivity_t * conn, double R)
/**
* Geometric coordinate transformation for shell2d geometry.
*
* Define the geometric transformation from tree-local reference coordinates
* Define the geometric transformation from tree-local reference coordinates
* to physical space.
*
* \param[in] geom associated geometry
Expand Down Expand Up @@ -430,7 +433,7 @@ p4est_geometry_new_shell2d (p4est_connectivity_t * conn, double R2, double R1)
/**
* geometric coordinate transformation for disk2d geometry.
*
* Define the geometric transformation from tree-local reference coordinates
* Define the geometric transformation from tree-local reference coordinates
* to physical space.
*
* \param[in] geom associated geometry
Expand Down Expand Up @@ -558,7 +561,7 @@ p4est_geometry_new_disk2d (p4est_connectivity_t * conn, double R0, double R1)
/**
* geometric coordinate transformation for sphere2d geometry.
*
* Define the geometric transformation from tree-local reference coordinates to the
* Define the geometric transformation from tree-local reference coordinates to the
* physical space.
*
* \param[in] geom associated geometry
Expand Down
17 changes: 9 additions & 8 deletions src/p4est_geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ typedef void (*p4est_geometry_destroy_t) (p4est_geometry_t * geom);
* user defined physical space.
*
* Used in \ref p4est_vtk.h to write global-coordinate meshes.
*
* Some internal p4est functions assume that *user points to a
*
* Some internal p4est functions assume that *user points to a
* \ref p4est_connectivity. However, in general it can be used as the user wishes.
*
* This structure can be filled or allocated by the user.
Expand Down Expand Up @@ -110,23 +110,24 @@ p4est_geometry_t *p4est_geometry_new_connectivity (p4est_connectivity_t *
/** Geometric coordinate transformation for geometry created with
* \ref p4est_geometry_new_connectivity. This is defined by
* tri/binlinear interpolation from vertex coordinates.
*
*
* May also be used as a building block in custom geometric coordinate transforms.
* See for example \ref p4est_geometry_sphere2d_X or \ref p4est_geometry_disk2d_X.
* See for example \ref p4est_geometry_new_sphere2d or \ref p4est_geometry_new_disk2d.
*
* \param[in] geom associated geometry
* \param[in] which_tree tree id inside forest
* \param[in] abc tree-local reference coordinates : [0,1]^3.
* \param[in] abc tree-local reference coordinates : [0,1]^3.
* Note: abc[2] is only accessed by the P4_TO_P8 version
* \param[out] xyz Cartesian coordinates in physical space after geometry
*
* \warning The associated geometry is assumed to have a connectivity
* as its *user field, and this connectivity is assumed to have vertex
* information in its *tree_to_vertex field.
*/
void p4est_geometry_connectivity_X (p4est_geometry_t * geom,
p4est_topidx_t which_tree,
const double abc[3], double xyz[3]);
void p4est_geometry_connectivity_X (p4est_geometry_t *geom,
p4est_topidx_t which_tree,
const double abc[3],
double xyz[3]);

/** Create a geometry for mapping the sphere using 2d connectivity icosahedron.
*
Expand Down
13 changes: 7 additions & 6 deletions src/p8est_geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,23 @@ p8est_geometry_t *p8est_geometry_new_connectivity (p8est_connectivity_t *
/** Geometric coordinate transformation for geometry created with
* \ref p8est_geometry_new_connectivity. This is defined by
* tri/binlinear interpolation from vertex coordinates.
*
*
* May also be used as a building block in custom geometric coordinate transforms.
* See for example \ref p8est_geometry_shell_X or \ref p8est_geometry_sphere_X.
* See for example \ref p8est_geometry_new_shell or \ref p8est_geometry_new_sphere.
*
* \param[in] geom associated geometry
* \param[in] which_tree tree id inside forest
* \param[in] abc tree-local reference coordinates : [0,1]^3.
* \param[in] abc tree-local reference coordinates : [0,1]^3.
* \param[out] xyz Cartesian coordinates in physical space after geometry
*
* \warning The associated geometry is assumed to have a connectivity
* as its *user field, and this connectivity is assumed to have vertex
* information in its *tree_to_vertex field.
*/
void p8est_geometry_connectivity_X (p8est_geometry_t * geom,
p4est_topidx_t which_tree,
const double abc[3], double xyz[3]);
void p8est_geometry_connectivity_X (p8est_geometry_t *geom,
p4est_topidx_t which_tree,
const double abc[3],
double xyz[3]);

/** Create a geometry structure for the spherical shell of 24 trees.
* \param [in] conn Result of p8est_connectivity_new_shell or equivalent.
Expand Down

0 comments on commit 24ed47f

Please sign in to comment.