- time_sequenceThe values of t
C++ Type:std::vector<double>
Unit:(no unit assumed)
Controllable:No
Description:The values of t
TimeSequenceStepper
This time stepper derives from TimeSequenceStepperBase and provides the sequence of time values from a user-specified list, given by "time_sequence".
See Failed solves for information on the behavior of this time stepper for failed time steps.
Example input syntax
In this example, the numerical problem is solved at four specified points in time using a TimeSequenceStepper
.
[Executioner<<<{"href": "../../syntax/Executioner/index.html"}>>>]
type = Transient
end_time = 4.0
[./TimeStepper<<<{"href": "../../syntax/Executioner/TimeStepper/index.html"}>>>]
type = TimeSequenceStepper
time_sequence = '0 0.85 1.3 2 4'
[../]
[]
(test/tests/time_steppers/timesequence_stepper/timesequence.i)Input Parameters
- cutback_factor_at_failure0.5Factor to apply to timestep if a time step fails to converge.
Default:0.5
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Factor to apply to timestep if a time step fails to converge.
- reset_dtFalseUse when restarting a calculation to force a change in dt.
Default:False
C++ Type:bool
Controllable:No
Description:Use when restarting a calculation to force a change in dt.
- use_last_dt_after_last_tFalseIf true, uses the final time step size for times after the last time in the sequence, instead of taking a single step directly to the simulation end time
Default:False
C++ Type:bool
Controllable:No
Description:If true, uses the final time step size for times after the last time in the sequence, instead of taking a single step directly to the simulation end time
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTruewhether or not to enable the time stepper
Default:True
C++ Type:bool
Controllable:Yes
Description:whether or not to enable the time stepper
Advanced Parameters
Input Files
- (test/tests/time_steppers/time_stepper_system/multiple_timesteppers.i)
- (test/tests/time_steppers/timesequence_stepper/timesequence_restart_failure.i)
- (test/tests/time_steppers/timesequence_stepper/timesequence_restart1.i)
- (modules/phase_field/test/tests/misc/timestepmaterial.i)
- (test/tests/mesh/add_subdomain_ids/add_subdomain_names.i)
- (test/tests/time_steppers/timesequence_stepper/timesequence_restart2.i)
- (test/tests/time_steppers/time_stepper_system/timestepper_input_error.i)
- (modules/solid_mechanics/test/tests/dynamics/time_integration/direct_central_difference_varied_dt.i)
- (test/tests/time_steppers/timesequence_stepper/timesequence_restart3.i)
- (test/tests/time_steppers/timesequence_stepper/timesequence.i)
- (test/tests/time_steppers/timesequence_stepper/timesequence_last_dt.i)
- (test/tests/time_steppers/time_stepper_system/time_stepper_system.i)
- (test/tests/time_steppers/time_stepper_system/multiple_timesequences.i)
- (test/tests/time_steppers/time_stepper_system/time_stepper_system_restart.i)
- (modules/optimization/test/tests/executioners/transient_and_adjoint/nonuniform_tstep.i)
Child Objects
time_sequence
C++ Type:std::vector<double>
Unit:(no unit assumed)
Controllable:No
Description:The values of t
(test/tests/time_steppers/timesequence_stepper/timesequence.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = QUAD9
[]
[Functions]
[./exact_fn]
type = ParsedFunction
expression = t*t*(x*x+y*y)
[../]
[./forcing_fn]
type = ParsedFunction
expression = 2*t*(x*x+y*y)-4*t*t
[../]
[]
[Variables]
[./u]
family = LAGRANGE
order = SECOND
[../]
[]
[ICs]
[./u_var]
type = FunctionIC
variable = u
function = exact_fn
[../]
[]
[Kernels]
[./td]
type = TimeDerivative
variable = u
[../]
[./diff]
type = Diffusion
variable = u
[../]
[./ffn]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./all]
type = FunctionDirichletBC
variable = u
boundary = 'left right top bottom'
function = exact_fn
[../]
[]
[Executioner]
type = Transient
end_time = 4.0
[./TimeStepper]
type = TimeSequenceStepper
time_sequence = '0 0.85 1.3 2 4'
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/time_steppers/time_stepper_system/multiple_timesteppers.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[Functions]
[dts]
type = PiecewiseLinear
x = '0 0.85 2'
y = '0.2 0.15 0.2'
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Transient
end_time = 0.8
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
# Use as many different time steppers as we could to test the compositionDT,
# SolutionTimeAdaptiveDT give slightly different dt per run, set rel_err = 1e-2
# to ensure the test won't fail due to the small difference in the high-digit.
[TimeSteppers]
[ConstDT1]
type = ConstantDT
dt = 0.2
[]
[FunctionDT]
type = FunctionDT
function = dts
[]
[LogConstDT]
type = LogConstantDT
log_dt = 0.2
first_dt = 0.1
[]
[IterationAdapDT]
type = IterationAdaptiveDT
dt = 0.5
[]
[Timesequence]
type = TimeSequenceStepper
time_sequence = '0 0.25 0.3 0.5 0.8'
[]
[PPDT]
type = PostprocessorDT
postprocessor = PostDT
dt = 0.1
[]
[]
[]
[Postprocessors]
[timestep]
type = TimePostprocessor
execute_on = 'timestep_end'
[]
[PostDT]
type = ElementAverageValue
variable = u
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
csv = true
file_base='multiple_timesteppers'
[]
(test/tests/time_steppers/timesequence_stepper/timesequence_restart_failure.i)
[Mesh]
file = timesequence_restart_failure1_cp/0002-mesh.cpa.gz
[]
[Problem]
restart_file_base = timesequence_restart_failure1_cp/0002
# There is an initial conditions overwriting the restart on the nonlinear variable u
# As you can see in the gold file, this makes the initial step output be from the
# initial condition
allow_initial_conditions_with_restart = true
[]
[Functions]
[exact_fn]
type = ParsedFunction
expression = t*t*(x*x+y*y)
[]
[forcing_fn]
type = ParsedFunction
expression = 2*t*(x*x+y*y)-4*t*t
[]
[]
[Variables]
[u]
family = LAGRANGE
order = SECOND
[]
[]
[ICs]
[u_var]
type = FunctionIC
variable = u
function = exact_fn
[]
[]
[Kernels]
[td]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[ffn]
type = BodyForce
variable = u
function = forcing_fn
[]
[]
[BCs]
[all]
type = FunctionDirichletBC
variable = u
boundary = 'left right top bottom'
function = exact_fn
[]
[]
[Executioner]
type = Transient
end_time = 4.0
[TimeStepper]
type = TimeSequenceStepper
time_sequence = '0 0.85 1.2 1.3 2 4'
[]
[]
[Outputs]
exodus = true
[]
(test/tests/time_steppers/timesequence_stepper/timesequence_restart1.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = QUAD9
[]
[Functions]
[./exact_fn]
type = ParsedFunction
expression = t*t*(x*x+y*y)
[../]
[./forcing_fn]
type = ParsedFunction
expression = 2*t*(x*x+y*y)-4*t*t
[../]
[]
[Variables]
[./u]
family = LAGRANGE
order = SECOND
[../]
[]
[ICs]
[./u_var]
type = FunctionIC
variable = u
function = exact_fn
[../]
[]
[Kernels]
[./td]
type = TimeDerivative
variable = u
[../]
[./diff]
type = Diffusion
variable = u
[../]
[./ffn]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./all]
type = FunctionDirichletBC
variable = u
boundary = 'left right top bottom'
function = exact_fn
[../]
[]
[Executioner]
type = Transient
end_time = 4.0
[./TimeStepper]
type = TimeSequenceStepper
time_sequence = '0 0.85 1.3 2 4'
[../]
[]
[Outputs]
exodus = true
[./checkpoint]
type = Checkpoint
num_files = 4
[../]
[]
(modules/phase_field/test/tests/misc/timestepmaterial.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 1
[]
[Materials]
[./time]
type = TimeStepMaterial
outputs = exodus
[../]
[]
[Problem]
solve = false
kernel_coverage_check = false
[]
[Executioner]
type = Transient
num_steps = 6
[./TimeStepper]
type = TimeSequenceStepper
time_sequence = '4 8 15 16 23 42'
[../]
[]
[Outputs]
exodus = true
execute_on = timestep_end
[]
(test/tests/mesh/add_subdomain_ids/add_subdomain_names.i)
[Problem]
solve = false
kernel_coverage_check = false
material_coverage_check = false
[]
Box2_inactive_name = 'Box2_inactive'
Box3_inactive_name = 'Box3_inactive'
Box4_inactive_name = 'Box4_inactive'
inactive_domain_block_names = '${Box2_inactive_name} ${Box3_inactive_name} ${Box4_inactive_name}'
[Mesh]
[BaseMesh]
type = GeneratedMeshGenerator
elem_type = TET4
dim = 3
nx = 4
ny = 3
nz = 2
xmin = -10
xmax = +10
ymin = -10
ymax = +10
zmin = -2
zmax = +2
[]
[Box1]
type = SubdomainBoundingBoxGenerator
input = "BaseMesh"
block_id = 1
location = "INSIDE"
bottom_left = "-20 -20 -2"
top_right = "+20 +20 +2"
[]
[Box2]
type = SubdomainBoundingBoxGenerator
input = "Box1"
block_id = 2
location = "INSIDE"
bottom_left = "-4 -3 +3"
top_right = "0 +3 0"
[]
[Box3]
type = SubdomainBoundingBoxGenerator
input = "Box2"
block_id = 3
location = "INSIDE"
bottom_left = "0 -3 +2"
top_right = "+4 +3 0"
[]
add_subdomain_names = ${inactive_domain_block_names}
[]
[AuxVariables]
[dummy]
type = MooseVariableFVReal
[]
[]
# move elements between subdomains back and forth
[UserObjects]
[GlobalSubdomainModifier]
type = TimedSubdomainModifier
times = ' 0.4 0.6 0.4'
blocks_from = '2 Box2_inactive 3'
blocks_to = ' Box2_inactive 2 Box3_inactive'
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[]
[Executioner]
type = Transient
end_time = 1.0
[TimeSteppers]
[BlockEventTimeStepper]
type = TimeSequenceStepper
time_sequence = '0.0 0.2 0.4 0.5 0.6 1.0'
[]
[]
solve_type = 'PJFNK'
petsc_options = '-snes_converged_reason'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu mumps'
nl_abs_tol = 1E-3
nl_max_its = 400
l_tol = 1E-3
l_max_its = 200
[]
[Outputs]
exodus = true
[]
(test/tests/time_steppers/timesequence_stepper/timesequence_restart2.i)
[Mesh]
file = timesequence_restart1_cp/0002-mesh.cpa.gz
[]
[Problem]
restart_file_base = timesequence_restart1_cp/0002
# There is an initial conditions overwriting the restart on the nonlinear variable u
# As you can see in the gold file, this makes the initial step output be from the
# initial condition
allow_initial_conditions_with_restart = true
[]
[Functions]
[exact_fn]
type = ParsedFunction
expression = t*t*(x*x+y*y)
[]
[forcing_fn]
type = ParsedFunction
expression = 2*t*(x*x+y*y)-4*t*t
[]
[]
[Variables]
[u]
family = LAGRANGE
order = SECOND
[]
[]
[ICs]
[u_var]
type = FunctionIC
variable = u
function = exact_fn
[]
[]
[Kernels]
[td]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[ffn]
type = BodyForce
variable = u
function = forcing_fn
[]
[]
[BCs]
[all]
type = FunctionDirichletBC
variable = u
boundary = 'left right top bottom'
function = exact_fn
[]
[]
[Executioner]
type = Transient
end_time = 4.0
[TimeStepper]
type = TimeSequenceStepper
time_sequence = '0 0.85 1.3 2 4'
[]
[]
[Outputs]
exodus = true
[]
(test/tests/time_steppers/time_stepper_system/timestepper_input_error.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Transient # Here we use the Transient Executioner
[TimeSteppers]
type = TimeSequenceStepper
time_sequence = '0 43200 86400 172800 432000 864000'
[]
start_time = 0.0
end_time = 864000
[]
[Postprocessors]
[timestep]
type = TimePostprocessor
execute_on = 'timestep_end'
[]
[]
[Outputs]
csv = true
file_base='multiple_timesequence'
[]
(modules/solid_mechanics/test/tests/dynamics/time_integration/direct_central_difference_varied_dt.i)
###########################################################
# This is a simple test with a time-dependent problem
# demonstrating the use of a central difference with a
# direct calculation of acceleration.
#
# Testing that the first and second time derivatives
# are calculated correctly using the Direct Central Difference
# method
# Testing the accuracy of the timestep averaging method within
# the Direct Central Difference method
###########################################################
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
extra_tag_matrices = 'mass'
[]
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 1
ny = 1
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[Functions]
#Mid-step velocities
#0 0.00625 0.015 0.0075 0.25 0
#Accelerations
#0.025 0.01944 -0.01 0.48 -2.17
[forcing_fn]
type = PiecewiseLinear
x = '0.0 0.1 0.5 1.0 2.0 2.01 2.23'
y = '0.0 0.0 0.0025 0.01 0.0175 0.02 0.02'
[]
[]
[Kernels]
[DynamicSolidMechanics]
displacements = 'disp_x disp_y'
[]
[massmatrix]
type = MassMatrix
density = density
matrix_tags = 'mass'
variable = disp_x
[]
[massmatrix_y]
type = MassMatrix
density = density
matrix_tags = 'mass'
variable = disp_y
[]
[]
[Materials]
[elasticity_tensor_block_one]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e1
poissons_ratio = 0.0
[]
[strain_block]
type = ComputeFiniteStrain
displacements = 'disp_x disp_y'
implicit = false
[]
[stress_block]
type = ComputeFiniteStrainElasticStress
implicit = false
[]
[density]
type = GenericConstantMaterial
prop_names = 'density'
prop_values = 5
[]
[]
[BCs]
[left_x]
type = ExplicitFunctionDirichletBC
variable = disp_x
boundary = 'left'
function = forcing_fn
[]
[right_x]
type = ExplicitFunctionDirichletBC
variable = disp_x
boundary = 'right'
function = forcing_fn
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
second_order_vars = 'disp_x disp_y'
[]
[TimeStepper]
type = TimeSequenceStepper
time_sequence = '0.0 0.1 0.5 1.0 2.0 2.01 2.23'
[]
start_time = 0.0
num_steps = 6
dt = 0.1
[]
[Postprocessors]
[udot]
type = ElementAverageTimeDerivative
variable = disp_x
[]
[udotdot]
type = ElementAverageSecondTimeDerivative
variable = disp_x
[]
[u]
type = ElementAverageValue
variable = disp_x
[]
[]
[Outputs]
exodus = true
[]
(test/tests/time_steppers/timesequence_stepper/timesequence_restart3.i)
[Mesh]
file = timesequence_restart1_cp/0002-mesh.cpa.gz
[]
[Problem]
restart_file_base = timesequence_restart1_cp/0002
# There is an initial conditions overwriting the restart on the nonlinear variable u
# As you can see in the gold file, this makes the initial step output be from the
# initial condition
allow_initial_conditions_with_restart = true
[]
[Functions]
[exact_fn]
type = ParsedFunction
expression = t*t*(x*x+y*y)
[]
[forcing_fn]
type = ParsedFunction
expression = 2*t*(x*x+y*y)-4*t*t
[]
[]
[Variables]
[u]
family = LAGRANGE
order = SECOND
[]
[]
[ICs]
[u_var]
type = FunctionIC
variable = u
function = exact_fn
[]
[]
[Kernels]
[td]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[ffn]
type = BodyForce
variable = u
function = forcing_fn
[]
[]
[BCs]
[all]
type = FunctionDirichletBC
variable = u
boundary = 'left right top bottom'
function = exact_fn
[]
[]
[Executioner]
type = Transient
end_time = 4.5
[TimeStepper]
type = TimeSequenceStepper
time_sequence = '0 0.85 1.3 1.9 2 4 4.5'
[]
[]
[Outputs]
exodus = true
[]
(test/tests/time_steppers/timesequence_stepper/timesequence.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = QUAD9
[]
[Functions]
[./exact_fn]
type = ParsedFunction
expression = t*t*(x*x+y*y)
[../]
[./forcing_fn]
type = ParsedFunction
expression = 2*t*(x*x+y*y)-4*t*t
[../]
[]
[Variables]
[./u]
family = LAGRANGE
order = SECOND
[../]
[]
[ICs]
[./u_var]
type = FunctionIC
variable = u
function = exact_fn
[../]
[]
[Kernels]
[./td]
type = TimeDerivative
variable = u
[../]
[./diff]
type = Diffusion
variable = u
[../]
[./ffn]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
[./all]
type = FunctionDirichletBC
variable = u
boundary = 'left right top bottom'
function = exact_fn
[../]
[]
[Executioner]
type = Transient
end_time = 4.0
[./TimeStepper]
type = TimeSequenceStepper
time_sequence = '0 0.85 1.3 2 4'
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/time_steppers/timesequence_stepper/timesequence_last_dt.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 6
[TimeStepper]
type = TimeSequenceStepper
time_sequence = '0 1 3 4 8'
use_last_dt_after_last_t = true
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
[]
[]
[Outputs]
csv = true
[]
(test/tests/time_steppers/time_stepper_system/time_stepper_system.i)
[Mesh]
file = restart_test_cp/0005-mesh.cpa.gz
[]
[Variables]
[u]
order = CONSTANT
family = MONOMIAL
[]
[]
[Problem]
type = SlowProblem
seconds_to_sleep = '0.0 0.0 0.1 0.1 0.5 0.2 0.2 0.1 0.1 0.1'
kernel_coverage_check = false
restart_file_base = restart_test_cp/0005
[]
[Executioner]
type = Transient
solve_type = NEWTON
num_steps = 10
[TimeSteppers]
[LogConstDT]
type = LogConstantDT
log_dt = 0.2
first_dt = 0.1
[]
[Timesequence]
type = TimeSequenceStepper
time_sequence = '0 0.12 0.2 0.5 0.6'
[]
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
[]
[]
[Outputs]
csv = true
file_base='time_stepper_restart'
[]
(test/tests/time_steppers/time_stepper_system/multiple_timesequences.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Transient
end_time = 0.8
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
# Use as many different time sequence steppers as we could to test the compositionDT
[TimeSteppers]
[ConstDT1]
type = ConstantDT
dt = 0.2
[]
[ConstDT2]
type = ConstantDT
dt = 0.1
[]
[LogConstDT]
type = LogConstantDT
log_dt = 0.2
first_dt = 0.1
[]
[Timesequence1]
type = TimeSequenceStepper
time_sequence = '0 0.25 0.3 0.5 0.8'
[]
[Timesequence2]
type = CSVTimeSequenceStepper
file_name = timesequence.csv
column_name = time
[]
[Timesequence3]
type = ExodusTimeSequenceStepper
mesh = timesequence.e
[]
[]
[]
[Postprocessors]
[timestep]
type = TimePostprocessor
execute_on = 'timestep_end'
[]
[]
[Outputs]
csv = true
file_base='multiple_timesequences'
[]
(test/tests/time_steppers/time_stepper_system/time_stepper_system_restart.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[u]
order = CONSTANT
family = MONOMIAL
[]
[]
[Problem]
type = SlowProblem
seconds_to_sleep = '0.0 0.0 0.1 0.1 0.5 0.2 0.2 0.1 0.1 0.1'
kernel_coverage_check = false
[]
[Executioner]
type = Transient
solve_type = NEWTON
num_steps = 5
[TimeSteppers]
[SolutionTimeAdaptiveDT]
type = SolutionTimeAdaptiveDT
dt = 0.5
[]
[LogConstDT]
type = LogConstantDT
log_dt = 0.2
first_dt = 0.1
[]
[Timesequence]
type = TimeSequenceStepper
time_sequence = '0 0.12 0.2 0.5 0.6'
[]
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
[]
[]
[Outputs]
[checkpoint]
type = Checkpoint
num_files = 5
[]
file_base='restart_test'
[]
(modules/optimization/test/tests/executioners/transient_and_adjoint/nonuniform_tstep.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmax = 1
ymax = 1
nx = 10
ny = 10
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
[]
[Variables]
[u]
[]
[u_adjoint]
solver_sys = adjoint
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[src]
type = BodyForce
variable = u
value = 10
[]
[src_adjoint]
type = BodyForce
variable = u_adjoint
value = 100
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'top right'
value = 0
[]
[]
[Executioner]
type = TransientAndAdjoint
forward_system = nl0
adjoint_system = adjoint
[TimeStepper]
type = TimeSequenceStepper
time_sequence = '0 0.1 0.2 0.4 0.7 1.1 1.4 1.6 1.7'
[]
end_time = 1.7
nl_rel_tol = 1e-12
l_tol = 1e-12
[]
[Postprocessors]
[u_avg]
type = ElementAverageValue
variable = u
execute_on = 'TIMESTEP_END ADJOINT_TIMESTEP_END'
[]
[u_adjoint_avg]
type = ElementAverageValue
variable = u_adjoint
execute_on = ADJOINT_TIMESTEP_END
[]
[inner_product]
type = VariableInnerProduct
variable = u
second_variable = u_adjoint
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Outputs]
[forward]
type = CSV
[]
[adjoint]
type = CSV
execute_on = 'INITIAL ADJOINT_TIMESTEP_END'
[]
[console]
type = Console
execute_postprocessors_on = 'INITIAL TIMESTEP_END ADJOINT_TIMESTEP_END'
[]
[]
(test/include/timesteppers/TimeSequenceStepperFailTest.h)
// This file is part of the MOOSE framework
// https://mooseframework.inl.gov
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "TimeSequenceStepper.h"
/**
* Exactly the same as TimeSequenceStepper, but fails at predetermined
* timesteps.
*/
class TimeSequenceStepperFailTest : public TimeSequenceStepper
{
public:
static InputParameters validParams();
TimeSequenceStepperFailTest(const InputParameters & parameters);
virtual void step() override;
protected:
/// stores a copy of the original sequence of time points, is not updated due to failures.
std::vector<Real> _original_time_sequence;
};