29 real(dp),
dimension(:),
allocatable :: min
30 real(dp),
dimension(:),
allocatable :: max
52 local_extrema%dis => dis
54 allocate (local_extrema%min(dis%nodes))
55 allocate (local_extrema%max(dis%nodes))
69 real(DP),
intent(in),
dimension(:),
pointer :: phi
71 call this%compute_local_extrema(phi)
77 integer(I4B),
intent(in) :: n
79 real(dp),
pointer :: min_val
81 min_val => this%min(n)
87 integer(I4B),
intent(in) :: n
89 real(dp),
pointer :: max_val
91 max_val => this%max(n)
97 real(DP),
intent(in),
dimension(:) :: phi
100 real(DP) :: min_phi, max_phi
102 do n = 1, this%dis%nodes
103 call this%find_local_extrema(n, phi, min_phi, max_phi)
104 this%min(n) = min_phi
105 this%max(n) = max_phi
112 integer(I4B),
intent(in) :: n
113 real(DP),
intent(in),
dimension(:) :: phi
114 real(DP),
intent(out) :: min_phi, max_phi
116 integer(I4B) :: ipos, m
120 do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
121 m = this%dis%con%ja(ipos)
122 min_phi = min(min_phi, phi(m))
123 max_phi = max(max_phi, phi(m))
This module defines variable data types.
type(localcellextrematype) function constructor(dis)
subroutine set_field(this, phi)
subroutine compute_local_extrema(this, phi)
real(dp) function, pointer get_min(this, n)
real(dp) function, pointer get_max(this, n)
subroutine destructor(this)
subroutine find_local_extrema(this, n, phi, min_phi, max_phi)
Computes and caches local extrema for each cell and its connected neighbors.