PACMAN 0.1.0
Portable Algorithms for Coupling, Mapping, and Adaptive iNterpolation
Loading...
Searching...
No Matches
PACMAN Namespace Reference

Namespaces

namespace  detail
 A type variant which defines the enabled Kokkos execution spaces.
namespace  FiniteElements
namespace  fp_consts
namespace  MLS
namespace  RbfPum

Classes

struct  ExecSpaces
 Constants representing available Kokkos execution spaces as unsigned chars, usable both from C++ and the Python bindings. More...
struct  is_kokkos_array
struct  is_kokkos_array< Kokkos::Array< T, N > >
struct  is_kokkos_view
struct  is_kokkos_view< Kokkos::View< DataType, P... > >
struct  RbfFunctions
 Constants representing available RBF basis functions as unsigned chars, matching PyBindingsRbf::RbfFunctions in the Python bindings. More...

Concepts

concept  IsKokkosView
concept  IsRank
concept  IsRBFFunction
concept  IsKokkosArray
concept  IsValidDim
concept  KokkosViewRank
concept  KokkosArray
concept  RBFFunction

Typedefs

using AvailableExecSpaces = typename detail::ToVariant<detail::ExecSpaces6>::type
typedef double fp_t
typedef double coordinates_t
typedef int32_t int_t
typedef int32_t shortint_t
typedef uint32_t index_t
typedef int32_t offset_t
typedef int32_t method_t
typedef int32_t cell_t
typedef int32_t status_t
typedef int32_t geosupport_t
using ExecSpaces = PACMAN::ExecSpaces

Enumerations

enum class  TransferMethods : method_t {
  NEAREST_NEAREST = 0xF0 , INTERP_CLAMP = 0xF1 , INTERP_NEAREST = 0xF2 , INTERP_ZEROFILL = 0xF3 ,
  INTERP_EXTRAP = 0xF4 , RBF_PUM = 0xF5 , MLS = 0xF6
}
enum class  TransferStatus : status_t {
  OUTSIDE , NEAREST , INTER , EXTRAP ,
  CLAMP
}
enum class  GeoSupport : geosupport_t {
  NA , POINT , LINE , TRIANGLE ,
  QUAD , TETRA , HEXAHEDRON , WEDGE ,
  PYRAMID
}
enum class  CellType : cell_t {
  VTK_EMPTY_CELL , VTK_VERTEX , VTK_LINE , VTK_QUADRATIC_EDGE ,
  VTK_TRIANGLE , VTK_QUAD , VTK_QUADRATIC_TRIANGLE , VTK_QUADRATIC_QUAD ,
  VTK_TETRA , VTK_HEXAHEDRON , VTK_WEDGE , VTK_PYRAMID ,
  VTK_QUADRATIC_TETRA , VTK_QUADRATIC_HEXAHEDRON , VTK_QUADRATIC_WEDGE , VTK_QUADRATIC_PYRAMID
}

Functions

static AvailableExecSpaces MakeExecSpace (const unsigned char s)
 Converts an execution-space selector byte to a variant type.
void fe_interpolate (int_t spaceDimension, unsigned char execSpace, method_t method, coordinates_t *sourcePoints, int_t nSourcePoints, fp_t *sourceValues, int_t *connVal, int_t connValSize, offset_t *connOff, int_t connOffSize, cell_t *cellTypes, coordinates_t *targetPoints, int_t nTargetPoints, fp_t *targetValues, int_t *targetStatus, bool fortranIndexing=false, int_t nComponents=1)
 C++ interface for finite-elements interpolation.
void vtk_to_pacman_cell_type (const int_t *vtkTypes, cell_t *pacmanTypes, int_t n)
 Convert an array of VTK cell type IDs to PACMAN CellType enum values.
void rbf_interpolate (int_t spaceDimension, unsigned char execSpace, unsigned char rbfFunction, coordinates_t *sourcePoints, int_t nSourcePoints, fp_t *sourceValues, coordinates_t *targetPoints, int_t nTargetPoints, fp_t *targetValues, int_t nComponents=1)
 C++ interface for RBF-PUM interpolation.
void MLS_interpolate (int_t spaceDimension, unsigned char execSpace, coordinates_t *sourcePoints, int_t nSourcePoints, fp_t *sourceValues, coordinates_t *targetPoints, int_t nTargetPoints, fp_t *targetValues, int_t nComponents=1)
 C++ interface for Moving Least Squares (MLS) interpolation.
template<typename ExecSpace, int_t Dim>
void Interpolate (Transfer< ExecSpace, Dim > &transfer)
 Generic C++ interface to PACMAN interpolation methods.

Typedef Documentation

◆ AvailableExecSpaces

Definition at line 77 of file execspaces.hpp.

◆ cell_t

typedef int32_t PACMAN::cell_t

Definition at line 25 of file types.hpp.

◆ coordinates_t

typedef double PACMAN::coordinates_t

Definition at line 16 of file types.hpp.

◆ ExecSpaces

using PACMAN::ExecSpaces = PACMAN::ExecSpaces

Definition at line 16 of file interface.hpp.

◆ fp_t

typedef double PACMAN::fp_t

Definition at line 15 of file types.hpp.

◆ geosupport_t

typedef int32_t PACMAN::geosupport_t

Definition at line 27 of file types.hpp.

◆ index_t

typedef uint32_t PACMAN::index_t

Definition at line 20 of file types.hpp.

◆ int_t

typedef int32_t PACMAN::int_t

Definition at line 18 of file types.hpp.

◆ method_t

typedef int32_t PACMAN::method_t

Definition at line 24 of file types.hpp.

◆ offset_t

typedef int32_t PACMAN::offset_t

Definition at line 21 of file types.hpp.

◆ shortint_t

typedef int32_t PACMAN::shortint_t

Definition at line 19 of file types.hpp.

◆ status_t

typedef int32_t PACMAN::status_t

Definition at line 26 of file types.hpp.

Enumeration Type Documentation

◆ CellType

enum class PACMAN::CellType : cell_t
strong
Enumerator
VTK_EMPTY_CELL 
VTK_VERTEX 
VTK_LINE 
VTK_QUADRATIC_EDGE 
VTK_TRIANGLE 
VTK_QUAD 
VTK_QUADRATIC_TRIANGLE 
VTK_QUADRATIC_QUAD 
VTK_TETRA 
VTK_HEXAHEDRON 
VTK_WEDGE 
VTK_PYRAMID 
VTK_QUADRATIC_TETRA 
VTK_QUADRATIC_HEXAHEDRON 
VTK_QUADRATIC_WEDGE 
VTK_QUADRATIC_PYRAMID 

Definition at line 60 of file types.hpp.

◆ GeoSupport

enum class PACMAN::GeoSupport : geosupport_t
strong
Enumerator
NA 
POINT 
LINE 
TRIANGLE 
QUAD 
TETRA 
HEXAHEDRON 
WEDGE 
PYRAMID 

Definition at line 47 of file types.hpp.

◆ TransferMethods

enum class PACMAN::TransferMethods : method_t
strong
Enumerator
NEAREST_NEAREST 
INTERP_CLAMP 
INTERP_NEAREST 
INTERP_ZEROFILL 
INTERP_EXTRAP 
RBF_PUM 
MLS 

Definition at line 29 of file types.hpp.

◆ TransferStatus

enum class PACMAN::TransferStatus : status_t
strong
Enumerator
OUTSIDE 
NEAREST 
INTER 
EXTRAP 
CLAMP 

Definition at line 39 of file types.hpp.

Function Documentation

◆ fe_interpolate()

void PACMAN::fe_interpolate ( int_t spaceDimension,
unsigned char execSpace,
method_t method,
coordinates_t * sourcePoints,
int_t nSourcePoints,
fp_t * sourceValues,
int_t * connVal,
int_t connValSize,
offset_t * connOff,
int_t connOffSize,
cell_t * cellTypes,
coordinates_t * targetPoints,
int_t nTargetPoints,
fp_t * targetValues,
int_t * targetStatus,
bool fortranIndexing = false,
int_t nComponents = 1 )

C++ interface for finite-elements interpolation.

Mirrors pacman.fe.interpolate from the Python bindings, accepting raw pointers instead of NumPy arrays. All pointer arrays are row-major.

Parameters
spaceDimensionGeometric dimension of points (1, 2, or 3).
execSpaceExecution-space selector (
See also
ExecSpaces constants).
Parameters
methodTransfer method (
See also
TransferMethods enum cast to method_t).
Parameters
sourcePointsRow-major source points [nSourcePoints × spaceDimension].
nSourcePointsNumber of source points.
sourceValuesRow-major source values [nSourcePoints × nComponents].
connValFlattened CSR connectivity values; may be null for NEAREST_NEAREST.
connValSizeNumber of entries in connVal.
connOffCSR connectivity offsets; may be null for NEAREST_NEAREST.
connOffSizeNumber of entries in connOff (= nElems + 1).
cellTypesPACMAN CellType per element, length connOffSize - 1; use vtk_to_pacman_cell_type to convert from VTK IDs.
targetPointsRow-major target points [nTargetPoints × spaceDimension].
nTargetPointsNumber of target points.
targetValuesCaller-owned row-major output buffer with nTargetPoints * nComponents entries.
targetStatusCaller-owned output buffer with nTargetPoints TransferStatus codes.
fortranIndexingWhether the connectivity arrays use 1-based indexing (true) or 0-based indexing (false, default). Only relevant if connVal and connOff are provided.
nComponentsNumber of scalar components per point.
Exceptions
std::invalid_argumenton inconsistent sizes.
std::runtime_errorif spaceDimension is not in {1, 2, 3}.

Definition at line 84 of file interface.cpp.

Referenced by pacman_fe_interpolate_c().

◆ Interpolate()

template<typename ExecSpace, int_t Dim>
void PACMAN::Interpolate ( Transfer< ExecSpace, Dim > & transfer)

Generic C++ interface to PACMAN interpolation methods.

The interpolation algorithm is selected through transfer.method and then dispatched to the corresponding implementation:

  • Finite-elements: nearest/nearest, interp-nearest, zero-fill, extrap, clamp
Template Parameters
ExecSpaceKokkos execution space used by PACMAN kernels.
DimSpatial dimension of source/target points.
Parameters
[in,out]transferTransfer descriptor containing source/target data, interpolation method, and output buffers.

Definition at line 41 of file interpolate.hpp.

References PACMAN::FiniteElements::FTInterClamp(), PACMAN::FiniteElements::FTInterExtrap(), PACMAN::FiniteElements::FTInterpNearest(), PACMAN::FiniteElements::FTInterZero(), PACMAN::FiniteElements::FTNearest(), INTERP_CLAMP, INTERP_EXTRAP, INTERP_NEAREST, INTERP_ZEROFILL, and NEAREST_NEAREST.

◆ MakeExecSpace()

AvailableExecSpaces PACMAN::MakeExecSpace ( const unsigned char s)
inlinestatic

Converts an execution-space selector byte to a variant type.

Definition at line 80 of file execspaces.hpp.

References PACMAN::ExecSpaces::CUDA, PACMAN::ExecSpaces::HIP, PACMAN::ExecSpaces::OPENMP, PACMAN::ExecSpaces::SERIAL, PACMAN::ExecSpaces::SYCL, and PACMAN::ExecSpaces::THREADS.

◆ MLS_interpolate()

void PACMAN::MLS_interpolate ( int_t spaceDimension,
unsigned char execSpace,
coordinates_t * sourcePoints,
int_t nSourcePoints,
fp_t * sourceValues,
coordinates_t * targetPoints,
int_t nTargetPoints,
fp_t * targetValues,
int_t nComponents = 1 )

C++ interface for Moving Least Squares (MLS) interpolation.

Mirrors pacman.MLS.interpolate from the Python bindings, accepting raw pointers instead of NumPy arrays. Points arrays are row-major [nPoints × spaceDimension].

Parameters
spaceDimensionGeometric dimension (1, 2, or 3).
execSpaceExecution-space selector (
See also
ExecSpaces constants).
Parameters
sourcePointsRow-major source points [nSourcePoints × spaceDimension].
nSourcePointsNumber of source points.
sourceValuesRow-major source values [nSourcePoints × nComponents].
targetPointsRow-major target points [nTargetPoints × spaceDimension].
nTargetPointsNumber of target points.
targetValuesCaller-owned row-major output buffer with nTargetPoints * nComponents entries.
nComponentsNumber of scalar components per point.
Exceptions
std::invalid_argumenton inconsistent sizes / null pointers.
std::runtime_errorif spaceDimension is not in {1, 2, 3}.

Definition at line 72 of file mls_interface.cpp.

Referenced by pacman_mls_interpolate_c().

◆ rbf_interpolate()

void PACMAN::rbf_interpolate ( int_t spaceDimension,
unsigned char execSpace,
unsigned char rbfFunction,
coordinates_t * sourcePoints,
int_t nSourcePoints,
fp_t * sourceValues,
coordinates_t * targetPoints,
int_t nTargetPoints,
fp_t * targetValues,
int_t nComponents = 1 )

C++ interface for RBF-PUM interpolation.

Mirrors pacman.rbf.interpolate from the Python bindings, accepting raw pointers instead of NumPy arrays. Points arrays are row-major [nPoints × spaceDimension].

Parameters
spaceDimensionGeometric dimension (1, 2, or 3).
execSpaceExecution-space selector (
See also
ExecSpaces constants).
Parameters
rbfFunctionRBF basis function selector (
See also
RbfFunctions constants).
Parameters
sourcePointsRow-major source points [nSourcePoints × spaceDimension].
nSourcePointsNumber of source points.
sourceValuesRow-major source values [nSourcePoints × nComponents].
targetPointsRow-major target points [nTargetPoints × spaceDimension].
nTargetPointsNumber of target points.
targetValuesCaller-owned row-major output buffer with nTargetPoints * nComponents entries.
nComponentsNumber of scalar components per point.
Exceptions
std::invalid_argumenton inconsistent sizes / null pointers.
std::runtime_errorif spaceDimension is not in {1, 2, 3}.

Definition at line 98 of file rbf_interface.cpp.

Referenced by pacman_rbf_interpolate_c().

◆ vtk_to_pacman_cell_type()

void PACMAN::vtk_to_pacman_cell_type ( const int_t * vtkTypes,
cell_t * pacmanTypes,
int_t n )

Convert an array of VTK cell type IDs to PACMAN CellType enum values.

Equivalent to pacman.fe.vtk_to_pacman_cell_type from the Python bindings.

Parameters
vtkTypesInput array of VTK cell type identifiers, length n.
pacmanTypesOutput array of PACMAN CellType values, length n.
nNumber of cell types to convert.
Exceptions
std::runtime_errorif an unsupported VTK cell type is encountered.

Definition at line 133 of file interface.cpp.

References VTK_HEXAHEDRON, VTK_LINE, VTK_PYRAMID, VTK_QUAD, VTK_QUADRATIC_EDGE, VTK_QUADRATIC_HEXAHEDRON, VTK_QUADRATIC_PYRAMID, VTK_QUADRATIC_QUAD, VTK_QUADRATIC_TETRA, VTK_QUADRATIC_TRIANGLE, VTK_QUADRATIC_WEDGE, VTK_TETRA, VTK_TRIANGLE, VTK_VERTEX, and VTK_WEDGE.

Referenced by pacman_vtk_to_pacman_cell_type_c().