Reference documentation for deal.II version GIT f24ba87524 2022-11-27 03:40:02+00:00
\(\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\}}\)
mg_tools.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2005 - 2022 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_mg_tools_h
17 #define dealii_mg_tools_h
18 
19 #include <deal.II/base/config.h>
20 
21 #include <deal.II/base/index_set.h>
22 
24 #include <deal.II/dofs/dof_tools.h>
25 
26 #include <set>
27 #include <vector>
28 
29 
31 
32 // Forward declarations
33 #ifndef DOXYGEN
34 template <int dim, int spacedim>
35 class DoFHandler;
36 class MGConstrainedDoFs;
37 #endif
38 
51 namespace MGTools
52 {
56  template <int dim, int spacedim>
57  void
59  const DoFHandler<dim, spacedim> &dofs,
60  const unsigned int level,
61  std::vector<unsigned int> & row_lengths,
62  const DoFTools::Coupling flux_couplings = DoFTools::none);
63 
68  template <int dim, int spacedim>
69  void
71  const unsigned int level,
72  std::vector<unsigned int> & row_lengths,
73  const Table<2, DoFTools::Coupling> &couplings,
74  const Table<2, DoFTools::Coupling> &flux_couplings);
75 
88  template <int dim, int spacedim, typename number = double>
89  void
91  const DoFHandler<dim, spacedim> &dof_handler,
92  SparsityPatternBase & sparsity,
93  const unsigned int level,
95  const bool keep_constrained_dofs = true);
96 
105  template <int dim, int spacedim, typename number = double>
106  void
108  const DoFHandler<dim, spacedim> &dof_handler,
109  SparsityPatternBase & sparsity,
110  const unsigned int level,
112  const bool keep_constrained_dofs = true);
113 
114 
121  template <int dim, int spacedim>
122  void
124  SparsityPatternBase & sparsity,
125  const unsigned int level);
135  template <int dim, int spacedim>
136  void
138  SparsityPatternBase & sparsity,
139  const unsigned int level,
140  const Table<2, DoFTools::Coupling> &int_mask,
141  const Table<2, DoFTools::Coupling> &flux_mask);
142 
151  template <int dim, int spacedim>
152  void
154  const DoFHandler<dim, spacedim> & dof_handler,
155  SparsityPatternBase & sparsity,
156  const unsigned int level,
157  const Table<2, DoFTools::Coupling> &flux_mask);
158 
159 
166  template <int dim, int spacedim>
167  void
169  const MGConstrainedDoFs &mg_constrained_dofs,
170  SparsityPatternBase & sparsity,
171  const unsigned int level);
172 
173 
180  template <int dim, int spacedim>
181  void
183  const DoFHandler<dim, spacedim> & dof_handler,
184  std::vector<std::vector<types::global_dof_index>> &dofs_per_block,
185  std::vector<unsigned int> target_block = {});
186 
194  template <int dim, int spacedim>
195  void
197  const DoFHandler<dim, spacedim> & mg_dof,
198  std::vector<std::vector<types::global_dof_index>> &result,
199  const bool only_once = false,
200  std::vector<unsigned int> target_component = {});
201 
221  template <int dim, int spacedim>
222  void
224  const DoFHandler<dim, spacedim> &mg_dof,
225  const std::map<types::boundary_id, const Function<spacedim> *>
226  & function_map,
227  std::vector<std::set<types::global_dof_index>> &boundary_indices,
228  const ComponentMask &component_mask = ComponentMask());
229 
237  template <int dim, int spacedim>
238  void
240  const std::map<types::boundary_id,
241  const Function<spacedim> *> &function_map,
242  std::vector<IndexSet> &boundary_indices,
243  const ComponentMask & component_mask = ComponentMask());
244 
252  template <int dim, int spacedim>
253  void
255  const std::set<types::boundary_id> &boundary_ids,
256  std::vector<IndexSet> & boundary_indices,
257  const ComponentMask &component_mask = ComponentMask());
258 
264  template <int dim, int spacedim>
265  void
267  std::vector<IndexSet> & interface_dofs);
268 
278  template <int dim, int spacedim>
279  unsigned int
281 
292  template <int dim, int spacedim>
293  std::vector<types::global_dof_index>
295 
303  template <int dim, int spacedim>
304  std::vector<types::global_dof_index>
306  const std::vector<std::shared_ptr<const Triangulation<dim, spacedim>>>
307  &trias);
308 
327  template <int dim, int spacedim>
328  double
330 
336  template <int dim, int spacedim>
337  double
339  const std::vector<std::shared_ptr<const Triangulation<dim, spacedim>>>
340  &trias);
341 
349  template <int dim, int spacedim>
350  std::vector<std::pair<types::global_dof_index, types::global_dof_index>>
352 
361  template <int dim, int spacedim>
362  std::vector<std::pair<types::global_dof_index, types::global_dof_index>>
364  const std::vector<std::shared_ptr<const Triangulation<dim, spacedim>>>
365  &trias);
366 
378  template <int dim, int spacedim>
379  double
381 
387  template <int dim, int spacedim>
388  double
390  const std::vector<std::shared_ptr<const Triangulation<dim, spacedim>>>
391  &trias);
392 
393 
394 } // namespace MGTools
395 
399 
400 #endif
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:458
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:459
unsigned int level
Definition: grid_out.cc:4608
std::vector< std::pair< types::global_dof_index, types::global_dof_index > > local_vertical_communication_cost(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1700
void make_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity, const unsigned int level, const AffineConstraints< number > &constraints=AffineConstraints< number >(), const bool keep_constrained_dofs=true)
Definition: mg_tools.cc:576
void make_interface_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, const MGConstrainedDoFs &mg_constrained_dofs, SparsityPatternBase &sparsity, const unsigned int level)
Definition: mg_tools.cc:1014
std::vector< types::global_dof_index > local_workload(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1632
void make_flux_sparsity_pattern_edge(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity, const unsigned int level)
Definition: mg_tools.cc:680
void compute_row_length_vector(const DoFHandler< dim, spacedim > &dofs, const unsigned int level, std::vector< unsigned int > &row_lengths, const DoFTools::Coupling flux_couplings=DoFTools::none)
Definition: mg_tools.cc:107
void extract_inner_interface_dofs(const DoFHandler< dim, spacedim > &mg_dof_handler, std::vector< IndexSet > &interface_dofs)
Definition: mg_tools.cc:1446
void make_boundary_list(const DoFHandler< dim, spacedim > &mg_dof, const std::map< types::boundary_id, const Function< spacedim > * > &function_map, std::vector< std::set< types::global_dof_index >> &boundary_indices, const ComponentMask &component_mask=ComponentMask())
Definition: mg_tools.cc:1240
double workload_imbalance(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1678
void count_dofs_per_block(const DoFHandler< dim, spacedim > &dof_handler, std::vector< std::vector< types::global_dof_index >> &dofs_per_block, std::vector< unsigned int > target_block={})
Definition: mg_tools.cc:1157
void make_flux_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity, const unsigned int level, const AffineConstraints< number > &constraints=AffineConstraints< number >(), const bool keep_constrained_dofs=true)
Definition: mg_tools.cc:606
double vertical_communication_efficiency(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1809
void count_dofs_per_component(const DoFHandler< dim, spacedim > &mg_dof, std::vector< std::vector< types::global_dof_index >> &result, const bool only_once=false, std::vector< unsigned int > target_component={})
Definition: mg_tools.cc:1055
unsigned int max_level_for_coarse_mesh(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1534
unsigned int boundary_id
Definition: types.h:134
const ::Triangulation< dim, spacedim > & tria