Reference documentation for deal.II version 9.3.2
\(\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 - 2020 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 
39 /* !@addtogroup mg */
40 /* @{ */
41 
49 namespace MGTools
50 {
54  template <int dim, int spacedim>
55  void
57  const DoFHandler<dim, spacedim> &dofs,
58  const unsigned int level,
59  std::vector<unsigned int> & row_lengths,
60  const DoFTools::Coupling flux_couplings = DoFTools::none);
61 
66  template <int dim, int spacedim>
67  void
69  const unsigned int level,
70  std::vector<unsigned int> & row_lengths,
71  const Table<2, DoFTools::Coupling> &couplings,
72  const Table<2, DoFTools::Coupling> &flux_couplings);
73 
86  template <int dim,
87  int spacedim,
88  typename SparsityPatternType,
89  typename number = double>
90  void
92  const DoFHandler<dim, spacedim> &dof_handler,
93  SparsityPatternType & sparsity,
94  const unsigned int level,
96  const bool keep_constrained_dofs = true);
97 
106  template <int dim, typename SparsityPatternType, int spacedim>
107  void
109  SparsityPatternType & sparsity,
110  const unsigned int level);
111 
118  template <int dim, typename SparsityPatternType, int spacedim>
119  void
121  SparsityPatternType & sparsity,
122  const unsigned int level);
132  template <int dim, typename SparsityPatternType, int spacedim>
133  void
135  SparsityPatternType & sparsity,
136  const unsigned int level,
137  const Table<2, DoFTools::Coupling> &int_mask,
138  const Table<2, DoFTools::Coupling> &flux_mask);
139 
148  template <int dim, typename SparsityPatternType, int spacedim>
149  void
151  const DoFHandler<dim, spacedim> & dof_handler,
152  SparsityPatternType & sparsity,
153  const unsigned int level,
154  const Table<2, DoFTools::Coupling> &flux_mask);
155 
156 
163  template <int dim, int spacedim, typename SparsityPatternType>
164  void
166  const MGConstrainedDoFs &mg_constrained_dofs,
167  SparsityPatternType & sparsity,
168  const unsigned int level);
169 
170 
177  template <int dim, int spacedim>
178  void
180  const DoFHandler<dim, spacedim> & dof_handler,
181  std::vector<std::vector<types::global_dof_index>> &dofs_per_block,
182  std::vector<unsigned int> target_block = {});
183 
191  template <int dim, int spacedim>
192  void
194  const DoFHandler<dim, spacedim> & mg_dof,
195  std::vector<std::vector<types::global_dof_index>> &result,
196  const bool only_once = false,
197  std::vector<unsigned int> target_component = {});
198 
218  template <int dim, int spacedim>
219  void
221  const DoFHandler<dim, spacedim> &mg_dof,
222  const std::map<types::boundary_id, const Function<spacedim> *>
223  & function_map,
224  std::vector<std::set<types::global_dof_index>> &boundary_indices,
225  const ComponentMask &component_mask = ComponentMask());
226 
234  template <int dim, int spacedim>
235  void
237  const std::map<types::boundary_id,
238  const Function<spacedim> *> &function_map,
239  std::vector<IndexSet> &boundary_indices,
240  const ComponentMask & component_mask = ComponentMask());
241 
249  template <int dim, int spacedim>
250  void
252  const std::set<types::boundary_id> &boundary_ids,
253  std::vector<IndexSet> & boundary_indices,
254  const ComponentMask &component_mask = ComponentMask());
255 
261  template <int dim, int spacedim>
262  void
264  std::vector<IndexSet> & interface_dofs);
265 
275  template <int dim, int spacedim>
276  unsigned int
278 
296  template <int dim, int spacedim>
297  double
299 
300 } // namespace MGTools
301 
302 /* @} */
303 
305 
306 #endif
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:396
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:397
unsigned int level
Definition: grid_out.cc:4590
void make_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternType &sparsity, const unsigned int level, const AffineConstraints< number > &constraints=AffineConstraints< number >(), const bool keep_constrained_dofs=true)
Definition: mg_tools.cc:593
void make_flux_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:628
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:105
void extract_inner_interface_dofs(const DoFHandler< dim, spacedim > &mg_dof_handler, std::vector< IndexSet > &interface_dofs)
Definition: mg_tools.cc:1480
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:1270
double workload_imbalance(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1612
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:1187
void make_interface_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, const MGConstrainedDoFs &mg_constrained_dofs, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:1052
void make_flux_sparsity_pattern_edge(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:703
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:1085
unsigned int max_level_for_coarse_mesh(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1577
unsigned int boundary_id
Definition: types.h:129