libMesh
uniform_refinement_estimator.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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_UNIFORM_REFINEMENT_ESTIMATOR_H
21 #define LIBMESH_UNIFORM_REFINEMENT_ESTIMATOR_H
22 
23 // Local Includes
24 #include "libmesh/error_estimator.h"
25 #include "libmesh/libmesh.h"
26 
27 // C++ includes
28 #include <cstddef>
29 #include <vector>
30 
31 #ifdef LIBMESH_ENABLE_AMR
32 
33 namespace libMesh
34 {
35 
46 {
47 public:
48 
56  { error_norm = H1; }
57 
62 
63 
80  virtual void estimate_error (const System & system,
81  ErrorVector & error_per_cell,
82  const NumericVector<Number> * solution_vector = libmesh_nullptr,
83  bool estimate_parent_error = false) libmesh_override;
84 
92  virtual void estimate_errors (const EquationSystems & equation_systems,
93  ErrorVector & error_per_cell,
94  const std::map<const System *, SystemNorm> & error_norms,
95  const std::map<const System *, const NumericVector<Number> *> * solution_vectors = libmesh_nullptr,
96  bool estimate_parent_error = false) libmesh_override;
97 
106  virtual void estimate_errors (const EquationSystems & equation_systems,
107  ErrorMap & errors_per_cell,
108  const std::map<const System *, const NumericVector<Number> *> * solution_vectors = libmesh_nullptr,
109  bool estimate_parent_error = false) libmesh_override;
110 
111  virtual ErrorEstimatorType type() const libmesh_override
112  { return UNIFORM_REFINEMENT;}
113 
117  unsigned char number_h_refinements;
118 
122  unsigned char number_p_refinements;
123 
124 protected:
129  virtual void _estimate_error (const EquationSystems * equation_systems,
130  const System * system,
131  ErrorVector * error_per_cell,
132  std::map<std::pair<const System *, unsigned int>, ErrorVector *> * errors_per_cell,
133  const std::map<const System *, SystemNorm > * error_norms,
134  const std::map<const System *, const NumericVector<Number> *> * solution_vectors = libmesh_nullptr,
135  bool estimate_parent_error = false);
136 };
137 
138 } // namespace libMesh
139 
140 #endif // #ifdef LIBMESH_ENABLE_AMR
141 
142 #endif // LIBMESH_UNIFORM_REFINEMENT_ESTIMATOR_H
unsigned char number_h_refinements
How many h refinements to perform to get the fine grid.
virtual void estimate_errors(const EquationSystems &equation_systems, ErrorVector &error_per_cell, const std::map< const System *, SystemNorm > &error_norms, const std::map< const System *, const NumericVector< Number > * > *solution_vectors=libmesh_nullptr, bool estimate_parent_error=false) libmesh_override
Currently this function ignores the error_norm member variable, and uses the function argument error_...
This is the EquationSystems class.
virtual void estimate_error(const System &system, ErrorVector &error_per_cell, const NumericVector< Number > *solution_vector=libmesh_nullptr, bool estimate_parent_error=false) libmesh_override
This function does uniform refinements and a solve to get an improved solution on each cell...
SystemNorm error_norm
When estimating the error in a single system, the error_norm is used to control the scaling and norm ...
The ErrorVector is a specialization of the StatisticsVector for error data computed on a finite eleme...
Definition: error_vector.h:50
const class libmesh_nullptr_t libmesh_nullptr
The libMesh namespace provides an interface to certain functionality in the library.
virtual void _estimate_error(const EquationSystems *equation_systems, const System *system, ErrorVector *error_per_cell, std::map< std::pair< const System *, unsigned int >, ErrorVector * > *errors_per_cell, const std::map< const System *, SystemNorm > *error_norms, const std::map< const System *, const NumericVector< Number > * > *solution_vectors=libmesh_nullptr, bool estimate_parent_error=false)
The code for estimate_error and both estimate_errors versions is very similar, so we use the same fun...
This is the base class for classes which contain information related to any physical process that mig...
Definition: system.h:76
This class implements a ``brute force&#39;&#39; error estimator which integrates differences between the curr...
This class holds functions that will estimate the error in a finite element solution on a given mesh...
std::map< std::pair< const System *, unsigned int >, ErrorVector * > ErrorMap
When calculating many error vectors at once, we need a data structure to hold them all...
virtual ErrorEstimatorType type() const libmesh_override
unsigned char number_p_refinements
How many p refinements to perform to get the fine grid.