https://mooseframework.inl.gov
AddDefaultSubchannelPartitioner.C
Go to the documentation of this file.
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 
11 #include "MooseMesh.h"
12 #include "Factory.h"
13 #include "MoosePartitioner.h"
14 
15 registerMooseAction("SubChannelApp", AddDefaultSubchannelPartitioner, "add_partitioner");
16 
19 {
21  params.addClassDescription(
22  "Adds a default partitioner to subchannel simulation. Currently, a SingleRankPartitioner");
23  return params;
24 }
25 
27  : Action(params)
28 {
29 }
30 
31 void
33 {
34  if (_current_task == "add_partitioner")
35  {
36  _mesh->setIsCustomPartitionerRequested(true);
37  auto pars = _factory.getValidParams("SingleRankPartitioner");
38  pars.set<MooseMesh *>("mesh") = _mesh.get();
39  std::shared_ptr<MoosePartitioner> mp =
40  _factory.create<MoosePartitioner>("SingleRankPartitioner", "SCM_partitioner", pars);
41  _mesh->setCustomPartitioner(mp.get());
42  }
43 }
Factory & _factory
T & set(const std::string &name, bool quiet_mode=false)
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
InputParameters getValidParams(const std::string &name) const
Adds default partitioner to the mesh.
static InputParameters validParams()
const std::string & _current_task
registerMooseAction("SubChannelApp", AddDefaultSubchannelPartitioner, "add_partitioner")
std::shared_ptr< MooseMesh > & _mesh
void addClassDescription(const std::string &doc_string)
AddDefaultSubchannelPartitioner(const InputParameters &params)