https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PetscExternalPartitioner.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
12// MOOSE includes
13#include "MooseEnum.h"
14#include "MoosePartitioner.h"
15
16class MooseMesh;
17
23{
24public:
26
28
29 virtual std::unique_ptr<Partitioner> clone() const override;
30
31 virtual dof_id_type computeElementWeight(Elem & elm);
32
33 virtual dof_id_type computeSideWeight(Elem & elem, unsigned int side);
34
35 using Partitioner::partition;
36
37 virtual void partition(MeshBase & mesh, const unsigned int n) override;
38
40
42
43 static void partitionGraph(const Parallel::Communicator & comm,
44 const std::vector<std::vector<dof_id_type>> & graph,
45 const std::vector<dof_id_type> & elem_weights,
46 const std::vector<dof_id_type> & side_weights,
47 const dof_id_type num_parts,
48 const dof_id_type num_parts_per_compute_node,
49 const std::string & part_package,
50 std::vector<dof_id_type> & partition);
51
55 virtual void initialize(MeshBase & /* mesh */) {}
56
57protected:
58 virtual void _do_partition(MeshBase & mesh, const unsigned int n) override;
59
60private:
61 /*
62 * Do a partition before we call the partitioner
63 * It should be used if the mesh is unpartitioned or the number of parts
64 * does not equal to the number of processors
65 */
66 void preLinearPartition(MeshBase & mesh);
67
68 std::string _part_package;
71 processor_id_type _num_parts_per_compute_node;
72};
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
Base class for MOOSE partitioner.
Partitions a mesh using external petsc partitioners such as parmetis, ptscotch, chaco,...
void preLinearPartition(MeshBase &mesh)
virtual void initialize(MeshBase &)
Called immediately before partitioning.
virtual void _do_partition(MeshBase &mesh, const unsigned int n) override
virtual void partition(MeshBase &mesh, const unsigned int n) override
virtual dof_id_type computeElementWeight(Elem &elm)
static void partitionGraph(const Parallel::Communicator &comm, const std::vector< std::vector< dof_id_type > > &graph, const std::vector< dof_id_type > &elem_weights, const std::vector< dof_id_type > &side_weights, const dof_id_type num_parts, const dof_id_type num_parts_per_compute_node, const std::string &part_package, std::vector< dof_id_type > &partition)
processor_id_type _num_parts_per_compute_node
static InputParameters validParams()
virtual std::unique_ptr< Partitioner > clone() const override
virtual dof_id_type computeSideWeight(Elem &elem, unsigned int side)
const Parallel::Communicator & comm() const
MeshBase & mesh