Reference documentation for deal.II version Git c93c00f928 2020-04-01 06:59:45 +0200
\(\newcommand{\vcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\vcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
refinement.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2019 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_hp_refinement_h
17 #define dealii_hp_refinement_h
18 
19 
20 #include <deal.II/base/config.h>
21 
22 #include <deal.II/base/template_constraints.h>
23 
24 #include <functional>
25 #include <vector>
26 
27 
28 DEAL_II_NAMESPACE_OPEN
29 
30 
31 // forward declarations
32 #ifndef DOXYGEN
33 template <typename Number>
34 class Vector;
35 
36 namespace hp
37 {
38  template <int dim, int spacedim>
39  class DoFHandler;
40 }
41 #endif
42 
43 
44 namespace hp
45 {
130  namespace Refinement
131  {
141  template <typename Number>
142  using ComparisonFunction =
143  std::function<bool(const Number &, const Number &)>;
144 
158  template <int dim, int spacedim>
159  void
161 
175  template <int dim, int spacedim>
176  void
178  const std::vector<bool> & p_flags);
179 
204  template <int dim, typename Number, int spacedim>
205  void
207  const hp::DoFHandler<dim, spacedim> &dof_handler,
208  const Vector<Number> & criteria,
209  const Number p_refine_threshold,
210  const Number p_coarsen_threshold,
211  const ComparisonFunction<typename identity<Number>::type>
212  &compare_refine = std::greater_equal<Number>(),
213  const ComparisonFunction<typename identity<Number>::type>
214  &compare_coarsen = std::less_equal<Number>());
215 
246  template <int dim, typename Number, int spacedim>
247  void
249  const hp::DoFHandler<dim, spacedim> &dof_handler,
250  const Vector<Number> & criteria,
251  const double p_refine_fraction = 0.5,
252  const double p_coarsen_fraction = 0.5,
253  const ComparisonFunction<typename identity<Number>::type>
254  &compare_refine = std::greater_equal<Number>(),
255  const ComparisonFunction<typename identity<Number>::type>
256  &compare_coarsen = std::less_equal<Number>());
257 
289  template <int dim, typename Number, int spacedim>
290  void
292  const hp::DoFHandler<dim, spacedim> &dof_handler,
293  const Vector<Number> & criteria,
294  const double p_refine_fraction = 0.5,
295  const double p_coarsen_fraction = 0.5,
296  const ComparisonFunction<typename identity<Number>::type>
297  &compare_refine = std::greater_equal<Number>(),
298  const ComparisonFunction<typename identity<Number>::type>
299  &compare_coarsen = std::less_equal<Number>());
300 
340  template <int dim, typename Number, int spacedim>
341  void
343  const hp::DoFHandler<dim, spacedim> &dof_handler,
344  const Vector<Number> & sobolev_indices);
345 
365  template <int dim, typename Number, int spacedim>
366  void
368  const hp::DoFHandler<dim, spacedim> & dof_handler,
369  const Vector<Number> & criteria,
370  const Vector<Number> & references,
371  const ComparisonFunction<typename identity<Number>::type> &compare_refine,
372  const ComparisonFunction<typename identity<Number>::type>
373  &compare_coarsen);
538  template <int dim, typename Number, int spacedim>
539  void
540  predict_error(const hp::DoFHandler<dim, spacedim> &dof_handler,
541  const Vector<Number> & error_indicators,
542  Vector<Number> & predicted_errors,
543  const double gamma_p = std::sqrt(0.1),
544  const double gamma_h = 1.,
545  const double gamma_n = 1.);
546 
566  template <int dim, int spacedim>
567  void
568  force_p_over_h(const hp::DoFHandler<dim, spacedim> &dof_handler);
569 
610  template <int dim, int spacedim>
611  void
613 
617  } // namespace Refinement
618 } // namespace hp
619 
620 
621 DEAL_II_NAMESPACE_CLOSE
622 
623 #endif // dealii_hp_refinement_h
void p_adaptivity_from_reference(const hp::DoFHandler< dim, spacedim > &dof_handler, const Vector< Number > &criteria, const Vector< Number > &references, const ComparisonFunction< typename identity< Number >::type > &compare_refine, const ComparisonFunction< typename identity< Number >::type > &compare_coarsen)
Definition: refinement.cc:462
void p_adaptivity_from_relative_threshold(const hp::DoFHandler< dim, spacedim > &dof_handler, const Vector< Number > &criteria, const double p_refine_fraction=0.5, const double p_coarsen_fraction=0.5, const ComparisonFunction< typename identity< Number >::type > &compare_refine=std::greater_equal< Number >(), const ComparisonFunction< typename identity< Number >::type > &compare_coarsen=std::less_equal< Number >())
Definition: refinement.cc:123
void p_adaptivity_from_absolute_threshold(const hp::DoFHandler< dim, spacedim > &dof_handler, const Vector< Number > &criteria, const Number p_refine_threshold, const Number p_coarsen_threshold, const ComparisonFunction< typename identity< Number >::type > &compare_refine=std::greater_equal< Number >(), const ComparisonFunction< typename identity< Number >::type > &compare_coarsen=std::less_equal< Number >())
Definition: refinement.cc:91
LinearAlgebra::distributed::Vector< Number > Vector
void force_p_over_h(const hp::DoFHandler< dim, spacedim > &dof_handler)
Definition: refinement.cc:570
void full_p_adaptivity(const hp::DoFHandler< dim, spacedim > &dof_handler)
Definition: refinement.cc:43
void p_adaptivity_from_flags(const hp::DoFHandler< dim, spacedim > &dof_handler, const std::vector< bool > &p_flags)
Definition: refinement.cc:55
Definition: hp.h:117
void choose_p_over_h(const hp::DoFHandler< dim, spacedim > &dof_handler)
Definition: refinement.cc:584
void p_adaptivity_fixed_number(const hp::DoFHandler< dim, spacedim > &dof_handler, const Vector< Number > &criteria, const double p_refine_fraction=0.5, const double p_coarsen_fraction=0.5, const ComparisonFunction< typename identity< Number >::type > &compare_refine=std::greater_equal< Number >(), const ComparisonFunction< typename identity< Number >::type > &compare_coarsen=std::less_equal< Number >())
Definition: refinement.cc:217
void predict_error(const hp::DoFHandler< dim, spacedim > &dof_handler, const Vector< Number > &error_indicators, Vector< Number > &predicted_errors, const double gamma_p=std::sqrt(0.1), const double gamma_h=1., const double gamma_n=1.)
Definition: refinement.cc:498
std::function< bool(const Number &, const Number &)> ComparisonFunction
Definition: refinement.h:143
void p_adaptivity_from_regularity(const hp::DoFHandler< dim, spacedim > &dof_handler, const Vector< Number > &sobolev_indices)
Definition: refinement.cc:411