fitpack
Modern Fortran library for curve and surface fitting with splines
Loading...
Searching...
No Matches
fitpack_parametric_surfaces Module Reference

OOP wrapper for parametric surface fitting in \( \mathbb{R}^d \). More...

Data Types

interface  fitpack_parametric_surface
 Bicubic parametric surface fitter in \( \mathbb{R}^d \). More...
 

Functions/Subroutines

type(fitpack_parametric_surface) function new_from_points (u, v, z, periodic_bc, ierr)
 Construct a parametric surface from gridded data and perform a default fit.
 
integer function new_fit (this, u, v, z, smoothing, periodic_bc)
 Load new data and perform a fresh parametric surface fit.
 
elemental subroutine destroy (this)
 Destroy a parametric surface object and release all allocated memory.
 
subroutine new_points (this, u, v, z, periodic_bc)
 Load new gridded data and allocate workspace for parametric surface fitting.
 
pure subroutine allocate_knot_storage (this, knots)
 
real(fp_real) function, dimension(this%idim) surf_eval_one (this, u, v, ierr)
 Evaluate the parametric surface at a single \( (u, v) \) point.
 
real(fp_real) function, dimension(size(v), size(u), this%idim) surf_eval_grid (this, u, v, ierr)
 Evaluate the parametric surface on a rectangular parameter grid.
 
integer function interpolating_curve (this, reset_knots)
 Fit an interpolating parametric surface ( \( s = 0 \)).
 
integer function surface_fit_least_squares (this, u_knots, v_knots, smoothing, reset_knots)
 Fit a least-squares parametric surface with current or user-supplied knots.
 
integer function surf_fit_automatic_knots (this, smoothing, periodic, keep_knots)
 Fit a smoothing parametric surface with automatic knot placement.
 
elemental integer(fp_size) function parsurf_comm_size (this)
 Return the communication buffer size for the parametric surface.
 
pure subroutine parsurf_comm_pack (this, buffer)
 Pack parametric surface data into a communication buffer.
 
pure subroutine parsurf_comm_expand (this, buffer)
 Expand parametric surface data from a communication buffer.
 

Detailed Description

OOP wrapper for parametric surface fitting in \( \mathbb{R}^d \).

Provides fitpack_parametric_surface, a derived type for fitting bicubic parametric tensor-product spline surfaces through gridded data in \( d \)-dimensional space. The surface maps parameter pairs \( (u, v) \) to points \( \mathbf{s}(u, v) = (s_1(u,v), \ldots, s_d(u,v)) \), with optional periodicity in either or both parameter directions.

See also
Dierckx, Ch. 10, §10.2 (pp. 241–254); parsur, surev

Function/Subroutine Documentation

◆ allocate_knot_storage()

pure subroutine fitpack_parametric_surfaces::allocate_knot_storage ( class(fitpack_parametric_surface), intent(inout) this,
integer, dimension(2), intent(in) knots )
private

◆ destroy()

elemental subroutine fitpack_parametric_surfaces::destroy ( class(fitpack_parametric_surface), intent(inout) this)
private

Destroy a parametric surface object and release all allocated memory.

◆ interpolating_curve()

integer function fitpack_parametric_surfaces::interpolating_curve ( class(fitpack_parametric_surface), intent(inout) this,
logical, intent(in), optional reset_knots )
private

Fit an interpolating parametric surface ( \( s = 0 \)).

See also
parsur
Here is the call graph for this function:

◆ new_fit()

integer function fitpack_parametric_surfaces::new_fit ( class(fitpack_parametric_surface), intent(inout) this,
real(fp_real), dimension(:), intent(in) u,
real(fp_real), dimension(:), intent(in) v,
real(fp_real), dimension(:,:,:), intent(in) z,
real(fp_real), intent(in), optional smoothing,
logical, dimension(2), intent(in), optional periodic_bc )
private

Load new data and perform a fresh parametric surface fit.

See also
parsur
Here is the call graph for this function:

◆ new_from_points()

type(fitpack_parametric_surface) function fitpack_parametric_surfaces::new_from_points ( real(fp_real), dimension(:), intent(in) u,
real(fp_real), dimension(:), intent(in) v,
real(fp_real), dimension(:,:,:), intent(in) z,
logical, dimension(2), intent(in), optional periodic_bc,
integer, intent(out), optional ierr )
private

Construct a parametric surface from gridded data and perform a default fit.

Parameters
[in]uParameter grid in the u direction.
[in]vParameter grid in the v direction.
[in]zData values z(j,i,l) for component l at (u(i),v(j)).
[in]periodic_BCOptional periodicity flags [u_periodic, v_periodic].
[out]ierrOptional error flag.
Returns
Fitted parametric surface object.
See also
parsur

◆ new_points()

subroutine fitpack_parametric_surfaces::new_points ( class(fitpack_parametric_surface), intent(inout) this,
real(fp_real), dimension(:), intent(in) u,
real(fp_real), dimension(:), intent(in) v,
real(fp_real), dimension(:,:,:), intent(in) z,
logical, dimension(2), intent(in), optional periodic_bc )
private

Load new gridded data and allocate workspace for parametric surface fitting.

See also
parsur
Here is the call graph for this function:

◆ parsurf_comm_expand()

pure subroutine fitpack_parametric_surfaces::parsurf_comm_expand ( class(fitpack_parametric_surface), intent(inout) this,
real(fp_comm), dimension(:), intent(in) buffer )
private

Expand parametric surface data from a communication buffer.

◆ parsurf_comm_pack()

pure subroutine fitpack_parametric_surfaces::parsurf_comm_pack ( class(fitpack_parametric_surface), intent(in) this,
real(fp_comm), dimension(:), intent(out) buffer )
private

Pack parametric surface data into a communication buffer.

◆ parsurf_comm_size()

elemental integer(fp_size) function fitpack_parametric_surfaces::parsurf_comm_size ( class(fitpack_parametric_surface), intent(in) this)
private

Return the communication buffer size for the parametric surface.

Here is the call graph for this function:

◆ surf_eval_grid()

real(fp_real) function, dimension(size(v),size(u),this%idim) fitpack_parametric_surfaces::surf_eval_grid ( class(fitpack_parametric_surface), intent(inout) this,
real(fp_real), dimension(:), intent(in) u,
real(fp_real), dimension(:), intent(in) v,
integer, intent(out), optional ierr )
private

Evaluate the parametric surface on a rectangular parameter grid.

Returns f(j,i,l) = \( s_l(u_i, v_j) \).

See also
surev

◆ surf_eval_one()

real(fp_real) function, dimension(this%idim) fitpack_parametric_surfaces::surf_eval_one ( class(fitpack_parametric_surface), intent(inout) this,
real(fp_real), intent(in) u,
real(fp_real), intent(in) v,
integer, intent(out), optional ierr )
private

Evaluate the parametric surface at a single \( (u, v) \) point.

Returns
Point \( \mathbf{s}(u, v) \in \mathbb{R}^d \).
See also
surev
Here is the call graph for this function:

◆ surf_fit_automatic_knots()

integer function fitpack_parametric_surfaces::surf_fit_automatic_knots ( class(fitpack_parametric_surface), intent(inout) this,
real(fp_real), intent(in), optional smoothing,
logical, dimension(2), intent(in), optional periodic,
logical, intent(in), optional keep_knots )
private

Fit a smoothing parametric surface with automatic knot placement.

See also
parsur

Ensure we start with new knots (unless caller wants to keep them)

◆ surface_fit_least_squares()

integer function fitpack_parametric_surfaces::surface_fit_least_squares ( class(fitpack_parametric_surface), intent(inout) this,
real(fp_real), dimension(:), intent(in), optional u_knots,
real(fp_real), dimension(:), intent(in), optional v_knots,
real(fp_real), intent(in), optional smoothing,
logical, intent(in), optional reset_knots )
private

Fit a least-squares parametric surface with current or user-supplied knots.

Optional u_knots and v_knots set interior knots directly. If omitted, the current knot vectors are used.

See also
parsur
Here is the call graph for this function: