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_ERROR_ESTIMATOR_H
21 #define LIBMESH_ERROR_ESTIMATOR_H
22 
23 // Local Includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/system_norm.h"
26 
27 // C++ includes
28 #include <cstddef>
29 #include <map>
30 #include <string>
31 #include <vector>
32 
33 namespace libMesh
34 {
35 
36 // Forward Declarations
37 class ErrorVector;
38 class EquationSystems;
39 class System;
40 template <typename T> class NumericVector;
41 
53 {
54 public:
55 
61  error_norm()
62  {}
63 
67  virtual ~ErrorEstimator() {}
68 
69 
83  virtual void estimate_error (const System& system,
84  ErrorVector& error_per_cell,
85  const NumericVector<Number>* solution_vector = NULL,
86  bool estimate_parent_error = false) = 0;
87 
99  virtual void estimate_errors (const EquationSystems& equation_systems,
100  ErrorVector& error_per_cell,
101  const std::map<const System*, SystemNorm>& error_norms,
102  const std::map<const System*, const NumericVector<Number>* >* solution_vectors = NULL,
103  bool estimate_parent_error = false);
104 
109  typedef std::map<std::pair<const System*, unsigned int>, ErrorVector*> ErrorMap;
110 
123  virtual void estimate_errors (const EquationSystems& equation_systems,
124  ErrorMap& errors_per_cell,
125  const std::map<const System*, const NumericVector<Number>* >* solution_vectors = NULL,
126  bool estimate_parent_error = false);
127 
142 
143 protected:
144 
150  void reduce_error (std::vector<float>& error_per_cell,
152  LIBMESH_CAN_DEFAULT_TO_COMMWORLD) const;
153 };
154 
155 
156 } // namespace libMesh
157 
158 #endif // LIBMESH_ERROR_ESTIMATOR_H

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

Hosted By:
SourceForge.net Logo