namespace p3m_functions

Overview

Cubic interpolation functions. More…

namespace p3m_functions {

// global functions

subroutine, public p3m_interpolation(
    N N,
    h h,
    u u,
    ppoly_E ppoly_E,
    ppoly_S ppoly_S,
    ppoly_coef ppoly_coef,
    h_neglect h_neglect
    );

subroutine, public p3m_boundary_extrapolation(
    N N,
    h h,
    u u,
    ppoly_E ppoly_E,
    ppoly_S ppoly_S,
    ppoly_coef ppoly_coef,
    h_neglect h_neglect,
    h_neglect_edge h_neglect_edge
    );

} // namespace p3m_functions

Detailed Documentation

Cubic interpolation functions.

Date of creation: 2008.06.09 L. White

This module contains p3m interpolation routines.

p3m interpolation is performed by estimating the edge values and slopes and constructing a cubic polynomial. We then make sure that the edge values are bounded and continuous and we then modify the slopes to get a monotonic cubic curve.

Global Functions

subroutine, public p3m_interpolation(
    N N,
    h h,
    u u,
    ppoly_E ppoly_E,
    ppoly_S ppoly_S,
    ppoly_coef ppoly_coef,
    h_neglect h_neglect
    )

Set up a piecewise cubic interpolation from cell averages and estimated edge slopes and values.

Cubic interpolation between edges.

The edge values and slopes MUST have been estimated prior to calling this routine.

It is assumed that the size of the array ‘u’ is equal to the number of cells defining ‘grid’ and ‘ppoly’. No consistency check is performed here.

Parameters:

n

Number of cells

h

cell widths (size N)

u

cell averages (size N)

ppoly_e

Edge value of polynomial, with the same units as u.

ppoly_s

Edge slope of polynomial, in the units of u over the units of h.

ppoly_coef

Coefficients of polynomial, mainly with the same units as u.

h_neglect

A negligibly small width for the purpose of cell reconstructions in the same units as h.

subroutine, public p3m_boundary_extrapolation(
    N N,
    h h,
    u u,
    ppoly_E ppoly_E,
    ppoly_S ppoly_S,
    ppoly_coef ppoly_coef,
    h_neglect h_neglect,
    h_neglect_edge h_neglect_edge
    )

Calculate the edge values and slopes at boundary cells as part of building a piecewise cubic sub-grid scale profiles.

The following explanations apply to the left boundary cell. The same reasoning holds for the right boundary cell.

A cubic needs to be built in the cell and requires four degrees of freedom, which are the edge values and slopes. The right edge values and slopes are taken to be that of the neighboring cell (i.e., the left edge value and slope of the neighboring cell). The left edge value and slope are determined by computing the parabola based on the cell average and the right edge value and slope. The resulting cubic is not necessarily monotonic and the slopes are subsequently modified to yield a monotonic cubic.

Parameters:

n

Number of cells

h

cell widths (size N)

u

cell averages (size N)

ppoly_e

Edge value of polynomial, with the same units as u.

ppoly_s

Edge slope of polynomial, in the units of u over the units of h.

ppoly_coef

Coefficients of polynomial, mainly with the same units as u.

h_neglect

A negligibly small width for the purpose of cell reconstructions in the same units as h.

h_neglect_edge

A negligibly small width for the purpose of finding edge values in the same units as h.