MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
localcellextremamodule::localcellextrematype Interface Reference

Computes and caches local extrema for each cell and its connected neighbors. More...

Collaboration diagram for localcellextremamodule::localcellextrematype:
Collaboration graph

Public Member Functions

procedure set_field (this, phi)
procedure get_min (this, n)
procedure get_max (this, n)
final destructor (this)
type(localcellextrematype) function constructor (dis)

Public Attributes

real(dp), dimension(:), allocatable min
real(dp), dimension(:), allocatable max

Private Member Functions

procedure, private compute_local_extrema (this, phi)
procedure, private find_local_extrema (this, n, phi, min_phi, max_phi)

Private Attributes

class(disbasetype), pointer dis

Detailed Description

This class computes the minimum and maximum values within the local stencil of each cell (the cell itself plus all directly connected neighboring cells). The extrema are computed once when the scalar field is set and then cached for fast retrieval. This is particularly useful for TVD limiters and slope limiting algorithms that need to enforce monotonicity constraints.

The local extrema computation follows the connectivity pattern defined by the discretization object, examining all cells that share a face with the target cell. This creates a computational stencil that includes the central cell and its immediate neighbors.

Note
The get_min() and get_max() methods return pointers for zero-copy performance in performance-critical loops. Callers should treat returned values as read-only.

Definition at line 26 of file LocalCellExtrema.f90.

Constructor & Destructor Documentation

◆ destructor()

final localcellextremamodule::localcellextrematype::destructor ( type(localcellextrematype), intent(inout) this)
final

Definition at line 35 of file LocalCellExtrema.f90.

Here is the call graph for this function:

Member Function/Subroutine Documentation

◆ compute_local_extrema()

procedure, private localcellextremamodule::localcellextrematype::compute_local_extrema ( class(localcellextrematype), target this,
real(dp), dimension(:), intent(in) phi )
private

Definition at line 37 of file LocalCellExtrema.f90.

◆ constructor()

type(localcellextrematype) function localcellextremamodule::localcellextrematype::constructor ( class(disbasetype), intent(in), pointer dis)

Definition at line 46 of file LocalCellExtrema.f90.

47 ! -- return
48 type(LocalCellExtremaType) :: local_extrema
49 ! -- dummy
50 class(DisBaseType), pointer, intent(in) :: dis
51
52 local_extrema%dis => dis
53
54 allocate (local_extrema%min(dis%nodes))
55 allocate (local_extrema%max(dis%nodes))

◆ find_local_extrema()

procedure, private localcellextremamodule::localcellextrematype::find_local_extrema ( class(localcellextrematype), target this,
integer(i4b), intent(in) n,
real(dp), dimension(:), intent(in) phi,
real(dp), intent(out) min_phi,
real(dp), intent(out) max_phi )
private

Definition at line 38 of file LocalCellExtrema.f90.

Here is the call graph for this function:

◆ get_max()

procedure localcellextremamodule::localcellextrematype::get_max ( class(localcellextrematype), target this,
integer(i4b), intent(in) n )

Definition at line 34 of file LocalCellExtrema.f90.

◆ get_min()

procedure localcellextremamodule::localcellextrematype::get_min ( class(localcellextrematype), target this,
integer(i4b), intent(in) n )

Definition at line 33 of file LocalCellExtrema.f90.

◆ set_field()

procedure localcellextremamodule::localcellextrematype::set_field ( class(localcellextrematype), target this,
real(dp), dimension(:), intent(in), pointer phi )

Definition at line 32 of file LocalCellExtrema.f90.

Member Data Documentation

◆ dis

class(disbasetype), pointer localcellextremamodule::localcellextrematype::dis
private

Definition at line 28 of file LocalCellExtrema.f90.

28 class(DisBaseType), pointer :: dis

◆ max

real(dp), dimension(:), allocatable localcellextremamodule::localcellextrematype::max

Definition at line 30 of file LocalCellExtrema.f90.

30 real(DP), dimension(:), allocatable :: max

◆ min

real(dp), dimension(:), allocatable localcellextremamodule::localcellextrematype::min

Definition at line 29 of file LocalCellExtrema.f90.

29 real(DP), dimension(:), allocatable :: min

The documentation for this interface was generated from the following file: