ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
cubic_polynomials.f90
Go to the documentation of this file.
1 subroutine cubic_polynomials(i, j, r0, s0, r, s, h, hr, hs, &
2  hrs, hrr, hss)
3 
4 !------------------------------------------------------------------
5 ! subroutine to calculate the value of the cubic polynomials and
6 ! the derivatives of the corner marked by r0,s0 at the position r,s
7 !------------------------------------------------------------------
8 
9  use itm_types
10 
11  implicit none
12 
13  integer(itm_i4), intent(in) :: i, j
14  real(r8), intent(in) :: r0, s0, r, s
15 
16  real(r8), intent(out) :: h, hr, hs, hrs, hrr, hss
17 
18  real(r8) :: hi, hri, hrri
19  real(r8) :: hj, hsj, hssj
20 
21  if (i == 0) then
22  hi = -(r + r0)**2 * (r * r0 - 2._r8) / 4._r8
23  hri = -(r + r0) * (r * r0 - 2._r8) / 2._r8 - r0 * (r + r0)**2 &
24  / 4._r8
25  hrri = -1.5_r8 * r * r0
26  else
27  hi = r0 * (r + r0)**2 * (r * r0 - 1._r8) / 4._r8
28  hri = r0 * (r + r0) * (r * r0 - 1._r8) / 2._r8 + (r + r0)**2 &
29  / 4._r8
30  hrri = 1.5_r8 * r + 0.5_r8 * r0
31  end if
32  if (j == 0) then
33  hj = -(s + s0)**2 * (s * s0 - 2._r8) / 4._r8
34  hsj = -(s + s0) * (s * s0 - 2._r8) / 2._r8 - s0 * (s + s0)**2 &
35  / 4._r8
36  hssj = -1.5_r8 * s * s0
37  else
38  hj = s0 * (s + s0)**2 * (s * s0 - 1._r8) / 4._r8
39  hsj = s0 * (s + s0) * (s * s0 - 1._r8) / 2._r8 + (s + s0)**2 &
40  / 4._r8
41  hssj = 1.5_r8 * s + 0.5_r8 * s0
42  end if
43 
44  h = hi * hj
45  hr = hri * hj
46  hs = hi * hsj
47  hrs = hri * hsj
48  hrr = hrri * hj
49  hss = hi * hssj
50 
51  return
52 end subroutine cubic_polynomials
subroutine cubic_polynomials(i, j, r0, s0, r, s, h, hr, hs, hrs, hrr, hss)