knlmat3d_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 _KNLMAT3D_HPP_
00019 #define _KNLMAT3D_HPP_
00020 
00021 #include "comobject_mpi.hpp"
00022 #include "common/vec3t.hpp"
00023 #include "kernel3d_mpi.hpp"
00024 
00025 using std::pair;
00026 
00027 //----------------------------------------------------------------------------------
00029 class KnlMat3d_MPI: public ComObject_MPI
00030 {
00031 protected:
00032   //---PARAMS (REQ)
00034   Vec _srcPos;
00036   Vec _srcNor;
00038   Vec _trgPos;
00040   Kernel3d_MPI _knl;
00041 public:
00044   KnlMat3d_MPI(const string& p): 
00045          ComObject_MPI(p), _srcPos(NULL), _srcNor(NULL), _trgPos(NULL) {;}
00047   virtual ~KnlMat3d_MPI() { }
00048   //MEMBER ACESS
00050   Vec& srcPos() { return _srcPos; }
00052   Vec& srcNor() { return _srcNor; }
00054   Vec& trgPos() { return _trgPos; }
00055   /* Return kernel (kernel type and coefficients) */
00056   Kernel3d_MPI& knl()    { return _knl; }
00057   //SETUP and USE
00059   virtual int setup()=0;
00062   virtual int evaluate(Vec srcDen, Vec trgVal) = 0;
00063   //OTHER ACCESS
00065   int dim() { return 3; }
00067   int srcDOF() { return _knl.srcDOF(); }
00069   int trgDOF() { return _knl.trgDOF(); }
00070   //EXTRA STUFF
00072   int  procLclNum(Vec pos) { int tmp; VecGetLocalSize(pos, &tmp); return tmp/dim(); }
00074   int  procGlbNum(Vec pos) { int tmp; VecGetSize(     pos, &tmp); return tmp/dim(); }
00077   void procLclRan(Vec pos, int& beg, int& end) { VecGetOwnershipRange(pos, &beg, &end); beg=beg/dim(); end=end/dim(); }
00078 };
00079 
00080 #endif
00081 
00082 

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