p4est 2.8.6
p4est is a software library for parallel adaptive mesh refinement.
|
Transform from tree-local "reference" coordinate system to global "physical space" coordinates. More...
#include <p4est_connectivity.h>
Go to the source code of this file.
Data Structures | |
struct | p4est_geometry |
Encapsulates a custom transformation from tree-local coordinates to user defined physical space. More... | |
Typedefs | |
typedef struct p4est_geometry | p4est_geometry_t |
This object encapsulates a custom geometry transformation. | |
typedef void(* | p4est_geometry_X_t) (p4est_geometry_t *geom, p4est_topidx_t which_tree, const double abc[3], double xyz[3]) |
Forward transformation from the tree-local coordinates to physical space. More... | |
typedef void(* | p4est_geometry_destroy_t) (p4est_geometry_t *geom) |
Destructor prototype for a user-allocated p4est_geometry_t. More... | |
Functions | |
void | p4est_geometry_destroy (p4est_geometry_t *geom) |
Can be used to conveniently destroy a geometry structure. More... | |
p4est_geometry_t * | p4est_geometry_new_connectivity (p4est_connectivity_t *conn) |
Create a geometry structure based on the vertices in a connectivity. More... | |
void | p4est_geometry_connectivity_X (p4est_geometry_t *geom, p4est_topidx_t which_tree, const double abc[3], double xyz[3]) |
Geometric coordinate transformation for geometry created with p4est_geometry_new_connectivity. More... | |
p4est_geometry_t * | p4est_geometry_new_icosahedron (p4est_connectivity_t *conn, double R) |
Create a geometry for mapping the sphere using 2d connectivity icosahedron. More... | |
p4est_geometry_t * | p4est_geometry_new_shell2d (p4est_connectivity_t *conn, double R2, double R1) |
Create a geometry for mapping the annulus. More... | |
p4est_geometry_t * | p4est_geometry_new_disk2d (p4est_connectivity_t *conn, double R0, double R1) |
Create disk2d geometry associated to disk2d connectivity. More... | |
p4est_geometry_t * | p4est_geometry_new_sphere2d (p4est_connectivity_t *conn, double R) |
Create sphere geometry associated to cubed connectivity. More... | |
Transform from tree-local "reference" coordinate system to global "physical space" coordinates.
These are used in p4est_vtk.h to write global coordinate meshes to disk.
We provide several example geometries for use. You may also implement your own geometry as you see fit.
typedef void(* p4est_geometry_destroy_t) (p4est_geometry_t *geom) |
Destructor prototype for a user-allocated p4est_geometry_t.
It is invoked by p4est_geometry_destroy. If the user chooses to reserve the structure statically, there is no need to provide it.
typedef void(* p4est_geometry_X_t) (p4est_geometry_t *geom, p4est_topidx_t which_tree, const double abc[3], double xyz[3]) |
Forward transformation from the tree-local coordinates to physical space.
[in] | geom | associated geometry |
[in] | which_tree | tree id inside forest |
[in] | abc | tree-local coordinates: . For 2D meshes abc[2] should never be accessed. |
[out] | xyz | cartesian coordinates in physical space after geometry |
void p4est_geometry_connectivity_X | ( | p4est_geometry_t * | geom, |
p4est_topidx_t | which_tree, | ||
const double | abc[3], | ||
double | xyz[3] | ||
) |
Geometric coordinate transformation for geometry created with 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 p4est_geometry_sphere2d_X or p4est_geometry_disk2d_X.
[in] | geom | associated geometry |
[in] | which_tree | tree id inside forest |
[in] | abc | tree-local reference coordinates : [0,1]^3. Note: abc[2] is only accessed by the P4_TO_P8 version |
[out] | xyz | Cartesian coordinates in physical space after geometry |
void p4est_geometry_destroy | ( | p4est_geometry_t * | geom | ) |
Can be used to conveniently destroy a geometry structure.
The user is free not to call this function at all if they handle the memory of the p4est_geometry_t in their own way.
p4est_geometry_t * p4est_geometry_new_connectivity | ( | p4est_connectivity_t * | conn | ) |
Create a geometry structure based on the vertices in a connectivity.
The transformation is constructed using bilinear interpolation.
[in] | conn | A connectivity with vertex coordinate information. We do not take ownership and expect this structure to stay alive. |
p4est_geometry_t * p4est_geometry_new_disk2d | ( | p4est_connectivity_t * | conn, |
double | R0, | ||
double | R1 | ||
) |
Create disk2d geometry associated to disk2d connectivity.
[in] | conn | The result of p4est_connectivity_new_disk2d. |
[in] | R0 | radius of the inner circle. |
[in] | R1 | radius of the outer circle (external border). |
This geometry is meant to be used with the disk2d connectivity, which is a 5-tree connectivity to map the spherical disk.
p4est_geometry_t * p4est_geometry_new_icosahedron | ( | p4est_connectivity_t * | conn, |
double | R | ||
) |
Create a geometry for mapping the sphere using 2d connectivity icosahedron.
[in] | conn | The result of p4est_connectivity_new_icosahedron. |
[in] | R | The radius of the sphere. |
p4est_geometry_t * p4est_geometry_new_shell2d | ( | p4est_connectivity_t * | conn, |
double | R2, | ||
double | R1 | ||
) |
Create a geometry for mapping the annulus.
This a direct adaptation of geometric shell in 3d.
[in] | conn | The result of p4est_connectivity_new_shell2d. |
[in] | R1 | radius of the inner circle (internal border). |
[in] | R2 | radius of the outer circle (external border). |
p4est_geometry_t * p4est_geometry_new_sphere2d | ( | p4est_connectivity_t * | conn, |
double | R | ||
) |
Create sphere geometry associated to cubed connectivity.
[in] | conn | The result of p4est_connectivity_new_cubed. |
[in] | R | radius of the sphere |
This geometry is meant to be used with the cubed connectivity p4est_connectivity_new_cubed, which is a 6-tree connectivity, to map the sphere.