Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
QuadTreeNodeNM.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Array.h>
35#include <ogdf/basic/Graph.h>
36#include <ogdf/basic/List.h>
37#include <ogdf/basic/geometry.h>
38
39#include <complex>
40#include <iosfwd>
41
43class ParticleInfo;
44} // namespace ogdf::energybased::fmmm
45
46namespace ogdf {
47namespace energybased {
48namespace fmmm {
49
54 friend std::ostream& operator<<(std::ostream&, const QuadTreeNodeNM&);
55
57 friend std::istream& operator>>(std::istream&, QuadTreeNodeNM&);
58
59public:
62
63 void set_Sm_level(int level) { Sm_level = level; }
64
66
67 void set_Sm_boxlength(double len) { Sm_boxlength = len; }
68
69 void set_x_List_ptr(List<ParticleInfo>* x_ptr) { L_x_ptr = x_ptr; }
70
71 void set_y_List_ptr(List<ParticleInfo>* y_ptr) { L_y_ptr = y_ptr; }
72
74
75 void set_Sm_center(std::complex<double> c) { Sm_center = c; }
76
78
80
81 node pop_contained_nodes() { return contained_nodes.popFrontRet(); }
82
83 bool contained_nodes_empty() { return contained_nodes.empty(); }
84
85 void set_I(List<QuadTreeNodeNM*>& list) { I = list; }
86
87 void set_D1(List<QuadTreeNodeNM*>& list) { D1 = list; }
88
89 void set_D2(List<QuadTreeNodeNM*>& list) { D2 = list; }
90
91 void set_M(List<QuadTreeNodeNM*>& list) { M = list; }
92
94 void set_locale_exp(Array<std::complex<double>>& local, int precision) {
95 int i;
96 LE = new std::complex<double>[precision + 1];
97 for (i = 0; i <= precision; i++) {
98 LE[i] = local[i];
99 }
100 }
101
103 void set_multipole_exp(Array<std::complex<double>>& multi, int precision) {
104 int i;
105 ME = new std::complex<double>[precision + 1];
106 for (i = 0; i <= precision; i++) {
107 ME[i] = multi[i];
108 }
109 }
110
112 void replace_multipole_exp(Array<std::complex<double>>& multi, int precision) {
113 int i;
114 for (i = 0; i <= precision; i++) {
115 ME[i] = multi[i];
116 }
117 }
118
120
122
124
126
128
129 bool is_root() { return father_ptr == nullptr; }
130
131 bool is_leaf() {
132 return child_lt_ptr == nullptr && child_rt_ptr == nullptr && child_lb_ptr == nullptr
133 && child_rb_ptr == nullptr;
134 }
135
136 bool child_lt_exists() { return child_lt_ptr != nullptr; }
137
138 bool child_rt_exists() { return child_rt_ptr != nullptr; }
139
140 bool child_lb_exists() { return child_lb_ptr != nullptr; }
141
142 bool child_rb_exists() { return child_rb_ptr != nullptr; }
143
144 int get_Sm_level() const { return Sm_level; }
145
147
148 double get_Sm_boxlength() const { return Sm_boxlength; }
149
151
153
155
156 std::complex<double> get_Sm_center() const { return Sm_center; }
157
158 std::complex<double>* get_local_exp() const { return LE; }
159
160 std::complex<double>* get_multipole_exp() const { return ME; }
161
162 void get_contained_nodes(List<node>& list) const { list = contained_nodes; }
163
164 void get_I(List<QuadTreeNodeNM*>& list) const { list = I; }
165
166 void get_D1(List<QuadTreeNodeNM*>& list) const { list = D1; }
167
168 void get_D2(List<QuadTreeNodeNM*>& list) const { list = D2; }
169
170 void get_M(List<QuadTreeNodeNM*>& list) const { list = M; }
171
173
175
177
179
181
182private:
192 std::complex<double> Sm_center;
193 std::complex<double>* ME;
194 std::complex<double>* LE;
208};
209
210}
211}
212}
Declaration and implementation of Array class and Array algorithms.
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:219
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Class for the representation of nodes.
Definition Graph_d.h:241
Helping data structure that stores the information needed to represent a node of the reduced quad tre...
QuadTreeNodeNM * child_lt_ptr
points to left top child
int subtreeparticlenumber
the number of particles in the subtree rooted at this node
QuadTreeNodeNM * get_child_lb_ptr() const
List< ParticleInfo > * L_y_ptr
and a cross reference to the list_item in the list with the other coordinate
std::complex< double > * get_local_exp() const
void get_I(List< QuadTreeNodeNM * > &list) const
QuadTreeNodeNM * get_child_rt_ptr() const
QuadTreeNodeNM * father_ptr
points to the father node
List< QuadTreeNodeNM * > I
the list of min.
List< QuadTreeNodeNM * > M
list of nodes with multipole force contribution like in DIM2
void set_M(List< QuadTreeNodeNM * > &list)
void get_M(List< QuadTreeNodeNM * > &list) const
QuadTreeNodeNM * child_lb_ptr
points to left bottom child
std::complex< double > * ME
Multipole Expansion terms.
void set_locale_exp(Array< std::complex< double > > &local, int precision)
LE[i] is set to local[i] for i = 0 to precision and space for LE is reserved.
List< ParticleInfo > * L_x_ptr
points to the lists that contain each Particle of G with its x(y)coordinate in increasing order
List< ParticleInfo > * get_y_List_ptr()
std::complex< double > * LE
Locale Expansion terms.
void set_I(List< QuadTreeNodeNM * > &list)
void set_Sm_center(std::complex< double > c)
List< node > contained_nodes
list of nodes of G that are contained in this QuadTreeNode (emty if it is not a leave of the ModQuadT...
void set_D1(List< QuadTreeNodeNM * > &list)
QuadTreeNodeNM * get_father_ptr() const
friend std::ostream & operator<<(std::ostream &, const QuadTreeNodeNM &)
Outputstream for QuadTreeNodeNM.
std::complex< double > * get_multipole_exp() const
friend std::istream & operator>>(std::istream &, QuadTreeNodeNM &)
Inputstream for QuadTreeNodeNM.
double Sm_boxlength
length of small cell
void get_D1(List< QuadTreeNodeNM * > &list) const
void replace_multipole_exp(Array< std::complex< double > > &multi, int precision)
ME[i] is set to multi[i] for i = 0 to precision and no space for LE is reserved.
std::complex< double > get_Sm_center() const
DPoint Sm_downleftcorner
coords of the down left corner of the small cell
void set_x_List_ptr(List< ParticleInfo > *x_ptr)
QuadTreeNodeNM * get_child_lt_ptr() const
int Sm_level
level of the small cell
void set_D2(List< QuadTreeNodeNM * > &list)
void set_y_List_ptr(List< ParticleInfo > *y_ptr)
void get_contained_nodes(List< node > &list) const
QuadTreeNodeNM * child_rb_ptr
points to right bottom child
void set_contained_nodes(List< node > &list)
std::complex< double > Sm_center
center of the small cell
List< ParticleInfo > * get_x_List_ptr()
QuadTreeNodeNM * child_rt_ptr
points to right bottom child
void get_D2(List< QuadTreeNodeNM * > &list) const
QuadTreeNodeNM * get_child_rb_ptr() const
void set_multipole_exp(Array< std::complex< double > > &multi, int precision)
ME[i] is set to multi[i] for i = 0 to precision and space for LE is reserved.
List< QuadTreeNodeNM * > D2
list of neighbouring(=D1) and not adjacent(=D2) leaves for direct force calculation in DIM2
The namespace for all OGDF objects.