Reference documentation for deal.II version 9.6.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
repartitioning_policy_tools.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2021 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_distributed_repartitioning_policy_tools_h
16#define dealii_distributed_repartitioning_policy_tools_h
17
18#include <deal.II/grid/tria.h>
19
21
23
39{
47 template <int dim, int spacedim = dim>
48 class Base : public Subscriptor
49 {
50 public:
56 partition(const Triangulation<dim, spacedim> &tria_coarse_in) const = 0;
57
61 virtual ~Base() = default;
62 };
63
69 template <int dim, int spacedim = dim>
70 class DefaultPolicy : public Base<dim, spacedim>
71 {
72 public:
79 DefaultPolicy(const bool tighten = false);
80
83 const Triangulation<dim, spacedim> &tria_coarse_in) const override;
84
85 private:
86 const bool tighten;
87 };
88
94 template <int dim, int spacedim = dim>
95 class FirstChildPolicy : public Base<dim, spacedim>
96 {
97 public:
102
104 partition(
105 const Triangulation<dim, spacedim> &tria_coarse_in) const override;
106
107 private:
111 const unsigned int n_coarse_cells;
112
116 const unsigned int n_global_levels;
117
124 };
125
132 template <int dim, int spacedim = dim>
133 class MinimalGranularityPolicy : public Base<dim, spacedim>
134 {
135 public:
139 MinimalGranularityPolicy(const unsigned int n_min_cells);
140
142 partition(const Triangulation<dim, spacedim> &tria_in) const override;
143
144 private:
148 const unsigned int n_min_cells;
149 };
150
155 template <int dim, int spacedim = dim>
156 class CellWeightPolicy : public Base<dim, spacedim>
157 {
158 public:
163 const std::function<unsigned int(
166
168 partition(const Triangulation<dim, spacedim> &tria_in) const override;
169
170 private:
174 const std::function<
175 unsigned int(const typename Triangulation<dim, spacedim>::cell_iterator &,
176 const CellStatus)>
178 };
179
180} // namespace RepartitioningPolicyTools
181
183
184#endif
CellStatus
Definition cell_status.h:31
virtual LinearAlgebra::distributed::Vector< double > partition(const Triangulation< dim, spacedim > &tria_coarse_in) const =0
virtual LinearAlgebra::distributed::Vector< double > partition(const Triangulation< dim, spacedim > &tria_in) const override
const std::function< unsigned int(const typename Triangulation< dim, spacedim >::cell_iterator &, const CellStatus)> weighting_function
CellWeightPolicy(const std::function< unsigned int(const typename Triangulation< dim, spacedim >::cell_iterator &, const CellStatus)> &weighting_function)
virtual LinearAlgebra::distributed::Vector< double > partition(const Triangulation< dim, spacedim > &tria_coarse_in) const override
virtual LinearAlgebra::distributed::Vector< double > partition(const Triangulation< dim, spacedim > &tria_coarse_in) const override
FirstChildPolicy(const Triangulation< dim, spacedim > &tria_fine)
virtual LinearAlgebra::distributed::Vector< double > partition(const Triangulation< dim, spacedim > &tria_in) const override
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:503
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504