exact_error_estimator.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 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_EXACT_ERROR_ESTIMATOR_H
21 #define LIBMESH_EXACT_ERROR_ESTIMATOR_H
22 
23 // Local Includes
25 
26 // C++ includes
27 #include <cstddef>
28 #include <string>
29 #include <vector>
30 
31 namespace libMesh
32 {
33 
34 // Forward Declarations
35 class Elem;
36 template <typename T> class FEGenericBase;
38 class MeshFunction;
39 class Point;
40 class Parameters;
41 
42 template <typename T> class DenseVector;
43 
44 // Is there any way to simplify this?
45 // All we need are Tensor and Gradient. - RHS
46 template <typename T> class TensorValue;
47 template <typename T> class VectorValue;
52 
53 
54 
66 {
67 public:
68 
75  _exact_value(NULL),
76  _exact_deriv(NULL),
77  _exact_hessian(NULL),
78  _extra_order(0)
79  { error_norm = H1; }
80 
85 
90  void attach_exact_values (std::vector<FunctionBase<Number> *> f);
91 
96  void attach_exact_value (unsigned int sys_num,
98 
103  void attach_exact_value ( Number fptr(const Point& p,
104  const Parameters& Parameters,
105  const std::string& sys_name,
106  const std::string& unknown_name));
107 
112  void attach_exact_derivs (std::vector<FunctionBase<Gradient> *> g);
113 
118  void attach_exact_deriv (unsigned int sys_num,
120 
125  void attach_exact_deriv ( Gradient gptr(const Point& p,
126  const Parameters& parameters,
127  const std::string& sys_name,
128  const std::string& unknown_name));
129 
134  void attach_exact_hessians (std::vector<FunctionBase<Tensor> *> h);
135 
140  void attach_exact_hessian (unsigned int sys_num,
142 
147  void attach_exact_hessian ( Tensor hptr(const Point& p,
148  const Parameters& parameters,
149  const std::string& sys_name,
150  const std::string& unknown_name));
151 
158 
159 
164  void extra_quadrature_order (const int extraorder)
165  { _extra_order = extraorder; }
166 
167 
168  // Bring the base class functionality into the name lookup
169  // procedure. This allows for alternative calling formats
170  // defined in the base class. Thanks Wolfgang.
171  // GCC 2.95.3 cannot compile such code. Since it was not really
172  // essential to the functioning of this class, it's been removed.
173  // using ErrorEstimator::estimate_error;
174 
181  virtual void estimate_error (const System& system,
182  ErrorVector& error_per_cell,
183  const NumericVector<Number>* solution_vector = NULL,
184  bool estimate_parent_error = false);
185 
186 private:
187 
192  Number (* _exact_value) (const Point& p,
193  const Parameters& parameters,
194  const std::string& sys_name,
195  const std::string& unknown_name);
196 
201  Gradient (* _exact_deriv) (const Point& p,
202  const Parameters& parameters,
203  const std::string& sys_name,
204  const std::string& unknown_name);
205 
210  Tensor (* _exact_hessian) (const Point& p,
211  const Parameters& parameters,
212  const std::string& sys_name,
213  const std::string& unknown_name);
214 
219  std::vector<FunctionBase<Number> *> _exact_values;
220 
225  std::vector<FunctionBase<Gradient> *> _exact_derivs;
226 
231  std::vector<FunctionBase<Tensor> *> _exact_hessians;
232 
238 
242  Real find_squared_element_error (const System& system,
243  const std::string& var_name,
244  const Elem *elem,
245  const DenseVector<Number> &Uelem,
246  FEBase *fe,
247  MeshFunction *fine_values) const;
248 
252  void clear_functors ();
253 
258 };
259 
260 
261 } // namespace libMesh
262 
263 #endif // LIBMESH_EXACT_ERROR_ESTIMATOR_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:04 UTC

Hosted By:
SourceForge.net Logo