adjoint_residual_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_ADJOINT_RESIDUAL_ERROR_ESTIMATOR_H
21 #define LIBMESH_ADJOINT_RESIDUAL_ERROR_ESTIMATOR_H
22 
23 // Local Includes
24 #include "libmesh/auto_ptr.h" // deprecated
26 #include "libmesh/qoi_set.h"
27 
28 // C++ includes
29 #include <cstddef>
30 #include <string>
31 #include <vector>
32 #include <memory>
33 
34 namespace libMesh
35 {
51 {
52 public:
53 
58 
66 
72  virtual ~AdjointResidualErrorEstimator() = default;
73 
78  std::unique_ptr<ErrorEstimator> & primal_error_estimator() { return _primal_error_estimator; }
79 
84  std::unique_ptr<ErrorEstimator> & dual_error_estimator() { return _dual_error_estimator; }
85 
90  QoISet & qoi_set() { return _qoi_set; }
91 
96  const QoISet & qoi_set() const { return _qoi_set; }
97 
105  std::string error_plot_suffix;
106 
117  virtual void estimate_error (const System & system,
118  ErrorVector & error_per_cell,
119  const NumericVector<Number> * solution_vector = nullptr,
120  bool estimate_parent_error = false) override;
121 
122  virtual ErrorEstimatorType type() const override;
123 
124 protected:
125 
129  std::unique_ptr<ErrorEstimator> _primal_error_estimator;
130 
134  std::unique_ptr<ErrorEstimator> _dual_error_estimator;
135 
140 };
141 
142 
143 } // namespace libMesh
144 
145 #endif // LIBMESH_ADJOINT_RESIDUAL_ERROR_ESTIMATOR_H
std::unique_ptr< ErrorEstimator > & dual_error_estimator()
Used to specify quantities of interest in a simulation.
Definition: qoi_set.h:45
Manages consistently variables, degrees of freedom, and coefficient vectors.
Definition: system.h:92
virtual ~AdjointResidualErrorEstimator()=default
std::unique_ptr< ErrorEstimator > _dual_error_estimator
std::unique_ptr< ErrorEstimator > & primal_error_estimator()
std::unique_ptr< ErrorEstimator > _primal_error_estimator
AdjointResidualErrorEstimator & operator=(const AdjointResidualErrorEstimator &)=delete
virtual void estimate_error(const System &system, ErrorVector &error_per_cell, const NumericVector< Number > *solution_vector=nullptr, bool estimate_parent_error=false) override
virtual ErrorEstimatorType type() const override