kernel3d_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 
00026 #ifndef _KERNEL3D_HPP_
00027 #define _KERNEL3D_HPP_
00028 
00029 #include "common/nummat.hpp"
00030 
00031 using std::vector;
00032 
00033 //eqt: 1 2 3 4 5 6
00034 //lyr: s d r p
00035 //qnt: u p ...
00036 
00037 enum {
00038   //laplace kernels
00040   KNL_LAP_S_U = 111,
00042   KNL_LAP_D_U = 121,
00044   KNL_LAP_I   = 191, 
00045   //stokes kernels
00047   KNL_STK_F_U = 301,
00049   KNL_STK_S_U = 311,
00051   KNL_STK_S_P = 312,
00053   KNL_STK_D_U = 321,
00055   KNL_STK_D_P = 322,
00057   KNL_STK_R_U = 331,
00059   KNL_STK_R_P = 332,
00061   KNL_STK_I   = 391,
00063   KNL_STK_E   = 392, 
00064   //navier kernels
00066   KNL_NAV_S_U = 511,
00068   KNL_NAV_D_U = 521,
00070   KNL_NAV_R_U = 531,
00072   KNL_NAV_I   = 591,
00074   KNL_NAV_E   = 592, 
00075   //other kernels
00077   KNL_ERR = -1
00078 };
00079 
00081 class Kernel3d_MPI
00082 {
00083 protected:
00085   int _kernelType;
00087   vector<double> _coefs;
00089   static double _mindif; 
00090 public:
00092   Kernel3d_MPI(): _kernelType(KNL_ERR) {;}
00094   Kernel3d_MPI(int kernelType, const vector<double>& coefs): _kernelType(kernelType), _coefs(coefs) {;}
00096   Kernel3d_MPI(const Kernel3d_MPI& c): _kernelType(c._kernelType), _coefs(c._coefs) {;}
00098   Kernel3d_MPI& operator=(const Kernel3d_MPI& c) {
00099          _kernelType = c._kernelType; _coefs = c._coefs; return *this;
00100   }
00102   int& kernelType() { return _kernelType; }
00104   const int& kernelType() const { return _kernelType; }
00106   vector<double>& coefs() { return _coefs; }
00108   const vector<double>& coefs() const { return _coefs; }
00110   int dim() { return 3; }
00112   int srcDOF() const;
00114   int trgDOF() const;
00116   bool homogeneous() const;
00118   void homogeneousDeg(vector<double>&) const; 
00124   int buildKnlIntCtx(const DblNumMat& srcPos, const DblNumMat& srcNor, const DblNumMat& trgPos, DblNumMat& inter);
00125 };
00126 
00128 inline bool operator==(const Kernel3d_MPI& a, const Kernel3d_MPI& b) {
00129   return (a.kernelType()==b.kernelType() && a.coefs()==b.coefs());
00130 }
00131 
00132 
00133 
00134 #endif

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