matmgnt3d.hpp

Go to the documentation of this file.
00001 /* Kernel Independent Fast Multipole Method
00002    Copyright (C) 2004 Lexing Ying, New York University
00003 
00004 This program is free software; you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation; either version 2, or (at your option)
00007 any later version.
00008 
00009 This program is distributed in the hope that it will be useful, but WITHOUT
00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00012 for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; see the file COPYING.  If not, write to the Free
00016 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00017 02111-1307, USA.  */
00018 #ifndef _MATMGNT3D_HPP_
00019 #define _MATMGNT3D_HPP_
00020 
00021 #include "common/nummat.hpp"
00022 #include "common/numtns.hpp"
00023 #include "common/offtns.hpp"
00024 #include "common/vec3t.hpp"
00025 #include "kernel3d.hpp"
00026 #include "comobject.hpp"
00027 
00028 using std::map;
00029 using std::pair;
00030 
00031 //--------------------------------------
00032 //unique identifier: equation
00033 class MatMgnt3d
00034 {
00035 public:
00041   enum {         UE=0,   UC=1,   DE=2,   DC=3,  };
00042 public:
00043   //PARAMS(REQ) -- has to be set by parent class
00044   Kernel3d _knl; //the elq used by matmagnt (provide from fmm)
00045   int _np;
00046   bool _hom;
00047   vector<double> _degVec;
00048   //COMPONENTS
00049 
00051   map<int, DblNumMat> _upwChk2UpwEqu;
00053   map<int, NumTns<DblNumMat> > _upwEqu2UpwChk;
00055   map<int, DblNumMat> _dwnChk2DwnEqu;
00057   map<int, NumTns<DblNumMat> > _dwnEqu2DwnChk;
00059   map<int, OffTns<DblNumMat> > _upwEqu2DwnChk;
00061   DblNumMat _samPos[4];
00063   DblNumMat _regPos; 
00064   
00065 public:
00066   MatMgnt3d();
00067   ~MatMgnt3d();
00068   //MEMBER ACCESS
00069   Kernel3d& knl() { return _knl; }
00070   int& np() { return _np; }
00071   double alt(); //TODO: decide it based on np
00072   //...
00074   int srcDOF() { return _knl.srcDOF(); }  //int tdof() { return eq().tdof(qt()); }
00076   int trgDOF() { return _knl.trgDOF(); }
00078   int dim() { return 3; }
00079   //SETUP AND USE
00080   int setup();
00081   int report();
00083   int plnDatSze(int tp); 
00085   int effDatSze(int tp); 
00086   
00087   int UpwChk2UpwEqu_dgemv (int level,             const DblNumVec&, DblNumVec&);
00088   int UpwEqu2UpwChk_dgemv (int level, Index3 ii,  const DblNumVec&, DblNumVec&);
00089   int DwnChk2DwnEqu_dgemv (int level,             const DblNumVec&, DblNumVec&);
00090   int DwnEqu2DwnChk_dgemv (int level, Index3 ii,  const DblNumVec&, DblNumVec&);
00091   int UpwEqu2DwnChk_dgemv (int level, Index3 ii,  const DblNumVec& effDen, DblNumVec& effVal);
00092 
00094   int plnDen2EffDen(int level, const DblNumVec&, DblNumVec&); 
00095   int samDen2RegDen(const DblNumVec&, DblNumVec&);
00097   int effVal2PlnVal(int level, const DblNumVec&, DblNumVec&); 
00098   int regVal2SamVal(const DblNumVec&, DblNumVec&);
00099 
00106   const DblNumMat& samPos(int tp) { return _samPos[tp]; }
00108   const DblNumMat& regPos()       { return _regPos; }
00110   int localPos(int, Point3, double, DblNumMat&);
00112   int samPosCal(int n, double R, DblNumMat& ret);
00114   int regPosCal(int n, double R, DblNumMat& ret); 
00115   int cptwvv(int, double, fftw_complex*, int, fftw_complex*, int, fftw_complex*, int);
00116   
00117 public:
00118   static double _wsbuf[];
00119   static vector<MatMgnt3d> _mmvec;
00120 public:
00121   static MatMgnt3d* getmmptr(Kernel3d, int);  //static void clearmmptrs();
00122 };
00123 
00124 
00125 
00126 
00127 /*       int plnnum(ItlGrdType tp) { return _plnpos[tp].n(); }
00128          int effnum(ItlGrdType tp) { return (2*_np+2)*(2*_np)*(2*_np); }
00129          int regnum(ItlGrdType tp) { return _regpos[tp].n(); }  */
00130 //int SE2TC_dgemv(const DblNumMat& srcpos, const DblNumMat& srcnor, const DblNumMat& trgpos, const DblNumVec& srcden, DblNumVec& trgval);
00131 //int SE2UC_dgemv(const DblNumMat& srcpos, const DblNumMat& srcnor, Point3 trgctr, double trgrad, const DblNumVec& srcden, DblNumVec& trgval);
00132 //int SE2DC_dgemv(const DblNumMat& srcpos, const DblNumMat& srcnor, Point3 trgctr, double trgrad, const DblNumVec& srcden, DblNumVec& trgval);
00133 //int DE2TC_dgemv(Point3 srcctr, double srcrad, const DblNumMat& trgpos, const DblNumVec& srcden, DblNumVec& trgval);
00134 //int UE2TC_dgemv(Point3 srcctr, double srcrad, const DblNumMat& trgpos, const DblNumVec& srcden, DblNumVec& trgval);
00135 
00136 
00137 
00138 
00139 #endif
00140 
00141 

Generated on Sun Dec 4 19:24:39 2005 for fmm3d by  doxygen 1.4.5