8#define PACMAN_FE_ETI_COMPILATION
12#include <Kokkos_Core.hpp>
13#include <Kokkos_Profiling_ScopedRegion.hpp>
16#include <unordered_map>
19#include "common/transfer.hxx"
28template <
typename ExecSpace, PACMAN::
int_t Dim>
38 nTargetPoints, pSourcePoints, pSourceValues,
39 pConnVal, pConnOff, pCellTypes, pTargetPoints, fortranIndexing);
46 auto unmanaged_host_tv =
48 Kokkos::DefaultHostExecutionSpace::memory_space,
49 Kokkos::MemoryTraits<Kokkos::Unmanaged>>(
51 auto unmanaged_host_ts = Kokkos::View<
53 Kokkos::MemoryTraits<Kokkos::Unmanaged>>(
57 Kokkos::deep_copy(unmanaged_host_tv, transfer.targetValues);
58 Kokkos::deep_copy(unmanaged_host_ts, transfer.targetStatus);
62template <PACMAN::
int_t Dim>
71 [&](
auto execSpaceObj) {
72 return RunInterpolate<decltype(execSpaceObj), Dim>(
73 method, pSourcePoints, nSourcePoints, pSourceValues, pConnVal,
74 connValSize, pConnOff, connOffSize, pCellTypes, pTargetPoints,
75 nTargetPoints, fortranIndexing);
94 const std::string
_region_name =
"PACMAN::fe_interpolate";
98 throw std::invalid_argument(
"sourcePoints is null but nSourcePoints > 0");
100 throw std::invalid_argument(
"targetPoints is null but nTargetPoints > 0");
102 throw std::invalid_argument(
"sourceValues is null but nSourcePoints > 0");
118 throw std::runtime_error(
119 "The dimension of the points can only be: 1, 2 or 3.\n");
125 static const std::unordered_map<int_t, CellType>
vtk_to_pacman = {
149 throw std::runtime_error(
"Unsupported VTK cell type: " +
156 static const std::unordered_map<int_t, int_t>
vtk_dim = {
179 throw std::runtime_error(
"Unsupported VTK cell type: " +
Generic C++ entry point for PACMAN interpolation methods.
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)
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.
static AvailableExecSpaces MakeExecSpace(const unsigned char s)
Converts an execution-space selector byte to a variant type.
void Interpolate(Transfer< ExecSpace, Dim > &transfer)
Generic C++ interface to PACMAN interpolation methods.
@ VTK_QUADRATIC_HEXAHEDRON
int_t vtk_cell_dim(int_t vtkCellType)
Return the topological dimension for a VTK cell type identifier.
Result of a finite-elements interpolation call.
std::vector< int_t > targetStatus
TransferStatus code per target point (same underlying int_t as TransferStatus enum).
std::vector< fp_t > targetValues
Interpolated scalar value per target point.