PACMAN 0.1.0
Portable Algorithms for Coupling, Mapping, and Adaptive iNterpolation
Loading...
Searching...
No Matches
pacman_mod Module Reference

Fortran module providing a high-level interface to the PACMAN interpolation library via ISO C bindings. More...

Functions/Subroutines

subroutine, public pacman_kokkos_initialize ()
 Initialize Kokkos with default settings.
 
subroutine, public pacman_kokkos_finalize ()
 Finalize Kokkos.
 
integer(c_int) function, public pacman_best_execspace ()
 Return the best execution space available in the current build.
 
subroutine, public pacman_rbf_interpolate (spacedimension, execspace, rbffunction, sourcepoints, sourcevalues, targetpoints, targetvalues, ierr)
 Interpolate scalar values from source to target points using RBF-PUM (no mesh connectivity required).
 
subroutine, public pacman_fe_interpolate (spacedimension, execspace, method, sourcepoints, sourcevalues, connval, connoff, celltypes, targetpoints, targetvalues, targetstatus, ierr)
 Interpolate scalar values from a source mesh to target points using finite-element transfer methods.
 
subroutine, public pacman_mls_interpolate (spacedimension, execspace, sourcepoints, sourcevalues, targetpoints, targetvalues, ierr)
 Interpolate scalar values from source to target points using Moving Least Squares (no mesh connectivity required).
 
subroutine, public pacman_vtk_to_pacman_cell_type (vtktypes, pacmantypes, ierr)
 Convert VTK cell-type IDs to PACMAN CellType codes.
 
integer(c_int) function, public pacman_vtk_cell_dim (vtkcelltype)
 Return the topological dimension for a VTK cell-type ID.
 

Variables

integer(c_int), parameter, public pacman_serial = 0
 
integer(c_int), parameter, public pacman_openmp = 1
 
integer(c_int), parameter, public pacman_threads = 2
 
integer(c_int), parameter, public pacman_cuda = 3
 
integer(c_int), parameter, public pacman_hip = 4
 
integer(c_int), parameter, public pacman_sycl = 5
 
integer(c_int), parameter, public pacman_wendlandc0 = 16
 
integer(c_int), parameter, public pacman_wendlandc2 = 17
 
integer(c_int), parameter, public pacman_wendlandc4 = 18
 
integer(c_int), parameter, public pacman_wendlandc6 = 19
 
integer(c_int), parameter, public pacman_wendlandc8 = 20
 
integer(c_int), parameter, public pacman_fe_nearest_nearest = 240
 
integer(c_int), parameter, public pacman_fe_interp_clamp = 241
 
integer(c_int), parameter, public pacman_fe_interp_nearest = 242
 
integer(c_int), parameter, public pacman_fe_interp_zerofill = 243
 
integer(c_int), parameter, public pacman_fe_interp_extrap = 244
 
integer(c_int), parameter, public pacman_mls = 246
 

Detailed Description

Fortran module providing a high-level interface to the PACMAN interpolation library via ISO C bindings.

Usage example (RBF-PUM):

real(8), allocatable :: srcPts(:,:), srcVals(:), tgtPts(:,:), tgtVals(:)
integer :: ierr
allocate(tgtvals(ntarget))
srcpts, srcvals, tgtpts, tgtvals, ierr)
Fortran module providing a high-level interface to the PACMAN interpolation library via ISO C binding...
integer(c_int), parameter, public pacman_openmp
subroutine, public pacman_kokkos_initialize()
Initialize Kokkos with default settings.
subroutine, public pacman_kokkos_finalize()
Finalize Kokkos.
integer(c_int), parameter, public pacman_wendlandc2
subroutine, public pacman_rbf_interpolate(spacedimension, execspace, rbffunction, sourcepoints, sourcevalues, targetpoints, targetvalues, ierr)
Interpolate scalar values from source to target points using RBF-PUM (no mesh connectivity required).

Point arrays must be laid out as pts(spaceDimension, nPoints), which in Fortran column-major storage is identical to C row-major pts[nPoints][spaceDimension].

Function/Subroutine Documentation

◆ pacman_best_execspace()

integer(c_int) function, public pacman_mod::pacman_best_execspace

Return the best execution space available in the current build.

Returns
Integer constant from PACMAN_SERIAL / PACMAN_OPENMP / etc.

Definition at line 194 of file pacman_fortran.f90.

References pacman_best_execspace_c().

◆ pacman_fe_interpolate()

subroutine, public pacman_mod::pacman_fe_interpolate ( integer, intent(in)  spacedimension,
integer(c_int), intent(in)  execspace,
integer(c_int), intent(in)  method,
real(c_double), dimension(:,:), intent(in), target, contiguous  sourcepoints,
real(c_double), dimension(:), intent(in), target, contiguous  sourcevalues,
integer(c_int), dimension(:), intent(in), target, contiguous  connval,
integer(c_int), dimension(:), intent(in), target, contiguous  connoff,
integer(c_int), dimension(:), intent(in), target, contiguous  celltypes,
real(c_double), dimension(:,:), intent(in), target, contiguous  targetpoints,
real(c_double), dimension(:), intent(out), target, contiguous  targetvalues,
integer(c_int), dimension(:), intent(out), target, contiguous  targetstatus,
integer(c_int), intent(out), optional  ierr 
)

Interpolate scalar values from a source mesh to target points using finite-element transfer methods.

Parameters
spaceDimensionGeometric dimension (1, 2, or 3).
execSpaceExecution-space constant.
methodFE method constant (e.g. PACMAN_FE_INTERP_CLAMP).
sourcePointsSource coordinates, shape (spaceDimension, nSource).
sourceValuesSource scalar values, shape (nSource).
connValCSR connectivity values, shape (connValSize).
connOffCSR connectivity offsets, shape (nElems + 1).
cellTypesPACMAN cell-type codes, shape (nElems).
targetPointsTarget coordinates, shape (spaceDimension, nTarget).
targetValuesInterpolated output, shape (nTarget).
targetStatusTransfer-status codes per target point, shape (nTarget).
ierrOptional error code: 0 = success.

Definition at line 256 of file pacman_fortran.f90.

References pacman_fe_interpolate_c().

◆ pacman_kokkos_finalize()

subroutine, public pacman_mod::pacman_kokkos_finalize

Finalize Kokkos.

Must be called after all interpolation calls are complete.

Definition at line 188 of file pacman_fortran.f90.

References pacman_kokkos_finalize_c().

◆ pacman_kokkos_initialize()

subroutine, public pacman_mod::pacman_kokkos_initialize

Initialize Kokkos with default settings.

Must be called before any interpolation subroutine.

Definition at line 182 of file pacman_fortran.f90.

References pacman_kokkos_initialize_c().

◆ pacman_mls_interpolate()

subroutine, public pacman_mod::pacman_mls_interpolate ( integer, intent(in)  spacedimension,
integer(c_int), intent(in)  execspace,
real(c_double), dimension(:,:), intent(in), target, contiguous  sourcepoints,
real(c_double), dimension(:), intent(in), target, contiguous  sourcevalues,
real(c_double), dimension(:,:), intent(in), target, contiguous  targetpoints,
real(c_double), dimension(:), intent(out), target, contiguous  targetvalues,
integer(c_int), intent(out), optional  ierr 
)

Interpolate scalar values from source to target points using Moving Least Squares (no mesh connectivity required).

Parameters
spaceDimensionGeometric dimension (1, 2, or 3).
execSpaceExecution-space constant (e.g. PACMAN_OPENMP).
sourcePointsSource coordinates, shape (spaceDimension, nSource).
sourceValuesSource scalar values, shape (nSource).
targetPointsTarget coordinates, shape (spaceDimension, nTarget).
targetValuesInterpolated output, shape (nTarget). Must be allocated by the caller before the call.
ierrOptional error code: 0 = success.

Definition at line 311 of file pacman_fortran.f90.

References pacman_mls_interpolate_c().

◆ pacman_rbf_interpolate()

subroutine, public pacman_mod::pacman_rbf_interpolate ( integer, intent(in)  spacedimension,
integer(c_int), intent(in)  execspace,
integer(c_int), intent(in)  rbffunction,
real(c_double), dimension(:,:), intent(in), target, contiguous  sourcepoints,
real(c_double), dimension(:), intent(in), target, contiguous  sourcevalues,
real(c_double), dimension(:,:), intent(in), target, contiguous  targetpoints,
real(c_double), dimension(:), intent(out), target, contiguous  targetvalues,
integer(c_int), intent(out), optional  ierr 
)

Interpolate scalar values from source to target points using RBF-PUM (no mesh connectivity required).

Parameters
spaceDimensionGeometric dimension (1, 2, or 3).
execSpaceExecution-space constant (e.g. PACMAN_OPENMP).
rbfFunctionRBF basis-function constant (e.g. PACMAN_WENDLANDC2).
sourcePointsSource coordinates, shape (spaceDimension, nSource).
sourceValuesSource scalar values, shape (nSource).
targetPointsTarget coordinates, shape (spaceDimension, nTarget).
targetValuesInterpolated output, shape (nTarget). Must be allocated by the caller before the call.
ierrOptional error code: 0 = success.

Definition at line 215 of file pacman_fortran.f90.

References pacman_rbf_interpolate_c().

◆ pacman_vtk_cell_dim()

integer(c_int) function, public pacman_mod::pacman_vtk_cell_dim ( integer(c_int), intent(in)  vtkcelltype)

Return the topological dimension for a VTK cell-type ID.

Parameters
vtkCellTypeVTK cell-type ID.
Returns
Topological dimension (0, 1, 2, or 3); -1 on error.

Definition at line 355 of file pacman_fortran.f90.

References pacman_vtk_cell_dim_c().

◆ pacman_vtk_to_pacman_cell_type()

subroutine, public pacman_mod::pacman_vtk_to_pacman_cell_type ( integer(c_int), dimension(:), intent(in), target, contiguous  vtktypes,
integer(c_int), dimension(:), intent(out), target, contiguous  pacmantypes,
integer(c_int), intent(out), optional  ierr 
)

Convert VTK cell-type IDs to PACMAN CellType codes.

Parameters
vtkTypesInput VTK cell-type IDs, shape (n).
pacmanTypesOutput PACMAN cell-type codes, shape (n).
ierrOptional error code: 0 = success.

Definition at line 341 of file pacman_fortran.f90.

References pacman_vtk_to_pacman_cell_type_c().

Variable Documentation

◆ pacman_cuda

integer(c_int), parameter, public pacman_mod::pacman_cuda = 3

Definition at line 50 of file pacman_fortran.f90.

◆ pacman_fe_interp_clamp

integer(c_int), parameter, public pacman_mod::pacman_fe_interp_clamp = 241

Definition at line 69 of file pacman_fortran.f90.

◆ pacman_fe_interp_extrap

integer(c_int), parameter, public pacman_mod::pacman_fe_interp_extrap = 244

Definition at line 72 of file pacman_fortran.f90.

◆ pacman_fe_interp_nearest

integer(c_int), parameter, public pacman_mod::pacman_fe_interp_nearest = 242

Definition at line 70 of file pacman_fortran.f90.

◆ pacman_fe_interp_zerofill

integer(c_int), parameter, public pacman_mod::pacman_fe_interp_zerofill = 243

Definition at line 71 of file pacman_fortran.f90.

◆ pacman_fe_nearest_nearest

integer(c_int), parameter, public pacman_mod::pacman_fe_nearest_nearest = 240

Definition at line 68 of file pacman_fortran.f90.

◆ pacman_hip

integer(c_int), parameter, public pacman_mod::pacman_hip = 4

Definition at line 51 of file pacman_fortran.f90.

◆ pacman_mls

integer(c_int), parameter, public pacman_mod::pacman_mls = 246

Definition at line 77 of file pacman_fortran.f90.

◆ pacman_openmp

integer(c_int), parameter, public pacman_mod::pacman_openmp = 1

Definition at line 48 of file pacman_fortran.f90.

◆ pacman_serial

integer(c_int), parameter, public pacman_mod::pacman_serial = 0

Definition at line 47 of file pacman_fortran.f90.

◆ pacman_sycl

integer(c_int), parameter, public pacman_mod::pacman_sycl = 5

Definition at line 52 of file pacman_fortran.f90.

◆ pacman_threads

integer(c_int), parameter, public pacman_mod::pacman_threads = 2

Definition at line 49 of file pacman_fortran.f90.

◆ pacman_wendlandc0

integer(c_int), parameter, public pacman_mod::pacman_wendlandc0 = 16

Definition at line 58 of file pacman_fortran.f90.

◆ pacman_wendlandc2

integer(c_int), parameter, public pacman_mod::pacman_wendlandc2 = 17

Definition at line 59 of file pacman_fortran.f90.

◆ pacman_wendlandc4

integer(c_int), parameter, public pacman_mod::pacman_wendlandc4 = 18

Definition at line 60 of file pacman_fortran.f90.

◆ pacman_wendlandc6

integer(c_int), parameter, public pacman_mod::pacman_wendlandc6 = 19

Definition at line 61 of file pacman_fortran.f90.

◆ pacman_wendlandc8

integer(c_int), parameter, public pacman_mod::pacman_wendlandc8 = 20

Definition at line 62 of file pacman_fortran.f90.