Bookmark and Share FiPy: A Finite Volume PDE Solver Using Python
Version 2.1.3

This Page

Contact

FiPy developers
Jonathan Guyer
Daniel Wheeler
James Warren

Join our mailing list

100 Bureau Drive, M/S 6555
Gaithersburg, MD 20899

301-975-5329 Telephone
301-975-4553 Facsimile

steppers Package Documentation

This page contains the steppers Package documentation.

The steppers Package

fipy.steppers.L1error(var, matrix, RHSvector)
Parameters :
  • var: The CellVariable in question.
  • matrix: (ignored)
  • RHSvector: (ignored)
Returns :

\frac{\|\mathtt{var} - \mathtt{var}^\text{old}\|_1}
{\|\mathtt{var}^\text{old}\|_1}

where \|\vec{x}\|_1 is the L^1-norm of \vec{x}.

fipy.steppers.L2error(var, matrix, RHSvector)
Parameters :
  • var: The CellVariable in question.
  • matrix: (ignored)
  • RHSvector: (ignored)
Returns :

\frac{\|\mathtt{var} - \mathtt{var}^\text{old}\|_2}
{\|\mathtt{var}^\text{old}\|_2}

where \|\vec{x}\|_2 is the L^2-norm of \vec{x}.

fipy.steppers.LINFerror(var, matrix, RHSvector)
Parameters :
  • var: The CellVariable in question.
  • matrix: (ignored)
  • RHSvector: (ignored)
Returns :

\frac{\|\mathtt{var} - \mathtt{var}^\text{old}\|_\infty}
{\|\mathtt{var}^\text{old}\|_\infty}

where \|\vec{x}\|_\infty is the L^\infty-norm of \vec{x}.

fipy.steppers.error(var, matrix, RHSvector, norm)
Parameters :
  • var: The CellVariable in question.
  • matrix: (ignored)
  • RHSvector: (ignored)
  • norm: A function that will normalize its array argument and return a single number
Returns :

\frac{\|\mathtt{var} - \mathtt{var}^\text{old}\|_?}
{\|\mathtt{var}^\text{old}\|_?}

where \|\vec{x}\|_? is the normalization of \vec{x} provided by norm().

fipy.steppers.residual(var, matrix, RHSvector)

Determines the residual for the current solution matrix and variable.

Parameters :
  • var: The CellVariable in question, prior to solution.
  • matrix: The coefficient matrix at this step/sweep
  • RHSvector: The
Returns :

\|\mathsf{L}\vec{x} - \vec{b}\|_\infty

where \|\vec{\xi}\|_\infty is the L^\infty-norm of \vec{\xi}.

fipy.steppers.sweepMonotonic(fn, *args, **kwargs)

Repeatedly calls fn(*args, **kwargs)() until the residual returned by fn() is no longer decreasing.

Parameters :
  • fn: The function to call
  • args: The unnamed function argument list
  • kwargs: The named function argument dict
Returns :

the final residual

The pidStepper Module

class fipy.steppers.pidStepper.PIDStepper(vardata=(), proportional=0.075, integral=0.175, derivative=0.01)

Bases: fipy.steppers.stepper.Stepper

Adaptive stepper using a PID controller, based on:

@article{PIDpaper,
   author =  {A. M. P. Valli and G. F. Carey and A. L. G. A. Coutinho},
   title =   {Control strategies for timestep selection in finite element
              simulation of incompressible flows and coupled
              reaction-convection-diffusion processes},
   journal = {Int. J. Numer. Meth. Fluids},
   volume =  47,
   year =    2005,
   pages =   {201-231},
}

The pseudoRKQSStepper Module

class fipy.steppers.pseudoRKQSStepper.PseudoRKQSStepper(vardata=(), safety=0.9, pgrow=-0.2, pshrink=-0.25, errcon=0.000189)

Bases: fipy.steppers.stepper.Stepper

Adaptive stepper based on the rkqs (Runge-Kutta “quality-controlled” stepper) algorithm of numerixal Recipes in C: 2nd Edition, Section 16.2.

Not really appropriate, since we’re not doing Runge-Kutta steps in the first place, but works OK.

The stepper Module

class fipy.steppers.stepper.Stepper(vardata=())
static failFn(vardata, dt, *args, **kwargs)
step(dt, dtTry=None, dtMin=None, dtPrev=None, sweepFn=None, successFn=None, failFn=None, *args, **kwargs)
static successFn(vardata, dt, dtPrev, elapsed, *args, **kwargs)
static sweepFn(vardata, dt, *args, **kwargs)