fipy.steppers package

Submodules

fipy.steppers.pidStepper module

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

Bases: 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},
}
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)

fipy.steppers.pseudoRKQSStepper module

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

Bases: Stepper

Adaptive stepper based on the rkqs (Runge-Kutta “quality-controlled” stepper) algorithm of Numerical 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.

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)

fipy.steppers.stepper module

class fipy.steppers.stepper.Stepper(vardata=())

Bases: object

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)

Module contents

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

\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}.

Parameters:
  • var (CellVariable) – The CellVariable in question.

  • matrix(ignored)

  • RHSvector(ignored)

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

\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}.

Parameters:
  • var (CellVariable) – The CellVariable in question.

  • matrix(ignored)

  • RHSvector(ignored)

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

\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}.

Parameters:
  • var (CellVariable) – The CellVariable in question.

  • matrix(ignored)

  • RHSvector(ignored)

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

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

Parameters:
  • fn (function) – The function to call

  • *args

  • **kwargs

Return type:

float

Last updated on Jun 27, 2023. Created using Sphinx 6.2.1.