PACMAN 0.1.0
Portable Algorithms for Coupling, Mapping, and Adaptive iNterpolation
Loading...
Searching...
No Matches
interpolate.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 <iostream>
9#include <utility>
10
11#include "common/transfer.hxx"
17
27namespace PACMAN {
40template <typename ExecSpace, int_t Dim>
42 const TransferMethods method = transfer.method;
43
44 switch (method) {
47 break;
50 break;
53 break;
56 break;
59 break;
60 default:
61 std::cerr << "Invalid transfer method" << std::endl;
62 assert(false);
63 break;
64 }
65 return;
66}
67} // namespace PACMAN
68
69// Explicit template instantiation declarations.
70// Each enabled exec space has a dedicated ETI translation unit — suppress
71// implicit instantiation of Interpolate<ExecSpace, Dim> everywhere else.
72#ifndef PACMAN_FE_ETI_COMPILATION
73namespace PACMAN {
74
75// clang-format off
76#if defined(KOKKOS_ENABLE_SERIAL)
77extern template void Interpolate<Kokkos::Serial, 1>(Transfer<Kokkos::Serial, 1> &);
78extern template void Interpolate<Kokkos::Serial, 2>(Transfer<Kokkos::Serial, 2> &);
79extern template void Interpolate<Kokkos::Serial, 3>(Transfer<Kokkos::Serial, 3> &);
80#endif
81
82#if defined(KOKKOS_ENABLE_OPENMP)
83extern template void Interpolate<Kokkos::OpenMP, 1>(Transfer<Kokkos::OpenMP, 1> &);
84extern template void Interpolate<Kokkos::OpenMP, 2>(Transfer<Kokkos::OpenMP, 2> &);
85extern template void Interpolate<Kokkos::OpenMP, 3>(Transfer<Kokkos::OpenMP, 3> &);
86#endif
87
88#if defined(KOKKOS_ENABLE_THREADS)
89extern template void Interpolate<Kokkos::Threads, 1>(Transfer<Kokkos::Threads, 1> &);
90extern template void Interpolate<Kokkos::Threads, 2>(Transfer<Kokkos::Threads, 2> &);
91extern template void Interpolate<Kokkos::Threads, 3>(Transfer<Kokkos::Threads, 3> &);
92#endif
93
94#if defined(KOKKOS_ENABLE_CUDA)
95extern template void Interpolate<Kokkos::Cuda, 1>(Transfer<Kokkos::Cuda, 1> &);
96extern template void Interpolate<Kokkos::Cuda, 2>(Transfer<Kokkos::Cuda, 2> &);
97extern template void Interpolate<Kokkos::Cuda, 3>(Transfer<Kokkos::Cuda, 3> &);
98#endif
99
100#if defined(KOKKOS_ENABLE_HIP)
101extern template void Interpolate<Kokkos::HIP, 1>(Transfer<Kokkos::HIP, 1> &);
102extern template void Interpolate<Kokkos::HIP, 2>(Transfer<Kokkos::HIP, 2> &);
103extern template void Interpolate<Kokkos::HIP, 3>(Transfer<Kokkos::HIP, 3> &);
104#endif
105
106#if defined(KOKKOS_ENABLE_SYCL)
107extern template void Interpolate<Kokkos::SYCL, 1>(Transfer<Kokkos::SYCL, 1> &);
108extern template void Interpolate<Kokkos::SYCL, 2>(Transfer<Kokkos::SYCL, 2> &);
109extern template void Interpolate<Kokkos::SYCL, 3>(Transfer<Kokkos::SYCL, 3> &);
110#endif
111// clang-format on
112
113} // namespace PACMAN
114#endif // PACMAN_FE_ETI_COMPILATION
void FTInterZero(Transfer< ExecSpace, Dim > &transfer)
Interpolate target points from FE cells, zero-filling points outside the source mesh.
void FTInterClamp(Transfer< ExecSpace, Dim > &transfer)
Interpolate target points from FE cells and clamp outside points by projection onto the source mesh s...
void FTInterpNearest(Transfer< ExecSpace, Dim > &transfer)
Interpolate target points from FE cells and fallback to nearest source-node value outside the source ...
void FTInterExtrap(Transfer< ExecSpace, Dim > &transfer)
Interpolate target points from FE cells and extrapolate outside points via projection onto the source...
void FTNearest(Transfer< ExecSpace, Dim > &transfer)
Transfer source values to target points using nearest-neighbor search.
Definition FTNearest.hpp:28
void Interpolate(Transfer< ExecSpace, Dim > &transfer)
Generic C++ interface to PACMAN interpolation methods.
TransferMethods
Definition types.hpp:29