Reference documentation for deal.II version 9.0.0
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 at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_mg_tools_h
17 #define dealii_mg_tools_h
18 
19 #include <deal.II/base/config.h>
20 #include <deal.II/base/index_set.h>
21 #include <deal.II/dofs/dof_tools.h>
22 #include <deal.II/dofs/dof_handler.h>
23 
24 #include <vector>
25 #include <set>
26 
27 
28 DEAL_II_NAMESPACE_OPEN
29 
30 template <int dim, int spacedim> class DoFHandler;
31 class MGConstrainedDoFs;
32 
33 /* !@addtogroup mg */
34 /* @{ */
35 
45 namespace MGTools
46 {
50  template <int dim, int spacedim>
51  void
53  const unsigned int level,
54  std::vector<unsigned int> &row_lengths,
55  const DoFTools::Coupling flux_couplings = DoFTools::none);
56 
61  template <int dim, int spacedim>
62  void
64  const unsigned int level,
65  std::vector<unsigned int> &row_lengths,
66  const Table<2,DoFTools::Coupling> &couplings,
67  const Table<2,DoFTools::Coupling> &flux_couplings);
68 
78  template <typename DoFHandlerType, typename SparsityPatternType>
79  void
80  make_sparsity_pattern (const DoFHandlerType &dof_handler,
81  SparsityPatternType &sparsity,
82  const unsigned int level);
83 
92  template <int dim, typename SparsityPatternType, int spacedim>
93  void
95  SparsityPatternType &sparsity,
96  const unsigned int level);
97 
104  template <int dim, typename SparsityPatternType, int spacedim>
105  void
107  SparsityPatternType &sparsity,
108  const unsigned int level);
118  template <int dim, typename SparsityPatternType, int spacedim>
119  void
121  SparsityPatternType &sparsity,
122  const unsigned int level,
123  const Table<2,DoFTools::Coupling> &int_mask,
124  const Table<2,DoFTools::Coupling> &flux_mask);
125 
134  template <int dim, typename SparsityPatternType, int spacedim>
135  void
137  SparsityPatternType &sparsity,
138  const unsigned int level,
139  const Table<2,DoFTools::Coupling> &flux_mask);
140 
141 
147  template <typename DoFHandlerType, typename SparsityPatternType>
148  void
149  make_interface_sparsity_pattern (const DoFHandlerType &dof_handler,
150  const MGConstrainedDoFs &mg_constrained_dofs,
151  SparsityPatternType &sparsity,
152  const unsigned int level);
153 
154 
161  template <typename DoFHandlerType>
162  void
163  count_dofs_per_block (const DoFHandlerType &dof_handler,
164  std::vector<std::vector<types::global_dof_index> > &dofs_per_block,
165  std::vector<unsigned int> target_block = std::vector<unsigned int>());
166 
174  template <int dim, int spacedim>
175  void
177  std::vector<std::vector<types::global_dof_index> > &result,
178  const bool only_once = false,
179  std::vector<unsigned int> target_component = std::vector<unsigned int>());
180 
200  template <int dim, int spacedim>
201  void
203  const typename FunctionMap<dim>::type &function_map,
204  std::vector<std::set<types::global_dof_index> > &boundary_indices,
205  const ComponentMask &component_mask = ComponentMask());
206 
214  template <int dim, int spacedim>
215  void
217  const typename FunctionMap<dim>::type &function_map,
218  std::vector<IndexSet> &boundary_indices,
219  const ComponentMask &component_mask = ComponentMask());
220 
228  template <int dim, int spacedim>
229  void
231  const std::set<types::boundary_id> &boundary_ids,
232  std::vector<IndexSet> &boundary_indices,
233  const ComponentMask &component_mask = ComponentMask());
234 
240  template <int dim, int spacedim>
241  void
243  std::vector<IndexSet> &interface_dofs);
244 
245 
246  template <int dim, int spacedim>
247  void
248  extract_non_interface_dofs (const DoFHandler<dim,spacedim> &mg_dof_handler,
249  std::vector<std::set<types::global_dof_index> > &non_interface_dofs);
250 
259  template <int dim, int spacedim>
260  unsigned int
262 }
263 
264 /* @} */
265 
266 DEAL_II_NAMESPACE_CLOSE
267 
268 #endif
void make_flux_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:573
void make_sparsity_pattern(const DoFHandlerType &dof_handler, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:540
void make_boundary_list(const DoFHandler< dim, spacedim > &mg_dof, const typename FunctionMap< dim >::type &function_map, std::vector< std::set< types::global_dof_index > > &boundary_indices, const ComponentMask &component_mask=ComponentMask())
Definition: mg_tools.cc:1208
void make_interface_sparsity_pattern(const DoFHandlerType &dof_handler, const MGConstrainedDoFs &mg_constrained_dofs, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:988
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=std::vector< unsigned int >())
Definition: mg_tools.cc:1021
std::map< types::boundary_id, const Function< dim, Number > * > type
Definition: function_map.h:81
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 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=std::vector< unsigned int >())
Definition: mg_tools.cc:1125
void extract_inner_interface_dofs(const DoFHandler< dim, spacedim > &mg_dof_handler, std::vector< IndexSet > &interface_dofs)
Definition: mg_tools.cc:1466
Definition: table.h:34
void make_flux_sparsity_pattern_edge(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:648
unsigned int max_level_for_coarse_mesh(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1555