File: del2lib.f90

package info (click to toggle)
petsc4py 3.23.1-1exp2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 3,448 kB
  • sloc: python: 12,503; ansic: 1,697; makefile: 343; f90: 313; sh: 14
file content (24 lines) | stat: -rw-r--r-- 642 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
! file: del2lib.f90

! to build a Python module, use this:
! $$ f2py -m del2lib -c del2lib.f90

subroutine del2apply (n, F, x, y)

  !f2py intent(hide) :: n=shape(F,0)-2
  integer      , intent(in)    :: n
  real(kind=8) , intent(inout) :: F(0:n+1,0:n+1,0:n+1)
  real(kind=8) , intent(in)    :: x(n,n,n)
  real(kind=8) , intent(inout) :: y(n,n,n)

  F(1:n,1:n,1:n) = x

  y(:,:,:) = 6.0 * F(1:n,1:n,1:n) &
           - F(0:n-1,1:n,1:n)     &
           - F(2:n+1,1:n,1:n)     &
           - F(1:n,0:n-1,1:n)     &
           - F(1:n,2:n+1,1:n)     &
           - F(1:n,1:n,0:n-1)     &
           - F(1:n,1:n,2:n+1)

end subroutine del2apply