Advanced Multi-Physics (AMP)
On-Line Documentation
Typedefs | Functions
AMP::Geometry::GeometryHelpers Namespace Reference

Typedefs

using Point1D = std::array< double, 1 >
 
using Point2D = std::array< double, 2 >
 
using Point3D = std::array< double, 3 >
 

Functions

std::vector< int > assignRanks (const std::vector< double > &x, int N_ranks)
 Assign ranks to a point cloud.
 
std::vector< int > assignRanks (const std::vector< Point1D > &x, int N_ranks)
 Assign ranks to a point cloud.
 
std::vector< int > assignRanks (const std::vector< Point2D > &x, int N_ranks)
 Assign ranks to a point cloud.
 
std::vector< int > assignRanks (const std::vector< Point3D > &x, int N_ranks)
 Assign ranks to a point cloud.
 
template<int NP, int NDIM>
std::array< double, NP > barycentric (const std::array< std::array< double, NDIM >, NP > &x, const std::array< double, NDIM > &p)
 Compute the barycentric coordinates.
 
double distance (const Point3D &x1, const Point3D &x2)
 Compute the distance between two points.
 
template<std::size_t NDIM>
double distanceToBox (const std::array< double, NDIM > &pos, const std::array< double, NDIM > &ang, const std::array< double, NDIM > &lb, const std::array< double, NDIM > &ub)
 Compute the intersection of a ray and a box.
 
double distanceToCircle (double r, const Point2D &pos, const Point2D &ang)
 Compute the intersection of a ray and circle (2D)
 
double distanceToCircularFrustum (double rb, double rt, double h, const Point3D &pos, const Point3D &ang)
 Compute the intersection of a ray and circular frustum.
 
double distanceToCone (const Point3D &V, double theta, const Point3D &pos, const Point3D &ang)
 Compute the intersection of a ray and cone.
 
double distanceToCylinder (double r, double h, const Point3D &pos, const Point3D &ang)
 Compute the intersection of a ray and cylinder.
 
double distanceToLine (const Point2D &pos, const Point2D &ang, const Point2D &v1, const Point2D &v2)
 Compute the intersection of a ray and a line segment.
 
double distanceToLine (const Point3D &pos, const Point3D &ang, const Point3D &v1, const Point3D &v2)
 Compute the intersection of a ray and a line segment.
 
double distanceToPlane (const Point3D &n, const Point3D &p0, const Point3D &pos, const Point3D &ang)
 Compute the intersection of a ray and an infinite plane.
 
double distanceToQuadrilateral (const std::array< Point2D, 4 > &quad, const Point2D &pos, const Point2D &ang)
 Compute the intersection of a ray and quadrilateral.
 
double distanceToQuadrilateral (const std::array< Point3D, 4 > &quad, const Point3D &pos, const Point3D &ang)
 Compute the intersection of a ray and quadrilateral.
 
double distanceToSphere (double r, const Point3D &pos, const Point3D &ang)
 Compute the intersection of a ray and sphere.
 
double distanceToTetrahedron (const std::array< Point3D, 4 > &tet, const Point3D &pos, const Point3D &ang)
 Compute the intersection of a ray and tetrahedron.
 
double distanceToTriangle (const std::array< Point2D, 3 > &tri, const Point2D &pos, const Point2D &ang)
 Compute the intersection of a ray and triangle.
 
double distanceToTriangle (const std::array< Point3D, 3 > &tri, const Point3D &pos, const Point3D &ang)
 Compute the intersection of a ray and triangle.
 
double distanceToTube (double r1, double r2, double h, const Point3D &pos, const Point3D &ang)
 Compute the intersection of a ray and tube.
 
std::vector< Point2Dget_poly_vertices (int N, double R)
 Get the Vertices of a regular polygon.
 
Point2D map_circle_logical (double R, int method, double x, double y)
 Map physical coordinates to the logical coordinates.
 
Point2D map_logical_circle (double R, int method, double x, double y)
 Map logical coordinates to a circle.
 
Point2D map_logical_poly (int N, double R, double x, double y)
 Map logical coordinates to a regular polygon.
 
Point3D map_logical_shell (double r1, double r2, double x, double y, double z)
 Map logical coordinates to a shell.
 
Point3D map_logical_sphere (double R, double x, double y, double z)
 Map logical coordinates to a sphere.
 
Point3D map_logical_sphere_surface (int method, double R, double x, double y)
 Map logical coordinates to the surface of a sphere.
 
Point2D map_poly_logical (int N, double R, double x, double y)
 Map physical coordinates to the logical coordinates.
 
Point3D map_shell_logical (double r1, double r2, double x, double y, double z)
 Map a shell to logical coordinates.
 
Point3D map_sphere_logical (double R, double x, double y, double z)
 Map logical coordinates to a sphere.
 
Point2D map_sphere_surface_logical (int method, double R, double x, double y, double z)
 Map coordinates from the surface of a sphere to logical.
 
Point2D nearest (const Point2D &v1, const Point2D &v2, const Point2D &p)
 Find the nearest point to a line segment.
 
Point3D nearest (const Point3D &v1, const Point3D &v2, const Point3D &p)
 Find the nearest point to a line segment.
 
Point3D nearest (const std::array< Point3D, 3 > &v, const Point3D &p)
 Find the nearest point to a triangle.
 
Point3D nearest (const std::array< Point3D, 4 > &v, const Point3D &p)
 Find the nearest point to a tetrahedron.
 
Point2D normal (const Point2D &a, const Point2D &b)
 Compute the normal to a line defined by 2 points.
 
Point3D normal (const Point3D &a, const Point3D &b, const Point3D &c)
 Compute the normal to a plane defined by 3 points.
 
Point3D normalToQuadrilateral (const std::array< Point3D, 4 > &quad)
 Compute the normal to a quadrilateral.
 
std::vector< Point3DsampleLine (const std::array< Point3D, 2 > &v, double d0, bool interior=true)
 Sample a line.
 
std::vector< Point3DsampleQuad (const std::array< Point3D, 4 > &v, double d0, bool interior=true)
 Sample a line.
 
std::vector< Point3DsampleTet (const std::array< Point3D, 4 > &v, double d0, bool interior=true)
 Sample a line.
 
std::vector< Point3DsampleTri (const std::array< Point3D, 3 > &v, double d0, bool interior=true)
 Sample a line.
 
std::vector< AMP::Mesh::Pointsubdivide (const std::array< AMP::Mesh::Point, 3 > &v, double res)
 Subdivide a triangle.
 

Typedef Documentation

◆ Point1D

using AMP::Geometry::GeometryHelpers::Point1D = typedef std::array<double, 1>

Definition at line 17 of file GeometryHelpers.h.

◆ Point2D

using AMP::Geometry::GeometryHelpers::Point2D = typedef std::array<double, 2>

Definition at line 18 of file GeometryHelpers.h.

◆ Point3D

using AMP::Geometry::GeometryHelpers::Point3D = typedef std::array<double, 3>

Definition at line 19 of file GeometryHelpers.h.

Function Documentation

◆ assignRanks() [1/4]

std::vector< int > AMP::Geometry::GeometryHelpers::assignRanks ( const std::vector< double > &  x,
int  N_ranks 
)

Assign ranks to a point cloud.

This routine will divide a point cloud spatially and assign ranks to a point cloud.

Parameters
[in]xPoints
[in]N_ranksNumber of processors
Returns
Returns the rank of each point

◆ assignRanks() [2/4]

std::vector< int > AMP::Geometry::GeometryHelpers::assignRanks ( const std::vector< Point1D > &  x,
int  N_ranks 
)

Assign ranks to a point cloud.

This routine will divide a point cloud spatially and assign ranks to a point cloud.

Parameters
[in]xPoints
[in]N_ranksNumber of processors
Returns
Returns the rank of each point

◆ assignRanks() [3/4]

std::vector< int > AMP::Geometry::GeometryHelpers::assignRanks ( const std::vector< Point2D > &  x,
int  N_ranks 
)

Assign ranks to a point cloud.

This routine will divide a point cloud spatially and assign ranks to a point cloud.

Parameters
[in]xPoints
[in]N_ranksNumber of processors
Returns
Returns the rank of each point

◆ assignRanks() [4/4]

std::vector< int > AMP::Geometry::GeometryHelpers::assignRanks ( const std::vector< Point3D > &  x,
int  N_ranks 
)

Assign ranks to a point cloud.

This routine will divide a point cloud spatially and assign ranks to a point cloud.

Parameters
[in]xPoints
[in]N_ranksNumber of processors
Returns
Returns the rank of each point

◆ barycentric()

template<int NP, int NDIM>
std::array< double, NP > AMP::Geometry::GeometryHelpers::barycentric ( const std::array< std::array< double, NDIM >, NP > &  x,
const std::array< double, NDIM > &  p 
)

Compute the barycentric coordinates.

This function will compute the barycentric coordinates determine the normal.

Parameters
[in]xVertices
[in]pPoint of interest
Returns
Returns the barycentric coordinates

◆ distance()

double AMP::Geometry::GeometryHelpers::distance ( const Point3D x1,
const Point3D x2 
)

Compute the distance between two points.

This function will compute the distance between two points

Parameters
[in]x1First point
[in]x2Second point
Returns
Returns the distance

◆ distanceToBox()

template<std::size_t NDIM>
double AMP::Geometry::GeometryHelpers::distanceToBox ( const std::array< double, NDIM > &  pos,
const std::array< double, NDIM > &  ang,
const std::array< double, NDIM > &  lb,
const std::array< double, NDIM > &  ub 
)

Compute the intersection of a ray and a box.

This function will compute the intersection of a ray with a box. If the ray will never intersect the object, this distance is inf.

Parameters
[in]posStarting point of ray
[in]angDirection of ray
[in]lbLower bound of the box
[in]ubUpper bound of the box
Returns
Returns the distance

◆ distanceToCircle()

double AMP::Geometry::GeometryHelpers::distanceToCircle ( double  r,
const Point2D pos,
const Point2D ang 
)

Compute the intersection of a ray and circle (2D)

This function will compute the intersection of a ray with a circle. It assumes a circle of radius r centered at the origin. If the ray is inside the cylinder the distance is negative. If the ray will never intersect the object, this distance is inf.

Parameters
[in]rRadius of circle
[in]posStarting point of ray
[in]angDirection of ray
Returns
Returns the distance

◆ distanceToCircularFrustum()

double AMP::Geometry::GeometryHelpers::distanceToCircularFrustum ( double  rb,
double  rt,
double  h,
const Point3D pos,
const Point3D ang 
)

Compute the intersection of a ray and circular frustum.

This function will compute the intersection of a ray with a circular frustum. It assumes the circular frustum is located at the origin (base radius), with the given height, oriented in the +z direction. If the ray is inside the cone the distance is negative. If the ray will never intersect the object, this distance is inf.

Parameters
[in]rbBase radius
[in]rtTop radius
[in]hObject height
[in]posStarting point of ray
[in]angDirection of ray
Returns
Returns the distance

◆ distanceToCone()

double AMP::Geometry::GeometryHelpers::distanceToCone ( const Point3D V,
double  theta,
const Point3D pos,
const Point3D ang 
)

Compute the intersection of a ray and cone.

This function will compute the intersection of a ray with a cone. It assumes a cone with the apex at the origin in the direction given by V. If the ray is inside the cone the distance is negative. If the ray will never intersect the object, this distance is inf.

Parameters
[in]VDirection of cone
[in]thetaApex angle of cone
[in]posStarting point of ray
[in]angDirection of ray
Returns
Returns the distance

◆ distanceToCylinder()

double AMP::Geometry::GeometryHelpers::distanceToCylinder ( double  r,
double  h,
const Point3D pos,
const Point3D ang 
)

Compute the intersection of a ray and cylinder.

This function will compute the intersection of a ray with a cylinder. It assumes a cylinder of radius r and height h, centered at the origin along the z axis: z=[-h/2,h/2]. If the ray is inside the cylinder the distance is negative. If the ray will never intersect the object, this distance is inf.

Parameters
[in]rRadius of cylinder
[in]hHeight of cylinder
[in]posStarting point of ray
[in]angDirection of ray
Returns
Returns the distance

◆ distanceToLine() [1/2]

double AMP::Geometry::GeometryHelpers::distanceToLine ( const Point2D pos,
const Point2D ang,
const Point2D v1,
const Point2D v2 
)

Compute the intersection of a ray and a line segment.

This function will compute the intersection of a ray with a line segment. If the ray will never intersect the object, this distance is inf.

Parameters
[in]posStarting point of ray
[in]angDirection of ray
[in]v1First vertex
[in]v2Second vertex
Returns
Returns the distance

◆ distanceToLine() [2/2]

double AMP::Geometry::GeometryHelpers::distanceToLine ( const Point3D pos,
const Point3D ang,
const Point3D v1,
const Point3D v2 
)

Compute the intersection of a ray and a line segment.

This function will compute the intersection of a ray with a line segment. If the ray will never intersect the object, this distance is inf.

Parameters
[in]posStarting point of ray
[in]angDirection of ray
[in]v1First vertex
[in]v2Second vertex
Returns
Returns the distance

◆ distanceToPlane()

double AMP::Geometry::GeometryHelpers::distanceToPlane ( const Point3D n,
const Point3D p0,
const Point3D pos,
const Point3D ang 
)

Compute the intersection of a ray and an infinite plane.

This function will compute the intersection of a ray with an infinite plane. The plane is described by the normal and a point on the plane. If the ray will never intersect the object, this distance is inf.

Parameters
[in]nNormal to the plane
[in]p0A point on the plane
[in]posStarting point of ray
[in]angDirection of ray
Returns
Returns the distance

◆ distanceToQuadrilateral() [1/2]

double AMP::Geometry::GeometryHelpers::distanceToQuadrilateral ( const std::array< Point2D, 4 > &  quad,
const Point2D pos,
const Point2D ang 
)

Compute the intersection of a ray and quadrilateral.

This function will compute the intersection of a ray with a quadrilateral. If the ray is inside the cone the distance is negative. If the ray will never intersect the object, this distance is inf.

Parameters
[in]quadTriangle coordinates
[in]posStarting point of ray
[in]angDirection of ray
Returns
Returns the distance

◆ distanceToQuadrilateral() [2/2]

double AMP::Geometry::GeometryHelpers::distanceToQuadrilateral ( const std::array< Point3D, 4 > &  quad,
const Point3D pos,
const Point3D ang 
)

Compute the intersection of a ray and quadrilateral.

This function will compute the intersection of a ray with a quadrilateral. If the ray is inside the cone the distance is negative. If the ray will never intersect the object, this distance is inf.

Parameters
[in]quadTriangle coordinates
[in]posStarting point of ray
[in]angDirection of ray
Returns
Returns the distance

◆ distanceToSphere()

double AMP::Geometry::GeometryHelpers::distanceToSphere ( double  r,
const Point3D pos,
const Point3D ang 
)

Compute the intersection of a ray and sphere.

This function will compute the intersection of a ray with a cylinder. It assumes a sphere of radius r and height h, centered at the origin. If the ray is inside the cylinder the distance is negative. If the ray will never intersect the object, this distance is inf.

Parameters
[in]rRadius of cylinder
[in]posStarting point of ray
[in]angDirection of ray
Returns
Returns the distance

◆ distanceToTetrahedron()

double AMP::Geometry::GeometryHelpers::distanceToTetrahedron ( const std::array< Point3D, 4 > &  tet,
const Point3D pos,
const Point3D ang 
)

Compute the intersection of a ray and tetrahedron.

This function will compute the intersection of a ray with a tetrahedron. If the ray is inside the cone the distance is negative. If the ray will never intersect the object, this distance is inf.

Parameters
[in]tetTetrahedron coordinates
[in]posStarting point of ray
[in]angDirection of ray
Returns
Returns the distance

◆ distanceToTriangle() [1/2]

double AMP::Geometry::GeometryHelpers::distanceToTriangle ( const std::array< Point2D, 3 > &  tri,
const Point2D pos,
const Point2D ang 
)

Compute the intersection of a ray and triangle.

This function will compute the intersection of a ray with a triangle. If the ray is inside the cone the distance is negative. If the ray will never intersect the object, this distance is inf.

Parameters
[in]triTriangle coordinates
[in]posStarting point of ray
[in]angDirection of ray
Returns
Returns the distance

◆ distanceToTriangle() [2/2]

double AMP::Geometry::GeometryHelpers::distanceToTriangle ( const std::array< Point3D, 3 > &  tri,
const Point3D pos,
const Point3D ang 
)

Compute the intersection of a ray and triangle.

This function will compute the intersection of a ray with a triangle. If the ray is inside the cone the distance is negative. If the ray will never intersect the object, this distance is inf.

Parameters
[in]triTriangle coordinates
[in]posStarting point of ray
[in]angDirection of ray
Returns
Returns the distance

◆ distanceToTube()

double AMP::Geometry::GeometryHelpers::distanceToTube ( double  r1,
double  r2,
double  h,
const Point3D pos,
const Point3D ang 
)

Compute the intersection of a ray and tube.

This function will compute the intersection of a ray with a tube. It assumes a tube ith inner radius r1, outer radius r2, and height h centered at the origin along the z axis: z=[-h/2,h/2]. If the ray is inside the cylinder the distance is negative. If the ray will never intersect the object, this distance is inf.

Parameters
[in]r1Inner radius of cylinder
[in]r2Outer radius of cylinder
[in]hHeight of cylinder
[in]posStarting point of ray
[in]angDirection of ray
Returns
Returns the distance

◆ get_poly_vertices()

std::vector< Point2D > AMP::Geometry::GeometryHelpers::get_poly_vertices ( int  N,
double  R 
)

Get the Vertices of a regular polygon.

This function will return the Vertices of a N-sided polygon that is compatible with the functions map_logical_poly and map_poly_logical.

Parameters
[in]NNumber of faces
[in]RRadius of circumcircle
Returns
Returns the Vertices clockwise (physical coordinates)

◆ map_circle_logical()

Point2D AMP::Geometry::GeometryHelpers::map_circle_logical ( double  R,
int  method,
double  x,
double  y 
)

Map physical coordinates to the logical coordinates.

This function will map physical coordinates (x,y) coordinates in a circle to [0,1] logical coordinates. It uses the inverse of the mapping by: Dona Calhoun, Christiane Helzel, Randall LeVeque, "Logically Rectangular Grids and Finite Volume Methods for PDEs in Circular and Spherical Domains", SIAM Review, Vol. 50, No. 4, pp. 723-752 (2008) There are 3 methods to choose from: 1 - D(d) = r*d/sqrt(2), R(d) = r*d 2 - D(d) = r*d/sqrt(2), R(d) = r 3 - D(d) = r*d*(2-d)/sqrt(2), R(d) = r1

Parameters
[in]RRadius of circle
[in]methodMethod to map
[in]xPhysical x coordinate
[in]yPhysical y coordinate
Returns
Returns a pair with the logical (x,y) value

◆ map_logical_circle()

Point2D AMP::Geometry::GeometryHelpers::map_logical_circle ( double  R,
int  method,
double  x,
double  y 
)

Map logical coordinates to a circle.

This function will map logical coordinates in [0,1] to (x,y) coordinates in a circle. It uses the mapping by: Dona Calhoun, Christiane Helzel, Randall LeVeque, "Logically Rectangular Grids and Finite Volume Methods for PDEs in Circular and Spherical Domains", SIAM Review, Vol. 50, No. 4, pp. 723-752 (2008) There are 3 methods to choose from: 1 - D(d) = r*d/sqrt(2), R(d) = r*d 2 - D(d) = r*d/sqrt(2), R(d) = r 3 - D(d) = r*d*(2-d)/sqrt(2), R(d) = r1

Parameters
[in]RRadius of circle
[in]methodMethod to map
[in]xLogical x coordinate
[in]yLogical y coordinate
Returns
Returns a pair with the (x,y) value

◆ map_logical_poly()

Point2D AMP::Geometry::GeometryHelpers::map_logical_poly ( int  N,
double  R,
double  x,
double  y 
)

Map logical coordinates to a regular polygon.

This function will map logical coordinates in [0,1] to (x,y) coordinates in a regular polygon.

Parameters
[in]NNumber of faces
[in]RRadius of circumcircle
[in]xLogical x coordinate
[in]yLogical y coordinate
Returns
Returns a pair with the (x,y) value

◆ map_logical_shell()

Point3D AMP::Geometry::GeometryHelpers::map_logical_shell ( double  r1,
double  r2,
double  x,
double  y,
double  z 
)

Map logical coordinates to a shell.

This function will map logical coordinates in [0,1] to (x,y,z) coordinates in a shell. It uses the mapping by: Dona Calhoun, Christiane Helzel, Randall LeVeque, "Logically Rectangular Grids and Finite Volume Methods for PDEs in Circular and Spherical Domains", SIAM Review, Vol. 50, No. 4, pp. 723-752 (2008)

Parameters
[in]r1Inner radius of shell
[in]r2Outer radius of shell
[in]xLogical x coordinate
[in]yLogical y coordinate
[in]zLogical z coordinate
Returns
Returns the physical point

◆ map_logical_sphere()

Point3D AMP::Geometry::GeometryHelpers::map_logical_sphere ( double  R,
double  x,
double  y,
double  z 
)

Map logical coordinates to a sphere.

This function will map logical coordinates in [0,1] to (x,y,z) coordinates in a sphere. It uses the mapping by: Dona Calhoun, Christiane Helzel, Randall LeVeque, "Logically Rectangular Grids and Finite Volume Methods for PDEs in Circular and Spherical Domains", SIAM Review, Vol. 50, No. 4, pp. 723-752 (2008)

Parameters
[in]RRadius of sphere
[in]xLogical x coordinate
[in]yLogical y coordinate
[in]zLogical z coordinate
Returns
Returns the physical point

◆ map_logical_sphere_surface()

Point3D AMP::Geometry::GeometryHelpers::map_logical_sphere_surface ( int  method,
double  R,
double  x,
double  y 
)

Map logical coordinates to the surface of a sphere.

This function will map logical coordinates in [0,1] to (x,y,z) coordinates on the surface of a sphere. It uses the mapping by: Dona Calhoun, Christiane Helzel, Randall LeVeque, "Logically Rectangular Grids and Finite Volume Methods for PDEs in Circular and Spherical Domains", SIAM Review, Vol. 50, No. 4, pp. 723-752 (2008)

Parameters
[in]methodMethod to use: 1 - Use method in Calhoun, requires extra attention to boundary conditions 2 - Half sphere mapping 3 - Spherical coordinates
[in]RRadius of sphere
[in]xLogical x coordinate
[in]yLogical y coordinate
Returns
Returns the physical point

◆ map_poly_logical()

Point2D AMP::Geometry::GeometryHelpers::map_poly_logical ( int  N,
double  R,
double  x,
double  y 
)

Map physical coordinates to the logical coordinates.

This function will map physical coordinates (x,y) coordinates in a regular polygon to [0,1] logical coordinates.

Parameters
[in]NNumber of faces
[in]RRadius of circumcircle
[in]xPhysical x coordinate
[in]yPhysical y coordinate
Returns
Returns a pair with the logical (x,y) value

◆ map_shell_logical()

Point3D AMP::Geometry::GeometryHelpers::map_shell_logical ( double  r1,
double  r2,
double  x,
double  y,
double  z 
)

Map a shell to logical coordinates.

This function will map (x,y,z) coordinates in a shell to logical coordinates in [0,1]. It uses the mapping by: Dona Calhoun, Christiane Helzel, Randall LeVeque, "Logically Rectangular Grids and Finite Volume Methods for PDEs in Circular and Spherical Domains", SIAM Review, Vol. 50, No. 4, pp. 723-752 (2008)

Parameters
[in]r1Inner radius of shell
[in]r2Outer radius of shell
[in]xLogical x coordinate
[in]yLogical y coordinate
[in]zLogical z coordinate
Returns
Returns the physical point

◆ map_sphere_logical()

Point3D AMP::Geometry::GeometryHelpers::map_sphere_logical ( double  R,
double  x,
double  y,
double  z 
)

Map logical coordinates to a sphere.

This function will map physical coordinates in (x,y,z) to [0,1] locial coordinates in a sphere. It uses the mapping by: Dona Calhoun, Christiane Helzel, Randall LeVeque, "Logically Rectangular Grids and Finite Volume Methods for PDEs in Circular and Spherical Domains",Point3D SIAM Review, Vol. 50, No. 4, pp. 723-752 (2008)

Parameters
[in]RRadius of sphere
[in]xPhysical x coordinate
[in]yPhysical y coordinate
[in]zPhysical z coordinate
Returns
Returns the logical point

◆ map_sphere_surface_logical()

Point2D AMP::Geometry::GeometryHelpers::map_sphere_surface_logical ( int  method,
double  R,
double  x,
double  y,
double  z 
)

Map coordinates from the surface of a sphere to logical.

This function will map the (x,y,z) coordinates on the surface of a sphere to logical coordinates in [0,1]. It uses the mapping by: Dona Calhoun, Christiane Helzel, Randall LeVeque, "Logically Rectangular Grids and Finite Volume Methods for PDEs in Circular and Spherical Domains", SIAM Review, Vol. 50, No. 4, pp. 723-752 (2008)

Parameters
[in]methodMethod to use: 1 - Use method in Calhoun, requires extra attention to boundary conditions 2 - Half sphere mapping 3 - Spherical coordinates
[in]RRadius of sphere
[in]xPhysical x coordinate
[in]yPhysical y coordinate
[in]zPhysical z coordinate
Returns
Returns a pair with the logical (x,y) values

◆ nearest() [1/4]

Point2D AMP::Geometry::GeometryHelpers::nearest ( const Point2D v1,
const Point2D v2,
const Point2D p 
)

Find the nearest point to a line segment.

This function will compute the nearest point to a line segment in 2D.

Parameters
[in]v1First vertex
[in]v2Second vertex
[in]pPoint of interest
Returns
Returns the normal

◆ nearest() [2/4]

Point3D AMP::Geometry::GeometryHelpers::nearest ( const Point3D v1,
const Point3D v2,
const Point3D p 
)

Find the nearest point to a line segment.

This function will compute the nearest point to a line segment in 3D.

Parameters
[in]v1First vertex
[in]v2Second vertex
[in]pPoint of interest
Returns
Returns the normal

◆ nearest() [3/4]

Point3D AMP::Geometry::GeometryHelpers::nearest ( const std::array< Point3D, 3 > &  v,
const Point3D p 
)

Find the nearest point to a triangle.

This function will compute the nearest point to a triangle defined by three points in 3D.

Parameters
[in]vVertices
[in]pPoint of interest
Returns
Returns the normal

◆ nearest() [4/4]

Point3D AMP::Geometry::GeometryHelpers::nearest ( const std::array< Point3D, 4 > &  v,
const Point3D p 
)

Find the nearest point to a tetrahedron.

This function will compute the nearest point to a tetrahedron defined by three points in 3D.

Parameters
[in]vVertices
[in]pPoint of interest
Returns
Returns the normal

◆ normal() [1/2]

Point2D AMP::Geometry::GeometryHelpers::normal ( const Point2D a,
const Point2D b 
)

Compute the normal to a line defined by 2 points.

This function will compute the normal to a line defined by two points. The order of the points will determine the normal.

Parameters
[in]aFirst point
[in]bSecond point
Returns
Returns the normal

◆ normal() [2/2]

Point3D AMP::Geometry::GeometryHelpers::normal ( const Point3D a,
const Point3D b,
const Point3D c 
)

Compute the normal to a plane defined by 3 points.

This function will compute the normal to a plane defined by three points. The order of the points will determine the normal.

Parameters
[in]aFirst point
[in]bSecond point
[in]cThird point
Returns
Returns the normal

◆ normalToQuadrilateral()

Point3D AMP::Geometry::GeometryHelpers::normalToQuadrilateral ( const std::array< Point3D, 4 > &  quad)

Compute the normal to a quadrilateral.

This function will compute the normal to a quadrilateral. Since the points within the quadrilateral may not be co-planer, this will approximate the normal by dividing the quadrilateral into 4 triangles, computing the normal to each triangle, and then averaging the normal.

Parameters
[in]quadTriangle coordinates
Returns
Returns the distance

◆ sampleLine()

std::vector< Point3D > AMP::Geometry::GeometryHelpers::sampleLine ( const std::array< Point3D, 2 > &  v,
double  d0,
bool  interior = true 
)

Sample a line.

Compute points on a line such that no point along the line is farther than d0 from a sample point

Parameters
[in]vVertices
[in]d0Maximum distance between points
[in]interiorChoose interior points (default) or include the Vertices
Returns
Returns the new points

◆ sampleQuad()

std::vector< Point3D > AMP::Geometry::GeometryHelpers::sampleQuad ( const std::array< Point3D, 4 > &  v,
double  d0,
bool  interior = true 
)

Sample a line.

Compute points on a line such that no point within a quadrilateral is farther than d0 from a sample point

Parameters
[in]vVertices
[in]d0Maximum distance between points
[in]interiorChoose interior points (default) or include the Vertices
Returns
Returns the new points

◆ sampleTet()

std::vector< Point3D > AMP::Geometry::GeometryHelpers::sampleTet ( const std::array< Point3D, 4 > &  v,
double  d0,
bool  interior = true 
)

Sample a line.

Compute points on a line such that no point within a tetrahedron is farther than d0 from a sample point

Parameters
[in]vVertices
[in]d0Maximum distance between points
[in]interiorChoose interior points (default) or include the Vertices
Returns
Returns the new points

◆ sampleTri()

std::vector< Point3D > AMP::Geometry::GeometryHelpers::sampleTri ( const std::array< Point3D, 3 > &  v,
double  d0,
bool  interior = true 
)

Sample a line.

Compute points on a triangle such that no point within the triangle is farther than d0 from a sample point

Parameters
[in]vVertices
[in]d0Maximum distance between points
[in]interiorChoose interior points (default) or include the Vertices
Returns
Returns the new points

◆ subdivide()

std::vector< AMP::Mesh::Point > AMP::Geometry::GeometryHelpers::subdivide ( const std::array< AMP::Mesh::Point, 3 > &  v,
double  res 
)

Subdivide a triangle.

Given the Vertices of a triangle, sub-divide the triangle recursively until it is with the resolution, returning the new set of points

Parameters
[in]vVertices
[in]resDesired resolution
Returns
Returns the new points (excluding the Vertices)



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:42.
Comments on this page