Reference documentation for deal.II version Git e7a01acd5c 2022-01-26 14:48:47 -0700
\(\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\}}\)
repartitioning_policy_tools.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2021 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_distributed_repartitioning_policy_tools_h
17 #define dealii_distributed_repartitioning_policy_tools_h
18 
19 #include <deal.II/grid/tria.h>
20 
22 
24 
40 {
48  template <int dim, int spacedim = dim>
49  class Base : public Subscriptor
50  {
51  public:
57  partition(const Triangulation<dim, spacedim> &tria_coarse_in) const = 0;
58 
62  virtual ~Base() = default;
63  };
64 
70  template <int dim, int spacedim = dim>
71  class DefaultPolicy : public Base<dim, spacedim>
72  {
73  public:
80  DefaultPolicy(const bool tighten = false);
81 
83  partition(
84  const Triangulation<dim, spacedim> &tria_coarse_in) const override;
85 
86  private:
87  const bool tighten;
88  };
89 
95  template <int dim, int spacedim = dim>
96  class FirstChildPolicy : public Base<dim, spacedim>
97  {
98  public:
103 
105  partition(
106  const Triangulation<dim, spacedim> &tria_coarse_in) const override;
107 
108  private:
112  const unsigned int n_coarse_cells;
113 
117  const unsigned int n_global_levels;
118 
125  };
126 
133  template <int dim, int spacedim = dim>
134  class MinimalGranularityPolicy : public Base<dim, spacedim>
135  {
136  public:
140  MinimalGranularityPolicy(const unsigned int n_min_cells);
141 
143  partition(const Triangulation<dim, spacedim> &tria_in) const override;
144 
145  private:
149  const unsigned int n_min_cells;
150  };
151 
156  template <int dim, int spacedim = dim>
157  class CellWeightPolicy : public Base<dim, spacedim>
158  {
159  public:
164  const std::function<unsigned int(
167  &weighting_function);
168 
170  partition(const Triangulation<dim, spacedim> &tria_in) const override;
171 
172  private:
176  const std::function<
177  unsigned int(const typename Triangulation<dim, spacedim>::cell_iterator &,
180  };
181 
182 } // namespace RepartitioningPolicyTools
183 
185 
186 #endif
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:407
const std::function< unsigned int(const typename Triangulation< dim, spacedim >::cell_iterator &, const typename Triangulation< dim, spacedim >::CellStatus)> weighting_function
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:406
virtual LinearAlgebra::distributed::Vector< double > partition(const Triangulation< dim, spacedim > &tria_coarse_in) const =0