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
00035 #ifndef __FE_SHAPE_H
00036 #define __FE_SHAPE_H
00037
00038 #include <math.h>
00039 #include <float.h>
00040 #include <stdlib.h>
00041 #include <assert.h>
00042
00043 #include "OFELI_Config.h"
00044 #include "Element.h"
00045 #include "Side.h"
00046 #include "LocalMatrix.h"
00047 #include "LocalVect.h"
00048 #include "Point.h"
00049 #include "util.h"
00050 #include "Gauss.h"
00051
00052
00053 namespace OFELI {
00054
00059 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00060 struct ErrorInFEShape {
00061 void Message(const char *file, size_t line, int code, int p1);
00062 };
00063 #endif
00064
00071 class FEShape
00072 {
00073
00074 public :
00075
00077 FEShape() { }
00078
00081 FEShape(const Element *el);
00082
00085 FEShape(const Side *sd);
00086
00088 virtual ~FEShape() { }
00089
00090
00091
00092
00093
00094
00095
00097 double Sh(size_t i) const { return _sh[i-1]; }
00098
00103 double Sh(size_t i, Point<double> s) const { s = 0; return _sh[i-1]; }
00104
00110 Point<double> DSh(size_t i) const { return _dsh[i-1]; }
00111
00116 double getDet() const { return _det; }
00117
00119 Point<double> getCenter() const { return _c; }
00120
00126 Point<double> getLocalPoint() const
00127 {
00128 Point<double> s = 0.;
00129 for (size_t i=0; i<_x.size(); i++)
00130 s += _sh[i] * _x[i];
00131 return s;
00132 }
00133
00136 Point<double> getLocalPoint(const Point<double> &s) const
00137 {
00138 Point<double> t = 0.;
00139 for (size_t i=0; i<_x.size(); i++)
00140 t += Sh(i+1,s) * _x[i];
00141 return t;
00142 }
00143
00144 protected:
00145
00146 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00147 bool _localized;
00148 double _det;
00149 valarray<double> _sh;
00150 valarray<size_t> _node;
00151 valarray<Point<double> > _x, _dsh, _dshl;
00152 Point<double> _c;
00153 size_t _label;
00154 #endif
00155 };
00156
00157 }
00158
00159 #endif