From 44ac38ecfb8b26f878ed972a288d51a172cd302f Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 4 Mar 2016 11:42:31 +0100 Subject: [PATCH] add the common h_K factor to Kelly estimator --- doc/news/changes.h | 5 +++++ include/deal.II/numerics/error_estimator.h | 18 ++++++++++-------- .../numerics/error_estimator.templates.h | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/doc/news/changes.h b/doc/news/changes.h index 08a79fbf1b..c643ca6afb 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -68,6 +68,11 @@ inconvenience this causes.

General

    +
  1. New: added another scaling factor to Kelly error estimator, namely h_K. +
    + (Denis Davydov, 2016/03/05) +
  2. +
  3. New: added indent target to indent all headers and source files. Now you can do make (or ninja) indent inside the build directory. diff --git a/include/deal.II/numerics/error_estimator.h b/include/deal.II/numerics/error_estimator.h index 52407af4f0..2435f3ad5d 100644 --- a/include/deal.II/numerics/error_estimator.h +++ b/include/deal.II/numerics/error_estimator.h @@ -95,12 +95,12 @@ namespace hp * \eta_K^2 = \sum_{F\in\partial K} c_F \int_{\partial K_F} \left[a * \frac{\partial u_h}{\partial n}\right]^2 do \f] be the error estimator for * cell $K$. $[\cdot]$ denotes the jump of the argument at the face. In the - * paper of Ainsworth $ c_F=\frac h{24} $, but this factor is a bit esoteric, + * paper of Ainsworth $ c_F=\frac {h_K}{24} $, but this factor is a bit esoteric, * stemming from interpolation estimates and stability constants which may * hold for the Poisson problem, but may not hold for more general situations. * Alternatively, we consider the case when $ c_F=\frac {h_F}{2p_F} $, where $ * h_F $ is face diagonal and $ p_F=max(p^+,p^-) $ is the maximum polynomial - * degree of adjacent elements. The choice between the two is done by means of + * degree of adjacent elements; or $c_F=h_K$. The choice between these factors is done by means of * the enumerator, provided as the last argument in all functions. * * To perform the integration, use is made of the FEFaceValues and @@ -120,13 +120,13 @@ namespace hp * standard library, with the iterator pointing to that face being the key * into the map. When looping the second time over all cells, we have to sum * up the contributions of the faces and take the square root. For the Kelly - * estimator, the multiplication with $\frac h{24}$ is done in the second - * loop. By doing so we avoid problems to decide with which $h$ to multiply, + * estimator, the multiplication with $\frac {h_K}{24}$ is done in the second + * loop. By doing so we avoid problems to decide with which $h_K$ to multiply, * that of the cell on the one or that of the cell on the other side of the * face. Whereas for the hp-estimator the @p map stores integrals multiplied * by $\frac {h_F}{2p_F}$, which are then summed in the second loop. * - * $h$ ($h_F$) is taken to be the greatest length of the diagonals of the cell + * $h_K$ ($h_F$) is taken to be the greatest length of the diagonals of the cell * (face). For more or less uniform cells (faces) without deformed angles, * this coincides with the diameter of the cell (face). * @@ -178,7 +178,7 @@ namespace hp *
  4. The face belongs to a Neumann boundary. In this case, the * contribution of the face $F\in\partial K$ looks like \f[ n_F\int_F * \left|g-a\frac{\partial u_h}{\partial n}\right|^2 ds \f] where $g$ is the - * Neumann boundary function, $n_F=\frac {h}{24}$ and $n_F=\frac {h_F}{p}$ for + * Neumann boundary function, $n_F=\frac {h_K}{24}$ and $n_F=\frac {h_F}{p}$ for * the Kelly and hp-estimator, respectively. If the finite element is vector- * valued, then obviously the function denoting the Neumann boundary * conditions needs to be vector-valued as well. @@ -259,10 +259,12 @@ public: */ enum Strategy { - //! Kelly error estimator with the factor $\frac {h}{24}$. + //! Kelly error estimator with the factor $\frac {h_K}{24}$. cell_diameter_over_24 = 0, //! the boundary residual estimator with the factor $\frac {h_F}{2 max(p^+,p^-)}$. - face_diameter_over_twice_max_degree + face_diameter_over_twice_max_degree, + //! Kelly error estimator with the factor $h_K$. + cell_diameter }; /** diff --git a/include/deal.II/numerics/error_estimator.templates.h b/include/deal.II/numerics/error_estimator.templates.h index 9087529220..c94dbad4d6 100644 --- a/include/deal.II/numerics/error_estimator.templates.h +++ b/include/deal.II/numerics/error_estimator.templates.h @@ -499,6 +499,10 @@ namespace internal { return 1.0; } + case KellyErrorEstimator::cell_diameter : + { + return 1.0; + } case KellyErrorEstimator::face_diameter_over_twice_max_degree : { const double cell_degree = fe_face_values_cell.get_fe_collection()[cell->active_fe_index()].degree; @@ -529,6 +533,10 @@ namespace internal { return 1.0; } + case KellyErrorEstimator::cell_diameter : + { + return 1.0; + } case KellyErrorEstimator::face_diameter_over_twice_max_degree : { const double cell_degree = fe_face_values_cell.get_fe_collection()[cell->active_fe_index()].degree; @@ -561,6 +569,10 @@ namespace internal { return 1.0; } + case KellyErrorEstimator::cell_diameter : + { + return 1.0; + } case KellyErrorEstimator::face_diameter_over_twice_max_degree : { const double cell_degree = fe_face_values.get_fe_collection()[cell->active_fe_index()].degree; @@ -591,6 +603,10 @@ namespace internal { return cell->diameter()/24; } + case KellyErrorEstimator::cell_diameter : + { + return cell->diameter(); + } case KellyErrorEstimator::face_diameter_over_twice_max_degree : { return 1.0; -- 2.39.5