patch_recovery_error_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_PATCH_RECOVERY_ERROR_ESTIMATOR_H 00021 #define LIBMESH_PATCH_RECOVERY_ERROR_ESTIMATOR_H 00022 00023 // Local Includes 00024 #include "libmesh/error_estimator.h" 00025 #include "libmesh/enum_order.h" 00026 #include "libmesh/patch.h" 00027 #include "libmesh/point.h" 00028 #include "libmesh/elem_range.h" 00029 00030 // C++ includes 00031 #include <cstddef> 00032 #include <vector> 00033 00034 namespace libMesh 00035 { 00036 00037 // Forward Declarations 00038 class Elem; 00039 00040 00047 class PatchRecoveryErrorEstimator : public ErrorEstimator 00048 { 00049 public: 00050 00056 PatchRecoveryErrorEstimator() : 00057 target_patch_size(20), 00058 patch_growth_strategy(&Patch::add_local_face_neighbors), 00059 patch_reuse(true) 00060 { error_norm = H1_SEMINORM; } 00061 00065 ~PatchRecoveryErrorEstimator() {} 00066 00067 00074 virtual void estimate_error (const System& system, 00075 ErrorVector& error_per_cell, 00076 const NumericVector<Number>* solution_vector = NULL, 00077 bool estimate_parent_error = false); 00078 00083 unsigned int target_patch_size; 00084 00091 Patch::PMF patch_growth_strategy; 00092 00093 void set_patch_reuse (bool ); 00094 00095 protected: 00096 00101 static std::vector<Real> specpoly(const unsigned int dim, 00102 const Order order, 00103 const Point p, 00104 const unsigned int matsize); 00105 00106 bool patch_reuse ; 00107 00108 private: 00109 00114 class EstimateError 00115 { 00116 public: 00117 EstimateError (const System& sys, 00118 const PatchRecoveryErrorEstimator &ee, 00119 ErrorVector& epc) : 00120 system(sys), 00121 error_estimator(ee), 00122 error_per_cell(epc) 00123 {} 00124 00125 void operator()(const ConstElemRange &range) const; 00126 00132 private: 00133 00134 const System &system; 00135 const PatchRecoveryErrorEstimator &error_estimator; 00136 ErrorVector &error_per_cell; 00137 }; 00138 00139 friend class EstimateError; 00140 }; 00141 00142 00143 } // namespace libMesh 00144 00145 00146 #endif // LIBMESH_PATCH_RECOVERY_ERROR_ESTIMATOR_H
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:48 UTC
Hosted By: