proteus.StepControl module
A class hierarchy for methods of controlling the step size
- class proteus.StepControl.SC_base(model, nOptions)[source]
Bases:
objectA simple fixed time stepping controller with no error/stability control and reduction by 1/2 in case of solver failures.
- class proteus.StepControl.Newton_controller(model, nOptions)[source]
Bases:
SC_baseSame as SC_base but since there is no dt we have not way to retry
- class proteus.StepControl.Min_dt_cfl_controller(model, nOptions)[source]
Bases:
Min_dt_controller
- class proteus.StepControl.Min_dt_controller_FCT(model, nOptions)[source]
Bases:
Min_dt_controllercontroller try and implement a piece of FCT methodology where first step is a low order solution and the next step corrects is
- class proteus.StepControl.FLCBDF_controller_sys(model, nOptions)[source]
Bases:
FLCBDF_controller
- class proteus.StepControl.HeuristicNL_dt_controller(model, nOptions)[source]
Bases:
SC_baseClassical Heuristic step controller that picks time step based on threshholds in nonlinear solver iterations:
if nnl < nonlinearIterationsFloor: dt *= dtNLgrowFactor else if nnl > nonlinearIterationsCeil: dt *= dtNLreduceFactor end
if the nonlinear solver fails, the time step is modified using:
dt *= dtNLfailureReduceFactor
Also includes simple linear predictor for initial guess:
y^{n+1,p} = y^{n} + (y^{n}-y^{n-1})/(\Delta t^{n})(t - t^{n-1})
- class proteus.StepControl.GustafssonFullNewton_dt_controller(model, nOptions)[source]
Bases:
SC_base- Try version of basic Gustafsson and Soederlind 97 time step selection strategy
that accounts for nonlinear solver performance assuming a full Newton nonlinear solver
Also includes error control based on classical “deadbeat” control Right now, decisions based on finest level solve:
input: dt_prev output: dt get time step estimate based on temporal error --> dt_e get convergence rate estimate from nonlinear solver --> a get number of iterations from nonlinear solver --> nnl if nonlinear solver converges r_a = phi(a_ref/a) r_a = min(r_a_max,max(r_a,r_a_min)) else if a_ref < a #convergence rate ok but took too many iterations anyway r_a = phi(nnl_ref/nnl) else r_a = phi(a_ref/a) # r_a = min(r_a_max,max(r_a,r_a_min)) # dt = min(dt_e,r_a dt_prev)
Here,
a_ref – target convergence rate nnl_ref – target number of nonlinear iterations r_a_max – max growth rate r_a_min – min growth rate
phi – limiter function, defaut is phi(x) = x
Also includes simple linear predictor for initial guess:
y^{n+1,p} = y^{n} + (y^{n}-y^{n-1})/(\Delta t^{n})(t - t^{n-1})
- setInitialGuess(uList, rList)[source]
for now ignore time integrations predictor since that is for m and not u by default …
- retryStep_solverFailure()[source]
nonlinear solver failure .. todo:
make sure predictor gets called again after this to get error estimate correct for next solve
- retryStep_errorFailure()[source]
figure out where to make sure that predictor gets called by timeIntegration to setup error estimates
- choose_dt_fromError(dtIn)[source]
pick dt based on error considerations, assumes error is already calculated
- initialize_dt_model(t0, tOut)[source]
- TODO: Figure out good strategy for picking initial dt since we don’t necessarily want
time integration to be responsible for this right now