f04.hh

Go to the documentation of this file.
1 
6 #ifndef clusterF04_hh
7 #define clusterF04_hh
8 
10 #include "toolbox/hashMap.hh"
11 #include "cluster/expansion.hh"
12 #include "cluster/f.hh"
13 
14 namespace cluster {
15 
16  // ******************************************************************* F04 **
17 
22  template<class NodeX, class NodeY>
23  class F04 : public ClstF<NodeX, NodeY> {
24  public:
28  typedef typename ClstF<NodeX, NodeY>::FX FX;
29  typedef typename ClstF<NodeX, NodeY>::FY FY;
32  private:
35  class Ffld {
39  const NodeX* clstX_;
40  const NodeY* clstY_;
42  uint m_;
45 
46  public:
47  inline Ffld(const NodeX* clstX, const NodeY* clstY,
48  Ffld* lnk = 0)
49  : lnk_(lnk), clstX_(clstX), clstY_(clstY), m_(0), val_(0) {}
50  inline ~Ffld() {delete val_;}
51 
52  inline Ffld* link() const {return lnk_;}
53  inline uint sigma() const {return TraitsX::index(clstX_);}
54  inline uint tau() const {return TraitsY::index(clstY_);}
55  inline concepts::Real3d z() const {
57  }
58  inline uint m(uint m) {if (m) m_ = m; return m_;}
59  inline uint m() const {return m_;}
60  inline FColExp* val(uint blksz, const ExpansionF<FX>& exp) {
61  if (blksz) {delete val_; val_ = exp.getCol(blksz);} return val_;
62  }
63  inline FColExp* val() const {return val_;}
67  //concepts::Real I =
68  // (concepts::Real)TraitsX::nleaf(clstX_) * TraitsY::nleaf(clstY_);
69  return I * pow(z().l2(), -s);
70  }
71  };
72 
76 
79 
81  uint m_;
85  uint minsz_;
86 
90  uint nffld_;
91  uint nffldval_;
95  uint nnfld_;
96 
98  void constructor_(const NodeX* clstX, const NodeY* clstY,
99  concepts::Real* Imax);
100  template<class Trts, class Nd>
101  uint info_(uint idx, const Nd* clst,
102  std::unordered_map<uint, uint>& nlf) const;
103 
104  protected:
105  std::ostream& info(std::ostream& os) const;
106 
107  public:
108  F04(const Tree<NodeX>& treeX, const Tree<NodeY>& treeY,
109  const ExpansionF<FX>& exp, concepts::Real eta,
110  concepts::Real s, uint minsz);
111  ~F04();
112 
114  void operator()(const ClstY<NodeY>& vecY, ClstX<NodeX>& vecX) const;
115 
116  inline NfldScan* scan() const {
118  }
120  inline float memory() const;
121  std::ostream& info(std::ostream& os, uint idxX, uint idxY) const;
122  };
123 
124  template<class NodeX, class NodeY>
125  inline float F04<NodeX, NodeY>::memory() const {
126  return sizeof(F04<NodeX, NodeY>)
127  + (float)nffld_ * sizeof(typename F04<NodeX, NodeY>::Ffld)
128  + (float)nnfld_ * sizeof(concepts::Joiner<NfldNodes, 1>)
129  + nffldval_ *
130  (ffld_->val() ? ffld_->val()->memory(1)
131  : ffld_->val(1, exp_)->memory(1));
132  }
133 
134 } // namespace cluster
135 
136 #endif // clusterF04_hh
uint tau() const
Definition: f04.hh:54
ClstF< NodeX, NodeY >::TraitsX TraitsX
Interface of the far field.
Definition: f04.hh:26
ClstF< NodeX, NodeY >::NfldScan NfldScan
Definition: f04.hh:31
concepts::Real eta_
Definition: f04.hh:82
virtual FColExp * getCol(uint blksz) const =0
Allocates memory for the expansion coefficients.
const NodeX * clstX_
Pointer to two clusters belonging to the far field.
Definition: f04.hh:39
uint m() const
Definition: f04.hh:59
Class to store the far field coefficients.
Definition: f04.hh:35
static uint nleaf(const Node *nd)
Definition: tree.hh:267
uint nffldval_
Definition: f04.hh:91
Ffld * ffld_
Far field entries.
Definition: f04.hh:88
Joiner class with multiple successors, i.e.
Ffld * lnk_
Next far field entry.
Definition: f04.hh:37
F04(const Tree< NodeX > &treeX, const Tree< NodeY > &treeY, const ExpansionF< FX > &exp, concepts::Real eta, concepts::Real s, uint minsz)
const NodeY * clstY_
Definition: f04.hh:40
Scanner for a list.
static const concepts::Real3d & center(const Node *nd)
Definition: tree.hh:261
concepts::Joiner< NfldNodes, 1 > * nfld_
Near field entries.
Definition: f04.hh:93
TraitsY::F FY
Definition: f.hh:48
uint m_
Expansion order.
Definition: f04.hh:42
NfldScan * scan() const
Definition: f04.hh:116
void constructor_(const NodeX *clstX, const NodeY *clstY, concepts::Real *Imax)
Constructor for recursive calls.
const Tree< NodeY > & treeY_
Definition: f04.hh:75
FColExp * val() const
Definition: f04.hh:63
Interface class for a node in a cluster tree.
Definition: tree.hh:252
concepts::Real3d z() const
Definition: f04.hh:55
concepts::Real s_
Definition: f04.hh:83
FColExp * val_
Far field coefficients of the kernel expansion.
Definition: f04.hh:44
uint nffld_
Number of far field entries.
Definition: f04.hh:90
const ExpansionF< FX > & exp_
Kernel expansion.
Definition: f04.hh:78
Class to store a pair of clusters in the near field.
Definition: f.hh:22
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
std::ostream & info(std::ostream &os, uint idxX, uint idxY) const
float memory() const
Memory used by F04 in bytes.
Definition: f04.hh:125
An abstract class for scanning a mesh (a set of cells) or a space (a set of elements).
ClstF< NodeX, NodeY >::FY FY
Definition: f04.hh:29
static uint index(const Node *nd)
Definition: tree.hh:268
Abstract class for a far field matrix F.
Definition: f.hh:42
TraitsX::F FX
Definition: f.hh:47
uint nnfld_
Number of near field entries.
Definition: f04.hh:95
uint sigma() const
Definition: f04.hh:53
void operator()(const ClstY< NodeY > &vecY, ClstX< NodeX > &vecX) const
Application operator.
Ffld(const NodeX *clstX, const NodeY *clstY, Ffld *lnk=0)
Definition: f04.hh:47
uint minsz_
Minimal size for a cluster pair in the far field.
Definition: f04.hh:85
Ffld * link() const
Definition: f04.hh:52
Used for the cluster classes for the boundary element method.
Definition: cebysev.hh:13
uint m(uint m)
Definition: f04.hh:58
uint info_(uint idx, const Nd *clst, std::unordered_map< uint, uint > &nlf) const
uint m_
Expansion order.
Definition: f04.hh:81
ClstF< NodeX, NodeY >::TraitsY TraitsY
Definition: f04.hh:27
FColExp * val(uint blksz, const ExpansionF< FX > &exp)
Definition: f04.hh:60
ClstF< NodeX, NodeY >::NfldNodes NfldNodes
Definition: f04.hh:30
concepts::Real intensity(concepts::Real s) const
Definition: f04.hh:64
const Tree< NodeX > & treeX_
Cluster trees.
Definition: f04.hh:74
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
ClstF< NodeX, NodeY >::FX FX
Definition: f04.hh:28
Far field matrix F.
Definition: f04.hh:23
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