Reference documentation for deal.II version 9.2.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\}}\)
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 
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 
85  template <typename DoFHandlerType, typename SparsityPatternType>
86  void
87  make_sparsity_pattern(const DoFHandlerType &dof_handler,
88  SparsityPatternType & sparsity,
89  const unsigned int level);
90 
99  template <int dim, typename SparsityPatternType, int spacedim>
100  void
102  SparsityPatternType & sparsity,
103  const unsigned int level);
104 
111  template <int dim, typename SparsityPatternType, int spacedim>
112  void
114  SparsityPatternType & sparsity,
115  const unsigned int level);
125  template <int dim, typename SparsityPatternType, int spacedim>
126  void
128  SparsityPatternType & sparsity,
129  const unsigned int level,
130  const Table<2, DoFTools::Coupling> &int_mask,
131  const Table<2, DoFTools::Coupling> &flux_mask);
132 
141  template <int dim, typename SparsityPatternType, int spacedim>
142  void
144  const DoFHandler<dim, spacedim> & dof_handler,
145  SparsityPatternType & sparsity,
146  const unsigned int level,
147  const Table<2, DoFTools::Coupling> &flux_mask);
148 
149 
156  template <typename DoFHandlerType, typename SparsityPatternType>
157  void
158  make_interface_sparsity_pattern(const DoFHandlerType & dof_handler,
159  const MGConstrainedDoFs &mg_constrained_dofs,
160  SparsityPatternType & sparsity,
161  const unsigned int level);
162 
163 
170  template <typename DoFHandlerType>
171  void
173  const DoFHandlerType & dof_handler,
174  std::vector<std::vector<types::global_dof_index>> &dofs_per_block,
175  std::vector<unsigned int> target_block = {});
176 
184  template <int dim, int spacedim>
185  void
187  const DoFHandler<dim, spacedim> & mg_dof,
188  std::vector<std::vector<types::global_dof_index>> &result,
189  const bool only_once = false,
190  std::vector<unsigned int> target_component = {});
191 
211  template <int dim, int spacedim>
212  void
214  const DoFHandler<dim, spacedim> &mg_dof,
215  const std::map<types::boundary_id, const Function<spacedim> *>
216  & function_map,
217  std::vector<std::set<types::global_dof_index>> &boundary_indices,
218  const ComponentMask &component_mask = ComponentMask());
219 
227  template <int dim, int spacedim>
228  void
230  const std::map<types::boundary_id,
231  const Function<spacedim> *> &function_map,
232  std::vector<IndexSet> &boundary_indices,
233  const ComponentMask & component_mask = ComponentMask());
234 
242  template <int dim, int spacedim>
243  void
245  const std::set<types::boundary_id> &boundary_ids,
246  std::vector<IndexSet> & boundary_indices,
247  const ComponentMask &component_mask = ComponentMask());
248 
254  template <int dim, int spacedim>
255  void
257  std::vector<IndexSet> & interface_dofs);
258 
267  template <int dim, int spacedim>
268  DEAL_II_DEPRECATED void
270  const DoFHandler<dim, spacedim> & mg_dof_handler,
271  std::vector<std::set<types::global_dof_index>> &non_interface_dofs);
272 
282  template <int dim, int spacedim>
283  unsigned int
285 
303  template <int dim, int spacedim>
304  double
306 
307 } // namespace MGTools
308 
309 /* @} */
310 
312 
313 #endif
MGTools::make_flux_sparsity_pattern
void make_flux_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:599
MGTools::count_dofs_per_block
void count_dofs_per_block(const DoFHandlerType &dof_handler, std::vector< std::vector< types::global_dof_index >> &dofs_per_block, std::vector< unsigned int > target_block={})
Definition: mg_tools.cc:1158
MGConstrainedDoFs
Definition: mg_constrained_dofs.h:45
Triangulation
Definition: tria.h:1109
MGTools::make_sparsity_pattern
void make_sparsity_pattern(const DoFHandlerType &dof_handler, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:565
ComponentMask
Definition: component_mask.h:83
types::boundary_id
unsigned int boundary_id
Definition: types.h:129
MGTools
Definition: mg_tools.h:51
DoFHandler
Definition: dof_handler.h:205
Table
Definition: table.h:699
level
unsigned int level
Definition: grid_out.cc:4355
MGTools::make_interface_sparsity_pattern
void make_interface_sparsity_pattern(const DoFHandlerType &dof_handler, const MGConstrainedDoFs &mg_constrained_dofs, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:1023
DoFTools::none
@ none
Definition: dof_tools.h:232
index_set.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
MGTools::compute_row_length_vector
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
DEAL_II_DEPRECATED
#define DEAL_II_DEPRECATED
Definition: config.h:98
DoFTools::Coupling
Coupling
Definition: dof_tools.h:227
dof_tools.h
dof_handler.h
config.h
Function
Definition: function.h:151
MGTools::extract_inner_interface_dofs
void extract_inner_interface_dofs(const DoFHandler< dim, spacedim > &mg_dof_handler, std::vector< IndexSet > &interface_dofs)
Definition: mg_tools.cc:1528
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
MGTools::make_flux_sparsity_pattern_edge
void make_flux_sparsity_pattern_edge(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:674
MGTools::workload_imbalance
double workload_imbalance(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1660
MGTools::extract_non_interface_dofs
void extract_non_interface_dofs(const DoFHandler< dim, spacedim > &mg_dof_handler, std::vector< std::set< types::global_dof_index >> &non_interface_dofs)
Definition: mg_tools.cc:1450
MGTools::count_dofs_per_component
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:1056
MGTools::make_boundary_list
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:1243
MGTools::max_level_for_coarse_mesh
unsigned int max_level_for_coarse_mesh(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1625