libMesh
patch_recovery_error_estimator.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_PATCH_RECOVERY_ERROR_ESTIMATOR_H
21 #define LIBMESH_PATCH_RECOVERY_ERROR_ESTIMATOR_H
22 
23 // Local Includes
24 #include "libmesh/error_estimator.h"
25 #include "libmesh/enum_order.h"
26 #include "libmesh/patch.h"
27 #include "libmesh/point.h"
28 #include "libmesh/elem_range.h"
29 
30 // C++ includes
31 #include <cstddef>
32 #include <vector>
33 
34 namespace libMesh
35 {
36 
37 // Forward Declarations
38 class Elem;
39 
40 
49 {
50 public:
51 
60  patch_growth_strategy(&Patch::add_local_face_neighbors),
61  patch_reuse(true)
62  { error_norm = H1_SEMINORM; }
63 
68 
69 
76  virtual void estimate_error (const System & system,
77  ErrorVector & error_per_cell,
78  const NumericVector<Number> * solution_vector = libmesh_nullptr,
79  bool estimate_parent_error = false) libmesh_override;
80 
85  unsigned int target_patch_size;
86 
94 
95  void set_patch_reuse (bool);
96 
97  virtual ErrorEstimatorType type() const libmesh_override
98  { return PATCH_RECOVERY;}
99 
100 protected:
101 
105  static std::vector<Real> specpoly(const unsigned int dim,
106  const Order order,
107  const Point p,
108  const unsigned int matsize);
109 
111 
112 private:
113 
119  {
120  public:
122  const PatchRecoveryErrorEstimator & ee,
123  ErrorVector & epc) :
124  system(sys),
125  error_estimator(ee),
126  error_per_cell(epc)
127  {}
128 
129  void operator()(const ConstElemRange & range) const;
130 
131  private:
132  const System & system;
135  };
136 
137  friend class EstimateError;
138 };
139 
140 
141 } // namespace libMesh
142 
143 
144 #endif // LIBMESH_PATCH_RECOVERY_ERROR_ESTIMATOR_H
SystemNorm error_norm
When estimating the error in a single system, the error_norm is used to control the scaling and norm ...
Patch::PMF patch_growth_strategy
The PatchErrorEstimator will use this pointer to a Patch member function when growing patches...
This class implements useful utility functions for a patch of elements.
Definition: patch.h:47
Class to compute the error contribution for a range of elements.
unsigned int dim
The ErrorVector is a specialization of the StatisticsVector for error data computed on a finite eleme...
Definition: error_vector.h:50
ImplicitSystem & sys
const class libmesh_nullptr_t libmesh_nullptr
The StoredRange class defines a contiguous, divisible set of objects.
Definition: stored_range.h:52
The libMesh namespace provides an interface to certain functionality in the library.
EstimateError(const System &sys, const PatchRecoveryErrorEstimator &ee, ErrorVector &epc)
virtual ErrorEstimatorType type() const libmesh_override
This is the base class for classes which contain information related to any physical process that mig...
Definition: system.h:76
This class holds functions that will estimate the error in a finite element solution on a given mesh...
unsigned int target_patch_size
The PatchErrorEstimator will build patches of at least this many elements to perform estimates...
virtual void estimate_error(const System &system, ErrorVector &error_per_cell, const NumericVector< Number > *solution_vector=libmesh_nullptr, bool estimate_parent_error=false) libmesh_override
This function uses the Patch Recovery error estimate to estimate the error on each cell...
static std::vector< Real > specpoly(const unsigned int dim, const Order order, const Point p, const unsigned int matsize)
void(Patch::* PMF)()
Pointer to Member Function typedef.
Definition: patch.h:104
This class implements the Patch Recovery error indicator.
Order
defines an enum for polynomial orders.
Definition: enum_order.h:32
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38