Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

cluster/multipoleDY.hh
Go to the documentation of this file.
00001 /* Multipole kernel expansion
00002  */
00003 
00004 #ifndef multipoleDY_hh
00005 #define multipoleDY_hh
00006 
00007 #include "basics/exceptions.hh"
00008 #include "bem/element.hh"
00009 #include "cluster/expansion.hh"
00010 #include "cluster/multipoleY.hh"
00011 
00012 namespace cluster {
00013 
00014   // *********************************************************** DMultipoleY **
00015 
00019   template <class F = concepts::Real>
00020   class DMultipoleY : public ExpansionXY<F> {
00021 
00023     MultipoleY<F> Y_;
00024 
00026     uint m_;
00028     uint blksz_;
00030     uint gauss_;
00031 
00033     concepts::Real* foo_;
00034     concepts::Real* fee_;
00035 
00036   public:
00041     DMultipoleY(uint m, uint gauss);
00042 
00043     ~DMultipoleY() {delete[] fee_; delete[] foo_;}
00044 
00045     uint blksz() const {return blksz_;}
00046     uint m() const {return m_;}
00047     inline XYColReal* getCol(uint blksz, uint n) const;
00053     void evaluate(const concepts::Real3d& z, const concepts::Unit3d& h,
00054       concepts::Real Y[]) const;
00055     inline void shift(const concepts::Real3d& z, const concepts::Real src[],
00056           concepts::Real dst[]) const;
00057     inline void shift(const concepts::Real3d& z, const concepts::Cmplx src[],
00058           concepts::Cmplx dst[]) const;
00060     inline void apply(const XYColExpPtr* Y, const F src[], F dst[]) const;
00061 
00068     void evaluate(const concepts::Element<F>& elm,
00069       const concepts::Real3d& c, XYColExpPtr* Y[]) const;
00071     void evaluate(const bem::Constant3d000<F>& elm,
00072       const concepts::Real3d& c, XYColExpPtr* Y[]) const;
00074     void evaluate(const bem::Constant3d001<F>& elm,
00075       const concepts::Real3d& c, XYColExpPtr* Y[]) const;
00077     void evaluate(const bem::Constant3d002<F>& elm,
00078       const concepts::Real3d& c, XYColExpPtr* Y[]) const;
00080     void evaluate(const bem::Linear3d000<F>& elm,
00081       const concepts::Real3d& c, XYColExpPtr* Y[]) const;
00082   };
00083 
00084   template <class Fspc>
00085   inline XYColReal* DMultipoleY<Fspc>::getCol(uint blksz, uint n) const {
00086     return new XYColReal(blksz, n);
00087   }
00088 
00089   template <class Fspc>
00090   inline void DMultipoleY<Fspc>::shift(const concepts::Real3d& z,
00091                const concepts::Real src[],
00092                concepts::Real dst[]) const {
00093     Y_.shift(z, src, dst, 0);
00094   }
00095 
00096   template <class Fspc>
00097   inline void DMultipoleY<Fspc>::shift(const concepts::Real3d& z,
00098                const concepts::Cmplx src[],
00099                concepts::Cmplx dst[]) const {
00100     Y_.shift(z, src, dst);
00101   }
00102 
00103   template <class F>
00104   inline void DMultipoleY<F>::apply(const XYColExpPtr* Y,
00105             const F src[], F dst[]) const {
00106     const XYColRealPtr* YMPE = dynamic_cast<const XYColRealPtr*>(Y);
00107     if (YMPE) {Y_.apply(YMPE->value(), src, dst);  return;}
00108 
00109     throw
00110       conceptsException(concepts::MissingFeature("XYColExp not supported"));
00111   }
00112 
00113 } // namespace cluster
00114 
00115 #endif // multipoleDY_hh

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)