weighted_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_WEIGHTED_PATCH_RECOVERY_ERROR_ESTIMATOR_H
21 #define LIBMESH_WEIGHTED_PATCH_RECOVERY_ERROR_ESTIMATOR_H
22 
23 // C++ includes
24 #include <vector>
25 
26 // Local Includes
27 #include "libmesh/elem_range.h"
31 #include "libmesh/patch.h"
32 #include "libmesh/point.h"
33 
34 
35 namespace libMesh
36 {
37 
38 // Forward Declarations
39 class Elem;
40 
41 
49 {
50 public:
51 
58 
67  virtual ~WeightedPatchRecoveryErrorEstimator() = default;
68 
75  virtual void estimate_error (const System & system,
76  ErrorVector & error_per_cell,
77  const NumericVector<Number> * solution_vector = nullptr,
78  bool estimate_parent_error = false) override;
79 
84  std::vector<FEMFunctionBase<Number> *> weight_functions;
85 
86  virtual ErrorEstimatorType type() const override;
87 
88 private:
89 
95  {
96  public:
97  EstimateError (const System & sys,
99  ErrorVector & epc) :
100  system(sys),
101  error_estimator(ee),
102  error_per_cell(epc)
103  {}
104 
105  void operator()(const ConstElemRange & range) const;
106 
112  private:
113 
114  const System & system;
117  };
118 
119  friend class EstimateError;
120 };
121 
122 
123 } // namespace libMesh
124 
125 
126 #endif // LIBMESH_WEIGHTED_PATCH_RECOVERY_ERROR_ESTIMATOR_H
virtual void estimate_error(const System &system, ErrorVector &error_per_cell, const NumericVector< Number > *solution_vector=nullptr, bool estimate_parent_error=false) override
Utility class for defining generic ranges for threading.
Definition: stored_range.h:52
EstimateError(const System &sys, const WeightedPatchRecoveryErrorEstimator &ee, ErrorVector &epc)
Manages consistently variables, degrees of freedom, and coefficient vectors.
Definition: system.h:92
WeightedPatchRecoveryErrorEstimator & operator=(const WeightedPatchRecoveryErrorEstimator &)=default
std::vector< FEMFunctionBase< Number > * > weight_functions