sfepy.solvers.ts_solvers module

Time stepping solvers.

class sfepy.solvers.ts_solvers.AdaptiveTimeSteppingSolver(conf, **kwargs)[source]

Implicit time stepping solver with an adaptive time step.

Either the built-in or user supplied function can be used to adapt the time step.

Kind: ‘ts.adaptive’

For common configuration parameters, see Solver.

Specific configuration parameters:

Parameters:

t0 : float (default: 0.0)

The initial time.

t1 : float (default: 1.0)

The final time.

dt : float

The time step. Used if n_step is not given.

n_step : int (default: 10)

The number of time steps. Has precedence over dt.

quasistatic : bool (default: False)

If True, assume a quasistatic time-stepping. Then the non-linear solver is invoked also for the initial time.

adapt_fun : callable(ts, status, adt, problem)

If given, use this function to set the time step in ts. The function return value is a bool - if True, the adaptivity loop should stop. The other parameters below are collected in adt, status is the nonlinear solver status and problem is the Problem instance.

dt_red_factor : float (default: 0.2)

The time step reduction factor.

dt_red_max : float (default: 0.001)

The maximum time step reduction factor.

dt_inc_factor : float (default: 1.25)

The time step increase factor.

dt_inc_on_iter : int (default: 4)

Increase the time step if the nonlinear solver converged in less than this amount of iterations for dt_inc_wait consecutive time steps.

dt_inc_wait : int (default: 5)

The number of consecutive time steps, see dt_inc_on_iter.

name = 'ts.adaptive'
solve_step(ts, state0, nls_status=None)[source]

Solve a single time step.

class sfepy.solvers.ts_solvers.EquationSequenceSolver(conf, **kwargs)[source]

Solver for stationary problems with an equation sequence.

Kind: ‘ts.equation_sequence’

For common configuration parameters, see Solver.

Specific configuration parameters:

init_time(nls_status=None)[source]
name = 'ts.equation_sequence'
class sfepy.solvers.ts_solvers.SimpleTimeSteppingSolver(conf, **kwargs)[source]

Implicit time stepping solver with a fixed time step.

Kind: ‘ts.simple’

For common configuration parameters, see Solver.

Specific configuration parameters:

Parameters:

t0 : float (default: 0.0)

The initial time.

t1 : float (default: 1.0)

The final time.

dt : float

The time step. Used if n_step is not given.

n_step : int (default: 10)

The number of time steps. Has precedence over dt.

quasistatic : bool (default: False)

If True, assume a quasistatic time-stepping. Then the non-linear solver is invoked also for the initial time.

init_time(nls_status=None)[source]
name = 'ts.simple'
solve_step(ts, state0, nls_status=None)[source]

Solve a single time step.

class sfepy.solvers.ts_solvers.StationarySolver(conf, **kwargs)[source]

Solver for stationary problems without time stepping.

This class is provided to have a unified interface of the time stepping solvers also for stationary problems.

Kind: ‘ts.stationary’

For common configuration parameters, see Solver.

Specific configuration parameters:

init_time(nls_status=None)[source]
name = 'ts.stationary'
sfepy.solvers.ts_solvers.adapt_time_step(ts, status, adt, problem=None)[source]

Adapt the time step of ts according to the exit status of the nonlinear solver.

The time step dt is reduced, if the nonlinear solver did not converge. If it converged in less then a specified number of iterations for several time steps, the time step is increased. This is governed by the following parameters:

  • red_factor : time step reduction factor
  • red_max : maximum time step reduction factor
  • inc_factor : time step increase factor
  • inc_on_iter : increase time step if the nonlinear solver converged in less than this amount of iterations...
  • inc_wait : ...for this number of consecutive time steps
Parameters:

ts : VariableTimeStepper instance

The time stepper.

status : IndexedStruct instance

The nonlinear solver exit status.

adt : Struct instance

The adaptivity parameters of the time solver:

problem : Problem instance, optional

This canbe used in user-defined adaptivity functions. Not used here.

Returns:

is_break : bool

If True, the adaptivity loop should stop.

sfepy.solvers.ts_solvers.get_initial_state(problem)[source]

Create a zero state vector and apply initial conditions.

sfepy.solvers.ts_solvers.get_min_dt(adt)[source]
sfepy.solvers.ts_solvers.make_implicit_step(ts, state0, problem, nls_status=None)[source]

Make a step of an implicit time stepping solver.

sfepy.solvers.ts_solvers.prepare_matrix(problem, state)[source]

Pre-assemble tangent system matrix.

sfepy.solvers.ts_solvers.prepare_save_data(ts, conf)[source]

Given a time stepper configuration, return a list of time steps when the state should be saved.

sfepy.solvers.ts_solvers.replace_virtuals(deps, pairs)[source]