8#include <ArborX_LinearBVH.hpp>
9#include <Kokkos_Core.hpp>
10#include <Kokkos_Profiling_ScopedRegion.hpp>
18#include "common/transfer.hxx"
20#include "interpolator.hxx"
28template <KokkosViewRank<2> SourceType, KokkosViewRank<1> TargetType,
int_t Dim>
32 using ExecSpace =
typename SourceType::execution_space;
35 "FillTarget", Kokkos::RangePolicy(
ExecSpace{}, 0,
K),
37 ::ArborX::Point<Dim, coordinates_t>
point{};
65 const std::string
_region_name =
"RbfPumInterpolator::RbfPumInterpolator";
70 this->mSource = rTransfer.sourcePoints;
71 this->mValues = rTransfer.sourceValues;
72 this->mTarget = VectorView<Point>(
73 Kokkos::view_alloc(execspace, Kokkos::WithoutInitializing,
75 rTransfer.targetPoints.extent(0));
76 FillTarget<
decltype(rTransfer.targetPoints),
decltype(this->mTarget), Dim>(
77 rTransfer.targetPoints, this->mTarget);
78 this->out = rTransfer.targetValues;
81 this->mSourceBvh = ::ArborX::BoundingVolumeHierarchy{
82 execspace, ::ArborX::Experimental::attach_indices(this->mSource)};
83 this->mTargetBvh = ::ArborX::BoundingVolumeHierarchy{
84 execspace, ::ArborX::Experimental::attach_indices(this->mTarget)};
85 this->mRbfFunction = RbfFunctionBasisType{};
86 this->mWeightingFunction = WendlandC2{};
90 this->mRbfFunction.SetRadiusInv(
fp_consts::one() / this->mSupportRadius);
91 this->mWeightingFunction.SetRadiusInv(
fp_consts::one() / this->mRadius);
105std::string TEMPLATED_CLASSNAME::GetInterpolatorDetails(
void)
const {
106 std::ostringstream strs;
108 strs <<
"#Source points: " << this->mSource.extent(0) <<
"\n";
109 strs <<
"#Values: " << this->mValues.extent(0) <<
"\n";
110 strs <<
"#Target points: " << this->mTarget.extent(0) <<
"\n";
111 strs <<
"Source bounding box:\n";
112 strs <<
" Lower: " << this->mSourceBvh.bounds().minCorner() <<
"\n";
113 strs <<
" Upper: " << this->mSourceBvh.bounds().maxCorner() <<
"\n";
114 strs <<
"Interpolation params:\n";
115 strs <<
" #Points per cluster: " << this->mNodesPerCluster <<
"\n";
116 strs <<
" Relative overlap: " << this->mRelativeOverlap <<
"\n";
117 strs <<
" RBF Function: " <<
typeid(RbfFunctionBasisType).name() <<
"\n";
118 strs <<
" Execution space: " << ExecSpace{}.name() <<
"\n";
119 strs <<
"Found radius: " << this->mRadius <<
"\n";
120 strs <<
"Number of clusters: " << this->mClusters.extent(0);
static void FillTarget(const SourceType &sourceView, TargetType &targetView)
KOKKOS_INLINE_FUNCTION consteval fp_t zero(void)
KOKKOS_INLINE_FUNCTION consteval fp_t one(void)
void Interpolate(Transfer< ExecSpace, Dim > &transfer)
Generic C++ interface to PACMAN interpolation methods.