adjoint_refinement_estimator.h
Go to the documentation of this file.00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2012 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 00020 #ifndef LIBMESH_ADJOINT_REFINEMENT_ESTIMATOR_H 00021 #define LIBMESH_ADJOINT_REFINEMENT_ESTIMATOR_H 00022 00023 // Local Includes 00024 #include "libmesh/error_estimator.h" 00025 #include "libmesh/libmesh.h" 00026 #include "libmesh/qoi_set.h" 00027 00028 // C++ includes 00029 #include <cstddef> 00030 #include <vector> 00031 00032 #ifdef LIBMESH_ENABLE_AMR 00033 00034 namespace libMesh 00035 { 00036 00046 class AdjointRefinementEstimator : public ErrorEstimator 00047 { 00048 public: 00049 00053 AdjointRefinementEstimator() : number_h_refinements(1), 00054 number_p_refinements(0), 00055 _qoi_set(QoISet()) 00056 { 00057 // We're not actually going to use error_norm; our norms are 00058 // absolute values of QoI error. 00059 error_norm = INVALID_NORM; 00060 } 00061 00065 ~AdjointRefinementEstimator() {} 00066 00071 QoISet &qoi_set() { return _qoi_set; } 00072 00077 const QoISet &qoi_set() const { return _qoi_set; } 00078 00095 virtual void estimate_error (const System& system, 00096 ErrorVector& error_per_cell, 00097 const NumericVector<Number>* solution_vector = NULL, 00098 bool estimate_parent_error = false); 00099 00104 Number &get_global_QoI_error_estimate(unsigned int qoi_index) 00105 { 00106 return computed_global_QoI_errors[qoi_index]; 00107 } 00108 00112 unsigned char number_h_refinements; 00113 00117 unsigned char number_p_refinements; 00118 00119 protected: 00120 00121 /* A vector to hold the computed global QoI error estimate */ 00122 std::vector<Number> computed_global_QoI_errors; 00123 00124 /* /\** */ 00125 /* * The code for estimate_error and both estimate_errors versions is very */ 00126 /* * similar, so we use the same function for all three */ 00127 /* *\/ */ 00128 /* virtual void _estimate_error (const EquationSystems *equation_systems, */ 00129 /* const System* system, */ 00130 /* ErrorVector* error_per_cell, */ 00131 /* std::map<std::pair<const System*, unsigned int>, ErrorVector*>* errors_per_cell, */ 00132 /* const std::map<const System*, const NumericVector<Number>* >* solution_vectors = NULL, */ 00133 /* bool estimate_parent_error = false); */ 00134 00138 QoISet _qoi_set; 00139 }; 00140 00141 } // namespace libMesh 00142 00143 #endif // #ifdef LIBMESH_ENABLE_AMR 00144 00145 #endif // LIBMESH_ADJOINT_REFINEMENT_ESTIMATOR_H 00146
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:45 UTC
Hosted By: