pystella/multigrid/transfer.py
def CubicInterpolation(StencilKernel=Stencil, **kwargs):
    """
    Creates an cubic interpolation kernel, which interpolates in input array
    :math:`f^{(h)}` on the fine grid into an array :math:`f^{(2 h)}` on the
    coarse grid via

    .. math::

        f^{(h)}_{2 i}
        &= f^{(2 h)}_{i}

        f^{(h)}_{2 i + 1}
        &= - \\frac{1}{16} f^{(2 h)}_{i - 1}
            + \\frac{9}{16} f^{(2 h)}_{i}
            + \\frac{9}{16} f^{(2 h)}_{i + 1}
            - \\frac{1}{16} f^{(2 h)}_{i + 2}

    in each dimension.

    See :class:`transfer.InterpolationBase`.
    """

    if kwargs.get("halo_shape", 0) < 2:
        raise ValueError("CubicInterpolation requires padding >= 2")

    from pymbolic.primitives import Quotient
    odd_coefs = {-3: Quotient(-1, 16), -1: Quotient(9, 16),
                 1: Quotient(9, 16), 3: Quotient(-1, 16)}
    even_coefs = {0: 1}

    return InterpolationBase(even_coefs, odd_coefs, StencilKernel, **kwargs)

    Creates an cubic interpolation kernel, which interpolates in input array
    :math:`f^{(h)}` on the fine grid into an array :math:`f^{(2 h)}` on the
    coarse grid via

    .. math::

        f^{(h)}_{2 i}
        &= f^{(2 h)}_{i}

        f^{(h)}_{2 i + 1}
        &= - \\frac{1}{16} f^{(2 h)}_{i - 1}
            + \\frac{9}{16} f^{(2 h)}_{i}
            + \\frac{9}{16} f^{(2 h)}_{i + 1}
            - \\frac{1}{16} f^{(2 h)}_{i + 2}

    in each dimension.

    See :class:`transfer.InterpolationBase`.
    
Creates an cubic interpolation kernel, which interpolates in input array
Creates an cubic interpolation kernel which interpolates in input array
def CubicInterpolation(StencilKernel=Stencil, **kwargs):
    if kwargs.get("halo_shape", 0) < 2:
        raise ValueError("CubicInterpolation requires padding >= 2")
    from pymbolic.primitives import Quotient
    odd_coefs = {-3: Quotient(-1, 16), -1: Quotient(9, 16),
                 1: Quotient(9, 16), 3: Quotient(-1, 16)}
    even_coefs = {0: 1}
    return InterpolationBase(even_coefs, odd_coefs, StencilKernel, **kwargs)
def CubicInterpolation ( StencilKernel = Stencil , ** kwargs ) : if kwargs . get ( "halo_shape" , 0 ) < 2 : raise ValueError ( "CubicInterpolation requires padding >= 2" ) from pymbolic . primitives import Quotient odd_coefs = { - 3 : Quotient ( - 1 , 16 ) , - 1 : Quotient ( 9 , 16 ) , 1 : Quotient ( 9 , 16 ) , 3 : Quotient ( - 1 , 16 ) } even_coefs = { 0 : 1 } return InterpolationBase ( even_coefs , odd_coefs , StencilKernel , ** kwargs )
Creates an cubic interpolation kernel, which interpolates in input array
Creates an cubic interpolation kernel which interpolates in input array
"""
    Creates an cubic interpolation kernel, which interpolates in input array
    :math:`f^{(h)}` on the fine grid into an array :math:`f^{(2 h)}` on the
    coarse grid via

    .. math::

        f^{(h)}_{2 i}
        &= f^{(2 h)}_{i}

        f^{(h)}_{2 i + 1}
        &= - \\frac{1}{16} f^{(2 h)}_{i - 1}
            + \\frac{9}{16} f^{(2 h)}_{i}
            + \\frac{9}{16} f^{(2 h)}_{i + 1}
            - \\frac{1}{16} f^{(2 h)}_{i + 2}

    in each dimension.

    See :class:`transfer.InterpolationBase`.
    """
StencilKernel
math
`f^{(h)}` on the fine grid into an array :math:`f^{(2 h)}` on the
coarse grid via







in each dimension.

See :class:`transfer.InterpolationBase`.
` f^ { ( h ) } ` on the fine grid into an array : math : ` f^ { ( 2 h ) } ` on the coarse grid via in each dimension . See : class : ` transfer . InterpolationBase ` .