Advanced Multi-Physics (AMP)
On-Line Documentation
Classes | Functions
AMP::DelaunayTessellation Namespace Reference

Classes

class  FaceList
 

Functions

double calc_volume (int ndim, const double x[])
 Function to calculate the volume of a simplex.
 
template<class TYPE >
bool collinear (const Array< TYPE > &x)
 Check if.
 
void compute_Barycentric (const int ndim, const double *x, const double *xi, double *L)
 Subroutine to compute the Barycentric coordinates.
 
template<class TYPE >
std::tuple< AMP::Array< int >, AMP::Array< int > > create_tessellation (const Array< TYPE > &x)
 Function that creates the Delaunay Tessellation.
 
template<int NDIM, class TYPE >
void get_circumsphere (const std::array< TYPE, NDIM > x0[], double &R, double *center)
 Function to return the circumsphere containing a simplex.
 
template<int NDIM, class TYPE >
int test_in_circumsphere (const std::array< TYPE, NDIM > x[], const std::array< TYPE, NDIM > &xi, double TOL_VOL)
 Function to check if a point is inside the circumsphere of a simplex.
 

Function Documentation

◆ calc_volume()

double AMP::DelaunayTessellation::calc_volume ( int  ndim,
const double  x[] 
)

Function to calculate the volume of a simplex.

This function calculates the volume of a N-dimensional simplex Note: the sign of the volume depends on the order of the points. It will be positive for points stored in a clockwise mannor. Note: If the volume is zero, then the simplex is invalid. Eg. a line in 2D or a plane in 3D.

Parameters
ndimThe number of dimensions (currently only 2D and 3D are supported)
xThe coordinates of the vertices of the simplex ( NDIM x NDIM+1 )

◆ collinear()

template<class TYPE >
bool AMP::DelaunayTessellation::collinear ( const Array< TYPE > &  x)

Check if.

Check if the points are collinear

This function will check if all the points in a set are collinear

Parameters
xThe coordinates of the vertices (ndim x N)
Returns
Returns true if the points are collinear

◆ compute_Barycentric()

void AMP::DelaunayTessellation::compute_Barycentric ( const int  ndim,
const double *  x,
const double *  xi,
double *  L 
)

Subroutine to compute the Barycentric coordinates.

This function computes the Barycentric coordinates.

Parameters
[in]ndimThe number of dimensions
xCoordinates of the triangle vertices ( NDIM x NDIM+1 )
xiCoordinates of the desired point ( NDIM )
L(output) The Barycentric coordinates of the point ( NDIM+1 )

◆ create_tessellation()

template<class TYPE >
std::tuple< AMP::Array< int >, AMP::Array< int > > AMP::DelaunayTessellation::create_tessellation ( const Array< TYPE > &  x)

Function that creates the Delaunay Tessellation.

This function will create a valid Delaunay Tessellation in multiple dimensions. Currently only 2D and 3D are supported. If successful, it will return the number of triangles, if unsuccessful it will throw a std::exception. Additionally, there are several optional stuctures.

Parameters
xThe coordinates of the vertices (ndim x N)
Returns
Returns the triangles and triangle neighbors <tri,tri_nab> tri - The returned pointer where the triangles are stored (ndim+1,N) tri_nab - The returned pointer where the triangle neighbors are stored (ndim+1,N)

◆ get_circumsphere()

template<int NDIM, class TYPE >
void AMP::DelaunayTessellation::get_circumsphere ( const std::array< TYPE, NDIM >  x0[],
double &  R,
double *  center 
)

Function to return the circumsphere containing a simplex.

This function computes the circumsphere that contains a simplex

Parameters
[in]x0The coordinates of the vertices of the simplex
[out]RThe radius of the circumsphere
[out]centerThe center of the circumsphere

◆ test_in_circumsphere()

template<int NDIM, class TYPE >
int AMP::DelaunayTessellation::test_in_circumsphere ( const std::array< TYPE, NDIM >  x[],
const std::array< TYPE, NDIM > &  xi,
double  TOL_VOL 
)

Function to check if a point is inside the circumsphere of a simplex.

This function checks if a point is inside the circumsphere of a simplex. It returns -1 if the point is outside the circumsphere, 1 if it is inside the sphere, and 0 if it is within the tolerance of the sphere. Note: For this function to work properly, the volume of the simplex (as computed by calc_volume) must be positive. Note: If we are checking the surface between 2 simplicies and they are both valid (have a positive, non-zero volume), it is suffcient to check the vertix of 1 volume against the circumcircle of the other. We do not need to perform both checks.

Parameters
xThe coordinates of the vertices of the simplex
xiThe coordinates of the vertex to check
TOL_VOLA tolerance on the volume to use



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