AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::quest::ScatteredInterpolation< NDIMS > Class Template Reference

A class to perform scattered data interpolation at arbitrary points over an input point set. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/quest/ScatteredInterpolation.hpp>

Public Types

using DelaunayTriangulation = Delaunay< DIM >
 
using PointType = typename DelaunayTriangulation::PointType
 
using BoundingBoxType = typename DelaunayTriangulation::BoundingBox
 
using CoordType = typename PointType::CoordType
 

Public Member Functions

void buildTriangulation (conduit::Node &mesh_node, const std::string &coordset)
 Builds a Delaunay triangulation over the point set from mesh_node. More...
 
void locatePoints (conduit::Node &query_mesh, const std::string &coordset)
 Locates cell from Delaunay complex containing each point in query_mesh. More...
 
bool getInterpolationWeights (const PointType &query_pt, primal::Point< axom::IndexType, NDIMS+1 > &indices, primal::Point< CoordType, NDIMS+1 > &weights) const
 Given a location in space, find the associated indices and interpolation weights with respect to the input mesh points. More...
 
void interpolateField (conduit::Node &query_mesh, const std::string &coordset, conduit::Node &input_mesh, const std::string &input_field_name, const std::string &output_field_name, const double INVALID_VALUE=std::numeric_limits< double >::quiet_NaN())
 Interpolates a field from an input_mesh to one on a query_mesh. More...
 
void exportDelaunayComplex (conduit::Node &mesh_node, std::string &&filename) const
 Exports the Delaunay complex with scalar fields as a vtk file. More...
 
int numVertices () const
 Returns the number of vertices in the underlying Deluanay complex. More...
 
int numSimplices () const
 Returns the number of simplices (triangles/tetrahedra) in the underlying Deluanay complex. More...
 
const BoundingBoxTypeboundingBox () const
 Returns the bounding box of the input data points. More...
 

Static Public Attributes

static constexpr int DIM = NDIMS
 

Detailed Description

template<int NDIMS = 3>
class axom::quest::ScatteredInterpolation< NDIMS >

A class to perform scattered data interpolation at arbitrary points over an input point set.

The class uses linear interpolation over a Delaunay triangulation of the point set.

Member Typedef Documentation

◆ DelaunayTriangulation

template<int NDIMS = 3>
using axom::quest::ScatteredInterpolation< NDIMS >::DelaunayTriangulation = Delaunay<DIM>

◆ PointType

template<int NDIMS = 3>
using axom::quest::ScatteredInterpolation< NDIMS >::PointType = typename DelaunayTriangulation::PointType

◆ BoundingBoxType

◆ CoordType

template<int NDIMS = 3>
using axom::quest::ScatteredInterpolation< NDIMS >::CoordType = typename PointType::CoordType

Member Function Documentation

◆ buildTriangulation()

template<int NDIMS = 3>
void axom::quest::ScatteredInterpolation< NDIMS >::buildTriangulation ( conduit::Node &  mesh_node,
const std::string &  coordset 
)
inline

Builds a Delaunay triangulation over the point set from mesh_node.

Parameters
[in]mesh_nodeConduit node for the input mesh
[in]coordsetThe name of the coordinate set for the input mesh

References axom::quest::Delaunay< DIM >::initializeBoundary(), axom::quest::Delaunay< DIM >::insertPoint(), axom::quest::Delaunay< DIM >::removeBoundary(), and SLIC_ASSERT.

◆ locatePoints()

template<int NDIMS = 3>
void axom::quest::ScatteredInterpolation< NDIMS >::locatePoints ( conduit::Node &  query_mesh,
const std::string &  coordset 
)
inline

Locates cell from Delaunay complex containing each point in query_mesh.

Parameters
[in,out]query_nodeConduit node for the query points in mesh Blueprint format; results will be placed into the cell_idx field
[in]coordsetThe name of the coordinate set for the query mesh
Precondition
query_mesh is the root of a valid mesh blueprint with an unstructured coordinate set coordset and a scalar field named cell_idx to store the results
Note
Uses Delaunay::INVALID_INDEX for points that cannot be located within the mesh

References axom::quest::Delaunay< DIM >::findContainingElement(), SLIC_ASSERT, and SLIC_ERROR_IF.

◆ getInterpolationWeights()

template<int NDIMS = 3>
bool axom::quest::ScatteredInterpolation< NDIMS >::getInterpolationWeights ( const PointType query_pt,
primal::Point< axom::IndexType, NDIMS+1 > &  indices,
primal::Point< CoordType, NDIMS+1 > &  weights 
) const
inline

Given a location in space, find the associated indices and interpolation weights with respect to the input mesh points.

Parameters
[in]query_ptThe point at which we want to interpolate
[out]indicesThe indices of the points from the input mesh in the support of query_pt
[out]weightsThe interpolation weights associated with each input point in indices
Returns
true if query_pt is found within a cell of the Delaunay complex; false otherwise. If true, the associated indices from points in the input mesh are returned in indices and the interpolation weights for each point are returned in weights

References axom::quest::Delaunay< DIM >::findContainingElement(), axom::quest::Delaunay< DIM >::getBaryCoords(), axom::quest::Delaunay< DIM >::getMeshData(), and axom::quest::Delaunay< DIM >::INVALID_INDEX.

◆ interpolateField()

template<int NDIMS = 3>
void axom::quest::ScatteredInterpolation< NDIMS >::interpolateField ( conduit::Node &  query_mesh,
const std::string &  coordset,
conduit::Node &  input_mesh,
const std::string &  input_field_name,
const std::string &  output_field_name,
const double  INVALID_VALUE = std::numeric_limits<double>::quiet_NaN() 
)
inline

Interpolates a field from an input_mesh to one on a query_mesh.

Parameters
[in,out]query_meshRoot node of mesh (in blueprint format) containing field to generate
[in]coordsetThe name of the coords for query points in query_mesh
[in]input_meshRoot node of mesh (in blueprint format) containing the field to interpolate
[in]input_field_nameName of field on input_mesh
[in]output_field_nameName of field on query_mesh
[in]INVALID_VALUEValue to use for points that are not in the input_mesh
Precondition
input_mesh and query_mesh must conform to the mesh blueprint schema for point meshes
input_mesh must contain a nodal scalar field named input_field_name
query_mesh must contain a nodal scalar field named output_field_name
query_mesh must contain a nodal scalar field named cell_idx whose values are the index of the cell from the Delaunay triangulation containing the query points. These can be computed in the locatePoints() function
Postcondition
Scalar field output_field_name on query_mesh will contain the interpolated values of input_field_name from input_mesh for all query points that have a valid cell_idx to a cell in the input_mesh.

References axom::quest::Delaunay< DIM >::getBaryCoords(), axom::quest::Delaunay< DIM >::getMeshData(), axom::quest::Delaunay< DIM >::INVALID_INDEX, and SLIC_ASSERT.

◆ exportDelaunayComplex()

template<int NDIMS = 3>
void axom::quest::ScatteredInterpolation< NDIMS >::exportDelaunayComplex ( conduit::Node &  mesh_node,
std::string &&  filename 
) const
inline

◆ numVertices()

template<int NDIMS = 3>
int axom::quest::ScatteredInterpolation< NDIMS >::numVertices ( ) const
inline

Returns the number of vertices in the underlying Deluanay complex.

References axom::quest::Delaunay< DIM >::getMeshData().

◆ numSimplices()

template<int NDIMS = 3>
int axom::quest::ScatteredInterpolation< NDIMS >::numSimplices ( ) const
inline

Returns the number of simplices (triangles/tetrahedra) in the underlying Deluanay complex.

References axom::quest::Delaunay< DIM >::getMeshData().

◆ boundingBox()

template<int NDIMS = 3>
const BoundingBoxType& axom::quest::ScatteredInterpolation< NDIMS >::boundingBox ( ) const
inline

Returns the bounding box of the input data points.

Member Data Documentation

◆ DIM

template<int NDIMS>
constexpr int axom::quest::ScatteredInterpolation< NDIMS >::DIM = NDIMS
staticconstexpr

The documentation for this class was generated from the following file: