Skip to content

Commit

Permalink
Made geometry_X non-static
Browse files Browse the repository at this point in the history
ljcarlin committed Nov 22, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b98d83a commit ecca31e
Showing 5 changed files with 46 additions and 22 deletions.
20 changes: 1 addition & 19 deletions src/p4est_geometry.c
Original file line number Diff line number Diff line change
@@ -107,25 +107,7 @@ p4est_geometry_destroy (p4est_geometry_t * geom)
}
}

/**
* 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.
*
* \param[in] geom associated geometry
* \param[in] which_tree tree id inside forest
* \param[in] abc tree-local reference coordinates : [0,1]^d.
* 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.
*/
static void
void
p4est_geometry_connectivity_X (p4est_geometry_t * geom,
p4est_topidx_t which_tree,
const double abc[3], double xyz[3])
21 changes: 21 additions & 0 deletions src/p4est_geometry.h
Original file line number Diff line number Diff line change
@@ -107,6 +107,27 @@ void p4est_geometry_destroy (p4est_geometry_t * geom);
p4est_geometry_t *p4est_geometry_new_connectivity (p4est_connectivity_t *
conn);

/** 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.
*
* \param[in] geom associated geometry
* \param[in] which_tree tree id inside forest
* \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]);

/** Create a geometry for mapping the sphere using 2d connectivity icosahedron.
*
* \param[in] conn The result of \ref p4est_connectivity_new_icosahedron.
1 change: 1 addition & 0 deletions src/p4est_to_p8est.h
Original file line number Diff line number Diff line change
@@ -508,6 +508,7 @@
/* functions in p4est_geometry */
#define p4est_geometry_destroy p8est_geometry_destroy
#define p4est_geometry_new_connectivity p8est_geometry_new_connectivity
#define p4est_geometry_connectivity_X p8est_geometry_connectivity_X

/* functions in p4est_vtk */
#define p4est_vtk_context_new p8est_vtk_context_new
6 changes: 3 additions & 3 deletions src/p8est_geometry.c
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ p8est_geometry_shell_X (p8est_geometry_t * geom,
double abc[3];

/* transform from the reference cube into vertex space */
p4est_geometry_connectivity_X (geom, which_tree, rst, abc);
p8est_geometry_connectivity_X (geom, which_tree, rst, abc);

/* assert that input points are in the expected range */
P4EST_ASSERT (shell->type == P8EST_GEOMETRY_BUILTIN_SHELL);
@@ -184,7 +184,7 @@ p8est_geometry_sphere_X (p8est_geometry_t * geom,
double abc[3];

/* transform from the reference cube into vertex space */
p4est_geometry_connectivity_X (geom, which_tree, rst, abc);
p8est_geometry_connectivity_X (geom, which_tree, rst, abc);

/* assert that input points are in the expected range */
P4EST_ASSERT (sphere->type == P8EST_GEOMETRY_BUILTIN_SPHERE);
@@ -341,7 +341,7 @@ p8est_geometry_torus_X (p8est_geometry_t * geom,

/* transform from the reference cube [0,1]^3 into logical vertex space
using bi/trilinear transformation */
p4est_geometry_connectivity_X (geom, which_tree, rst, abc);
p8est_geometry_connectivity_X (geom, which_tree, rst, abc);

/*
* assert that input points are in the expected range
20 changes: 20 additions & 0 deletions src/p8est_geometry.h
Original file line number Diff line number Diff line change
@@ -87,6 +87,26 @@ void p8est_geometry_destroy (p8est_geometry_t * geom);
p8est_geometry_t *p8est_geometry_new_connectivity (p8est_connectivity_t *
conn);

/** 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.
*
* \param[in] geom associated geometry
* \param[in] which_tree tree id inside forest
* \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]);

/** Create a geometry structure for the spherical shell of 24 trees.
* \param [in] conn Result of p8est_connectivity_new_shell or equivalent.
* We do NOT take ownership and expect it to stay alive.

0 comments on commit ecca31e

Please sign in to comment.