Skip to content

Commit

Permalink
attempt removing the new legacy flag on fixed point execute_on in moo…
Browse files Browse the repository at this point in the history
…se test idaholab#28930
  • Loading branch information
YaqiWang committed Oct 25, 2024
1 parent 6c132b5 commit 214f82f
Show file tree
Hide file tree
Showing 85 changed files with 187 additions and 144 deletions.
3 changes: 3 additions & 0 deletions framework/include/executioners/Executioner.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ class Executioner : public MooseObject,
virtual PostprocessorValue & addAttributeReporter(const std::string & name,
Real initial_value = 0);

/// Flag to indicate timestep_begin/end objects are to be executed within a fixed point iteration
const bool _legacy_execute_on;

FEProblemBase & _fe_problem;

MooseEnum _iteration_method;
Expand Down
14 changes: 14 additions & 0 deletions framework/src/executioners/Eigenvalue.C
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@ Eigenvalue::execute()
#endif // LIBMESH_ENABLE_AMR
_eigen_problem.timestepSetup();

if (!_legacy_execute_on)
{
_eigen_problem.execute(EXEC_TIMESTEP_BEGIN);
_time = _time_step;
_eigen_problem.outputStep(EXEC_TIMESTEP_BEGIN);
_time = _system_time;
}

_last_solve_converged = _fixed_point_solve->solve();
if (!lastSolveConverged())
{
Expand All @@ -270,6 +278,12 @@ Eigenvalue::execute()
_eigen_problem.computeIndicators();
_eigen_problem.computeMarkers();
}

if (!_legacy_execute_on)
{
_eigen_problem.onTimestepEnd();
_eigen_problem.execute(EXEC_TIMESTEP_END);
}
// need to keep _time in sync with _time_step to get correct output
_time = _time_step;
_eigen_problem.outputStep(EXEC_TIMESTEP_END);
Expand Down
2 changes: 2 additions & 0 deletions framework/src/executioners/Executioner.C
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Executioner::Executioner(const InputParameters & parameters)
PostprocessorInterface(this),
Restartable(this, "Executioners"),
PerfGraphInterface(this),
_legacy_execute_on(_app.parameters().get<bool>("use_legacy_fixed_point_execute_on")),
_fe_problem(*getCheckedPointerParam<FEProblemBase *>(
"_fe_problem_base", "This might happen if you don't have a mesh")),
_iteration_method(getParam<MooseEnum>("fixed_point_algorithm")),
Expand Down Expand Up @@ -91,6 +92,7 @@ Executioner::Executioner(const InputParameters & parameters, bool)
PostprocessorInterface(this),
Restartable(this, "Executioners"),
PerfGraphInterface(this),
_legacy_execute_on(_app.parameters().get<bool>("use_legacy_fixed_point_execute_on")),
_fe_problem(*getCheckedPointerParam<FEProblemBase *>(
"_fe_problem_base", "This might happen if you don't have a mesh")),
_iteration_method(getParam<MooseEnum>("fixed_point_algorithm")),
Expand Down
13 changes: 13 additions & 0 deletions framework/src/executioners/Steady.C
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ Steady::execute()
#endif // LIBMESH_ENABLE_AMR
_problem.timestepSetup();

if (!_legacy_execute_on)
{
_problem.execute(EXEC_TIMESTEP_BEGIN);
_time = _time_step;
_problem.outputStep(EXEC_TIMESTEP_BEGIN);
_time = _system_time;
}

_last_solve_converged = _fixed_point_solve->solve();

if (!lastSolveConverged())
Expand All @@ -91,6 +99,11 @@ Steady::execute()
_problem.computeIndicators();
_problem.computeMarkers();

if (!_legacy_execute_on)
{
_problem.onTimestepEnd();
_problem.execute(EXEC_TIMESTEP_END);
}
// need to keep _time in sync with _time_step to get correct output
_time = _time_step;
_problem.outputStep(EXEC_TIMESTEP_END);
Expand Down
11 changes: 11 additions & 0 deletions framework/src/executioners/Transient.C
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ Transient::takeStep(Real input_dt)
_problem.timestepSetup();

_problem.onTimestepBegin();
if (!_legacy_execute_on)
{
_problem.execute(EXEC_TIMESTEP_BEGIN);
_problem.outputStep(EXEC_TIMESTEP_BEGIN);
}

_time_stepper->step();
_xfem_repeat_step = _fixed_point_solve->XFEMRepeatStep();
Expand All @@ -424,6 +429,12 @@ Transient::takeStep(Real input_dt)
return;
}

if (!_legacy_execute_on)
{
_problem.onTimestepEnd();
_problem.execute(EXEC_TIMESTEP_END);
}

if (!(_problem.haveXFEM() && _fixed_point_solve->XFEMRepeatStep()))
{
if (lastSolveConverged())
Expand Down
2 changes: 1 addition & 1 deletion framework/src/multiapps/MultiApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ MultiApp::validParams()
params.addPrivateParam<MPI_Comm>("_mpi_comm");

// Set the default execution time
params.set<ExecFlagEnum>("execute_on", true) = EXEC_TIMESTEP_BEGIN; //FixedPointSolve::EXEC_FIXEDPOINT_BEGIN;
params.set<ExecFlagEnum>("execute_on", true) = FixedPointSolve::EXEC_FIXEDPOINT_BEGIN;

params.addParam<processor_id_type>("max_procs_per_app",
std::numeric_limits<processor_id_type>::max(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
[sub]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_end
execute_on = fixedpoint_end
positions = '1 1 0'
input_files = application_block_sub.i
output_in_position = true
Expand Down
2 changes: 1 addition & 1 deletion test/tests/multiapps/catch_up/parent.i
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
positions = '0 0 0 0.5 0.5 0'
input_files = 'sub.i failing_sub.i'
app_type = MooseTestApp
execute_on = 'timestep_end'
execute_on = 'fixedpoint_end'
max_catch_up_steps = 100
max_failures = 100
catch_up = true
Expand Down
4 changes: 2 additions & 2 deletions test/tests/multiapps/grid-sequencing/fine.i
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
[coarse]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_begin
execute_on = fixedpoint_begin
positions = '0 0 0'
input_files = coarse.i
[]
Expand All @@ -70,6 +70,6 @@
from_multi_app = coarse
source_variable = u
variable = u
execute_on = timestep_begin
execute_on = fixedpoint_begin
[]
[]
10 changes: 5 additions & 5 deletions test/tests/multiapps/grid-sequencing/vi-coarse.i
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ num_steps = 2
exodus = true
[csv]
type = CSV
execute_on = 'nonlinear timestep_end'
execute_on = 'nonlinear fixedpoint_end'
[]
[dof]
type = DOFMap
Expand All @@ -113,14 +113,14 @@ num_steps = 2
[upper_violations]
type = GreaterThanLessThanPostprocessor
variable = u
execute_on = 'nonlinear timestep_end'
execute_on = 'nonlinear fixedpoint_end'
value = '${fparse 10+1e-8}'
comparator = 'greater'
[]
[lower_violations]
type = GreaterThanLessThanPostprocessor
variable = u
execute_on = 'nonlinear timestep_end'
execute_on = 'nonlinear fixedpoint_end'
value = -1e-8
comparator = 'less'
[]
Expand All @@ -137,7 +137,7 @@ num_steps = 2
[coarser]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_begin
execute_on = fixedpoint_begin
positions = '0 0 0'
input_files = vi-coarser.i
[]
Expand All @@ -149,6 +149,6 @@ num_steps = 2
from_multi_app = coarser
source_variable = u
variable = u
execute_on = timestep_begin
execute_on = fixedpoint_begin
[]
[]
6 changes: 3 additions & 3 deletions test/tests/multiapps/grid-sequencing/vi-coarser.i
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ num_steps=2
exodus = true
[csv]
type = CSV
execute_on = 'nonlinear timestep_end'
execute_on = 'nonlinear fixedpoint_end'
[]
[dof]
type = DOFMap
Expand All @@ -112,14 +112,14 @@ num_steps=2
[upper_violations]
type = GreaterThanLessThanPostprocessor
variable = u
execute_on = 'nonlinear timestep_end'
execute_on = 'nonlinear fixedpoint_end'
value = ${fparse 10+1e-8}
comparator = 'greater'
[]
[lower_violations]
type = GreaterThanLessThanPostprocessor
variable = u
execute_on = 'nonlinear timestep_end'
execute_on = 'nonlinear fixedpoint_end'
value = -1e-8
comparator = 'less'
[]
Expand Down
6 changes: 3 additions & 3 deletions test/tests/multiapps/grid-sequencing/vi-fine-alone.i
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ num_steps=2
exodus = true
[csv]
type = CSV
execute_on = 'nonlinear timestep_end'
execute_on = 'nonlinear fixedpoint_end'
[]
[dof]
type = DOFMap
Expand All @@ -112,14 +112,14 @@ num_steps=2
[upper_violations]
type = GreaterThanLessThanPostprocessor
variable = u
execute_on = 'nonlinear timestep_end'
execute_on = 'nonlinear fixedpoint_end'
value = ${fparse 10+1e-8}
comparator = 'greater'
[]
[lower_violations]
type = GreaterThanLessThanPostprocessor
variable = u
execute_on = 'nonlinear timestep_end'
execute_on = 'nonlinear fixedpoint_end'
value = -1e-8
comparator = 'less'
[]
Expand Down
10 changes: 5 additions & 5 deletions test/tests/multiapps/grid-sequencing/vi-fine.i
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ num_steps = 2
exodus = true
[csv]
type = CSV
execute_on = 'nonlinear timestep_end'
execute_on = 'nonlinear fixedpoint_end'
[]
[dof]
type = DOFMap
Expand All @@ -113,14 +113,14 @@ num_steps = 2
[upper_violations]
type = GreaterThanLessThanPostprocessor
variable = u
execute_on = 'nonlinear timestep_end'
execute_on = 'nonlinear fixedpoint_end'
value = '${fparse 10+1e-8}'
comparator = 'greater'
[]
[lower_violations]
type = GreaterThanLessThanPostprocessor
variable = u
execute_on = 'nonlinear timestep_end'
execute_on = 'nonlinear fixedpoint_end'
value = -1e-8
comparator = 'less'
[]
Expand All @@ -137,7 +137,7 @@ num_steps = 2
[coarse]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_begin
execute_on = fixedpoint_begin
positions = '0 0 0'
input_files = vi-coarse.i
[]
Expand All @@ -149,6 +149,6 @@ num_steps = 2
from_multi_app = coarse
source_variable = u
variable = u
execute_on = timestep_begin
execute_on = fixedpoint_begin
[]
[]
2 changes: 1 addition & 1 deletion test/tests/multiapps/initial_intactive/parent.i
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
disable_objects = 'MultiApps::sub'
start_time = 0
end_time = 1.3
execute_on = 'timestep_begin'
execute_on = 'fixedpoint_begin'
reverse_on_false = true
[../]
[]
2 changes: 1 addition & 1 deletion test/tests/multiapps/initial_transfer/sub.i
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
value = receiver
scaling_factor = 2
# Note: during subapp initial setup, parent postprocessor has not been transferred
execute_on = 'initial timestep_end'
execute_on = 'initial fixedpoint_end'
[]
[receiver]
type = Receiver
Expand Down
2 changes: 1 addition & 1 deletion test/tests/multiapps/loose_couple_time_adapt/begin.i
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
[./dummy]
type = TransientMultiApp
input_files = adaptiveDT.i
execute_on = timestep_begin
execute_on = fixedpoint_begin
[../]
[]

Expand Down
2 changes: 1 addition & 1 deletion test/tests/multiapps/loose_couple_time_adapt/end.i
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
[./dummy]
type = TransientMultiApp
input_files = adaptiveDT.i
execute_on = timestep_end
execute_on = fixedpoint_end
[../]
[]

Expand Down
2 changes: 1 addition & 1 deletion test/tests/multiapps/max_procs_per_app/parent.i
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
[./sub]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_end
execute_on = fixedpoint_end
positions = '0 0 0'
input_files = sub.i
max_procs_per_app = 1
Expand Down
2 changes: 1 addition & 1 deletion test/tests/multiapps/move/multilevel_parent.i
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
[./sub]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_end
execute_on = fixedpoint_end
positions = '1 1 0'
input_files = multilevel_sub.i
output_in_position = true
Expand Down
2 changes: 1 addition & 1 deletion test/tests/multiapps/move/multilevel_sub.i
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
[./sub]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_end
execute_on = fixedpoint_end
positions = '1 1 0'
input_files = sub.i
output_in_position = true
Expand Down
2 changes: 1 addition & 1 deletion test/tests/multiapps/move/parent.i
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
[./sub]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_end
execute_on = fixedpoint_end
positions = '1 1 0'
input_files = sub.i
output_in_position = true
Expand Down
2 changes: 1 addition & 1 deletion test/tests/multiapps/move_and_reset/multilevel_parent.i
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
[./sub]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_end
execute_on = fixedpoint_end
positions = '1 1 0'
input_files = multilevel_sub.i
output_in_position = true
Expand Down
2 changes: 1 addition & 1 deletion test/tests/multiapps/move_and_reset/multilevel_sub.i
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
[./sub]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_end
execute_on = fixedpoint_end
positions = '1 1 0'
input_files = multilevel_sub_sub.i
output_in_position = true
Expand Down
2 changes: 1 addition & 1 deletion test/tests/multiapps/move_and_reset/multilevel_sub_sub.i
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
[]

[Outputs]
execute_on = 'timestep_end'
execute_on = 'fixedpoint_end'
exodus = true
[]
2 changes: 1 addition & 1 deletion test/tests/multiapps/move_and_reset/parent.i
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
[./sub]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_end
execute_on = fixedpoint_end
positions = '1 1 0'
input_files = sub.i
reset_apps = 0
Expand Down
Loading

0 comments on commit 214f82f

Please sign in to comment.