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

Namespaces

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  FeInterpolateResult
 Result of a finite-elements interpolation call. 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  MLSInterpolateResult
 Result of a Moving Least Squares interpolation call. More...
 
struct  RbfFunctions
 Constants representing available RBF basis functions as unsigned chars, matching PyBindingsRbf::RbfFunctions in the Python bindings. More...
 
struct  RbfInterpolateResult
 Result of an RBF-PUM interpolation call. More...
 

Concepts

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

Typedefs

using AvailableExecSpaces = std::variant< >
 A type variant which defines the enabled Kokkos execution spaces.
 
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.
 
FeInterpolateResult 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, bool fortranIndexing=false)
 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.
 
int_t vtk_cell_dim (int_t vtkCellType)
 Return the topological dimension for a VTK cell type identifier.
 
RbfInterpolateResult 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)
 C++ interface for RBF-PUM interpolation.
 
MLSInterpolateResult MLS_interpolate (int_t spaceDimension, unsigned char execSpace, coordinates_t *sourcePoints, int_t nSourcePoints, fp_t *sourceValues, coordinates_t *targetPoints, int_t nTargetPoints)
 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

A type variant which defines the enabled Kokkos execution spaces.

Used to dispatch runtime execution-space selectors to template arguments.

Definition at line 29 of file execspaces.hpp.

◆ cell_t

Definition at line 25 of file types.hpp.

◆ coordinates_t

Definition at line 16 of file types.hpp.

◆ ExecSpaces

◆ fp_t

Definition at line 15 of file types.hpp.

◆ geosupport_t

Definition at line 27 of file types.hpp.

◆ index_t

Definition at line 20 of file types.hpp.

◆ int_t

Definition at line 18 of file types.hpp.

◆ method_t

Definition at line 24 of file types.hpp.

◆ offset_t

Definition at line 21 of file types.hpp.

◆ shortint_t

Definition at line 19 of file types.hpp.

◆ status_t

Definition at line 26 of file types.hpp.

Enumeration Type Documentation

◆ CellType

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

Enumerator
NA 
POINT 
LINE 
TRIANGLE 
QUAD 
TETRA 
HEXAHEDRON 
WEDGE 
PYRAMID 

Definition at line 47 of file types.hpp.

◆ TransferMethods

Enumerator
NEAREST_NEAREST 
INTERP_CLAMP 
INTERP_NEAREST 
INTERP_ZEROFILL 
INTERP_EXTRAP 
RBF_PUM 
MLS 

Definition at line 29 of file types.hpp.

◆ TransferStatus

Enumerator
OUTSIDE 
NEAREST 
INTER 
EXTRAP 
CLAMP 

Definition at line 39 of file types.hpp.

Function Documentation

◆ fe_interpolate()

FeInterpolateResult 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,
bool  fortranIndexing = false 
)

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.
sourceValuesSource scalar values, length nSourcePoints.
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.
fortranIndexingWhether the connectivity arrays use 1-based indexing (true) or 0-based indexing (false, default). Only relevant if connVal and connOff are provided.
Returns
FeInterpolateResult with targetValues and targetStatus of length nTargetPoints.
Exceptions
std::invalid_argumenton inconsistent sizes.
std::runtime_errorif spaceDimension is not in {1, 2, 3}.

Definition at line 89 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()

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

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

Definition at line 52 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()

MLSInterpolateResult PACMAN::MLS_interpolate ( int_t  spaceDimension,
unsigned char  execSpace,
coordinates_t sourcePoints,
int_t  nSourcePoints,
fp_t sourceValues,
coordinates_t targetPoints,
int_t  nTargetPoints 
)

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.
sourceValuesSource scalar values, length nSourcePoints.
targetPointsRow-major target points [nTargetPoints × spaceDimension].
nTargetPointsNumber of target points.
Returns
MLSInterpolateResult with targetValues of length nTargetPoints.
Exceptions
std::invalid_argumenton inconsistent sizes / null pointers.
std::runtime_errorif spaceDimension is not in {1, 2, 3}.

Definition at line 77 of file mls_interface.cpp.

Referenced by pacman_mls_interpolate_c().

◆ rbf_interpolate()

RbfInterpolateResult 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 
)

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.
sourceValuesSource scalar values, length nSourcePoints.
targetPointsRow-major target points [nTargetPoints × spaceDimension].
nTargetPointsNumber of target points.
Returns
RbfInterpolateResult with targetValues of length nTargetPoints.
Exceptions
std::invalid_argumenton inconsistent sizes / null pointers.
std::runtime_errorif spaceDimension is not in {1, 2, 3}.

Definition at line 102 of file rbf_interface.cpp.

Referenced by pacman_rbf_interpolate_c().

◆ vtk_cell_dim()

int_t PACMAN::vtk_cell_dim ( int_t  vtkCellType)

Return the topological dimension for a VTK cell type identifier.

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

Parameters
vtkCellTypeVTK cell type ID.
Returns
Topological dimension (0, 1, 2, or 3).
Exceptions
std::runtime_errorif the cell type is unsupported.

Definition at line 155 of file interface.cpp.

Referenced by pacman_vtk_cell_dim_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 123 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().