Reference documentation for deal.II version 9.4.1
\(\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\}}\)
Loading...
Searching...
No Matches
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
22
25
26#include <set>
27#include <vector>
28
29
31
32// Forward declarations
33#ifndef DOXYGEN
34template <int dim, int spacedim>
35class DoFHandler;
37#endif
38
39/* !@addtogroup mg */
40/* @{ */
41
49namespace 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,
107 int spacedim,
108 typename SparsityPatternType,
109 typename number = double>
110 void
112 const DoFHandler<dim, spacedim> &dof_handler,
113 SparsityPatternType & sparsity,
114 const unsigned int level,
116 const bool keep_constrained_dofs = true);
117
118
125 template <int dim, typename SparsityPatternType, int spacedim>
126 void
128 SparsityPatternType & sparsity,
129 const unsigned int level);
139 template <int dim, typename SparsityPatternType, int spacedim>
140 void
142 SparsityPatternType & sparsity,
143 const unsigned int level,
144 const Table<2, DoFTools::Coupling> &int_mask,
145 const Table<2, DoFTools::Coupling> &flux_mask);
146
155 template <int dim, typename SparsityPatternType, int spacedim>
156 void
158 const DoFHandler<dim, spacedim> & dof_handler,
159 SparsityPatternType & sparsity,
160 const unsigned int level,
161 const Table<2, DoFTools::Coupling> &flux_mask);
162
163
170 template <int dim, int spacedim, typename SparsityPatternType>
171 void
173 const MGConstrainedDoFs &mg_constrained_dofs,
174 SparsityPatternType & sparsity,
175 const unsigned int level);
176
177
184 template <int dim, int spacedim>
185 void
187 const DoFHandler<dim, spacedim> & dof_handler,
188 std::vector<std::vector<types::global_dof_index>> &dofs_per_block,
189 std::vector<unsigned int> target_block = {});
190
198 template <int dim, int spacedim>
199 void
201 const DoFHandler<dim, spacedim> & mg_dof,
202 std::vector<std::vector<types::global_dof_index>> &result,
203 const bool only_once = false,
204 std::vector<unsigned int> target_component = {});
205
225 template <int dim, int spacedim>
226 void
228 const DoFHandler<dim, spacedim> &mg_dof,
229 const std::map<types::boundary_id, const Function<spacedim> *>
230 & function_map,
231 std::vector<std::set<types::global_dof_index>> &boundary_indices,
232 const ComponentMask &component_mask = ComponentMask());
233
241 template <int dim, int spacedim>
242 void
244 const std::map<types::boundary_id,
245 const Function<spacedim> *> &function_map,
246 std::vector<IndexSet> &boundary_indices,
247 const ComponentMask & component_mask = ComponentMask());
248
256 template <int dim, int spacedim>
257 void
259 const std::set<types::boundary_id> &boundary_ids,
260 std::vector<IndexSet> & boundary_indices,
261 const ComponentMask &component_mask = ComponentMask());
262
268 template <int dim, int spacedim>
269 void
271 std::vector<IndexSet> & interface_dofs);
272
282 template <int dim, int spacedim>
283 unsigned int
285
296 template <int dim, int spacedim>
297 std::vector<types::global_dof_index>
299
307 template <int dim, int spacedim>
308 std::vector<types::global_dof_index>
310 const std::vector<std::shared_ptr<const Triangulation<dim, spacedim>>>
311 &trias);
312
331 template <int dim, int spacedim>
332 double
334
340 template <int dim, int spacedim>
341 double
343 const std::vector<std::shared_ptr<const Triangulation<dim, spacedim>>>
344 &trias);
345
353 template <int dim, int spacedim>
354 std::vector<std::pair<types::global_dof_index, types::global_dof_index>>
356
365 template <int dim, int spacedim>
366 std::vector<std::pair<types::global_dof_index, types::global_dof_index>>
368 const std::vector<std::shared_ptr<const Triangulation<dim, spacedim>>>
369 &trias);
370
382 template <int dim, int spacedim>
383 double
385
391 template <int dim, int spacedim>
392 double
394 const std::vector<std::shared_ptr<const Triangulation<dim, spacedim>>>
395 &trias);
396
397
398} // namespace MGTools
399
400/* @} */
401
403
404#endif
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
unsigned int level
Definition: grid_out.cc:4606
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:1086
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:1737
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:595
std::vector< types::global_dof_index > local_workload(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1669
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:1271
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:1477
double workload_imbalance(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1715
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:1188
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:1053
void make_flux_sparsity_pattern_edge(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternType &sparsity, const unsigned int level)
Definition: mg_tools.cc:704
double vertical_communication_efficiency(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1846
void make_flux_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:628
unsigned int max_level_for_coarse_mesh(const Triangulation< dim, spacedim > &tria)
Definition: mg_tools.cc:1568
unsigned int boundary_id
Definition: types.h:129
const ::Triangulation< dim, spacedim > & tria