PACMAN
0.1.0
Portable Algorithms for Coupling, Mapping, and Adaptive iNterpolation
Toggle main menu visibility
Loading...
Searching...
No Matches
FTNearest.hpp
Go to the documentation of this file.
1
//
2
// This file is subject to the terms and conditions defined in
3
// file 'LICENSE', which is part of this source code package.
4
//
5
6
#pragma once
7
8
#include <ArborX_LinearBVH.hpp>
9
#include <ArborX_Point.hpp>
10
11
#include "common/transfer.hxx"
12
#include "
common/types.hpp
"
13
#include "
finite_elements/utils/ArborXCallbacks.hpp
"
14
15
namespace
PACMAN
{
16
namespace
FiniteElements
{
27
template
<
typename
ExecSpace,
int
_t Dim>
28
void
FTNearest
(Transfer<ExecSpace, Dim> &transfer) {
29
Kokkos::Profiling::pushRegion(
"FTNearest"
);
30
31
using
TransferType = Transfer<ExecSpace, Dim>;
32
using
MemorySpace =
typename
TransferType::MemorySpace;
33
using
Point = ::ArborX::Point<Dim, coordinates_t>;
34
35
ExecSpace execspace{};
36
37
auto
source_points = transfer.sourcePoints;
38
auto
source_values = transfer.sourceValues;
39
auto
target_points = transfer.targetPoints;
40
auto
target_values = transfer.targetValues;
41
auto
target_status = transfer.targetStatus;
42
43
auto
nb_target_points = target_points.extent(0);
44
45
Kokkos::Profiling::pushRegion(
"BVH construction and NN search"
);
46
47
::ArborX::BoundingVolumeHierarchy bvh(
48
execspace, ::ArborX::Experimental::attach_indices(source_points));
49
PointCloudNearest<MemorySpace, Dim>
pcn{target_points};
50
bvh.query(execspace, pcn,
51
NearestPointProjection<MemorySpace>
{source_values, target_values, target_status });
52
Kokkos::Profiling::popRegion();
53
}
54
55
}
// namespace FiniteElements
56
57
}
// namespace PACMAN
ArborXCallbacks.hpp
ArborX predicate/callback helpers for PACMAN finite-elements kernels.
PACMAN::FiniteElements
Definition
FTInterpClamp.hpp:15
PACMAN::FiniteElements::FTNearest
void FTNearest(Transfer< ExecSpace, Dim > &transfer)
Transfer source values to target points using nearest-neighbor search.
Definition
FTNearest.hpp:28
PACMAN
Definition
concepts.hpp:14
PACMAN::FiniteElements::NearestPointProjection
Callback assigning source value at nearest-neighbor index.
Definition
ArborXCallbacks.hpp:175
PACMAN::FiniteElements::PointCloudNearest
Predicate wrapper for nearest-neighbor queries over point clouds.
Definition
ArborXCallbacks.hpp:169
types.hpp
src
finite_elements
FTNearest.hpp
Generated on
for PACMAN by
1.17.0