⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blend.f90

📁 FORTRAN程序 共有8个插值程序 希望能帮到大家
💻 F90
📖 第 1 页 / 共 5 页
字号:
subroutine blend_101 ( r, x0, x1, x )
!
!*******************************************************************************
!
!! BLEND_101 extends scalar endpoint data to a line.
!
!
!  Diagram:
!
!    0-----r-----1
!
!  Reference:
!
!    William Gordon,
!    Blending-Function Methods of Bivariate and Multivariate Interpolation
!      and Approximation,
!    SIAM Journal on Numerical Analysis,
!    Volume 8, Number 1, March 1971, pages 158-177.
!
!    William Gordon and Charles Hall,
!    Transfinite Element Methods: Blending-Function Interpolation over
!      Arbitrary Curved Element Domains,
!    Numerische Mathematik,
!    Volume 21, Number 1, 1973, pages 109-129.
!
!    William Gordon and Charles Hall,
!    Construction of Curvilinear Coordinate Systems and Application to
!      Mesh Generation,
!    International Journal of Numerical Methods in Engineering,
!    Volume 7, 1973, pages 461-477.
!
!    Joe Thompson, Bharat Soni, Nigel Weatherill,
!    Handbook of Grid Generation,
!    CRC Press, 1999.
!
!  Modified:
!
!    14 December 1998
!
!  Author:
!
!    John Burkardt
!
!  Parameters:
!
!    Input, real R, the coordinate where an interpolated value is desired.  
!
!    Input, real X0, X1, the data values at the ends of the line.
!
!    Output, real X, the interpolated data value at (R).
!
  implicit none
!
  real r
  real x
  real x0
  real x1
!
  x = ( 1.0E+00 - r ) * x0 + r * x1

  return
end
subroutine blend_102 ( r, s, x00, x01, x10, x11, x )
!
!*******************************************************************************
!
!! BLEND_102 extends scalar point data into a square.
!
!
!  Diagram:
!
!    01------------11
!     |      .      |
!     |      .      |
!     |.....rs......|
!     |      .      |
!     |      .      |
!    00------------10
!
!  Formula:
!
!    Written in terms of R and S, the map has the form:
!
!      X(R,S) =
!               1     * ( + x00 )
!             + r     * ( - x00 + x10 )
!             + s     * ( - x00       + x01 )
!             + r * s * ( + x00 - x10 - x01 + x11 )
!
!    Written in terms of the coefficients, the map has the form:
!
!      X(R,S) = x00 * ( 1 - r - s + r * s )
!             + x01 * (         s - r * s )
!             + x10 * (     r     - r * s )
!             + x11 * (             r * s )
!
!             = x00 * ( 1 - r ) * ( 1 - s )
!             + x01 * ( 1 - r ) *       s
!             + x10 *       r   * ( 1 - s )
!             + x11 *       r           s
!
!    The nonlinear term ( r * s ) has an important role:
!
!      If ( x01 + x10 - x00 - x11 ) is zero, then the input data lies in
!      a plane, and the mapping is affine.  All the interpolated data 
!      will lie on the plane defined by the four corner values.  In 
!      particular, on any line through the square, data values at 
!      intermediate points will lie between the values at the endpoints.  
!
!      If ( x01 + x10 - x00 - x11 ) is not zero, then the input data does
!      not lie in a plane, and the interpolation map is nonlinear.  On
!      any line through the square, data values at intermediate points
!      may lie above or below the data values at the endpoints.  The
!      size of the coefficient of r * s will determine how severe this
!      effect is.
!
!  Reference:
!
!    William Gordon,
!    Blending-Function Methods of Bivariate and Multivariate Interpolation
!      and Approximation,
!    SIAM Journal on Numerical Analysis,
!    Volume 8, Number 1, March 1971, pages 158-177.
!
!    William Gordon and Charles Hall,
!    Transfinite Element Methods: Blending-Function Interpolation over
!      Arbitrary Curved Element Domains,
!    Numerische Mathematik,
!    Volume 21, Number 1, 1973, pages 109-129.
!
!    William Gordon and Charles Hall,
!    Construction of Curvilinear Coordinate Systems and Application to
!      Mesh Generation,
!    International Journal of Numerical Methods in Engineering,
!    Volume 7, 1973, pages 461-477.
!
!    Joe Thompson, Bharat Soni, Nigel Weatherill,
!    Handbook of Grid Generation,
!    CRC Press, 1999.
!
!  Modified:
!
!    11 October 2001
!
!  Author:
!
!    John Burkardt
!
!  Parameters:
!
!    Input, real R, S, the coordinates where an interpolated value is 
!    desired.  
!
!    Input, real X00, X01, X10, X11, the data values at the corners.
!
!    Output, real X, the interpolated data value at (R,S).
!
  implicit none
!
  real r
  real s
  real x
  real x00
  real x01
  real x10
  real x11
!
  x =             + x00 &
      + r *     ( - x00 + x10 ) & 
      + s *     ( - x00       + x01 ) &
      + r * s * ( + x00 - x10 - x01 + x11 )

  return
end
subroutine blend_103 ( r, s, t, x000, x001, x010, x011, x100, x101, x110, &
  x111, x )
!
!*******************************************************************************
!
!! BLEND_103 extends scalar point data into a cube.
!
!
!  Diagram:
!
!    011--------------111 
!      |               |
!      |               | 
!      |               |
!      |               |
!      |               |
!    001--------------101
!
!
!      *---------------*
!      |               |
!      |               |
!      |      rst      |
!      |               |
!      |               |
!      *---------------*
!
!
!    010--------------110
!      |               |
!      |               |
!      |               |
!      |               | 
!      |               |
!    000--------------100 
!
!
!  Formula:
!
!    Written as a polynomial in R, S and T, the interpolation map has the 
!    form:
!
!      X(R,S,T) =
!        1         * ( + x000 )
!      + r         * ( - x000 + x100 )
!      +     s     * ( - x000        + x010 )
!      +         t * ( - x000               + x001 )
!      + r * s     * ( + x000 - x100 - x010                       + x110 )
!      + r     * t * ( + x000 - x100        - x001        + x101 )
!      +     s * t * ( + x000        - x010 - x001 + x011 )
!      + r * s * t * ( - x000 + x100 + x010 + x001 - x011 - x101 - x110 + x111 )
!
!  Reference:
!
!    William Gordon,
!    Blending-Function Methods of Bivariate and Multivariate Interpolation
!      and Approximation,
!    SIAM Journal on Numerical Analysis,
!    Volume 8, Number 1, March 1971, pages 158-177.
!
!    William Gordon and Charles Hall,
!    Transfinite Element Methods: Blending-Function Interpolation over
!      Arbitrary Curved Element Domains,
!    Numerische Mathematik,
!    Volume 21, Number 1, 1973, pages 109-129.
!
!    William Gordon and Charles Hall,
!    Construction of Curvilinear Coordinate Systems and Application to
!      Mesh Generation,
!    International Journal of Numerical Methods in Engineering,
!    Volume 7, 1973, pages 461-477.
!
!    Joe Thompson, Bharat Soni, Nigel Weatherill,
!    Handbook of Grid Generation,
!    CRC Press, 1999.
!
!  Modified:
!
!    11 October 2001
!
!  Author:
!
!    John Burkardt
!
!  Parameters:
!
!    Input, real R, S, T, the coordinates where an interpolated value
!    is desired.
!
!    Input, real X000, X001, X010, X011, X100, X101, X110, X111, the
!    data values at the corners.
!
!    Output, real X, the interpolated data value at (R,S,T).
!
  implicit none
!
  real r
  real s
  real t
  real x
  real x000
  real x001
  real x010
  real x011
  real x100
  real x101
  real x110
  real x111
!
!  Interpolate the interior point.
!
  x = &
    1.0E+00     * ( + x000 ) &
    + r         * ( - x000 + x100 ) &
    +     s     * ( - x000        + x010 ) &
    +         t * ( - x000               + x001 ) &
    + r * s     * ( + x000 - x100 - x010                      + x110 ) &
    + r     * t * ( + x000 - x100        - x001        + x101 ) &
    +     s * t * ( + x000        - x010 - x001 + x011 ) &
    + r * s * t * ( - x000 + x100 + x010 + x001 - x011 - x101 - x110 + x111 )
 
  return
end
subroutine blend_112 ( r, s, x00, x01, x10, x11, xr0, xr1, x0s, x1s, x )
!
!*******************************************************************************
!
!! BLEND_112 extends scalar line data into a square.
!
!
!  Diagram:
!
!    01-----r1-----11
!     |      .      |
!     |      .      |
!    0s.....rs.....1s
!     |      .      |
!     |      .      |
!    00-----r0-----10
!
!  Formula:
!
!    Written in terms of R and S, the interpolation map has the form:
!
!      X(R,S) =
!               1     * ( - x00       + x0s                   + xr0 )
!             + r     * (   x00       - x0s - x10       + x1s )
!             + s     * (   x00 - x01                         - xr0 + xr1 )
!             + r * s * ( - x00 + x01       + x10 - x11 )
!
!    Written in terms of the data, the map has the form:
!
!      X(R,S) =
!             - ( 1 - r ) * ( 1 - s ) * x00
!             + ( 1 - r )             * x0s
!             - ( 1 - r ) *       s   * x01
!             +             ( 1 - s ) * xr0
!             +                   s   * xr1
!             -       r   * ( 1 - s ) * x10
!             +       r               * x1s
!             -       r   *       s   * x11
!
!  Reference:
!
!    William Gordon,
!    Blending-Function Methods of Bivariate and Multivariate Interpolation
!      and Approximation,
!    SIAM Journal on Numerical Analysis,
!    Volume 8, Number 1, March 1971, pages 158-177.
!
!    William Gordon and Charles Hall,
!    Transfinite Element Methods: Blending-Function Interpolation over
!      Arbitrary Curved Element Domains,
!    Numerische Mathematik,
!    Volume 21, Number 1, 1973, pages 109-129.
!
!    William Gordon and Charles Hall,
!    Construction of Curvilinear Coordinate Systems and Application to
!      Mesh Generation,
!    International Journal of Numerical Methods in Engineering,
!    Volume 7, 1973, pages 461-477.
!
!    Joe Thompson, Bharat Soni, Nigel Weatherill,
!    Handbook of Grid Generation,
!    CRC Press, 1999.
!
!  Modified:
!
!    16 December 1998
!
!  Author:
!
!    John Burkardt
!
!  Parameters:
!
!    Input, real R, S, the coordinates where an interpolated value is 
!    desired.  
!
!    Input, real X00, X01, X10, X11, the data values at the corners.
!
!    Input, real XR0, XR1, X0S, X1S, the data values at points along 
!    the edges corresponding to (R,0), (R,1), (0,S) and (1,S).
!
!    Output, real X, the interpolated data value at (R,S).
!
  implicit none
!
  real r
  real s
  real x
  real x00
  real x01
  real x10
  real x11
  real xr0
  real xr1
  real x0s
  real x1s
!
  x = - ( 1.0E+00 - r ) * ( 1.0E+00 - s ) * x00 &
      + ( 1.0E+00 - r )                   * x0s &
      - ( 1.0E+00 - r ) *             s   * x01 &
      +                   ( 1.0E+00 - s ) * xr0 &
      +                               s   * xr1 &
      -             r   * ( 1.0E+00 - s ) * x10 &
      +             r                     * x1s &
      -             r   *             s   * x11

  return
end
subroutine blend_113 ( r, s, t, x000, x001, x010, x011, x100, x101, x110, &
  x111, xr00, xr01, xr10, xr11, x0s0, x0s1, x1s0, x1s1, x00t, x01t, x10t, &
  x11t, x )
!
!*******************************************************************************
!
!! BLEND_113 extends scalar line data into a cube.
!
!
!  Diagram:
!
!     011-----r11-----111 
!      |               |
!      |               | 
!     0s1             1s1
!      |               |
!      |               |
!     001-----r01-----101
!
!
!     01t-------------11t
!      |               |
!      |               |
!      |      rst      |
!      |               |
!      |               |
!     00t-------------10t
!
!
!     010-----r10-----110
!      |               |
!      |               |
!     0s0             1s0
!      |               | 
!      |               |
!     000-----r00-----100 
!
!  Reference:
!
!    William Gordon,
!    Blending-Function Methods of Bivariate and Multivariate Interpolation
!      and Approximation,
!    SIAM Journal on Numerical Analysis,
!    Volume 8, Number 1, March 1971, pages 158-177.
!
!    William Gordon and Charles Hall,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -