From 663db3b77e89b22be05dc9211789118094b90a3d Mon Sep 17 00:00:00 2001 From: Guillaume Giudicelli Date: Wed, 27 Nov 2024 10:48:16 -0700 Subject: [PATCH] Add support for multi-NL and multi-system in Transient executioner refs #29158 --- .../executioners/MultiSystemSolveObject.h | 2 +- framework/src/executioners/Transient.C | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/framework/include/executioners/MultiSystemSolveObject.h b/framework/include/executioners/MultiSystemSolveObject.h index 6118b034c448..d530d00ff5e8 100644 --- a/framework/include/executioners/MultiSystemSolveObject.h +++ b/framework/include/executioners/MultiSystemSolveObject.h @@ -27,7 +27,7 @@ class MultiSystemSolveObject : public SolveObject * Returns a reference to the vector of solver systems that this object is * supposed to solve */ - const std::vector & systemsToSolve() { return _systems; } + const std::vector & systemsToSolve() const { return _systems; } protected: /// Vector of pointers to the systems diff --git a/framework/src/executioners/Transient.C b/framework/src/executioners/Transient.C index f8c4db327883..9c280b67bbae 100644 --- a/framework/src/executioners/Transient.C +++ b/framework/src/executioners/Transient.C @@ -37,9 +37,18 @@ Real Transient::relativeSolutionDifferenceNorm() { // TODO: add multi-system support - const NumericVector & current_solution = - _check_aux ? _aux.solution() : *_nl.currentSolution(); - const NumericVector & old_solution = _check_aux ? _aux.solutionOld() : _nl.solutionOld(); + if (_check_aux) + return _aux.solution().l2_norm_diff(_aux.solutionOld()) / _aux.solution().l2_norm(); +} - return current_solution.l2_norm_diff(old_solution) / current_solution.l2_norm(); +std::vector +Transient::getTimeIntegrators() const +{ + std::vector tis; + tis.reserve(_feproblem_solve.systemsToSolve().size()); + // Get all time integrators from the systems in the FEProblemSolve + for (const auto sys : _feproblem_solve.systemsToSolve()) + for (const auto & ti : sys->getTimeIntegrators()) + tis.push_back(ti.get()); + return tis; }