FLASH-X
Doxygen Generated Documentation From Interface Source Code
Functions/Subroutines
Grid_computeVarNorm.F90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine Grid_computeVarNorm (level, normType, ivar, norm, leafOnly)
 

Function/Subroutine Documentation

◆ Grid_computeVarNorm()

subroutine Grid_computeVarNorm ( integer  level,
integer  normType,
integer  ivar,
real  norm,
integer  leafOnly 
)

Computes the L1 or L2 norm of the variable specified by ivar. This can be done per-level, or on leaf or all nodes. For multigrid, the L2 norm is used for convergence, but the L1 norm is incredibly useful for debugging purposes.

level - If the norm is restricted to a given level; 0 is all normType - p in the Lp norm where choices of p are 1 or 2 ivar - the grid variable being normed; -1 for work norm - the variable with which to return the norm leafOnly - if this isn't 0, compute the norm only on leaf nodes

RESULT

The norm of ivar is in norm.

NOTES

DEV: Currently only implemented for Paramesh4 and UG!

EXAMPLE

call gr_restrictTree() do i = 1, lrefine_max call Grid_computeVarNorm(i, 1, pdens, norm(i), 0) enddo do i = 1, lrefine_max if (norm(0) - norm(i) > 0.0000001) then call Driver_abort("restriction is highly nonconservatory!") endif enddo

Definition at line 51 of file Grid_computeVarNorm.F90.