proteus.StepControl module

A class hierarchy for methods of controlling the step size

Inheritance diagram of proteus.StepControl

class proteus.StepControl.SC_base(model, nOptions)[source]

A simple fixed time stepping controller with no error/stability control and reduction by 1/2 in case of solver failures.

setInitialGuess(uList, rList)[source]
set_dt_allLevels()[source]
resetSolution()[source]
saveSolution()[source]
retryStep_solverFailure()[source]
retryStep_errorFailure()[source]
stepExact_model(tOut)[source]
choose_dt_model()[source]
initialize_dt_model(t0, tOut)[source]
updateSubstep()[source]
setSubsteps(tList)[source]

default controller just sets substeps to be input list without regard to time integration scheme

initializeTimeHistory()[source]
updateTimeHistory(resetFromDOF=False)[source]
errorFailure()[source]
writeSolverStatisticsForStep()[source]

record some relevant time step and solver statistics uses finest level to get this information called before updating t_model –> t_model_last etc

proteus.StepControl.FixedStep[source]

alias of SC_base

class proteus.StepControl.Newton_controller(model, nOptions)[source]

Bases: proteus.StepControl.SC_base

Same as SC_base but since there is no dt we have not way to retry

retryStep_solverFailure()[source]
retryStep_errorFailure()[source]
class proteus.StepControl.PsiTCtte_controller(model, nOptions)[source]

Bases: proteus.StepControl.SC_base

stepExact_model(tOut)[source]
initialize_dt_model(t0, tOut)[source]
setInitialGuess(uList, rList)[source]
updateSubstep()[source]
choose_dt_model()[source]
class proteus.StepControl.Osher_controller(model, nOptions)[source]

Bases: proteus.StepControl.SC_base

stepExact_model(tOut)[source]
initialize_dt_model(t0, tOut)[source]
updateSubstep()[source]
choose_dt_model()[source]
class proteus.StepControl.Osher_PsiTC_controller(model, nOptions)[source]

Bases: proteus.StepControl.SC_base

stepExact_model(tOut)[source]
initialize_dt_model(t0, tOut)[source]
updateSubstep()[source]
choose_dt_model()[source]
class proteus.StepControl.Osher_PsiTC_controller2(model, nOptions)[source]

Bases: proteus.StepControl.SC_base

stepExact_model(tOut)[source]
initialize_dt_model(t0, tOut)[source]
updateSubstep()[source]
choose_dt_model()[source]
class proteus.StepControl.Osher_FMM_controller(model, nOptions, maxOsherSteps=4)[source]

Bases: proteus.StepControl.Osher_controller

TODO
setup so that can configure from options, test with Fast Sweeping
updateSubstep()[source]
class proteus.StepControl.Min_dt_controller(model, nOptions)[source]

Bases: proteus.StepControl.SC_base

initialize_dt_model(t0, tOut)[source]
choose_dt_model()[source]
setSubsteps(tList)[source]

allow time intergration scheme to pick ‘substeps’ for interval. This would be useful for multistage schemes

class proteus.StepControl.Min_dt_RKcontroller(model, nOptions)[source]

Bases: proteus.StepControl.SC_base

initialize_dt_model(t0, tOut)[source]
choose_dt_model()[source]
stepExact_model(tOut)[source]
setSubsteps(tList)[source]

allow time intergration scheme to pick ‘substeps’ for interval. this is necessary for RK since stages are substeps

class proteus.StepControl.Min_dt_cfl_controller(model, nOptions)[source]

Bases: proteus.StepControl.Min_dt_controller

initialize_dt_model(t0, tOut)[source]
choose_dt_model()[source]
updateTimeHistory(resetFromDOF=False)[source]
class proteus.StepControl.Min_dt_controller_FCT(model, nOptions)[source]

Bases: proteus.StepControl.Min_dt_controller

controller try and implement a piece of FCT methodology where first step is a low order solution and the next step corrects is

initialize_dt_model(t0, tOut)[source]
setInitialGuess(uList, rList)[source]
errorFailure()[source]
retryStep_errorFailure()[source]
class proteus.StepControl.FLCBDF_controller(model, nOptions)[source]

Bases: proteus.StepControl.SC_base

setInitialGuess(uList, rList)[source]
set_dt_allLevels()[source]
retryStep_solverFailure()[source]
retryStep_errorFailure()[source]
errorFailure()[source]
initialize_dt_model(t0, tOut)[source]
choose_dt_model()[source]
class proteus.StepControl.FLCBDF_controller_sys(model, nOptions)[source]

Bases: proteus.StepControl.FLCBDF_controller

retryStep_solverFailure()[source]
retryStep_errorFailure()[source]
class proteus.StepControl.HeuristicNL_dt_controller(model, nOptions)[source]

Bases: proteus.StepControl.SC_base

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

setInitialGuess(uList, rList)[source]
saveSolution()[source]
retryStep_solverFailure()[source]

nonlinear solver failure just use cut by dtNLfailureReduceFactor

retryStep_errorFailure()[source]
choose_dt_model()[source]

choose dt after successful step use finest level to pick for now

updateTimeHistory(resetFromDOF=False)[source]
errorFailure()[source]
class proteus.StepControl.GustafssonFullNewton_dt_controller(model, nOptions)[source]

Bases: proteus.StepControl.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 ...

saveSolution()[source]
retryStep_solverFailure()[source]

nonlinear solver failure .. todo:

make sure predictor gets called again after this to get error
estimate correct for next solve
choose_dt_solverFailure(dt)[source]
choose_dt_solverSuccess(dt)[source]
retryStep_errorFailure()[source]

figure out where to make sure that predictor gets called by timeIntegration to setup error estimates

estimateError()[source]
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
choose_dt_model()[source]

choose dt after successful step use finest level to pick for now

assumes estimateError already called in errorFailure

updateTimeHistory(resetFromDOF=False)[source]
errorFailure()[source]
phi(x)[source]
set_dt_allLevels()[source]
stepExact_model(tOut)[source]