00001 #ifndef _MY_ArrayOfVecDouble_
00002 #define _MY_ArrayOfVecDouble_
00003
00004 #include "vecdoubleref.h"
00005 #include "vecdoublestack.h"
00006
00010 class ArrayOfVecDouble
00011 {
00012 private:
00013 Matrix m_M;
00014 protected:
00015
00016 public:
00017 ArrayOfVecDouble()
00018 {
00019 }
00020
00021 ArrayOfVecDouble(const std::vector<dealii::Point<3> > &dealpts)
00022 {
00023 this->operator=(dealpts);
00024
00025 }
00026
00027 ArrayOfVecDouble(const std::vector<dealii::Point<2> > &dealpts)
00028 {
00029 if (dealpts.size()==0)
00030 {
00031 reinit(0,0);
00032 return;
00033 }
00034 reinit(dealpts.size(),2);
00035 for (unsigned i=0;i<dealpts.size();i++)
00036 {
00037 operator()(i,0)=dealpts[i][0];
00038 operator()(i,1)=dealpts[i][1];
00039 }
00040
00041
00042 }
00043
00044
00045
00046 void reinit(unsigned size,unsigned vector_size)
00047 {
00048 m_M.reinit(size,vector_size);
00049 }
00050
00051 void getVecValues(unsigned i,VecDoubleRef *v);
00052
00053 void copyVecValues(unsigned i,VecDouble *v) const;
00054
00055 VecDouble operator[](Index i) const;
00056
00057 void getComponent(VecDouble &v,unsigned cmp);
00058
00059
00060
00061 operator Matrix&() {return m_M;}
00062 operator const Matrix&() const {return m_M;}
00063 double& operator()(Index i,Index j){return m_M(i,j);}
00064 unsigned size() const {return m_M.m();}
00065 unsigned vecs_size() const {return m_M.n();}
00066 ~ArrayOfVecDouble(){}
00067
00068 void operator= (const std::vector<dealii::Point<3> > &dealpts)
00069 {
00070 if (dealpts.size()==0)
00071 {
00072 reinit(0,0);
00073 return;
00074 }
00075 reinit(dealpts.size(),3);
00076 for (unsigned i=0;i<dealpts.size();i++)
00077 {
00078 operator()(i,0)=dealpts[i][0];
00079 operator()(i,1)=dealpts[i][1];
00080 operator()(i,2)=dealpts[i][2];
00081 }
00082 }
00083 void print()
00084 {
00085 m_M.print_formatted(std::cout);
00086
00087 }
00088 };
00089
00090 #endif