$extrastylesheet
error_vector.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 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_ERROR_VECTOR_H
00021 #define LIBMESH_ERROR_VECTOR_H
00022 
00023 // Local Includes
00024 #include "libmesh/statistics.h"
00025 
00026 // C++ includes
00027 #include <cstddef>
00028 
00029 namespace libMesh
00030 {
00031 
00032 // Now defined in libmesh_common.h:
00033 // typedef float ErrorVectorReal;
00034 
00035 // Forward Declarations
00036 class MeshBase;
00037 class Mesh;
00038 
00052 class ErrorVector : public StatisticsVector<ErrorVectorReal>
00053 {
00054 
00055 public:
00056 
00065   ErrorVector(dof_id_type i=0, MeshBase *mesh = NULL) : StatisticsVector<ErrorVectorReal> (i), _mesh(mesh) {}
00066 
00075   ErrorVector(dof_id_type i, ErrorVectorReal val) :
00076     StatisticsVector<ErrorVectorReal> (i,val) {}
00077 
00081   virtual ErrorVectorReal minimum() const;
00082 
00087   virtual Real mean() const;
00088 
00097   virtual Real median();
00098 
00104   virtual Real median() const;
00105 
00116   virtual Real variance() const
00117   { return this->variance(this->mean()); }
00118 
00130   virtual Real variance(const Real mean) const;
00131 
00137   virtual std::vector<dof_id_type> cut_below(Real cut) const;
00138 
00144   virtual std::vector<dof_id_type> cut_above(Real cut) const;
00145 
00151   void plot_error(const std::string &filename,
00152                   const MeshBase& mesh) const;
00153 
00154 protected:
00158   bool is_active_elem (dof_id_type i) const;
00159 
00164   MeshBase *_mesh;
00165 };
00166 
00167 
00168 } // namespace libMesh
00169 
00170 #endif // LIBMESH_ERROR_VECTOR_H