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

OOP wrapper for bivariate spline fitting on a gridded polar disc. More...

Data Types

interface  fitpack_grid_polar
 Bicubic spline fitter for data on a gridded polar disc. More...
 

Functions/Subroutines

integer function polr_fit_least_squares (this, smoothing, reset_knots)
 Fit a least-squares gridded polar surface with fixed knots.
 
integer function polr_fit_interpolating (this, reset_knots)
 Fit an interpolating gridded polar surface ( \( s = 0 \)).
 
integer function polr_fit_automatic_knots (this, smoothing, keep_knots)
 Fit a smoothing gridded polar surface with automatic knot placement.
 
elemental subroutine surf_destroy (this)
 Destroy a gridded polar surface object and release all allocated memory.
 
subroutine surf_new_points (this, u, v, r, z, z0)
 Load new gridded polar data and allocate workspace.
 
type(fitpack_grid_polar) function surf_new_from_points (u, v, r, z, z0, ierr)
 Construct a gridded polar surface from data and perform a default fit.
 
integer function surf_new_fit (this, u, v, r, z, z0, smoothing)
 Load new data and perform a fresh gridded polar fit.
 
real(fp_real) function, dimension(size(v), size(u)) gridded_eval_many (this, u, v, ierr)
 Evaluate the gridded polar surface on a rectangular \( u \times v \) grid.
 
real(fp_real) function gridded_eval_one (this, u, v, ierr)
 Evaluate the gridded polar surface at a single \( (u, v) \) point.
 
subroutine set_origin_bc (this, z0, exact, differentiable)
 Configure origin boundary conditions for the gridded polar surface.
 
subroutine gridded_to_disk (this, filename)
 Write gridded polar data to a text file.
 
elemental integer(fp_size) function gridpolar_comm_size (this)
 Return the communication buffer size for the gridded polar surface.
 
pure subroutine gridpolar_comm_pack (this, buffer)
 Pack gridded polar data into a communication buffer.
 
pure subroutine gridpolar_comm_expand (this, buffer)
 Expand gridded polar data from a communication buffer.
 

Detailed Description

OOP wrapper for bivariate spline fitting on a gridded polar disc.

Provides fitpack_grid_polar, a derived type for fitting bicubic splines to data sampled on a polar grid \( (u_i, v_j) \) over a disc of constant radius \( r \). The coordinate mapping is:

\[ x = u \, r \cos v, \quad y = u \, r \sin v, \quad 0 \leq u \leq 1, \ -\pi \leq v \leq \pi \]

Continuity constraints at the origin and optional specification of the function value \( z_0 = f(0,0) \) are supported. Uses the pogrid core routine.

See also
Dierckx, Ch. 11, §11.1 (pp. 255–263); pogrid

Function/Subroutine Documentation

◆ gridded_eval_many()

real(fp_real) function, dimension(size(v),size(u)) fitpack_gridded_polar::gridded_eval_many ( class(fitpack_grid_polar), 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 gridded polar surface on a rectangular \( u \times v \) grid.

Returns f(j,i) = \( s(u_i, v_j) \) in normalized polar coordinates.

See also
bispev

◆ gridded_eval_one()

real(fp_real) function fitpack_gridded_polar::gridded_eval_one ( class(fitpack_grid_polar), intent(inout) this,
real(fp_real), intent(in) u,
real(fp_real), intent(in) v,
integer, intent(out), optional ierr )
private

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

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

◆ gridded_to_disk()

subroutine fitpack_gridded_polar::gridded_to_disk ( class(fitpack_grid_polar), intent(inout) this,
character(*), intent(in) filename )
private

Write gridded polar data to a text file.

Here is the call graph for this function:

◆ gridpolar_comm_expand()

pure subroutine fitpack_gridded_polar::gridpolar_comm_expand ( class(fitpack_grid_polar), intent(inout) this,
real(fp_comm), dimension(:), intent(in) buffer )
private

Expand gridded polar data from a communication buffer.

◆ gridpolar_comm_pack()

pure subroutine fitpack_gridded_polar::gridpolar_comm_pack ( class(fitpack_grid_polar), intent(in) this,
real(fp_comm), dimension(:), intent(out) buffer )
private

Pack gridded polar data into a communication buffer.

◆ gridpolar_comm_size()

elemental integer(fp_size) function fitpack_gridded_polar::gridpolar_comm_size ( class(fitpack_grid_polar), intent(in) this)
private

Return the communication buffer size for the gridded polar surface.

Here is the call graph for this function:

◆ polr_fit_automatic_knots()

integer function fitpack_gridded_polar::polr_fit_automatic_knots ( class(fitpack_grid_polar), intent(inout) this,
real(fp_real), intent(in), optional smoothing,
logical, intent(in), optional keep_knots )
private

Fit a smoothing gridded polar surface with automatic knot placement.

Uses the pogrid core routine. Origin continuity constraints and optional function value at the origin are configured via set_origin_BC.

See also
pogrid

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

Here is the call graph for this function:

◆ polr_fit_interpolating()

integer function fitpack_gridded_polar::polr_fit_interpolating ( class(fitpack_grid_polar), intent(inout) this,
logical, intent(in), optional reset_knots )
private

Fit an interpolating gridded polar surface ( \( s = 0 \)).

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

◆ polr_fit_least_squares()

integer function fitpack_gridded_polar::polr_fit_least_squares ( class(fitpack_grid_polar), intent(inout) this,
real(fp_real), intent(in), optional smoothing,
logical, intent(in), optional reset_knots )
private

Fit a least-squares gridded polar surface with fixed knots.

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

◆ set_origin_bc()

subroutine fitpack_gridded_polar::set_origin_bc ( class(fitpack_grid_polar), intent(inout) this,
real(fp_real), intent(in), optional z0,
logical, intent(in), optional exact,
logical, intent(in), optional differentiable )
private

Configure origin boundary conditions for the gridded polar surface.

Parameters
[in,out]thisThe grid polar surface.
[in]z0Optional function value at the origin.
[in]exactIf .true., fit the origin value exactly.
[in]differentiableIf .true., enforce \( C^1 \) continuity at the origin.

◆ surf_destroy()

elemental subroutine fitpack_gridded_polar::surf_destroy ( class(fitpack_grid_polar), intent(inout) this)
private

Destroy a gridded polar surface object and release all allocated memory.

◆ surf_new_fit()

integer function fitpack_gridded_polar::surf_new_fit ( class(fitpack_grid_polar), intent(inout) this,
real(fp_real), dimension(:), intent(in) u,
real(fp_real), dimension(:), intent(in) v,
real(fp_real), intent(in) r,
real(fp_real), dimension(size(v),size(u)), intent(in) z,
real(fp_real), intent(in), optional z0,
real(fp_real), intent(in), optional smoothing )
private

Load new data and perform a fresh gridded polar fit.

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

◆ surf_new_from_points()

type(fitpack_grid_polar) function fitpack_gridded_polar::surf_new_from_points ( real(fp_real), dimension(:), intent(in) u,
real(fp_real), dimension(:), intent(in) v,
real(fp_real), intent(in) r,
real(fp_real), dimension(size(v),size(u)), intent(in) z,
real(fp_real), intent(in), optional z0,
integer, intent(out), optional ierr )
private

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

See also
pogrid

◆ surf_new_points()

subroutine fitpack_gridded_polar::surf_new_points ( class(fitpack_grid_polar), intent(inout) this,
real(fp_real), dimension(:), intent(in) u,
real(fp_real), dimension(:), intent(in) v,
real(fp_real), intent(in) r,
real(fp_real), dimension(size(v),size(u)), intent(in) z,
real(fp_real), intent(in), optional z0 )
private

Load new gridded polar data and allocate workspace.

Parameters
[in,out]thisThe grid polar surface (destroyed and reinitialized).
[in]uRadial grid values \( u_i \in [0, 1] \).
[in]vAngular grid values \( v_j \in [-\pi, \pi] \).
[in]rConstant boundary radius.
[in]zGridded function values z(j,i).
[in]z0Optional function value at the origin.
See also
pogrid
Here is the call graph for this function: