LCOV - code coverage report
Current view: top level - src/actions - AddDefaultSubchannelPartitioner.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #31706 (f8ed4a) with base bb0a08 Lines: 16 17 94.1 %
Date: 2025-11-03 17:29:21 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             : #include "AddDefaultSubchannelPartitioner.h"
      11             : #include "MooseMesh.h"
      12             : #include "Factory.h"
      13             : #include "MoosePartitioner.h"
      14             : 
      15             : registerMooseAction("SubChannelApp", AddDefaultSubchannelPartitioner, "add_partitioner");
      16             : 
      17             : InputParameters
      18         557 : AddDefaultSubchannelPartitioner::validParams()
      19             : {
      20         557 :   InputParameters params = Action::validParams();
      21         557 :   params.addClassDescription(
      22             :       "Adds a default partitioner to subchannel simulation. Currently, a SingleRankPartitioner");
      23         557 :   return params;
      24           0 : }
      25             : 
      26         557 : AddDefaultSubchannelPartitioner::AddDefaultSubchannelPartitioner(const InputParameters & params)
      27         557 :   : Action(params)
      28             : {
      29         557 : }
      30             : 
      31             : void
      32         557 : AddDefaultSubchannelPartitioner::act()
      33             : {
      34         557 :   if (_current_task == "add_partitioner")
      35             :   {
      36         557 :     _mesh->setIsCustomPartitionerRequested(true);
      37         557 :     auto pars = _factory.getValidParams("SingleRankPartitioner");
      38         557 :     pars.set<MooseMesh *>("mesh") = _mesh.get();
      39             :     std::shared_ptr<MoosePartitioner> mp =
      40        1114 :         _factory.create<MoosePartitioner>("SingleRankPartitioner", "SCM_partitioner", pars);
      41         557 :     _mesh->setCustomPartitioner(mp.get());
      42         557 :   }
      43         557 : }

Generated by: LCOV version 1.14