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

📄 blend.f90

📁 FORTRAN程序 共有8个插值程序 希望能帮到大家
💻 F90
📖 第 1 页 / 共 5 页
字号:
!    will only be called for "sides", that is, for values (R,S) where 
!    at least one of R and S is either 0.0E+00 or 1.0.  BOUND_RS has the 
!    form:
!
!    subroutine bound_rs ( r, s, i, xi )
!
  implicit none
!
  integer n
!
  integer i
  real r
  real s
  real x(n)
  real x00
  real x01
  real x10
  real x11
  real xr0
  real xr1
  real x0s
  real x1s
!
  external bound_rs
!
  do i = 1, n
!
!  Get the I-th coordinate component at the four corners.
!
    call bound_rs ( 0.0E+00, 0.0E+00, i, x00 )
    call bound_rs ( 0.0E+00, 1.0E+00, i, x01 )
    call bound_rs ( 1.0E+00, 0.0E+00, i, x10 )
    call bound_rs ( 1.0E+00, 1.0E+00, i, x11 )
!
!  Get the I-th coordinate component at the sides.
!
    call bound_rs ( r, 0.0E+00, i, xr0 )
    call bound_rs ( r, 1.0E+00, i, xr1 )
    call bound_rs ( 0.0E+00, s, i, x0s )
    call bound_rs ( 1.0E+00, s, i, x1s )
!
!  Interpolate the I-th coordinate component of the interior point.
!
    call blend_112 ( r, s, x00, x01, x10, x11, xr0, xr1, x0s, x1s, x(i) )

  end do

  return
end
subroutine blend_rst_0dn ( r, s, t, x, n, bound_rst )
!
!*******************************************************************************
!
!! BLEND_RST_0DN extends vector data at corners into a cube.
!
!
!  Diagram:
!
!    010-----r10-----110        011-----r11-----111
!      |       .       |          |       .       |  
!      |       .       |          |       .       |
!    0s0.....rs0.....1s0        0s1.....rs1.....1s1     S
!      |       .       |          |       .       |     |
!      |       .       |          |       .       |     |
!    000-----r00-----100        001-----r01-----101     +----R
!           BOTTOM                      TOP
!
!    011-----0s1-----001        111-----1s1-----101
!      |       .       |          |       .       |  
!      |       .       |          |       .       |
!    01t.....0st.....00t        11t.....1st.....10t          T
!      |       .       |          |       .       |          |
!      |       .       |          |       .       |          |
!    010-----0s0-----000        110-----1s0-----100     S----+
!           LEFT                       RIGHT
!
!    001-----r01-----101        011-----r11-----111
!      |       .       |          |       .       |  
!      |       .       |          |       .       |
!    00t.....r0t.....100        01t.....r1t.....11t     T
!      |       .       |          |       .       |     |
!      |       .       |          |       .       |     |
!    000-----r00-----100        010-----r10-----110     +----R
!           FRONT                       BACK
!
!  Note:
!
!    BLEND_RST_0DN is equivalent to a trilinear finite element method.
!    Data along the edges, faces, and interior of the cube is 
!    interpolated from the data at the corners.
!
!  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, S, T, the (R,S,T) coordinates of the point to be 
!    evaluated.
!
!    Output, real X(N), the interpolated value at the point (R,S,T).
!
!    Input, integer N, the dimension of the vector space.
!
!    External, BOUND_RST, is a subroutine which is given (R,S,T) 
!    coordinates and an component value I, and returns XI, the value 
!    of the I-th component of the N-vector at that point.  BOUND_RST 
!    will only be called for "corners", that is, for values (R,S,T) 
!    where R, S and T are either 0.0E+00 or 1.0.  BOUND_RST has the form:
!
!    subroutine bound_rst ( r, s, t, i, xi )
!
  implicit none
!
  integer n
!
  integer i
  real r
  real s
  real t
  real x(n)
  real x000
  real x001
  real x010
  real x011
  real x100
  real x101
  real x110
  real x111
  real xr00
  real xr01
  real xr10
  real xr11
  real x0s0
  real x0s1
  real x1s0
  real x1s1
  real x00t
  real x01t
  real x10t
  real x11t
  real x0st
  real x1st
  real xr0t
  real xr1t
  real xrs0
  real xrs1
!
  external bound_rst
!
  do i = 1, n
!
!  Get the I-th coordinate component at the corners.
!
    call bound_rst ( 0.0E+00, 0.0E+00, 0.0E+00, i, x000 )
    call bound_rst ( 0.0E+00, 0.0E+00, 1.0E+00, i, x001 )
    call bound_rst ( 0.0E+00, 1.0E+00, 0.0E+00, i, x010 )
    call bound_rst ( 0.0E+00, 1.0E+00, 1.0E+00, i, x011 )
    call bound_rst ( 1.0E+00, 0.0E+00, 0.0E+00, i, x100 )
    call bound_rst ( 1.0E+00, 0.0E+00, 1.0E+00, i, x101 )
    call bound_rst ( 1.0E+00, 1.0E+00, 0.0E+00, i, x110 )
    call bound_rst ( 1.0E+00, 1.0E+00, 1.0E+00, i, x111 )
!
!  Interpolate the I-th coordinate component at the edges.
!
    call blend_101 ( r, x000, x100, xr00 )
    call blend_101 ( r, x001, x101, xr01 )
    call blend_101 ( r, x010, x110, xr10 )
    call blend_101 ( r, x011, x111, xr11 )

    call blend_101 ( s, x000, x010, x0s0 )
    call blend_101 ( s, x001, x011, x0s1 )
    call blend_101 ( s, x100, x110, x1s0 )
    call blend_101 ( s, x101, x111, x1s1 )

    call blend_101 ( t, x000, x001, x00t )
    call blend_101 ( t, x010, x011, x01t )
    call blend_101 ( t, x100, x101, x10t )
    call blend_101 ( t, x110, x111, x11t )
!
!  Interpolate the I-th component on the faces.
!
    call blend_112 ( s, t, x000, x001, x010, x011, x0s0, x0s1, x00t, x01t, x0st )

    call blend_112 ( s, t, x100, x101, x110, x111, x1s0, x1s1, x10t, x11t, x1st )

    call blend_112 ( r, t, x000, x001, x100, x101, xr00, xr01, x00t, x10t, xr0t )

    call blend_112 ( r, t, x010, x011, x110, x111, xr10, xr11, x01t, x11t, xr1t )

    call blend_112 ( r, s, x000, x010, x100, x110, xr00, xr10, x0s0, x1s0, xrs0 )

    call blend_112 ( r, s, x001, x011, x101, x111, xr01, xr11, x0s1, x1s1, xrs1 )
!
!  Interpolate the I-th coordinate component of the interior point.
!
    call blend_123 ( r, s, t, x000, x001, x010, x011, x100, x101, x110, x111, &
      xr00, xr01, xr10, xr11, x0s0, x0s1, x1s0, x1s1, x00t, x01t, x10t, x11t, &
      x0st, x1st, xr0t, xr1t, xrs0, xrs1, x(i) )

  end do

  return
end
subroutine blend_rst_1dn ( r, s, t, x, n, bound_rst )
!
!*******************************************************************************
!
!! BLEND_RST_1DN extends vector data on edges into a cube.
!
!
!  Diagram:
!
!    010-----r10-----110        011-----r11-----111
!      |       .       |          |       .       |  
!      |       .       |          |       .       |
!    0s0.....rs0.....1s0        0s1.....rs1.....1s1     S
!      |       .       |          |       .       |     |
!      |       .       |          |       .       |     |
!    000-----r00-----100        001-----r01-----101     +----R
!           BOTTOM                      TOP
!
!    011-----0s1-----001        111-----1s1-----101
!      |       .       |          |       .       |  
!      |       .       |          |       .       |
!    01t.....0st.....00t        11t.....1st.....10t          T
!      |       .       |          |       .       |          |
!      |       .       |          |       .       |          |
!    010-----0s0-----000        110-----1s0-----100     S----+
!           LEFT                       RIGHT
!
!    001-----r01-----101        011-----r11-----111
!      |       .       |          |       .       |  
!      |       .       |          |       .       |
!    00t.....r0t.....100        01t.....r1t.....11t     T
!      |       .       |          |       .       |     |
!      |       .       |          |       .       |     |
!    000-----r00-----100        010-----r10-----110     +----R
!           FRONT                       BACK
!
!  Note:
!
!    BLEND_RST_1D is NOT equivalent to a trilinear finite element method,
!    since the data is sampled everywhere along the corners and edges,
!    rather than at a finite number of nodes.
!
!  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:
!
!    15 December 1998
!
!  Author:
!
!    John Burkardt
!
!  Parameters:
!
!    Input, real R, S, T, the (R,S,T) coordinates of the point to be 
!    evaluated.
!
!    Output, real X(N), the interpolated value at the point (R,S,T).
!
!    Input, integer N, the dimension of the vector space.
!
!    External, BOUND_RST, is a subroutine which is given (R,S,T) 
!    coordinates and an component value I, and returns XI, the value 
!    of the I-th component of the N-vector at that point.  BOUND_RST 
!    will only be called for "edges", that is, for values (R,S,T) 
!    where at least two of R, S and T are either 0.0E+00 or 1.0.  
!    BOUND_RST has the form:
!
!    subroutine bound_rst ( r, s, t, i, xi )
!
  implicit none
!
  integer n
!
  integer i
  real r
  real s
  real t
  real x(n)
  real x000
  real x001
  real x010
  real x011
  real x100
  real x101
  real x110
  real x111
  real xr00
  real xr01
  real xr10
  real xr11
  real x0s0
  real x0s1
  real x1s0
  real x1s1
  real x00t
  real x01t
  real x10t
  real x11t
  real x0st
  real x1st
  real xr0t
  real xr1t
  real xrs0
  real xrs1
!
  external bound_rst
!
  do i = 1, n
!
!  Get the I-th coordinate component at the corners.
!
    call bound_rst ( 0.0E+00, 0.0E+00, 0.0E+00, i, x000 )
    call bound_rst ( 0.0E+00, 0.0E+00, 1.0E+00, i, x001 )
    call bound_rst ( 0.0E+00, 1.0E+00, 0.0E+00, i, x010 )
    call bound_rst ( 0.0E+00, 1.0E+00, 1.0E+00, i, x011 )
    call bound_rst ( 1.0E+00, 0.0E+00, 0.0E+00, i, x100 )
    call bound_rst ( 1.0E+00, 0.0E+00, 1.0E+00, i, x101 )
    call bound_rst ( 1.0E+00, 1.0E+00, 0.0E+00, i, x110 )
    call bound_rst ( 1.0E+00, 1.0E+00, 1.0E+00, i, x111 )
!
!  Get the I-th coordinate component at the edges.
!
    call bound_rst ( r, 0.0E+00, 0.0E+00, i, xr00 )
    call bound_rst ( r, 0.0E+00, 1.0E+00, i, xr01 )
    call bound_rst ( r, 1.0E+00, 0.0E+00, i, xr10 )
    call bound_rst ( r, 1.0E+00, 1.0E+00, i, xr11 )

    call bound_rst ( 0.0E+00, s, 0.0E+00, i, x0s0 )
    call bound_rst ( 0.0E+00, s, 1.0E+00, i, x0s1 )
    call bound_rst ( 1.0E+00, s, 0.0E+00, i, x1s0 )
    call bound_rst ( 1.0E+00, s, 1.0E+00, i, x1s1 )

    call bound_rst ( 0.0E+00, 0.0E+00, t, i, x00t )
    call bound_rst ( 0.0E+00, 1.0E+00, t, i, x01t )
    call bound_rst ( 1.0E+00, 0.0E+00, t, i, x10t )
    call bound_rst ( 1.0E+00, 1.0E+00, t, i, x11t )
!
!  Interpolate the I-th component on the faces.
!
    call blend_112 ( s, t, x000, x001, x010, x011, x0s0, x0s1, x00t, x01t, x0st )

    call blend_112 ( s, t, x100, x101, x110, x111, x1s0, x1s1, x10t, x11t, x1st )

    call blend_112 ( r, t, x000, x001, x100, x101, xr00, xr01, x00t, x10t, xr0t )

    call blend_112 ( r, t, x010, x011, x110, x111, xr10, xr11, x01t, x11t, xr1t )

    call blend_112 ( r, s, x000, x010, x100, x110, xr00, xr10, x0s0, x1s0, xrs0 )

    call blend_112 ( r, s, x001, x011, x101, x111, xr01, xr11, x0s1, x1s1, xrs1 )
!
!  Interpolate the I-th coordinate component of the interior point.
!
    call blend_123 ( r, s, t, x000, x001, x010, x011, x100, x101, x110, x111, &
      xr00, xr01, xr10, xr11, x0s0, x0s1, x1s0, x1s1, x00t, x01t, x10t, x11t, &
      x0st, x1st, xr0t, xr1t, xrs0, xrs1, x(i) )

  end do

  return
end
subroutine blend_rst_2dn ( r, s, t, x, n, bound_rst )
!
!*******************************************************************************
!
!! BLEND_RST_2DN extends vector data on faces into a cube.
!
!
!  Diagram:
!
!    010-----r10-----110        011-----r11-----111
!      |       .       |          |       .       |  
!      |       .       |          |       .       |
!    0s0.....rs0.....1s0        0s1.....rs1.....1s1     S
!      |       .       |          |       .       |     |
!      |       .       |          |       .       |     |
!    000-----r00-----100        001-----r01-----101     +----R
!           BOTTOM                      TOP
!
!    011-----0s1-----001        111-----1s1-----101
!      |       .       |          |       .       |  
!      |       .       |          |       .       |
!    01t.....0st.....00t        11t.....1st.....10t          T
!      |       .       |          |       .       |          |
!      |       .       |          |       .       |          |
!    010-----0s0-----000        110-----1s0-----100     S----+
!           LEFT                       RIGHT
!
!    001-----r01-----101        011-----r11-----111
!      |       .       |          |       .       |  
!      |       .       |          |       .       |
!    00t.....r0t.....100        01t.....r1t.....11t     T
! 

⌨️ 快捷键说明

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