Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
mg_tools.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2005 - 2018 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 
23 #include <deal.II/dofs/dof_handler.h>
24 #include <deal.II/dofs/dof_tools.h>
25 
26 #include <set>
27 #include <vector>
28 
29 
30 DEAL_II_NAMESPACE_OPEN
31 
32 template <int dim, int spacedim>
33 class DoFHandler;
34 class MGConstrainedDoFs;
35 
36 /* !@addtogroup mg */
37 /* @{ */
38 
48 namespace MGTools
49 {
53  template <int dim, int spacedim>
54  void
56  const DoFHandler<dim, spacedim> &dofs,
57  const unsigned int level,
58  std::vector<unsigned int> & row_lengths,
59  const DoFTools::Coupling flux_couplings = DoFTools::none);
60 
65  template <int dim, int spacedim>
66  void
68  const unsigned int level,
69  std::vector<unsigned int> & row_lengths,
70  const Table<2, DoFTools::Coupling> &couplings,
71  const Table<2, DoFTools::Coupling> &flux_couplings);
72 
82  template <typename DoFHandlerType, typename SparsityPatternType>
83  void
84  make_sparsity_pattern(const DoFHandlerType &dof_handler,
85  SparsityPatternType & sparsity,
86  const unsigned int level);
87 
96  template <int dim, typename SparsityPatternType, int spacedim>
97  void
99  SparsityPatternType & sparsity,
100  const unsigned int level);
101 
108  template <int dim, typename SparsityPatternType, int spacedim>
109  void
111  SparsityPatternType & sparsity,
112  const unsigned int level);
122  template <int dim, typename SparsityPatternType, int spacedim>
123  void
125  SparsityPatternType & sparsity,
126  const unsigned int level,
127  const Table<2, DoFTools::Coupling> &int_mask,
128  const Table<2, DoFTools::Coupling> &flux_mask);
129 
138  template <int dim, typename SparsityPatternType, int spacedim>
139  void
141  const DoFHandler<dim, spacedim> & dof_handler,
142  SparsityPatternType & sparsity,
143  const unsigned int level,
144  const Table<2, DoFTools::Coupling> &flux_mask);
145 
146 
153  template <typename DoFHandlerType, typename SparsityPatternType>
154  void
155  make_interface_sparsity_pattern(const DoFHandlerType & dof_handler,
156  const MGConstrainedDoFs &mg_constrained_dofs,
157  SparsityPatternType & sparsity,
158  const unsigned int level);
159 
160 
167  template <typename DoFHandlerType>
168  void
170  const DoFHandlerType & dof_handler,
171  std::vector<std::vector<types::global_dof_index>> &dofs_per_block,
172  std::vector<unsigned int> target_block = {});
173 
181  template <int dim, int spacedim>
182  void
184  const DoFHandler<dim, spacedim> & mg_dof,
185  std::vector<std::vector<types::global_dof_index>> &result,
186  const bool only_once = false,
187  std::vector<unsigned int> target_component = {});
188 
208  template <int dim, int spacedim>
209  void
211  const DoFHandler<dim, spacedim> &mg_dof,
212  const std::map<types::boundary_id, const Function<spacedim> *>
213  & function_map,
214  std::vector<std::set<types::global_dof_index>> &boundary_indices,
215  const ComponentMask &component_mask = ComponentMask());
216 
224  template <int dim, int spacedim>
225  void
227  const std::map<types::boundary_id,
228  const Function<spacedim> *> &function_map,
229  std::vector<IndexSet> &boundary_indices,
230  const ComponentMask & component_mask = ComponentMask());
231 
239  template <int dim, int spacedim>
240  void
242  const std::set<types::boundary_id> &boundary_ids,
243  std::vector<IndexSet> & boundary_indices,
244  const ComponentMask &component_mask = ComponentMask());
245 
251  template <int dim, int spacedim>
252  void
254  std::vector<IndexSet> & interface_dofs);
255 
264  template <int dim, int spacedim>
265  DEAL_II_DEPRECATED void
267  const DoFHandler<dim, spacedim> & mg_dof_handler,
268  std::vector<std::set<types::global_dof_index>> &non_interface_dofs);
269 
279  template <int dim, int spacedim>
280  unsigned int
282 } // namespace MGTools
283 
284 /* @} */
285 
286 DEAL_II_NAMESPACE_CLOSE
287 
288 #endif
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:1068
void make_flux_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:607
void make_sparsity_pattern(const DoFHandlerType &dof_handler, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:573
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:1170
void make_interface_sparsity_pattern(const DoFHandlerType &dof_handler, const MGConstrainedDoFs &mg_constrained_dofs, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:1035
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:1255
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_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:1456
void extract_inner_interface_dofs(const DoFHandler< dim, spacedim > &mg_dof_handler, std::vector< IndexSet > &interface_dofs)
Definition: mg_tools.cc:1536
Definition: table.h:37
void make_flux_sparsity_pattern_edge(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:683
unsigned int boundary_id
Definition: types.h:111
unsigned int max_level_for_coarse_mesh(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1635