153 use,
intrinsic :: iso_fortran_env, only : stderr => error_unit
165 integer,
intent(in) :: NP
166 real(kind=
rp),
intent(inout) :: z(np), w(np)
167 real(kind=
rp) alpha, beta
170 call zwgj(z, w, np, alpha, beta)
180 integer,
intent(in) :: NP
181 real(kind=
rp),
intent(inout) :: z(np), w(np)
182 real(kind=
rp) alpha, beta
185 call zwglj(z, w, np, alpha, beta)
192 subroutine zwgj(Z, W, NP, ALPHA, BETA)
193 integer,
intent(in) :: NP
194 real(kind=
rp),
intent(inout) :: z(np), w(np)
195 real(kind=
rp),
intent(in) :: alpha, beta
197 integer,
parameter :: NMAX = 84
198 integer,
parameter :: NZD = nmax
200 real(kind=
xp) zd(nzd), wd(nzd), alphad, betad
204 if (np .gt. npmax)
then
205 write (stderr, *)
'Too large polynomial degree in ZWGJ'
206 write (stderr, *)
'Maximum polynomial degree is', nmax
207 write (stderr, *)
'Here NP=', np
211 alphad =
real(alpha, kind=
xp)
212 betad =
real(beta, kind=
xp)
213 call zwgjd(zd, wd, np, alphad, betad)
215 z(i) =
real(zd(i), kind=
rp)
216 w(i) =
real(wd(i), kind=
rp)
224 subroutine zwgjd(Z, W, NP, ALPHA, BETA)
225 integer,
intent(in) :: NP
226 real(kind=
xp),
intent(inout) :: z(np), w(np)
227 real(kind=
xp),
intent(in) :: alpha, beta
229 real(kind=
xp) :: dn, apb
230 real(kind=
xp) :: fac1, fac2, fac3, fnorm
231 real(kind=
xp) :: rcoef, p, pd, pm1, pdm1, pm2, pdm2
232 real(kind=
xp) :: dnp1, dnp2
233 integer :: N, NP1, NP2, I
241 write (stderr, *)
'ZWGJD: Minimum number of Gauss points is 1', np
243 else if ((alpha .le. -1.0_xp) .or. (beta .le. -1.0_xp))
then
244 call neko_error(
'ZWGJD: Alpha and Beta must be greater than -1')
248 z(1) = (beta - alpha) / (apb + 2.0_xp)
249 w(1) =
gammaf(alpha + 1.0_xp) *
gammaf(beta + 1.0_xp) / &
250 gammaf(apb + 2.0_xp) * 2.0_xp**(apb + 1.0_xp)
254 call jacg(z, np, alpha, beta)
260 fac1 = dnp1 + alpha + beta + 1.0_xp
263 fnorm =
pnormj(np1, alpha, beta)
264 rcoef = (fnorm*fac2*fac3) / (2.0_xp*fac1*dnp2)
266 call jacobf(p, pd, pm1, pdm1, pm2, pdm2, np2, alpha, beta, z(i))
267 w(i) = -rcoef/(p*pdm1)
275 subroutine zwglj(Z, W, NP, ALPHA, BETA)
276 integer,
intent(in) :: NP
277 real(kind=
rp),
intent(inout) :: z(np), w(np)
278 real(kind=
rp),
intent(in) :: alpha, beta
280 integer,
parameter :: NMAX = 84
281 integer,
parameter :: NZD = nmax
283 real(kind=
xp) zd(nzd), wd(nzd), alphad, betad
287 if (np .gt. npmax)
then
288 write (stderr, *)
'Too large polynomial degree in ZWGLJ'
289 write (stderr, *)
'Maximum polynomial degree is', nmax
290 write (stderr, *)
'Here NP=', np
293 alphad =
real(alpha, kind=
xp)
294 betad =
real(beta, kind=
xp)
295 call zwgljd(zd, wd, np, alphad, betad)
297 z(i) =
real(zd(i), kind=
rp)
298 w(i) =
real(wd(i), kind=
rp)
309 integer,
intent(in) :: NP
310 real(kind=
xp),
intent(inout) :: z(np), w(np)
311 real(kind=
xp),
intent(in) :: alpha, beta
313 real(kind=
xp) :: alpg, betg
314 real(kind=
xp) :: p, pd, pm1, pdm1, pm2, pdm2
321 write (stderr, *)
'ZWGLJD: Minimum number of Gauss-Lobatto points is 2'
322 write (stderr, *)
'ZWGLJD: alpha, beta:', alpha, beta, np
324 else if ((alpha .le. -1.0_xp) .or. (beta .le. -1.0_xp))
then
325 call neko_error(
'ZWGLJD: Alpha and Beta must be greater than -1')
329 alpg = alpha + 1.0_xp
331 call zwgjd(z(2), w(2), nm1, alpg, betg)
337 w(i) = w(i) / (1.0_xp-z(i)**2)
339 call jacobf(p, pd, pm1, pdm1, pm2, pdm2, n, alpha, beta, z(1))
340 w(1) =
endw1(n, alpha, beta) / (2.0_xp*pd)
341 call jacobf(p, pd, pm1, pdm1, pm2, pdm2, n, alpha, beta, z(np))
342 w(np) =
endw2(n, alpha, beta) / (2.0_xp*pd)
349 real(kind=
xp),
intent(in) :: alpha, beta
350 integer,
intent(in) :: n
353 real(kind=
xp) :: f1, f2, f3, fint1, fint2
354 real(kind=
xp) :: a1, a2, a3, di, abn, abnn
364 f1 = f1*(apb + 2.0_xp)*2.0_xp**(apb + 2.0_xp)/2.0_xp
371 fint1 = fint1*2.0_xp**(apb + 2.0_xp)
373 fint2 = fint2*2.0_xp**(apb + 3.0_xp)
374 f2 = (-2.0_xp*(beta + 2.0_xp)*fint1 + (apb + 4.0_xp)*fint2) * &
375 (apb + 3.0_xp) / 4.0_xp
383 abn = alpha + beta + di
385 a1 = -(2.0_xp*(di + alpha) * (di + beta)) / (abn*abnn*(abnn + 1.0_xp))
386 a2 = (2.0_xp*(alpha - beta)) / (abnn*(abnn + 2.0_xp))
387 a3 = (2.0_xp*(abn + 1.0_xp)) / ((abnn + 2.0_xp) * (abnn + 1.0_xp))
388 f3 = -(a2*f2 + a1*f1) / a3
398 real(kind=
xp),
intent(in) :: alpha, beta
399 integer,
intent(in) :: n
402 real(kind=
xp) :: f1, f2, f3, fint1, fint2
403 real(kind=
xp) :: a1, a2, a3, di, abn, abnn
414 f1 = f1*(apb + 2.0_xp)*2.0_xp**(apb + 2.0_xp)/2.0_xp
421 fint1 = fint1*2.0_xp**(apb + 2.0_xp)
423 fint2 = fint2*2.0_xp**(apb + 3.0_xp)
424 f2 = (2.0_xp*(alpha + 2.0_xp)*fint1 - (apb + 4.0_xp)*fint2) * &
425 (apb + 3.0_xp) / 4.0_xp
433 abn = alpha + beta + di
435 a1 = -(2.0_xp*(di + alpha) * (di + beta)) / (abn*abnn*(abnn + 1.0_xp))
436 a2 = (2.0_xp*(alpha - beta)) / (abnn*(abnn + 2.0_xp))
437 a3 = (2.0_xp*(abn + 1.0_xp)) / ((abnn + 2.0_xp) * (abnn + 1.0_xp))
438 f3 = -(a2*f2 + a1*f1)/a3
447 real(kind=
xp),
intent(in) :: x
448 real(kind=
xp),
parameter ::
pi = 4.0_xp*atan(1.0_xp)
457 if (
abscmp(x, 3.5_xp))
gammaf = 0.5_xp * (2.5_xp * (1.5_xp * sqrt(
pi)))
466 real(kind=
xp),
intent(in) :: alpha, beta
467 integer,
intent(in) :: n
469 real(kind=
xp) :: dn, dindx
470 real(kind=
xp) :: const, prod, frac
474 const = alpha + beta + 1.0_xp
478 pnormj = prod * 2.0_xp**const / (2.0_xp*dn + const)
483 prod = prod/(2.0_xp*(1.0_xp + const)*
gammaf(const + 1.0_xp))
484 prod = prod*(1.0_xp + alpha) * (2.0_xp + alpha)
485 prod = prod*(1.0_xp + beta) * (2.0_xp + beta)
488 frac = (dindx + alpha) * (dindx + beta) / (dindx*(dindx + alpha + beta))
491 pnormj = prod*2.0_xp**const / (2.0_xp*dn + const)
500 subroutine jacg(XJAC, NP, ALPHA, BETA)
501 integer,
intent(in) :: NP
502 real(kind=
xp),
intent(inout) :: xjac(np)
503 real(kind=
xp),
intent(in) :: alpha, beta
505 integer,
parameter :: KSTOP = 10
506 real(kind=
rp),
parameter :: eps = 1.0e-12_rp
507 real(kind=
xp),
parameter ::
pi = 4.0_xp*atan(1.0_xp)
509 real(kind=
xp) :: dth, x, x1, x2, xlast, delx, xmin
510 real(kind=
xp) :: p, pd, pm1, pdm1, pm2, pdm2
511 real(kind=
xp) :: recsum,
swap
512 integer :: I, J, K, N, JM, JMIN
515 dth =
pi / (2.0_xp*
real(n, kind=
xp) + 2.0_xp)
518 x = cos((2.0_xp*(
real(j, kind=
xp) - 1.0_xp) + 1.0_xp)*dth)
520 x1 = cos((2.0_xp*(
real(j, kind=
xp) - 1.0_xp) + 1.0_xp)*dth)
522 x = (x1 + x2) / 2.0_xp
526 call jacobf(p, pd, pm1, pdm1, pm2, pdm2, np, alpha, beta, x)
530 recsum = recsum + 1.0_xp / (x-xjac(np - i + 1))
532 delx = -p / (pd - recsum*p)
534 if (abs(delx) .lt. eps)
exit
544 if (xjac(j) .lt. xmin)
then
549 if (jmin .ne. i)
then
559 subroutine jacobf(POLY, PDER, POLYM1, PDERM1, POLYM2, PDERM2, N, ALP, BET, X)
561 real(kind=
xp),
intent(inout) :: poly, pder, polym1, pderm1, polym2, pderm2
562 real(kind=
xp),
intent(in) :: alp, bet, x
563 integer,
intent(in) :: N
565 real(kind=
xp) :: apb, polyl, pderl, polyn, pdern
566 real(kind=
xp) :: psave, pdsave
567 real(kind=
xp) :: a1, a2, a3, a4, b3
578 poly = (alp - bet + (apb + 2.0_xp)*x) / 2.0_xp
579 pder = (apb + 2.0_xp) / 2.0_xp
584 a1 = 2.0_xp*dk*(dk + apb) * (2.0_xp*dk + apb - 2.0_xp)
585 a2 = (2.0_xp*dk + apb - 1.0_xp) * (alp**2 - bet**2)
586 b3 = (2.0_xp*dk + apb - 2.0_xp)
587 a3 = b3*(b3 + 1.0_xp) * (b3 + 2.0_xp)
588 a4 = 2.0_xp*(dk + alp - 1.0_xp) * (dk + bet - 1.0_xp) * (2.0_xp*dk + apb)
589 polyn = ((a2 + a3*x)*poly - a4*polyl) / a1
590 pdern = ((a2 + a3*x)*pder - a4*pderl + a3*poly) / a1
607 real(kind=
xp)
function hgj(II, Z, ZGJ, NP, ALPHA, BETA)
608 integer,
intent(in) :: np, ii
609 real(kind=
xp),
intent(in) :: z, zgj(np), alpha, beta
611 integer,
parameter :: nmax = 84
612 integer,
parameter :: nzd = nmax
614 real(kind=
xp) zd, zgjd(nzd)
618 if (np .gt. npmax)
then
619 write (stderr, *)
'Too large polynomial degree in HGJ'
620 write (stderr, *)
'Maximum polynomial degree is', nmax
621 write (stderr, *)
'Here NP=', np
629 hgj =
hgjd(ii, zd, zgjd, np, alpha, beta)
635 real(kind=
xp)
function hgjd(II, Z, ZGJ, NP, ALPHA, BETA)
636 integer,
intent(in) :: np, ii
637 real(kind=
xp),
intent(in) :: z, zgj(np), alpha, beta
639 real(kind=
xp) :: eps, zi, dz
640 real(kind=
xp) :: pz, pdz, pzi, pdzi, pm1, pdm1, pm2, pdm2
645 if (abs(dz) .lt. eps)
then
649 call jacobf(pzi, pdzi, pm1, pdm1, pm2, pdm2, np, alpha, beta, zi)
650 call jacobf(pz, pdz, pm1, pdm1, pm2, pdm2, np, alpha, beta, z)
651 hgjd = pz / (pdzi*(z-zi))
657 real(kind=
xp)
function hglj(II, Z, ZGLJ, NP, ALPHA, BETA)
658 integer,
intent(in) :: np, ii
659 real(kind=
xp),
intent(in) :: z, zglj(np), alpha, beta
661 integer,
parameter :: nmax = 84
662 integer,
parameter :: nzd = nmax
664 real(kind=
xp) zd, zgljd(nzd)
668 if (np .gt. npmax)
then
669 write (stderr, *)
'Too large polynomial degree in HGLJ'
670 write (stderr, *)
'Maximum polynomial degree is', nmax
671 write (stderr, *)
'Here NP=', np
678 hglj =
hgljd(ii, zd, zgljd, np, alpha, beta)
684 real(kind=
xp)
function hgljd(I, Z, ZGLJ, NP, ALPHA, BETA)
685 integer,
intent(in) :: np, i
686 real(kind=
xp),
intent(in) :: z, zglj(np), alpha, beta
688 real(kind=
xp) :: eps, zi, dz, dn
689 real(kind=
xp) :: p, pd,
pi, pdi, pm1, pdm1, pm2, pdm2
690 real(kind=
xp) :: eigval, const
696 if (abs(dz) .lt. eps)
then
703 eigval = -dn*(dn + alpha + beta + 1.0_xp)
704 call jacobf(
pi, pdi, pm1, pdm1, pm2, pdm2, n, alpha, beta, zi)
705 const = eigval*
pi + alpha*(1.0_xp + zi)*pdi - beta*(1.0_xp - zi)*pdi
706 call jacobf(p, pd, pm1, pdm1, pm2, pdm2, n, alpha, beta, z)
707 hgljd = (1.0_xp - z**2)*pd / (const*(z - zi))
715 subroutine dgj(D, DT, Z, NZ, NZD, ALPHA, BETA)
716 integer,
intent(in) :: NZ, NZD
717 real(kind=
xp),
intent(inout) :: d(nzd, nzd), dt(nzd, nzd)
718 real(kind=
xp),
intent(in) :: z(nz), alpha, beta
720 integer,
parameter :: NMAX = 84
721 integer,
parameter :: NZDD = nmax
723 real(kind=
xp) :: dd(nzdd, nzdd), dtd(nzdd, nzdd), zd(nzdd)
727 call neko_error(
'DGJ: Minimum number of Gauss points is 1')
728 else if (nz .gt. nmax)
then
729 write (stderr, *)
'Too large polynomial degree in DGJ'
730 write (stderr, *)
'Maximum polynomial degree is', nmax
731 write (stderr, *)
'Here Nz=', nz
733 else if ((alpha .le. -1.0_xp) .or. (beta .le. -1.0_xp))
then
734 call neko_error(
'DGJ: Alpha and Beta must be greater than -1')
740 call dgjd(dd, dtd, zd, nz, nzdd, alpha, beta)
754 subroutine dgjd(D, DT, Z, NZ, NZD, ALPHA, BETA)
755 integer,
intent(in) :: NZ, NZD
756 real(kind=
xp),
intent(inout) :: d(nzd, nzd), dt(nzd, nzd)
757 real(kind=
xp),
intent(in) :: z(nz), alpha, beta
760 real(kind=
xp) :: pdi, pdj,
pi, pj, pm1, pdm1, pm2, pdm2
768 call neko_error(
'DGJD: Minimum number of Gauss-Lobatto points is 2')
769 else if ((alpha .le. -1.0_xp) .or. (beta .le. -1.0_xp))
then
770 call neko_error(
'DGJD: Alpha and Beta must be greater than -1')
775 call jacobf(
pi, pdi, pm1, pdm1, pm2, pdm2, nz, alpha, beta, z(i))
776 call jacobf(pj, pdj, pm1, pdm1, pm2, pdm2, nz, alpha, beta, z(j))
778 d(i, j) = pdi / (pdj*(z(i) - z(j)))
780 d(i, j) = ((alpha + beta + 2.0_xp)*z(i) + alpha - beta) / &
781 (2.0_xp*(1.0_xp - z(i)**2))
793 subroutine dglj(D, DT, Z, NZ, NZD, ALPHA, BETA)
794 integer,
parameter :: NMAX = 84
795 integer,
parameter :: NZDD = nmax
796 integer,
intent(in) :: NZ, NZD
797 real(kind=
xp),
intent(inout) :: d(nzd, nzd), dt(nzd, nzd)
798 real(kind=
xp),
intent(in) :: z(nz), alpha, beta
800 real(kind=
xp) :: dd(nzdd, nzdd), dtd(nzdd, nzdd), zd(nzdd)
804 call neko_error(
'DGLJ: Minimum number of Gauss-Lobatto points is 2')
805 else if (nz .gt. nmax)
then
806 write (stderr, *)
'Too large polynomial degree in DGLJ'
807 write (stderr, *)
'Maximum polynomial degree is', nmax
808 write (stderr, *)
'Here NZ=', nz
810 else if ((alpha .le. -1.0_xp) .or. (beta .le. -1.0_xp))
then
811 call neko_error(
'DGLJ: Alpha and Beta must be greater than -1')
817 call dgljd(dd, dtd, zd, nz, nzdd, alpha, beta)
832 subroutine dgljd(D, DT, Z, NZ, NZD, ALPHA, BETA)
833 integer,
intent(in) :: NZ, NZD
834 real(kind=
xp),
intent(inout) :: d(nzd, nzd), dt(nzd, nzd)
835 real(kind=
xp),
intent(in) :: z(nz), alpha, beta
837 real(kind=
xp) :: dn, eigval
838 real(kind=
xp) :: pdi, pdj,
pi, pj, pm1, pdm1, pm2, pdm2
839 real(kind=
xp) :: ci, cj
845 eigval = -dn*(dn + alpha + beta + 1.0_xp)
848 call neko_error(
'DGLJD: Minimum number of Gauss-Lobatto points is 2')
849 else if ((alpha .le. -1.0_xp) .or. (beta .le. -1.0_xp))
then
850 call neko_error(
'DGLJD: Alpha and Beta must be greater than -1')
855 call jacobf(
pi, pdi, pm1, pdm1, pm2, pdm2, n, alpha, beta, z(i))
856 call jacobf(pj, pdj, pm1, pdm1, pm2, pdm2, n, alpha, beta, z(j))
857 ci = eigval*
pi - (beta*(1.0_xp - z(i)) - alpha*(1.0_xp + z(i)))*pdi
858 cj = eigval*pj - (beta*(1.0_xp - z(j)) - alpha*(1.0_xp + z(j)))*pdj
862 d(i, j) = ci / (cj*(z(i) - z(j)))
863 else if (i .eq. 1)
then
864 d(i, j) = (eigval + alpha) / (2.0_xp*(beta + 2.0_xp))
865 else if (i .eq. nz)
then
866 d(i, j) = -(eigval + beta) / (2.0_xp*(alpha + 2.0_xp))
868 d(i, j) = (alpha*(1.0_xp + z(i)) - beta*(1.0_xp - z(i))) / &
869 (2.0_xp*(1.0_xp - z(i)**2))
880 subroutine dgll(D, DT, Z, NZ, NZD)
882 integer,
intent(in) :: NZ, NZD
883 real(kind=
rp),
intent(inout) :: d(nzd, nzd), dt(nzd, nzd)
884 real(kind=
rp),
intent(in) :: z(nz)
886 integer,
parameter :: NMAX = 84
888 real(kind=
xp) :: d0, fn
892 if (nz .gt. nmax)
then
893 write (stderr, *)
'Subroutine DGLL'
894 write (stderr, *)
'Maximum polynomial degree =', nmax
895 write (stderr, *)
'Polynomial degree =', nz
897 else if (nz .eq. 1)
then
903 d0 = fn*(fn + 1.0_xp)/4.0_xp
909 else if (i .eq. 1)
then
911 else if (i .eq. nz)
then
923 real(kind=
xp)
function hgll(I, Z, ZGLL, NZ)
924 integer,
intent(in) :: i, nz
925 real(kind=
xp),
intent(in) :: zgll(nz), z
927 real(kind=
xp) :: eps, dz
928 real(kind=
xp) :: alfan
933 if (abs(dz) .lt. eps)
then
946 real(kind=
xp)
function hgl (I, Z, ZGL, NZ)
947 integer,
intent(in) :: i, nz
948 real(kind=
xp),
intent(in) :: zgl(nz), z
949 real(kind=
xp) :: eps, dz
955 if (abs(dz) .lt. eps)
then
978 real(kind=
xp),
intent(in) :: z
979 integer,
intent(in) :: n
981 real(kind=
xp) :: p1, p2, p3, fk
994 p3 = ((2.0_xp*fk + 1.0_xp)*z*p2 - fk*p1) / (fk + 1.0_xp)
1004 integer,
intent(in) :: N
1005 real(kind=
rp),
intent(inout) :: l(0:n)
1006 real(kind=
rp),
intent(in) :: x
1012 if (n .eq. 0)
return
1017 l(j + 1) = ((2.0_rp*dj + 1.0_rp)*x*l(j) - dj*l(j-1)) / (dj + 1.0_rp)
1025 real(kind=
xp),
intent(in) :: z
1026 integer,
intent(in) :: n
1028 real(kind=
xp) :: p1, p2, p3, p1d, p2d, p3d, fk
1043 p3 = ((2.0_xp*fk + 1.0_xp)*z*p2 - fk*p1) / (fk + 1.0_xp)
1044 p3d = ((2.0_xp*fk + 1.0_xp)*p2 + (2.0_xp*fk + 1.0_xp)*z*p2d - fk*p1d) / &
1061 subroutine dgllgl(D, DT, ZM1, ZM2, IM12, NZM1, NZM2, ND1, ND2)
1062 integer,
intent(in) :: NZM1, NZM2, ND1, ND2
1063 real(kind=
xp),
intent(inout) :: d(nd2, nd1), dt(nd1, nd2)
1064 real(kind=
xp),
intent(in) :: zm1(nd1), zm2(nd2), im12(nd2, nd1)
1066 real(kind=
xp) eps, zp, zq
1067 integer :: IP, JQ, NM1
1069 if (nzm1 .eq. 1)
then
1080 if ((abs(zp) .lt. eps) .and. (abs(zq) .lt. eps))
then
1083 d(ip, jq) = (
pnleg(zp, nm1) /
pnleg(zq, nm1) - im12(ip, jq)) / &
1086 dt(jq, ip) = d(ip, jq)
1099 subroutine dgljgj(D, DT, ZGL, ZG, IGLG, NPGL, NPG, ND1, ND2, ALPHA, BETA)
1100 integer,
intent(in) :: NPGL, NPG, ND1, ND2
1101 real(kind=
xp),
intent(inout) :: d(nd2, nd1), dt(nd1, nd2)
1102 real(kind=
xp),
intent(in) :: zgl(nd1), zg(nd2), iglg(nd2, nd1), alpha, beta
1104 integer,
parameter :: NMAX = 84
1105 integer,
parameter :: NDD = nmax
1107 real(kind=
xp) dd(ndd, ndd), dtd(ndd, ndd)
1108 real(kind=
xp) zgd(ndd), zgld(ndd), iglgd(ndd, ndd)
1111 if (npgl .le. 1)
then
1112 call neko_error(
'DGLJGJ: Minimum number of Gauss-Lobatto points is 2')
1113 else if (npgl .gt. nmax)
then
1114 write(stderr, *)
'Polynomial degree too high in DGLJGJ'
1115 write(stderr, *)
'Maximum polynomial degree is', nmax
1116 write(stderr, *)
'Here NPGL=', npgl
1118 else if ((alpha .le. -1.0_xp) .or. (beta .le. -1.0_xp))
then
1119 call neko_error(
'DGLJGJ: Alpha and Beta must be greater than -1')
1125 iglgd(i, j) = iglg(i, j)
1131 call dgljgjd(dd, dtd, zgld, zgd, iglgd, npgl, npg, ndd, ndd, alpha, beta)
1135 dt(j, i) = dtd(j, i)
1148 subroutine dgljgjd(D, DT, ZGL, ZG, IGLG, NPGL, NPG, ND1, ND2, ALPHA, BETA)
1149 integer,
intent(in) :: NPGL, NPG, ND1, ND2
1150 real(kind=
xp),
intent(inout) :: d(nd2, nd1), dt(nd1, nd2)
1151 real(kind=
xp),
intent(in) :: zgl(nd1), zg(nd2), iglg(nd2, nd1), alpha, beta
1153 real(kind=
xp) :: eps, eigval, dn
1154 real(kind=
xp) :: pdi, pdj,
pi, pj, pm1, pdm1, pm2, pdm2
1155 real(kind=
xp) :: dz, faci, facj, const
1156 integer :: I, J, NGL
1158 if (npgl .le. 1)
then
1159 call neko_error(
'DGLJGJD: Minimum number of Gauss-Lobatto points is 2')
1160 else if ((alpha .le. -1.0_xp) .or. (beta .le. -1.0_xp))
then
1161 call neko_error(
'DGLJGJD: Alpha and Beta must be greater than -1')
1168 eigval = -dn*(dn + alpha + beta + 1.0_xp)
1172 dz = abs(zg(i)-zgl(j))
1173 if (dz .lt. eps)
then
1174 d(i, j) = (alpha*(1.0_xp + zg(i)) - beta*(1.0_xp - zg(i))) / &
1175 (2.0_xp*(1.0_xp - zg(i)**2))
1177 call jacobf(
pi, pdi, pm1, pdm1, pm2, pdm2, ngl, alpha, beta, zg(i))
1178 call jacobf(pj, pdj, pm1, pdm1, pm2, pdm2, ngl, alpha, &
1180 faci = alpha*(1.0_xp + zg(i)) - beta*(1.0_xp - zg(i))
1181 facj = alpha*(1.0_xp + zgl(j)) - beta*(1.0_xp - zgl(j))
1182 const = eigval*pj + facj*pdj
1183 d(i, j) = ((eigval*
pi + faci*pdi) * (zg(i) - zgl(j)) - &
1184 (1.0_xp - zg(i)**2)*pdi) / (const*(zg(i) - zgl(j))**2)
1196 subroutine iglm(I12, IT12, Z1, Z2, NZ1, NZ2, ND1, ND2)
1197 integer,
intent(in) :: NZ1, NZ2, ND1, ND2
1198 real(kind=
xp),
intent(inout) :: i12(nd2, nd1), it12(nd1, nd2)
1199 real(kind=
xp),
intent(in) :: z1(nd1), z2(nd2)
1203 if (nz1 .eq. 1)
then
1212 i12(i, j) =
hgl(j, zi, z1, nz1)
1213 it12(j, i) = i12(i, j)
1223 subroutine igllm(I12, IT12, Z1, Z2, NZ1, NZ2, ND1, ND2)
1224 integer,
intent(in) :: NZ1, NZ2, ND1, ND2
1225 real(kind=
xp),
intent(inout) :: i12(nd2, nd1), it12(nd1, nd2)
1226 real(kind=
xp),
intent(in) :: z1(nd1), z2(nd2)
1230 if (nz1 .eq. 1)
then
1239 i12(i, j) =
hgll(j, zi, z1, nz1)
1240 it12(j, i) = i12(i, j)
1243 end subroutine igllm
1251 subroutine igjm(I12, IT12, Z1, Z2, NZ1, NZ2, ND1, ND2, ALPHA, BETA)
1252 integer,
intent(in) :: NZ1, NZ2, ND1, ND2
1253 real(kind=
xp),
intent(inout) :: i12(nd2, nd1), it12(nd1, nd2)
1254 real(kind=
xp),
intent(in) :: z1(nd1), z2(nd2), alpha, beta
1258 if (nz1 .eq. 1)
then
1267 i12(i, j) =
hgj(j, zi, z1, nz1, alpha, beta)
1268 it12(j, i) = i12(i, j)
1279 subroutine igljm(I12, IT12, Z1, Z2, NZ1, NZ2, ND1, ND2, ALPHA, BETA)
1280 integer,
intent(in) :: NZ1, NZ2, ND1, ND2
1281 real(kind=
xp),
intent(inout) :: i12(nd2, nd1), it12(nd1, nd2)
1282 real(kind=
xp),
intent(in) :: z1(nd1), z2(nd2), alpha, beta
1286 if (nz1 .eq. 1)
then
1295 i12(i, j) =
hglj(j, zi, z1, nz1, alpha, beta)
1296 it12(j, i) = i12(i, j)
1299 end subroutine igljm
real(kind=rp), parameter, public pi
integer, parameter, public xp
integer, parameter, public rp
Global precision used in computations.
LIBRARY ROUTINES FOR SPECTRAL METHODS.
subroutine dgj(d, dt, z, nz, nzd, alpha, beta)
Compute the derivative matrix D and its transpose DT associated with the Nth order Lagrangian interpo...
real(kind=xp) function pndleg(z, n)
Compute the derivative of the Nth order Legendre polynomial at Z. (Simpler than JACOBF) Based on the ...
subroutine dgll(d, dt, z, nz, nzd)
Compute the derivative matrix D and its transpose DT associated with the Nth order Lagrangian interpo...
subroutine igjm(i12, it12, z1, z2, nz1, nz2, nd1, nd2, alpha, beta)
Compute the one-dimensional interpolation operator (matrix) I12 ands its transpose IT12 for interpola...
real(kind=xp) function hgj(ii, z, zgj, np, alpha, beta)
Compute the value of the Lagrangian interpolant HGJ through the NP Gauss Jacobi points ZGJ at the poi...
subroutine dgllgl(d, dt, zm1, zm2, im12, nzm1, nzm2, nd1, nd2)
Compute the (one-dimensional) derivative matrix D and its transpose DT associated with taking the der...
subroutine zwgll(z, w, np)
Generate NP Gauss-Lobatto Legendre points (Z) and weights (W) associated with Jacobi polynomial P(N)(...
real(kind=xp) function pnormj(n, alpha, beta)
subroutine dgjd(d, dt, z, nz, nzd, alpha, beta)
Compute the derivative matrix D and its transpose DT associated with the Nth order Lagrangian interpo...
real(kind=xp) function gammaf(x)
subroutine jacg(xjac, np, alpha, beta)
Compute NP Gauss points XJAC, which are the zeros of the Jacobi polynomial J(NP) with parameters ALPH...
subroutine zwgljd(z, w, np, alpha, beta)
Generate NP GAUSS LOBATTO JACOBI points (Z) and weights (W) associated with Jacobi polynomial P(N)(al...
real(kind=xp) function hglj(ii, z, zglj, np, alpha, beta)
Compute the value of the Lagrangian interpolant HGLJ through the NZ Gauss-Lobatto Jacobi points ZGLJ ...
real(kind=xp) function hgljd(i, z, zglj, np, alpha, beta)
Compute the value of the Lagrangian interpolant HGLJD through the NZ Gauss-Lobatto Jacobi points ZJAC...
subroutine zwglj(z, w, np, alpha, beta)
Generate NP GAUSS LOBATTO JACOBI points (Z) and weights (W) associated with Jacobi polynomial P(N)(al...
subroutine zwgj(z, w, np, alpha, beta)
Generate NP GAUSS JACOBI points (Z) and weights (W) associated with Jacobi polynomial P(N)(alpha>-1,...
subroutine iglm(i12, it12, z1, z2, nz1, nz2, nd1, nd2)
Compute the one-dimensional interpolation operator (matrix) I12 ands its transpose IT12 for interpola...
subroutine jacobf(poly, pder, polym1, pderm1, polym2, pderm2, n, alp, bet, x)
Computes the Jacobi polynomial (POLY) and its derivative (PDER) of degree N at X.
subroutine zwgjd(z, w, np, alpha, beta)
Generate NP GAUSS JACOBI points (Z) and weights (W) associated with Jacobi polynomial P(N)(alpha>-1,...
subroutine dglj(d, dt, z, nz, nzd, alpha, beta)
Compute the derivative matrix D and its transpose DT associated with the Nth order Lagrangian interpo...
subroutine dgljgj(d, dt, zgl, zg, iglg, npgl, npg, nd1, nd2, alpha, beta)
Compute the (one-dimensional) derivative matrix D and its transpose DT associated with taking the der...
real(kind=xp) function pnleg(z, n)
Compute the value of the Nth order Legendre polynomial at Z. (Simpler than JACOBF) Based on the recur...
real(kind=xp) function hgl(i, z, zgl, nz)
Compute the value of the Lagrangian interpolant HGL through the NZ Gauss Legendre points ZGL at the p...
subroutine dgljd(d, dt, z, nz, nzd, alpha, beta)
Compute the derivative matrix D and its transpose DT associated with the Nth order Lagrangian interpo...
subroutine legendre_poly(l, x, n)
Evaluate Legendre polynomials of degrees 0-N at point x and store in array L.
real(kind=xp) function endw1(n, alpha, beta)
subroutine igllm(i12, it12, z1, z2, nz1, nz2, nd1, nd2)
Compute the one-dimensional interpolation operator (matrix) I12 ands its transpose IT12 for interpola...
subroutine dgljgjd(d, dt, zgl, zg, iglg, npgl, npg, nd1, nd2, alpha, beta)
Compute the (one-dimensional) derivative matrix D and its transpose DT associated with taking the der...
subroutine zwgl(z, w, np)
Generate NP Gauss Legendre points Z and weights W associated with Jacobi polynomial ....
real(kind=xp) function hgll(i, z, zgll, nz)
Compute the value of the Lagrangian interpolant L through the NZ Gauss-Lobatto Legendre points ZGLL a...
real(kind=xp) function hgjd(ii, z, zgj, np, alpha, beta)
Compute the value of the Lagrangian interpolant HGJD through the NZ Gauss-Lobatto Jacobi points ZGJ a...
real(kind=xp) function endw2(n, alpha, beta)
subroutine igljm(i12, it12, z1, z2, nz1, nz2, nd1, nd2, alpha, beta)
Compute the one-dimensional interpolation operator (matrix) I12 ands its transpose IT12 for interpola...