LCOV - code coverage report
Current view: top level - src/interfaces - SolutionInvalidInterface.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 13 13 100.0 %
Date: 2025-07-17 01:28:37 Functions: 4 4 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             : // MOOSE includes
      11             : #include "SolutionInvalidInterface.h"
      12             : #include "MooseObject.h"
      13             : #include "MooseApp.h"
      14             : #include "FEProblemBase.h"
      15             : #include "SolutionInvalidityRegistry.h"
      16             : 
      17       37706 : SolutionInvalidInterface::SolutionInvalidInterface(MooseObject * const moose_object)
      18       37706 :   : _si_moose_object(*moose_object),
      19       37706 :     _si_problem(
      20       37706 :         *_si_moose_object.parameters().getCheckedPointerParam<FEProblemBase *>("_fe_problem_base"))
      21             : {
      22       37706 : }
      23             : 
      24             : /// Set solution invalid mark for the given solution ID
      25             : template <bool warning>
      26             : void
      27       94744 : SolutionInvalidInterface::flagInvalidSolutionInternal(
      28             :     const InvalidSolutionID invalid_solution_id) const
      29             : {
      30             :   mooseAssert(
      31             :       warning == moose::internal::getSolutionInvalidityRegistry().item(invalid_solution_id).warning,
      32             :       "Inconsistent warning flag");
      33       94744 :   auto & solution_invalidity = _si_moose_object.getMooseApp().solutionInvalidity();
      34             :   if constexpr (!warning)
      35       90184 :     if (_si_problem.immediatelyPrintInvalidSolution())
      36         672 :       solution_invalidity.printDebug(invalid_solution_id);
      37       94744 :   return solution_invalidity.flagInvalidSolutionInternal(invalid_solution_id);
      38             : }
      39             : 
      40             : InvalidSolutionID
      41         294 : SolutionInvalidInterface::registerInvalidSolutionInternal(const std::string & message,
      42             :                                                           const bool warning) const
      43             : {
      44         588 :   return moose::internal::getSolutionInvalidityRegistry().registerInvalidity(
      45         588 :       _si_moose_object.type(), message, warning);
      46             : }
      47             : 
      48             : template void SolutionInvalidInterface::flagInvalidSolutionInternal<true>(
      49             :     const InvalidSolutionID invalid_solution_id) const;
      50             : template void SolutionInvalidInterface::flagInvalidSolutionInternal<false>(
      51             :     const InvalidSolutionID invalid_solution_id) const;

Generated by: LCOV version 1.14