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

cluster/multipole.hh
Go to the documentation of this file.
00001 /* Multipole kernel expansion
00002  */
00003 
00004 #ifndef multipole_hh
00005 #define multipole_hh
00006 
00007 #include "basics/exceptions.hh"
00008 #include "bem/element.hh"
00009 #include "cluster/expansion.hh"
00010 
00011 namespace cluster {
00012 
00013   // ***************************************************** MultipoleLaplaceF **
00014 
00018   template <class Fspc = concepts::Real>
00019   class MultipoleLaplaceF : public ExpansionF<Fspc> {
00021     uint m_;
00022 
00023   public:
00027     MultipoleLaplaceF(uint m) {m_ = m;}
00028 
00032     uint blksz(uint m) const {return m * (m + 1);}
00033     uint m() const {return m_;}
00036     virtual FColReal* getCol(uint blksz) const {
00037       return new FColReal(blksz);
00038     }
00040     inline void evaluate(uint m, const concepts::Real3d& z,
00041        FColExp* Fexp) const;
00042     void evaluate(uint m, const concepts::Real3d& z, FColReal* Fexp) const;
00044     inline void apply(uint m, const FColExp* Fexp, const Fspc src[],
00045           Fspc dst[]) const;
00046     void apply(uint m, const FColReal Fexp[], const Fspc src[],
00047          Fspc dst[]) const;
00048   };
00049 
00050   template <class Fspc>
00051   void MultipoleLaplaceF<Fspc>::evaluate(uint m, const concepts::Real3d& z,
00052            FColExp* Fexp) const {
00053     FColReal* Fmpe = dynamic_cast<FColReal*>(Fexp);
00054     if (Fmpe) {evaluate(m, z, Fmpe);  return;}
00055 
00056     throw
00057       conceptsException(concepts::MissingFeature("FColExp not supported"));
00058   }
00059 
00060   template <class Fspc>
00061   void MultipoleLaplaceF<Fspc>::apply(uint m, const FColExp* Fexp,
00062               const Fspc src[], Fspc dst[]) const {
00063     const FColReal* Fmpe = dynamic_cast<const FColReal*>(Fexp);
00064     if (Fmpe) {apply(m, Fmpe, src, dst);  return;}
00065 
00066     throw
00067       conceptsException(concepts::MissingFeature("FColExp not supported"));
00068   }
00069 
00070 } // namespace cluster
00071 
00072 #endif // multipole_hh

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