00001 #ifndef _MY_MappedFEValuesBase_
00002 #define _MY_MappedFEValuesBase_
00003 #include "finiteelementinterface.h"
00004 #include "mappingorthomesh.h"
00005
00006 enum COMPUTE_DEF {COMPUTE_VALUES=1,COMPUTE_GRADS=2,COMPUTE_PTS=4,COMPUTE_J=8,COMPUTE_JxW=16};
00007
00008
00013 class MappedFEValuesBase
00014 {
00015
00016 protected:
00017 FiniteElementInterface &_fe;
00018 ArrayOfVecDouble _pts;
00019 VecDouble _weights;
00020 unsigned m_n_dofs;
00023 Matrix _Values;
00024 std::vector<VecDouble> _Grad;
00025 std::vector<VecDouble> _Mapped_Points;
00026 std::vector<Matrix> _TGrad;
00027 VecDouble _J;
00028 VecDouble _JxW;
00030 unsigned m_compute_flags;
00031
00032 void setPoints(const ArrayOfVecDouble &v,const VecDouble &weights);
00033
00034
00035 public:
00036
00037 MappedFEValuesBase(FiniteElementInterface &fe,Index n_dofs)
00038 :_fe(fe),m_n_dofs(n_dofs),m_compute_flags(0){}
00039
00040
00041 unsigned n_pts(){return _pts.size();}
00042
00043 double function_value(Index pt, Index local_dof) const
00044 {
00045
00046 return _Values(pt,local_dof);
00047 }
00048
00049
00050
00057 const VecDouble& function_grad(Index pt, Index local_dof) const
00058 {
00059
00060 return _Grad[pt*m_n_dofs + local_dof];
00061 }
00062
00069 double J(unsigned ptIndex)
00070 {
00071
00072 return _J(ptIndex);
00073 }
00074
00085 double JxW(unsigned ptIndex)
00086 {
00087
00088
00089 return _JxW(ptIndex);
00090 }
00091
00092 void compute_points(MappingOrthoMesh &map);
00093
00094 const VecDouble& mapped_pts(unsigned ptIndex)
00095 {
00096 return _Mapped_Points[ptIndex];
00097 }
00098
00099 ~MappedFEValuesBase(){}
00100
00101 void print(std::ostream &out=std::cout);
00102 };
00103
00104 #endif