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
26
27namespace PACMAN {
40template <typename ExecSpace, int_t Dim>
41void Interpolate(Transfer<ExecSpace, Dim> &transfer) {
42 const TransferMethods method = transfer.method;
43
44 switch (method) {
47 break;
50 break;
53 break;
56 break;
59 break;
60 // LCOV_EXCL_START
61 default:
62 std::cerr << "Invalid transfer method" << std::endl;
63 assert(false);
64 break;
65 // LCOV_EXCL_STOP
66 }
67 return;
68}
69} // namespace PACMAN
70
71// Explicit template instantiation declarations.
72// Each enabled exec space has a dedicated ETI translation unit — suppress
73// implicit instantiation of Interpolate<ExecSpace, Dim> everywhere else.
74#ifndef PACMAN_FE_ETI_COMPILATION
75namespace PACMAN {
76
77// clang-format off
78#if defined(KOKKOS_ENABLE_SERIAL)
79extern template void Interpolate<Kokkos::Serial, 1>(Transfer<Kokkos::Serial, 1> &);
80extern template void Interpolate<Kokkos::Serial, 2>(Transfer<Kokkos::Serial, 2> &);
81extern template void Interpolate<Kokkos::Serial, 3>(Transfer<Kokkos::Serial, 3> &);
82#endif
83
84#if defined(KOKKOS_ENABLE_OPENMP)
85extern template void Interpolate<Kokkos::OpenMP, 1>(Transfer<Kokkos::OpenMP, 1> &);
86extern template void Interpolate<Kokkos::OpenMP, 2>(Transfer<Kokkos::OpenMP, 2> &);
87extern template void Interpolate<Kokkos::OpenMP, 3>(Transfer<Kokkos::OpenMP, 3> &);
88#endif
89
90#if defined(KOKKOS_ENABLE_THREADS)
91extern template void Interpolate<Kokkos::Threads, 1>(Transfer<Kokkos::Threads, 1> &);
92extern template void Interpolate<Kokkos::Threads, 2>(Transfer<Kokkos::Threads, 2> &);
93extern template void Interpolate<Kokkos::Threads, 3>(Transfer<Kokkos::Threads, 3> &);
94#endif
95
96#if defined(KOKKOS_ENABLE_CUDA)
97extern template void Interpolate<Kokkos::Cuda, 1>(Transfer<Kokkos::Cuda, 1> &);
98extern template void Interpolate<Kokkos::Cuda, 2>(Transfer<Kokkos::Cuda, 2> &);
99extern template void Interpolate<Kokkos::Cuda, 3>(Transfer<Kokkos::Cuda, 3> &);
100#endif
101
102#if defined(KOKKOS_ENABLE_HIP)
103extern template void Interpolate<Kokkos::HIP, 1>(Transfer<Kokkos::HIP, 1> &);
104extern template void Interpolate<Kokkos::HIP, 2>(Transfer<Kokkos::HIP, 2> &);
105extern template void Interpolate<Kokkos::HIP, 3>(Transfer<Kokkos::HIP, 3> &);
106#endif
107
108#if defined(KOKKOS_ENABLE_SYCL)
109extern template void Interpolate<Kokkos::SYCL, 1>(Transfer<Kokkos::SYCL, 1> &);
110extern template void Interpolate<Kokkos::SYCL, 2>(Transfer<Kokkos::SYCL, 2> &);
111extern template void Interpolate<Kokkos::SYCL, 3>(Transfer<Kokkos::SYCL, 3> &);
112#endif
113// clang-format on
114
115} // namespace PACMAN
116#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