MODFLOW 6  version 6.7.0.dev3
USGS Modular Hydrologic Model
localcellextremamodule::localcellextrematype Interface Reference

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

Collaboration diagram for localcellextremamodule::localcellextrematype:
Collaboration graph

Private Member Functions

procedure set_field
 
procedure get_min
 
procedure get_max
 
final destructor
 
procedure, private compute_local_extrema
 
procedure, private find_local_extrema
 
type(localcellextrematype) function constructor (dis)
 

Private Attributes

class(disbasetype), pointer dis
 
real(dp), dimension(:), allocatable min
 
real(dp), dimension(:), allocatable max
 

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.

Member Function/Subroutine Documentation

◆ compute_local_extrema()

procedure, private localcellextremamodule::localcellextrematype::compute_local_extrema
private

Definition at line 37 of file LocalCellExtrema.f90.

◆ constructor()

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

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))

◆ destructor()

final localcellextremamodule::localcellextrematype::destructor
finalprivate

Definition at line 35 of file LocalCellExtrema.f90.

Here is the call graph for this function:

◆ find_local_extrema()

procedure, private localcellextremamodule::localcellextrematype::find_local_extrema
private

Definition at line 38 of file LocalCellExtrema.f90.

Here is the call graph for this function:

◆ get_max()

procedure localcellextremamodule::localcellextrematype::get_max
private

Definition at line 34 of file LocalCellExtrema.f90.

◆ get_min()

procedure localcellextremamodule::localcellextrematype::get_min
private

Definition at line 33 of file LocalCellExtrema.f90.

◆ set_field()

procedure localcellextremamodule::localcellextrematype::set_field
private

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
private

Definition at line 30 of file LocalCellExtrema.f90.

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

◆ min

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

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: