LCOV - code coverage report
Current view: top level - src/executioners - Transient.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 26 29 89.7 %
Date: 2026-05-29 20:35:17 Functions: 5 5 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #include "Transient.h"
      11             : 
      12             : // MOOSE includes
      13             : #include "FixedPointSolve.h"
      14             : #include "AuxiliarySystem.h"
      15             : #include "SolverSystem.h"
      16             : 
      17             : registerMooseObject("MooseApp", Transient);
      18             : 
      19             : InputParameters
      20       65690 : Transient::validParams()
      21             : {
      22       65690 :   InputParameters params = TransientBase::validParams();
      23       65690 :   params.addClassDescription("Executioner for time varying simulations.");
      24             : 
      25       65690 :   params += FEProblemSolve::validParams();
      26             : 
      27       65690 :   return params;
      28           0 : }
      29             : 
      30       29728 : Transient::Transient(const InputParameters & parameters)
      31       29728 :   : TransientBase(parameters), _feproblem_solve(*this)
      32             : {
      33       29722 :   _fixed_point_solve->setInnerSolve(_feproblem_solve);
      34       29722 : }
      35             : 
      36             : void
      37       29133 : Transient::init()
      38             : {
      39       29133 :   TransientBase::init();
      40             : 
      41       28948 :   _feproblem_solve.initialSetup();
      42       28945 : }
      43             : 
      44             : Real
      45       12349 : Transient::relativeSolutionDifferenceNorm(bool check_aux) const
      46             : {
      47       12349 :   if (check_aux)
      48           0 :     return _aux.solution().l2_norm_diff(_aux.solutionOld()) / _aux.solution().l2_norm();
      49             :   else
      50             :   {
      51             :     // Default criterion for now until we add a "steady-state-convergence-object" option
      52       12349 :     Real residual = 0;
      53       27823 :     for (const auto sys : _feproblem_solve.systemsToSolve())
      54       15474 :       residual +=
      55       15474 :           std::pow(sys->solution().l2_norm_diff(sys->solutionOld()) / sys->solution().l2_norm(), 2);
      56       12349 :     return std::sqrt(residual);
      57             :   }
      58             : }
      59             : 
      60             : std::set<TimeIntegrator *>
      61      424803 : Transient::getTimeIntegrators() const
      62             : {
      63             :   // We use a set because time integrators were added to every system, and we want a unique
      64      424803 :   std::set<TimeIntegrator *> tis;
      65             :   // Get all time integrators from the systems in the FEProblemSolve
      66      856120 :   for (const auto sys : _feproblem_solve.systemsToSolve())
      67      863383 :     for (const auto & ti : sys->getTimeIntegrators())
      68      432066 :       tis.insert(ti.get());
      69      424803 :   return tis;
      70           0 : }

Generated by: LCOV version 1.14