https://mooseframework.inl.gov
BlockWeightedPartitioner.h
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 
10 #pragma once
11 
13 
21 {
22 public:
24 
26 
27  virtual std::unique_ptr<Partitioner> clone() const override;
28 
29  virtual dof_id_type computeElementWeight(Elem & elm) override;
30 
34  void initialize(MeshBase & mesh) override;
35 
36 private:
38  const std::vector<SubdomainName> & _blocks;
39  // Block weights
40  const std::vector<dof_id_type> & _weights;
41 
43  std::unordered_map<SubdomainID, dof_id_type> _blocks_to_weights;
44 };
std::unordered_map< SubdomainID, dof_id_type > _blocks_to_weights
A map from subdomain to weight.
const std::vector< dof_id_type > & _weights
const std::vector< SubdomainName > & _blocks
Vector the block names supplied by the user via the input file.
MeshBase & mesh
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual std::unique_ptr< Partitioner > clone() const override
void initialize(MeshBase &mesh) override
Fills _blocks_to_weights before performing the partition.
BlockWeightedPartitioner(const InputParameters &params)
Partition a mesh by weighting blocks.
virtual dof_id_type computeElementWeight(Elem &elm) override
static InputParameters validParams()
Partitions a mesh using external petsc partitioners such as parmetis, ptscotch, chaco, party, etc.
uint8_t dof_id_type