error_vector.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_ERROR_VECTOR_H
21 #define LIBMESH_ERROR_VECTOR_H
22 
23 // Local Includes
24 #include "libmesh/statistics.h"
25 
26 // C++ includes
27 #include <cstddef>
28 
29 namespace libMesh
30 {
31 
32 // Forward Declarations
33 class MeshBase;
34 class Mesh;
35 
50 class ErrorVector : public StatisticsVector<ErrorVectorReal>
51 {
52 public:
53 
62  ErrorVector(dof_id_type i=0, MeshBase * mesh = nullptr) :
64  _mesh(mesh)
65  {}
66 
77 
81  virtual ErrorVectorReal minimum() const override;
82 
87  virtual Real mean() const override;
88 
96  virtual Real median() override;
97 
103  virtual Real median() const override;
104 
115  virtual Real variance() const override
116  { return this->variance(this->mean()); }
117 
129  virtual Real variance(const Real mean) const override;
130 
136  virtual std::vector<dof_id_type> cut_below(Real cut) const override;
137 
143  virtual std::vector<dof_id_type> cut_above(Real cut) const override;
144 
150  void plot_error(const std::string & filename,
151  const MeshBase & mesh) const;
152 
153 protected:
157  bool is_active_elem (dof_id_type i) const;
158 
164 };
165 
166 } // namespace libMesh
167 
168 #endif // LIBMESH_ERROR_VECTOR_H
MeshBase & mesh
virtual Real variance() const override
Definition: error_vector.h:115
A std::vector derived class for implementing simple statistical algorithms.
Definition: statistics.h:67
DIE A HORRIBLE DEATH HERE typedef float ErrorVectorReal
virtual std::vector< dof_id_type > cut_above(Real cut) const override
Definition: error_vector.C:174
Base class for Mesh.
Definition: mesh_base.h:77
virtual Real median() override
Definition: error_vector.C:92
void plot_error(const std::string &filename, const MeshBase &mesh) const
Definition: error_vector.C:210
virtual std::vector< dof_id_type > cut_below(Real cut) const override
Definition: error_vector.C:150
virtual ErrorVectorReal minimum() const override
Definition: error_vector.C:46
ErrorVector(dof_id_type i=0, MeshBase *mesh=nullptr)
Definition: error_vector.h:62
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ErrorVector(dof_id_type i, ErrorVectorReal val)
Definition: error_vector.h:75
bool is_active_elem(dof_id_type i) const
Definition: error_vector.C:197
uint8_t dof_id_type
Definition: id_types.h:64
virtual Real mean() const override
Definition: error_vector.C:69