LCOV - code coverage report
Current view: top level - src/actions - SetupPreconditionerAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 13 14 92.9 %
Date: 2025-08-08 20:01:16 Functions: 3 3 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 "SetupPreconditionerAction.h"
      12             : #include "Factory.h"
      13             : #include "PetscSupport.h"
      14             : #include "MoosePreconditioner.h"
      15             : #include "FEProblem.h"
      16             : #include "CreateExecutionerAction.h"
      17             : #include "NonlinearSystemBase.h"
      18             : 
      19             : unsigned int SetupPreconditionerAction::_count = 0;
      20             : 
      21             : registerMooseAction("MooseApp", SetupPreconditionerAction, "add_preconditioning");
      22             : 
      23             : InputParameters
      24       14665 : SetupPreconditionerAction::validParams()
      25             : {
      26       14665 :   InputParameters params = MooseObjectAction::validParams();
      27       14665 :   params.addClassDescription("Add a Preconditioner object to the simulation.");
      28       14665 :   return params;
      29           0 : }
      30             : 
      31       14462 : SetupPreconditionerAction::SetupPreconditionerAction(const InputParameters & params)
      32       14462 :   : MooseObjectAction(params)
      33             : {
      34       14462 : }
      35             : 
      36             : void
      37       14426 : SetupPreconditionerAction::act()
      38             : {
      39       14426 :   if (_problem.get() != NULL)
      40             :   {
      41             :     // build the preconditioner
      42             :     std::shared_ptr<MoosePreconditioner> pc =
      43       14426 :         _factory.create<MoosePreconditioner>(_type, _name, _moose_object_pars);
      44             : 
      45       14426 :     pc->_nl.setPreconditioner(pc);
      46       14419 :   }
      47       14419 : }

Generated by: LCOV version 1.14