Reference documentation for deal.II version 9.3.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\}}\)
refinement.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2019 - 2021 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 
23 
24 #include <functional>
25 #include <vector>
26 
27 
29 
30 
31 // forward declarations
32 #ifndef DOXYGEN
33 template <typename Number>
34 class Vector;
35 
36 template <int dim, int spacedim>
37 class DoFHandler;
38 #endif
39 
40 
41 namespace hp
42 {
126  namespace Refinement
127  {
137  template <typename Number>
138  using ComparisonFunction =
139  std::function<bool(const Number &, const Number &)>;
140 
155  template <int dim, int spacedim>
156  void
157  full_p_adaptivity(const ::DoFHandler<dim, spacedim> &dof_handler);
158 
173  template <int dim, int spacedim>
174  void
176  const ::DoFHandler<dim, spacedim> &dof_handler,
177  const std::vector<bool> & p_flags);
178 
204  template <int dim, typename Number, int spacedim>
205  void
207  const ::DoFHandler<dim, spacedim> &dof_handler,
208  const Vector<Number> & criteria,
209  const Number p_refine_threshold,
210  const Number p_coarsen_threshold,
212  &compare_refine = std::greater_equal<Number>(),
214  &compare_coarsen = std::less_equal<Number>());
215 
247  template <int dim, typename Number, int spacedim>
248  void
250  const ::DoFHandler<dim, spacedim> &dof_handler,
251  const Vector<Number> & criteria,
252  const double p_refine_fraction = 0.5,
253  const double p_coarsen_fraction = 0.5,
255  &compare_refine = std::greater_equal<Number>(),
257  &compare_coarsen = std::less_equal<Number>());
258 
291  template <int dim, typename Number, int spacedim>
292  void
294  const ::DoFHandler<dim, spacedim> &dof_handler,
295  const Vector<Number> & criteria,
296  const double p_refine_fraction = 0.5,
297  const double p_coarsen_fraction = 0.5,
299  &compare_refine = std::greater_equal<Number>(),
301  &compare_coarsen = std::less_equal<Number>());
302 
329  template <int dim, typename Number, int spacedim>
330  void
332  const ::DoFHandler<dim, spacedim> &dof_handler,
333  const Vector<Number> & sobolev_indices);
334 
355  template <int dim, typename Number, int spacedim>
356  void
358  const ::DoFHandler<dim, spacedim> & dof_handler,
359  const Vector<Number> & criteria,
360  const Vector<Number> & references,
361  const ComparisonFunction<typename identity<Number>::type> &compare_refine,
363  &compare_coarsen);
364 
593  template <int dim, typename Number, int spacedim>
594  void
595  predict_error(const ::DoFHandler<dim, spacedim> &dof_handler,
596  const Vector<Number> & error_indicators,
597  Vector<Number> & predicted_errors,
598  const double gamma_p = std::sqrt(0.4),
599  const double gamma_h = 2.,
600  const double gamma_n = 1.);
601 
622  template <int dim, int spacedim>
623  void
624  force_p_over_h(const ::DoFHandler<dim, spacedim> &dof_handler);
625 
670  template <int dim, int spacedim>
671  void
672  choose_p_over_h(const ::DoFHandler<dim, spacedim> &dof_handler);
673 
715  template <int dim, int spacedim>
716  bool
718  const ::DoFHandler<dim, spacedim> &dof_handler,
719  const unsigned int max_difference = 1,
720  const unsigned int contains_fe_index = 0);
721 
725  } // namespace Refinement
726 } // namespace hp
727 
728 
730 
731 #endif // dealii_hp_refinement_h
void p_adaptivity_from_regularity(const ::DoFHandler< dim, spacedim > &dof_handler, const Vector< Number > &sobolev_indices)
Definition: refinement.cc:448
void p_adaptivity_from_flags(const ::DoFHandler< dim, spacedim > &dof_handler, const std::vector< bool > &p_flags)
Definition: refinement.cc:67
void choose_p_over_h(const ::DoFHandler< dim, spacedim > &dof_handler)
Definition: refinement.cc:690
void p_adaptivity_from_reference(const ::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:506
void full_p_adaptivity(const ::DoFHandler< dim, spacedim > &dof_handler)
Definition: refinement.cc:47
void force_p_over_h(const ::DoFHandler< dim, spacedim > &dof_handler)
Definition: refinement.cc:668
void predict_error(const ::DoFHandler< dim, spacedim > &dof_handler, const Vector< Number > &error_indicators, Vector< Number > &predicted_errors, const double gamma_p=std::sqrt(0.4), const double gamma_h=2., const double gamma_n=1.)
Definition: refinement.cc:549
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:395
Definition: hp.h:117
void p_adaptivity_from_relative_threshold(const ::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:150
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:394
void p_adaptivity_from_absolute_threshold(const ::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:111
std::function< bool(const Number &, const Number &)> ComparisonFunction
Definition: refinement.h:139
bool limit_p_level_difference(const ::DoFHandler< dim, spacedim > &dof_handler, const unsigned int max_difference=1, const unsigned int contains_fe_index=0)
Definition: refinement.cc:804
void p_adaptivity_fixed_number(const ::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:247