Panel.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
5 #ifndef PANEL_H_
6 #define PANEL_H_
7 
8 #include <vector>
9 #include "Dipole.h"
10 #include "LocalExpansion.h"
11 #include "Math/NumericalVector.h"
12 #include "Math/Vector.h"
13 #include "Multipole.h"
14 #include "Source.h"
15 
16 class Panel;
17 
18 #include "Sphere.h"
19 
20 class Box;
21 
22 class Panel
23 {
24 public:
25  Panel(Panel* root,
26  int maximumPanelLevel,
27  Vec3D leftBound,
28  Vec3D rightBound,
29  std::vector<Source*> sources,
30  std::vector<Dipole*> dipoles,
31  NumericalVector<>* squaredFactorials,
32  Box* box);
33 
34  //Data structure functions
35  void initialise();
36 
37  void computeCoefficients();
38 
39  void createPanels(int dim, std::vector<Source*>& sources, std::vector<Dipole*>& dipoles, Vec3D& leftBoundChild,
40  Vec3D& rightBoundChild, NumericalVector<>* squaredFactorials);
41 
42  void findPanelInteractions();
43 
44  void setPanelInteractions();
45 
46  //Functions used for the upward pass
48 
50 
51  //Functions used for the downward pass
52  void setLocalExpansionZero(); //In the current implementation this function is not used
54 
56 
57 
58  //Functions that need to be removed or shift to another topic
59  void computeLocalExpansion();
60 
61 
62  //Getters
64  {
65  return centre_;
66  }
67 
69  {
70  return root_;
71  }
72 
73  std::vector<Panel*> getChilderen()
74  {
75  return childeren_;
76  }
77 
78  std::vector<Panel*> getNeighbours()
79  {
80  return neighbours_;
81  }
82 
83  std::vector<Panel*> getSecondNeighbours()
84  {
85  return secondNeighbours_;
86  }
87 
88  std::vector<Panel*> getInteractionList()
89  {
90  return interactionList_;
91  }
92 
93  std::vector<Source*> getSources()
94  {
95  return sources_;
96  }
97 
98  Source* getSource(int index)
99  {
100  return sources_[index];
101  }
102 
103  std::vector<Dipole*> getDipoles()
104  {
105  return dipoles_;
106  }
107 
108  std::vector<Multipole*> getMultipoles()
109  {
110  return multipoles_;
111  }
112 
113  std::vector<Sphere*> getSpheres()
114  {
115  return spheres_;
116  }
117 
119  {
120  return panelLevel_;
121  }
122 
124  {
125  return partialLocalExpansion_;
126  }
127 
129  {
130  return localExpansion_;
131  }
132 
133 private:
134  //Panel characteristics
135  const int panelLevel_; //The level at which the panel is living. This panel has no children when panelLevel = 1
136  Mdouble dim_; //dimension of the problem space
137  Vec3D leftBound_; // Left and bottom bounds
138  Vec3D rightBound_; // Right and top bounds
139  double size_; // the half of the width and length of the panel
140  Vec3D centre_; // Centre of the panel
141 
142  //Data structures
143  Panel* root_ = nullptr; //Root of the current panel
144  std::vector<Panel*> childeren_; //List of children which have the current panel as root.
145  std::vector<Panel*> neighbours_; //List of neighbours
146  std::vector<Panel*> secondNeighbours_; //List of second neighbours.
147  std::vector<Panel*> interactionList_; //List of interaction panels
148 
149  //Multipole structures
150  std::vector<Source*> sources_; //List of sources contained within this panel.
151  std::vector<Dipole*> dipoles_; //List of dipoles contained within this panel.
152  std::vector<Multipole*> multipoles_; //List of multipoles contained within this panel.
153 
154  //For fluid calculation
155  std::vector<Sphere*> spheres_; //For the finest level of panels this vector contains the spheres within that panel
156 
157  // Mother of all pointers
158  Box* box_; //Pointer to the data structure sorted per level
159 
160  //Computational values
161  // todo: sort out this mess
167 };
168 
169 
170 #endif /* PANEL_H_ */
Definition: Box.h:12
Definition: LocalExpansion.h:15
Definition: Multipole.h:14
Definition: NumericalVector.h:44
Definition: Panel.h:23
std::vector< Panel * > getInteractionList()
Definition: Panel.h:88
std::vector< Sphere * > getSpheres()
Definition: Panel.h:113
NumericalVector< std::complex< Mdouble > > getPartialLocalExpansion()
Definition: Panel.h:123
Source * getSource(int index)
Definition: Panel.h:98
void computePartialLocalExpansion()
Definition: Panel.cc:276
const int panelLevel_
Definition: Panel.h:135
std::vector< Source * > sources_
Definition: Panel.h:150
void computeMultipoleExpansion()
Definition: Panel.cc:230
NumericalVector< std::complex< Mdouble > > partialLocalExpansion_
Definition: Panel.h:165
Panel * root_
Definition: Panel.h:143
std::vector< Panel * > neighbours_
Definition: Panel.h:145
NumericalVector< std::complex< Mdouble > > localExpansion_
Definition: Panel.h:166
std::vector< Multipole * > getMultipoles()
Definition: Panel.h:108
std::vector< Panel * > childeren_
Definition: Panel.h:144
void initialise()
Definition: Panel.cc:143
Vec3D leftBound_
Definition: Panel.h:137
NumericalVector< std::complex< Mdouble > > getLocalExpansion()
Definition: Panel.h:128
std::vector< Panel * > interactionList_
Definition: Panel.h:147
void createPanels(int dim, std::vector< Source * > &sources, std::vector< Dipole * > &dipoles, Vec3D &leftBoundChild, Vec3D &rightBoundChild, NumericalVector<> *squaredFactorials)
Definition: Panel.cc:80
double size_
Definition: Panel.h:139
std::vector< Panel * > getNeighbours()
Definition: Panel.h:78
Vec3D centre_
Definition: Panel.h:140
void computeLocalExpansion()
Definition: Panel.cc:287
std::vector< Dipole * > getDipoles()
Definition: Panel.h:103
Panel(Panel *root, int maximumPanelLevel, Vec3D leftBound, Vec3D rightBound, std::vector< Source * > sources, std::vector< Dipole * > dipoles, NumericalVector<> *squaredFactorials, Box *box)
Definition: Panel.cc:17
std::vector< Panel * > getSecondNeighbours()
Definition: Panel.h:83
Panel * getRoot()
Definition: Panel.h:68
int getPanelLevel()
Definition: Panel.h:118
void computeCoefficients()
Definition: Panel.cc:150
void translateMultipoleExpansion()
Definition: Panel.cc:258
std::vector< Dipole * > dipoles_
Definition: Panel.h:151
void translateLocalExpansion()
Definition: Panel.cc:294
LocalExpansion * partialLocalExpansionAroundCentre_
Definition: Panel.h:163
void setPanelInteractions()
Definition: Panel.cc:178
std::vector< Sphere * > spheres_
Definition: Panel.h:155
void setLocalExpansionZero()
Definition: Panel.cc:271
std::vector< Multipole * > multipoles_
Definition: Panel.h:152
Vec3D getCentre()
Definition: Panel.h:63
Vec3D rightBound_
Definition: Panel.h:138
std::vector< Panel * > secondNeighbours_
Definition: Panel.h:146
std::vector< Panel * > getChilderen()
Definition: Panel.h:73
Mdouble dim_
Definition: Panel.h:136
LocalExpansion * localExpansionAroundCentre_
Definition: Panel.h:164
Multipole * multipoleAroundCentre_
Definition: Panel.h:162
std::vector< Source * > getSources()
Definition: Panel.h:93
void findPanelInteractions()
Definition: Panel.cc:159
Box * box_
Definition: Panel.h:158
Definition: Source.h:14
Definition: Kernel/Math/Vector.h:30