Skip to content

Commit

Permalink
Add support for multi-NL and multi-system in Transient executioner
Browse files Browse the repository at this point in the history
  • Loading branch information
GiudGiud committed Nov 27, 2024
1 parent 1cad2a3 commit 663db3b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion framework/include/executioners/MultiSystemSolveObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<SolverSystem *> & systemsToSolve() { return _systems; }
const std::vector<SolverSystem *> & systemsToSolve() const { return _systems; }

protected:
/// Vector of pointers to the systems
Expand Down
17 changes: 13 additions & 4 deletions framework/src/executioners/Transient.C
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,18 @@ Real
Transient::relativeSolutionDifferenceNorm()
{
// TODO: add multi-system support
const NumericVector<Number> & current_solution =
_check_aux ? _aux.solution() : *_nl.currentSolution();
const NumericVector<Number> & 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<TimeIntegrator *>
Transient::getTimeIntegrators() const
{
std::vector<TimeIntegrator *> 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;
}

0 comments on commit 663db3b

Please sign in to comment.