multipole.hh

Go to the documentation of this file.
1 
6 #ifndef multipole_hh
7 #define multipole_hh
8 
9 #include "basics/exceptions.hh"
10 #include "bem/element.hh"
11 #include "cluster/expansion.hh"
12 
13 namespace cluster {
14 
15  // ***************************************************** MultipoleLaplaceF **
16 
20  template <class Fspc = concepts::Real>
21  class MultipoleLaplaceF : public ExpansionF<Fspc> {
23  uint m_;
24 
25  public:
29  MultipoleLaplaceF(uint m) {m_ = m;}
30 
34  uint blksz(uint m) const {return m * (m + 1);}
35  uint m() const {return m_;}
38  virtual FColReal* getCol(uint blksz) const {
39  return new FColReal(blksz);
40  }
42  inline void evaluate(uint m, const concepts::Real3d& z,
43  FColExp* Fexp) const;
44  void evaluate(uint m, const concepts::Real3d& z, FColReal* Fexp) const;
46  inline void apply(uint m, const FColExp* Fexp, const Fspc src[],
47  Fspc dst[]) const;
48  void apply(uint m, const FColReal Fexp[], const Fspc src[],
49  Fspc dst[]) const;
50  };
51 
52  template <class Fspc>
54  FColExp* Fexp) const {
55  FColReal* Fmpe = dynamic_cast<FColReal*>(Fexp);
56  if (Fmpe) {evaluate(m, z, Fmpe); return;}
57 
58  throw
59  conceptsException(concepts::MissingFeature("FColExp not supported"));
60  }
61 
62  template <class Fspc>
63  void MultipoleLaplaceF<Fspc>::apply(uint m, const FColExp* Fexp,
64  const Fspc src[], Fspc dst[]) const {
65  const FColReal* Fmpe = dynamic_cast<const FColReal*>(Fexp);
66  if (Fmpe) {apply(m, Fmpe, src, dst); return;}
67 
68  throw
69  conceptsException(concepts::MissingFeature("FColExp not supported"));
70  }
71 
72 } // namespace cluster
73 
74 #endif // multipole_hh
Class to hold expansion coefficients of type F.
Definition: expansion.hh:156
#define conceptsException(exc)
Prepares an exception for throwing.
Definition: exceptions.hh:344
virtual FColReal * getCol(uint blksz) const
Allocates memory for the expansion coefficients.
Definition: multipole.hh:38
void evaluate(uint m, const concepts::Real3d &z, FColReal *Fexp) const
void apply(uint m, const FColReal Fexp[], const Fspc src[], Fspc dst[]) const
void apply(uint m, const FColExp *Fexp, const Fspc src[], Fspc dst[]) const
Definition: multipole.hh:63
uint blksz(uint m) const
Size of memory used for the expansion.
Definition: multipole.hh:34
uint m_
Expansion order.
Definition: multipole.hh:23
part of the Multipole expansion of the Laplace kernel.
Definition: multipole.hh:21
FColF< concepts::Real > FColReal
Definition: expansion.hh:176
Used for the cluster classes for the boundary element method.
Definition: cebysev.hh:13
Abstract class for the part of a kernel expansion.
Definition: expansion.hh:185
Exception class to express a missing feature.
Definition: exceptions.hh:206
void apply(Operator< F > &op, const Matrix< H > &mX, Matrix< I > &mY)
Multiplication with a matrix.
Definition: matrix.hh:256
void evaluate(uint m, const concepts::Real3d &z, FColExp *Fexp) const
Definition: multipole.hh:53
MultipoleLaplaceF(uint m)
Constructor.
Definition: multipole.hh:29
Abstract class to hold the expansion coefficients.
Definition: expansion.hh:143
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich