00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef __ESTIMATOR_H
00035 #define __ESTIMATOR_H
00036
00037 #include "OFELI_Config.h"
00038 #include "Mesh.h"
00039 #include "NodeVect.h"
00040 #include "ElementVect.h"
00041 #include "SideVect.h"
00042
00043
00044 namespace OFELI {
00045
00046 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00047 struct ErrorInEstimator {
00048 void Message(const char *file, size_t line, int code, int p1=0);
00049 };
00050 #endif
00051
00052
00053
00054
00055
00056
00069 class Estimator
00070 {
00071
00072 public :
00073
00075 Estimator() {
00076 #ifdef _OFELI_DEBUG
00077 std::clog << "An instance of class Estimator is constructed.\n";
00078 std::clog << "File : " << __FILE__ << ", Line : " << __LINE__ << endl;
00079 #endif
00080 }
00081
00083 Estimator(Mesh &m);
00084
00086 ~Estimator() {
00087 #ifdef _OFELI_DEBUG
00088 std::clog << "An instance of class Estimator is destructed.\n";
00089 std::clog << "File: " << __FILE__ << ", Line: " << __LINE__ << endl;
00090 #endif
00091 }
00092
00094 void setError(const NodeVect<double> &u);
00095
00097 ElementVect<double> Err;
00098
00100 double getAverage() const { return average_; }
00101
00103 const Mesh &getMesh() const { return *theMesh_; }
00104
00105 private :
00106
00107 Mesh *theMesh_;
00108 double average_;
00109 ErrorInEstimator e_;
00110 void elementT3_(const NodeVect<double> &u, Vect<double> &M, NodeVect<Point<double> > &b);
00111 };
00112
00113
00117 ostream& operator<<(ostream& s, const Estimator &r);
00118
00119 }
00120
00121 #endif