libMesh
Loading...
Searching...
No Matches
error_vector.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 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
29namespace libMesh
30{
31
32// Forward Declarations
33class MeshBase;
34class Mesh;
35
50class ErrorVector : public StatisticsVector<ErrorVectorReal>
51{
52public:
53
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,
152 const std::string & data_type = "error") const;
153
154protected:
158 bool is_active_elem (dof_id_type i) const;
159
165};
166
167} // namespace libMesh
168
169#endif // LIBMESH_ERROR_VECTOR_H
The ErrorVector is a specialization of the StatisticsVector for error data computed on a finite eleme...
virtual Real variance() const override
virtual Real mean() const override
virtual std::vector< dof_id_type > cut_above(Real cut) const override
virtual ErrorVectorReal minimum() const override
bool is_active_elem(dof_id_type i) const
Utility function to decide whether element i is active.
ErrorVector(dof_id_type i=0, MeshBase *mesh=nullptr)
ErrorVector constructor; sets initial length to i.
virtual std::vector< dof_id_type > cut_below(Real cut) const override
MeshBase * _mesh
Pointer to the mesh, which may be used to decide which elements are active.
ErrorVector(dof_id_type i, ErrorVectorReal val)
ErrorVector constructor; sets initial length to i and initial values to val.
virtual Real median() override
void plot_error(const std::string &filename, const MeshBase &mesh, const std::string &data_type="error") const
Plots a data file, of a type determined by looking at the file extension in filename,...
This is the MeshBase class.
Definition mesh_base.h:81
The StatisticsVector class is derived from the std::vector<> and therefore has all of its useful feat...
Definition statistics.h:68
MeshBase & mesh
The libMesh namespace provides an interface to certain functionality in the library.
DIE A HORRIBLE DEATH HERE typedef float ErrorVectorReal
uint8_t dof_id_type
Definition id_types.h:67
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real