www.mooseframework.org
PetscExternalPartitioner.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
12 // MOOSE includes
13 #include "MooseEnum.h"
14 #include "MoosePartitioner.h"
15 
17 class MooseMesh;
18 
19 template <>
21 
26 {
27 public:
29 
30  virtual std::unique_ptr<Partitioner> clone() const override;
31 
32  virtual dof_id_type computeElementWeight(Elem & elm);
33 
34  virtual dof_id_type computeSideWeight(Elem & elem, unsigned int side);
35 
36  using Partitioner::partition;
37 
38  virtual void partition(MeshBase & mesh, const unsigned int n) override;
39 
40 protected:
41  virtual void _do_partition(MeshBase & mesh, const unsigned int n) override;
42 
43 private:
44  /*
45  * Do a partition before we call the partitioner
46  * It should be used if the mesh is unpartitioned or the number of parts
47  * does not equal to the number of processors
48  */
49  void preLinearPartition(MeshBase & mesh);
50 
51  std::string _part_package;
54 };
55 
InputParameters validParams< PetscExternalPartitioner >()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void partition(MeshBase &mesh, const unsigned int n) override
virtual dof_id_type computeElementWeight(Elem &elm)
virtual dof_id_type computeSideWeight(Elem &elem, unsigned int side)
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
void preLinearPartition(MeshBase &mesh)
PetscInt n
Base class for MOOSE partitioner.
PetscExternalPartitioner(const InputParameters &params)
Partitions a mesh using a regular grid.
virtual void _do_partition(MeshBase &mesh, const unsigned int n) override
virtual std::unique_ptr< Partitioner > clone() const override