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

cluster/multipoleX.hh
Go to the documentation of this file.
00001 /* Multipole kernel expansion
00002  */
00003 
00004 #ifndef multipoleX_hh
00005 #define multipoleX_hh
00006 
00007 #include "basics/exceptions.hh"
00008 #include "bem/element.hh"
00009 #include "cluster/expansion.hh"
00010 
00011 namespace cluster {
00012 
00013   // ************************************************************ MultipoleX **
00014 
00018   template <class F = concepts::Real>
00019   class MultipoleX : public ExpansionXY<F> {
00020 
00022     uint m_;
00024     uint blksz_;
00026     uint gauss_;
00027 
00029     concepts::Real* foo_;
00030 
00031   public:
00036     MultipoleX(uint m, uint gauss);
00037 
00038     ~MultipoleX() {delete[] foo_;}
00039 
00040     uint blksz() const {return blksz_;}
00041     uint m() const {return m_;}
00042     inline XYColReal* getCol(uint blksz, uint n) const;
00047     void evaluate(const concepts::Real3d& z, concepts::Real X[]) const;
00049     inline void shift(const concepts::Real3d& z, const concepts::Real src[],
00050           concepts::Real dst[]) const;
00051     void shift(const concepts::Real3d& z, const concepts::Cmplx src[],
00052          concepts::Cmplx dst[]) const;
00053     template<class FF>
00054     void shift(const concepts::Real3d& z, const FF src[], FF dst[],
00055          uint foo) const;
00057     void apply(const concepts::Real X[], const F src[], F dst[]) const;
00058     inline void apply(const XYColExpPtr* Xexp, const F src[], F dst[]) const;
00059 
00066     void evaluate(const concepts::Element<F>& elm,
00067       const concepts::Real3d& c, XYColExpPtr* X[]) const;
00069     void evaluate(const bem::Dirac3d000<F>& elm,
00070       const concepts::Real3d& c, XYColExpPtr* X[]) const;
00072     void evaluate(const bem::Constant3d000<F>& elm,
00073       const concepts::Real3d& c, XYColExpPtr* X[]) const;
00075     void evaluate(const bem::Constant3d001<F>& elm,
00076       const concepts::Real3d& c, XYColExpPtr* X[]) const;
00078     void evaluate(const bem::Constant3d002<F>& elm,
00079       const concepts::Real3d& c, XYColExpPtr* X[]) const;
00081     void evaluate(const bem::Linear3d000<F>& elm,
00082       const concepts::Real3d& c, XYColExpPtr* X[]) const;
00083   };
00084 
00085   template <class F>
00086   inline XYColReal* MultipoleX<F>::getCol(uint blksz, uint n) const {
00087     return new XYColReal(blksz, n);
00088   }
00089 
00090   template <class F>
00091   inline void MultipoleX<F>::shift(const concepts::Real3d& z,
00092            const concepts::Real src[],
00093            concepts::Real dst[]) const {
00094     shift<concepts::Real>(z, src, dst, 0);
00095   }
00096 
00097   template <class F>
00098   inline void MultipoleX<F>::apply(const XYColExpPtr* Xexp, const F src[],
00099            F dst[]) const {
00100     const XYColRealPtr* X = dynamic_cast<const XYColRealPtr*>(Xexp);
00101     if (X) {apply(X->value(), src, dst);  return;}
00102 
00103     throw
00104       conceptsException(concepts::MissingFeature("XYColExp not supported"));
00105   }
00106 
00107 } // namespace cluster
00108 
00109 #endif // multipoleX_hh

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