matmgnt3d_mpi.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_mpi.hpp"
00026 #include "comobject_mpi.hpp"
00027 
00028 using std::map;
00029 using std::pair;
00030 
00031 //--------------------------------------
00032 //unique identifier: equation
00034 
00036 class MatMgnt3d_MPI
00037 {
00038 public:
00039   enum {          UE=0, UC=1, DE=2, DC=3,  };
00043 public:
00044   //PARAMS(REQ) -- has to be set by parent class
00046   Kernel3d_MPI _knl; 
00048   int _np;              
00050   bool _homogeneous;
00051   vector<double> _degVec;
00052   //COMPONENTS
00054   map<int, DblNumMat> _upwChk2UpwEqu;
00056   map<int, NumTns<DblNumMat> > _upwEqu2UpwChk;
00058   map<int, DblNumMat> _dwnChk2DwnEqu;
00060   map<int, NumTns<DblNumMat> > _dwnEqu2DwnChk;
00062   map<int, OffTns<DblNumMat> > _upwEqu2DwnChk;
00064   DblNumMat _samPos[4];
00066   DblNumMat _regPos; 
00067   
00068 public:
00069   MatMgnt3d_MPI();
00070   ~MatMgnt3d_MPI();
00071   //MEMBER ACCESS
00073   Kernel3d_MPI& knl() { return _knl; }
00075   int& np() { return _np; }
00076   /* Return 0.1^(_np+1) */
00077   double alt(); //TODO: decide it based on np
00078 
00080   int srcDOF() { return _knl.srcDOF(); }
00082   int trgDOF() { return _knl.trgDOF(); }
00084   int dim() { return 3; }
00085   //SETUP AND USE
00087   int setup();
00089   int report();
00091   int plnDatSze(int tp);
00093   int effDatSze(int tp);
00094 
00096   int UpwChk2UpwEqu_dgemv(int level,             const DblNumVec&, DblNumVec&);
00098   int UpwEqu2UpwChk_dgemv(int level, Index3 ii, const DblNumVec&, DblNumVec&);
00100   int DwnChk2DwnEqu_dgemv(int level,             const DblNumVec&, DblNumVec&);
00102   int DwnEqu2DwnChk_dgemv(int level, Index3 ii, const DblNumVec&, DblNumVec&);
00104   int UpwEqu2DwnChk_dgemv(int level, Index3 ii, const DblNumVec& effDen, DblNumVec& effVal);
00105 
00107   int plnDen2EffDen(int level, const DblNumVec&, DblNumVec&);
00109   int samDen2RegDen(const DblNumVec&, DblNumVec&);
00111   int effVal2PlnVal(int level, const DblNumVec&, DblNumVec&);
00113   int regVal2SamVal(const DblNumVec&, DblNumVec&);
00114 
00116   const DblNumMat& samPos(int tp) { return _samPos[tp]; }
00118   const DblNumMat& regPos()       { return _regPos; }
00120   int locPos(int, Point3, double, DblNumMat&);
00122   int samPosCal(int n, double R, DblNumMat& ret);
00124   int regPosCal(int n, double R, DblNumMat& ret); 
00125   int cptwvv(int, double, fftw_complex*, int, fftw_complex*, int, fftw_complex*, int);
00126   
00127 public:
00128   static double _wsbuf[];
00129   static vector<MatMgnt3d_MPI> _mmvec;
00130 public:
00131   static MatMgnt3d_MPI* getmmptr(Kernel3d_MPI, int);  //static void clearmmptrs();
00132 };
00133 
00134 #endif
00135 
00136 

Generated on Sun Dec 4 21:12:40 2005 for fmm3d_mpi by  doxygen 1.4.5