LCOV - code coverage report
Current view: top level - src/actions - SetupPreconditionerAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 13 14 92.9 %
Date: 2025-07-17 01:28:37 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       13731 : SetupPreconditionerAction::validParams()
      25             : {
      26       13731 :   InputParameters params = MooseObjectAction::validParams();
      27       13731 :   params.addClassDescription("Add a Preconditioner object to the simulation.");
      28       13731 :   return params;
      29           0 : }
      30             : 
      31       13528 : SetupPreconditionerAction::SetupPreconditionerAction(const InputParameters & params)
      32       13528 :   : MooseObjectAction(params)
      33             : {
      34       13528 : }
      35             : 
      36             : void
      37       13492 : SetupPreconditionerAction::act()
      38             : {
      39       13492 :   if (_problem.get() != NULL)
      40             :   {
      41             :     // build the preconditioner
      42             :     std::shared_ptr<MoosePreconditioner> pc =
      43       13492 :         _factory.create<MoosePreconditioner>(_type, _name, _moose_object_pars);
      44             : 
      45       13492 :     pc->_nl.setPreconditioner(pc);
      46       13485 :   }
      47       13485 : }

Generated by: LCOV version 1.14