patch_recovery_error_estimator.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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
25 #include "libmesh/patch.h"
26 #include "libmesh/point.h"
27 #include "libmesh/elem_range.h"
28 
29 #ifdef LIBMESH_FORWARD_DECLARE_ENUMS
30 namespace libMesh
31 {
32 enum Order : int;
33 }
34 #else
35 #include "libmesh/enum_order.h"
36 #endif
37 
38 // C++ includes
39 #include <cstddef>
40 #include <vector>
41 
42 namespace libMesh
43 {
44 
45 // Forward Declarations
46 class Elem;
47 
56 {
57 public:
58 
65 
74  virtual ~PatchRecoveryErrorEstimator() = default;
75 
82  virtual void estimate_error (const System & system,
83  ErrorVector & error_per_cell,
84  const NumericVector<Number> * solution_vector = nullptr,
85  bool estimate_parent_error = false) override;
86 
91  unsigned int target_patch_size;
92 
100 
101  void set_patch_reuse (bool);
102 
103  virtual ErrorEstimatorType type() const override;
104 
105 protected:
106 
110  static std::vector<Real> specpoly(const unsigned int dim,
111  const Order order,
112  const Point p,
113  const unsigned int matsize);
114 
116 
117 private:
118 
124  {
125  public:
126  EstimateError (const System & sys,
127  const PatchRecoveryErrorEstimator & ee,
128  ErrorVector & epc) :
129  system(sys),
130  error_estimator(ee),
131  error_per_cell(epc)
132  {}
133 
134  void operator()(const ConstElemRange & range) const;
135 
136  private:
137  const System & system;
140  };
141 
142  friend class EstimateError;
143 };
144 
145 
146 } // namespace libMesh
147 
148 
149 #endif // LIBMESH_PATCH_RECOVERY_ERROR_ESTIMATOR_H
Utility class for defining generic ranges for threading.
Definition: stored_range.h:52
EstimateError(const System &sys, const PatchRecoveryErrorEstimator &ee, ErrorVector &epc)
Manages consistently variables, degrees of freedom, and coefficient vectors.
Definition: system.h:92
virtual void estimate_error(const System &system, ErrorVector &error_per_cell, const NumericVector< Number > *solution_vector=nullptr, bool estimate_parent_error=false) override
static std::vector< Real > specpoly(const unsigned int dim, const Order order, const Point p, const unsigned int matsize)
void(Patch::* PMF)()
Definition: patch.h:104
virtual ErrorEstimatorType type() const override
A geometric point in (x,y,z) space.
Definition: point.h:38
virtual ~PatchRecoveryErrorEstimator()=default
PatchRecoveryErrorEstimator & operator=(const PatchRecoveryErrorEstimator &)=default