18#include <Kokkos_Core.hpp>
29 if (!Kokkos::is_initialized()) {
35 if (Kokkos::is_initialized()) {
41#if defined(KOKKOS_ENABLE_HIP)
43#elif defined(KOKKOS_ENABLE_CUDA)
45#elif defined(KOKKOS_ENABLE_SYCL)
47#elif defined(KOKKOS_ENABLE_OPENMP)
49#elif defined(KOKKOS_ENABLE_THREADS)
51#elif defined(KOKKOS_ENABLE_SERIAL)
63 const double *sourcePoints,
int nSourcePoints,
64 const double *sourceValues,
65 const double *targetPoints,
int nTargetPoints,
66 double *targetValues) {
70 static_cast<unsigned char>(execSpace),
71 static_cast<unsigned char>(rbfFunction),
82 catch (
const std::exception &e) {
83 std::cerr <<
"pacman_rbf_interpolate_c: " << e.what() <<
"\n";
86 std::cerr <<
"pacman_rbf_interpolate_c: unknown exception\n";
97 const double *sourcePoints,
int nSourcePoints,
98 const double *sourceValues,
const int *connVal,
99 int connValSize,
const int *connOff,
100 int connOffSize,
const int *cellTypes,
101 const double *targetPoints,
int nTargetPoints,
102 double *targetValues,
int *targetStatus) {
106 static_cast<unsigned char>(execSpace),
117 static_cast<PACMAN::int_t>(nTargetPoints), targetValues, targetStatus,
122 catch (
const std::exception &e) {
123 std::cerr <<
"pacman_fe_interpolate_c: " << e.what() <<
"\n";
127 std::cerr <<
"pacman_fe_interpolate_c: unknown exception\n";
138 const double *sourcePoints,
int nSourcePoints,
139 const double *sourceValues,
140 const double *targetPoints,
int nTargetPoints,
141 double *targetValues) {
146 static_cast<unsigned char>(execSpace),
156 catch (
const std::exception &e) {
157 std::cerr <<
"pacman_mls_interpolate_c: " << e.what() <<
"\n";
161 std::cerr <<
"pacman_mls_interpolate_c: unknown exception\n";
181 catch (
const std::exception &e) {
182 std::cerr <<
"pacman_vtk_to_pacman_cell_type_c: " << e.what() <<
"\n";
186 std::cerr <<
"pacman_vtk_to_pacman_cell_type_c: unknown exception\n";
void pacman_kokkos_initialize_c(void)
Initialize Kokkos with default settings.
int pacman_rbf_interpolate_c(int spaceDimension, int execSpace, int rbfFunction, const double *sourcePoints, int nSourcePoints, const double *sourceValues, const double *targetPoints, int nTargetPoints, double *targetValues)
C shim for PACMAN::rbf_interpolate.
int pacman_mls_interpolate_c(int spaceDimension, int execSpace, const double *sourcePoints, int nSourcePoints, const double *sourceValues, const double *targetPoints, int nTargetPoints, double *targetValues)
C shim for PACMAN::mls_interpolate.
int pacman_best_execspace_c(void)
Return the best execution space available in the current build.
int pacman_fe_interpolate_c(int spaceDimension, int execSpace, int method, const double *sourcePoints, int nSourcePoints, const double *sourceValues, const int *connVal, int connValSize, const int *connOff, int connOffSize, const int *cellTypes, const double *targetPoints, int nTargetPoints, double *targetValues, int *targetStatus)
C shim for PACMAN::fe_interpolate.
void pacman_kokkos_finalize_c(void)
Finalize Kokkos.
int pacman_vtk_to_pacman_cell_type_c(const int *vtkTypes, int *pacmanTypes, int n)
Convert an array of VTK cell-type IDs to PACMAN CellType values.
Plain-C shim declarations for the Fortran ISO C bindings interface.
void rbf_interpolate(int_t spaceDimension, unsigned char execSpace, unsigned char rbfFunction, coordinates_t *sourcePoints, int_t nSourcePoints, fp_t *sourceValues, coordinates_t *targetPoints, int_t nTargetPoints, fp_t *targetValues, int_t nComponents=1)
C++ interface for RBF-PUM 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.
void 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, fp_t *targetValues, int_t *targetStatus, bool fortranIndexing, int_t nComponents)
C++ interface for finite-elements interpolation.
void MLS_interpolate(int_t spaceDimension, unsigned char execSpace, coordinates_t *sourcePoints, int_t nSourcePoints, fp_t *sourceValues, coordinates_t *targetPoints, int_t nTargetPoints, fp_t *targetValues, int_t nComponents=1)
C++ interface for Moving Least Squares (MLS) interpolation.
static constexpr const unsigned char OPENMP
static constexpr const unsigned char SERIAL
static constexpr const unsigned char SYCL
static constexpr const unsigned char THREADS
static constexpr const unsigned char HIP
static constexpr const unsigned char CUDA