https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
15registerMooseAction("SubChannelApp", AddDefaultSubchannelPartitioner, "add_partitioner");
16
19{
22 "Adds a default partitioner to subchannel simulation. Currently, a SingleRankPartitioner");
23 return params;
24}
25
30
31void
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}
registerMooseAction("SubChannelApp", AddDefaultSubchannelPartitioner, "add_partitioner")
std::shared_ptr< MooseMesh > & _mesh
static InputParameters validParams()
const std::string & _current_task
Adds default partitioner to the mesh.
AddDefaultSubchannelPartitioner(const InputParameters &params)
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
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
Factory & _factory