libMesh
Loading...
Searching...
No Matches
patch_recovery_error_estimator.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 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/patch.h"
26#include "libmesh/point.h"
27#include "libmesh/elem_range.h"
28
29// C++ includes
30#include <cstddef>
31#include <vector>
32
33namespace libMesh
34{
35
36// Forward Declarations
37class Elem;
38enum Order : int;
39
48{
49public:
50
57
66 virtual ~PatchRecoveryErrorEstimator() = default;
67
74 virtual void estimate_error (const System & system,
75 ErrorVector & error_per_cell,
76 const NumericVector<Number> * solution_vector = nullptr,
77 bool estimate_parent_error = false) override;
78
83 unsigned int target_patch_size;
84
92
93 void set_patch_reuse (bool);
94
102 void extra_quadrature_order (const int extraorder)
103 { _extra_order = extraorder; }
104
105 virtual ErrorEstimatorType type() const override;
106
107protected:
108
112 static std::vector<Real> specpoly(const unsigned int dim,
113 const Order order,
114 const Point p,
115 const unsigned int matsize);
116
118
123
124private:
125
131 {
132 public:
133 EstimateError (const System & sys,
135 ErrorVector & epc) :
136 system(sys),
137 error_estimator(ee),
138 error_per_cell(epc)
139 {}
140
141 void operator()(const ConstElemRange & range) const;
142
143 private:
144 const System & system;
147 };
148
149 friend class EstimateError;
150};
151
152
153} // namespace libMesh
154
155
156#endif // LIBMESH_PATCH_RECOVERY_ERROR_ESTIMATOR_H
unsigned int dim
void ErrorVector unsigned int
This class holds functions that will estimate the error in a finite element solution on a given mesh.
The ErrorVector is a specialization of the StatisticsVector for error data computed on a finite eleme...
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
Class to compute the error contribution for a range of elements.
EstimateError(const System &sys, const PatchRecoveryErrorEstimator &ee, ErrorVector &epc)
This class implements the Patch Recovery error indicator.
virtual void estimate_error(const System &system, ErrorVector &error_per_cell, const NumericVector< Number > *solution_vector=nullptr, bool estimate_parent_error=false) override
This function uses the Patch Recovery error estimate to estimate the error on each cell.
unsigned int target_patch_size
The PatchErrorEstimator will build patches of at least this many elements to perform estimates.
static std::vector< Real > specpoly(const unsigned int dim, const Order order, const Point p, const unsigned int matsize)
void extra_quadrature_order(const int extraorder)
Increases or decreases the order of the quadrature rule used for numerical integration.
Patch::PMF patch_growth_strategy
The PatchErrorEstimator will use this pointer to a Patch member function when growing patches.
PatchRecoveryErrorEstimator(const PatchRecoveryErrorEstimator &)=default
Copy/move ctor, copy/move assignment operator, and destructor are all explicitly defaulted for this c...
int _extra_order
Extra order to use for quadrature rule.
PatchRecoveryErrorEstimator & operator=(const PatchRecoveryErrorEstimator &)=default
virtual ~PatchRecoveryErrorEstimator()=default
virtual ErrorEstimatorType type() const override
PatchRecoveryErrorEstimator(PatchRecoveryErrorEstimator &&)=default
void(Patch::* PMF)()
Pointer to Member Function typedef.
Definition patch.h:104
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition point.h:40
The StoredRange class defines a contiguous, divisible set of objects.
Manages consistently variables, degrees of freedom, and coefficient vectors.
Definition system.h:100
The libMesh namespace provides an interface to certain functionality in the library.
ErrorEstimatorType
Defines an enum for the different types of error estimators which are available.