diff --git a/Doxyfile b/Doxyfile index 61d59dd..7b951c6 100644 --- a/Doxyfile +++ b/Doxyfile @@ -917,7 +917,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = include src src/scripts README.md +INPUT = include src README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/docs/100_particles.gif b/docs/100_particles.gif index 53eb275..ba16c67 100644 Binary files a/docs/100_particles.gif and b/docs/100_particles.gif differ diff --git a/docs/Particle_8cpp.html b/docs/Particle_8cpp.html index e5f553c..d825cb9 100644 --- a/docs/Particle_8cpp.html +++ b/docs/Particle_8cpp.html @@ -113,7 +113,7 @@ $(document).ready(function(){initNavTree('Particle_8cpp.html',''); initResizable
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version
1.0
-
Bug:
No known bugs
+
Bug:
No known bugs

Definition in file Particle.cpp.

diff --git a/docs/PenningTrap_8cpp.html b/docs/PenningTrap_8cpp.html index f90f9c5..9ca258f 100644 --- a/docs/PenningTrap_8cpp.html +++ b/docs/PenningTrap_8cpp.html @@ -104,12 +104,12 @@ $(document).ready(function(){initNavTree('PenningTrap_8cpp.html',''); initResiza

The implementation of the PenningTrap class. More...

-
#include "PenningTrap.hpp"
-#include "typedefs.hpp"
-#include <algorithm>
+
#include <algorithm>
#include <functional>
#include <sys/types.h>
#include <vector>
+#include "PenningTrap.hpp"
+#include "typedefs.hpp"

Go to the source code of this file.

Detailed Description

@@ -118,7 +118,7 @@ $(document).ready(function(){initNavTree('PenningTrap_8cpp.html',''); initResiza
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version
1.0
-
Bug:
No known bugs
+
Bug:
No known bugs

Definition in file PenningTrap.cpp.

diff --git a/docs/PenningTrap_8cpp_source.html b/docs/PenningTrap_8cpp_source.html index 7a2c773..eff147a 100644 --- a/docs/PenningTrap_8cpp_source.html +++ b/docs/PenningTrap_8cpp_source.html @@ -102,351 +102,367 @@ $(document).ready(function(){initNavTree('PenningTrap_8cpp_source.html',''); ini
Go to the documentation of this file.
1
-
13#include "PenningTrap.hpp"
-
14#include "typedefs.hpp"
-
15#include <algorithm>
-
16#include <functional>
-
17#include <sys/types.h>
-
18#include <vector>
-
19
-
20vec3 PenningTrap::v_func(uint i, uint j, double dt)
-
21{
-
22 switch (i) {
-
23 case 0:
-
24 return .5 * dt * this->k_v[0][j];
-
25 case 1:
-
26 return .5 * dt * this->k_v[1][j];
-
27 case 2:
-
28 return dt * this->k_v[2][j];
-
29 case 3:
-
30 return vec3((dt / 6.)
-
31 * (this->k_v[0][j] + 2. * this->k_v[1][j]
-
32 + 2. * this->k_v[2][j] + this->k_v[3][j]));
-
33 default:
-
34 std::cout << "Not valid!" << std::endl;
-
35 abort();
-
36 }
-
37}
-
38
-
39vec3 PenningTrap::r_func(uint i, uint j, double dt)
-
40{
-
41 switch (i) {
-
42 case 0:
-
43 return .5 * dt * this->k_r[0][j];
-
44 case 1:
-
45 return .5 * dt * this->k_r[1][j];
-
46 case 2:
-
47 return dt * this->k_r[2][j];
-
48 case 3:
-
49 return vec3((dt / 6.)
-
50 * (this->k_r[0][j] + 2. * this->k_r[1][j]
-
51 + 2. * this->k_r[2][j] + this->k_r[3][j]));
-
52 default:
-
53 std::cout << "Not valid!" << std::endl;
-
54 abort();
-
55 }
-
56}
-
57
- -
59{
-
60 r(2) *= -2.;
-
61
-
62 return vec3((this->V_0 * this->perturbation(this->t) / (this->d * this->d))
-
63 * r);
-
64}
-
65
- -
67{
-
68 return vec3{0., 0., this->B_0};
-
69}
-
70
- -
72{
-
73 // Calculate the difference between the particles' position
-
74 vec3 res = this->particles[i].r_vec - this->particles[j].r_vec;
-
75
-
76 // Get the distance between the particles
-
77 double norm = arma::norm(res, 2);
-
78
-
79 return vec3((this->particles[j].q / (norm * norm * norm)) * res);
-
80}
-
81
- -
83{
-
84 Particle *p = &this->particles[i];
-
85
-
86 if (arma::norm(p->r_vec) > this->d) {
-
87 return vec3{0., 0., 0.};
-
88 }
-
89
-
90 return vec3(p->q
-
91 * (this->external_E_field(p->r_vec)
-
92 + arma::cross(p->v_vec, this->external_B_field(p->r_vec))));
-
93}
-
94
- -
96{
-
97 vec3 res;
-
98
-
99 for (size_t j = 0; j < this->particles.size(); j++) {
-
100 if (i != j)
-
101 res += this->force_on_particle(i, j);
-
102 }
+
13#include <algorithm>
+
14#include <functional>
+
15#include <sys/types.h>
+
16#include <vector>
+
17
+
18#include "PenningTrap.hpp"
+
19#include "typedefs.hpp"
+
20
+
21vec3 PenningTrap::v_func(uint i, uint j, double dt)
+
22{
+
23 switch (i) {
+
24 case 0:
+
25 return .5 * dt * this->k_v[0][j];
+
26 case 1:
+
27 return .5 * dt * this->k_v[1][j];
+
28 case 2:
+
29 return dt * this->k_v[2][j];
+
30 case 3:
+
31 return vec3((dt / 6.)
+
32 * (this->k_v[0][j] + 2. * this->k_v[1][j]
+
33 + 2. * this->k_v[2][j] + this->k_v[3][j]));
+
34 default:
+
35 std::cout << "Not valid!" << std::endl;
+
36 abort();
+
37 }
+
38}
+
39
+
40vec3 PenningTrap::r_func(uint i, uint j, double dt)
+
41{
+
42 switch (i) {
+
43 case 0:
+
44 return .5 * dt * this->k_r[0][j];
+
45 case 1:
+
46 return .5 * dt * this->k_r[1][j];
+
47 case 2:
+
48 return dt * this->k_r[2][j];
+
49 case 3:
+
50 return vec3((dt / 6.)
+
51 * (this->k_r[0][j] + 2. * this->k_r[1][j]
+
52 + 2. * this->k_r[2][j] + this->k_r[3][j]));
+
53 default:
+
54 std::cout << "Not valid!" << std::endl;
+
55 abort();
+
56 }
+
57}
+
58
+ +
60{
+
61 r(2) *= -2.;
+
62
+
63 return vec3(
+
64 ((this->V_0 * this->perturbation(this->t)) / (this->d * this->d)) * r);
+
65}
+
66
+ +
68{
+
69 return vec3{0., 0., this->B_0};
+
70}
+
71
+ +
73{
+
74 // Calculate the difference between the particles' position
+
75 vec3 res = this->particles[i].r_vec - this->particles[j].r_vec;
+
76
+
77 // Get the distance between the particles
+
78 double norm = arma::norm(res, 2);
+
79
+
80 return vec3((this->particles[j].q / (norm * norm * norm)) * res);
+
81}
+
82
+ +
84{
+
85 Particle *p = &this->particles[i];
+
86
+
87 return vec3(p->q
+
88 * (this->external_E_field(p->r_vec)
+
89 + arma::cross(p->v_vec, this->external_B_field(p->r_vec))));
+
90}
+
91
+ +
93{
+
94 vec3 res;
+
95
+
96 for (size_t j = 0; j < this->particles.size(); j++) {
+
97 if (i != j)
+
98 res += this->force_on_particle(i, j);
+
99 }
+
100
+
101 return vec3(res * (K_E * this->particles[i].q));
+
102}
103
-
104 return vec3(res * (K_E * this->particles[i].q));
-
105}
-
106
- -
108{
-
109 if (arma::norm(this->particles[i].r_vec) > this->d) {
-
110 return vec3{0., 0., 0.};
-
111 }
-
112 return vec3(this->total_force_external(i) - this->total_force_particles(i));
-
113}
-
114
-
115PenningTrap::PenningTrap(double B_0, double V_0, double d, double t)
-
116{
-
117 this->B_0 = B_0;
-
118 this->V_0 = V_0;
-
119 this->d = d;
-
120 this->t = t;
-
121 this->perturbation = [](double t) { return 1.; };
-
122}
-
123
-
124PenningTrap::PenningTrap(uint i, double B_0, double V_0, double d, double t)
-
125 : PenningTrap::PenningTrap(B_0, V_0, d)
-
126{
-
127 for (size_t j = 0; j < i; j++) {
-
128 this->particles.push_back(
-
129 Particle(vec3(vec3().randn() * .1 * this->d),
-
130 vec3(vec3().randn() * .1 * this->d)));
-
131 }
-
132}
-
133
-
134PenningTrap::PenningTrap(std::vector<Particle> particles, double B_0,
-
135 double V_0, double d, double t)
-
136 : PenningTrap::PenningTrap(B_0, V_0, d)
-
137{
-
138 this->particles = particles;
-
139}
-
140
-
141void PenningTrap::set_pertubation(double f, double omega_V)
+ +
105{
+
106 if (arma::norm(this->particles[i].r_vec) > this->d) {
+
107 return vec3{0., 0., 0.};
+
108 }
+
109 return vec3(this->total_force_external(i) - this->total_force_particles(i));
+
110}
+
111
+ +
113{
+
114 if (arma::norm(this->particles[i].r_vec) > this->d) {
+
115 return vec3{0., 0., 0.};
+
116 }
+
117 return vec3(this->total_force_external(i));
+
118}
+
119
+
120PenningTrap::PenningTrap(double B_0, double V_0, double d, double t)
+
121{
+
122 this->B_0 = B_0;
+
123 this->V_0 = V_0;
+
124 this->d = d;
+
125 this->t = t;
+
126 this->perturbation = [](double t) { return 1.; };
+
127}
+
128
+
129PenningTrap::PenningTrap(uint i, double B_0, double V_0, double d, double t)
+
130 : PenningTrap::PenningTrap(B_0, V_0, d)
+
131{
+
132 for (size_t j = 0; j < i; j++) {
+
133 this->particles.push_back(
+
134 Particle(vec3(vec3().randn() * .1 * this->d),
+
135 vec3(vec3().randn() * .1 * this->d)));
+
136 }
+
137}
+
138
+
139PenningTrap::PenningTrap(std::vector<Particle> particles, double B_0,
+
140 double V_0, double d, double t)
+
141 : PenningTrap::PenningTrap(B_0, V_0, d)
142{
-
143 this->perturbation = [f, omega_V](double t) {
-
144 return 1 + f * std::cos(omega_V * t);
-
145 };
-
146}
-
147
-
148void PenningTrap::reinitialize(double f, double omega_V, double t)
-
149{
-
150 this->t = t;
-
151 this->set_pertubation(f, omega_V);
+
143 this->particles = particles;
+
144}
+
145
+
146void PenningTrap::set_pertubation(double f, double omega_V)
+
147{
+
148 this->perturbation = [f, omega_V](double t) {
+
149 return 1 + f * std::cos(omega_V * t);
+
150 };
+
151}
152
-
153 for (size_t i = 0; i < this->particles.size(); i++) {
-
154 this->particles[i].r_vec = vec3().randn() * .1 * this->d;
-
155 }
-
156}
-
157
- -
159{
-
160 this->particles.push_back(particle);
-
161}
-
162
-
163void PenningTrap::evolve_RK4(double dt, bool particle_interaction)
-
164{
+
153void PenningTrap::reinitialize(double f, double omega_V, double t)
+
154{
+
155 this->t = t;
+
156 this->set_pertubation(f, omega_V);
+
157 Particle *p;
+
158
+
159 for (size_t i = 0; i < this->particles.size(); i++) {
+
160 p = &this->particles[i];
+
161 p->r_vec = vec3().randn() * .1 * this->d;
+
162 p->v_vec = vec3().randn() * .1 * this->d;
+
163 }
+
164}
165
-
166 std::vector<Particle> original_particles = this->particles;
-
167 std::vector<Particle> tmp_particles = this->particles;
-
168
-
169 vec3 (PenningTrap::*force)(uint) = particle_interaction
- - -
172
-
173 size_t size = this->particles.size();
+ +
167{
+
168 this->particles.push_back(particle);
+
169}
+
170
+
171void PenningTrap::evolve_RK4(double dt, bool particle_interaction)
+
172{
+
173 Particle *p;
174
-
175 // Allocating takes a long time, so reuse sim_arr if possible
-
176 if (this->k_v.size() != 4 || this->k_r.size() != 4
-
177 || this->k_v[0].size() != size || this->k_r[0].size() != size) {
-
178 this->k_v = sim_arr(4, sim_cols(size));
-
179 this->k_r = sim_arr(4, sim_cols(size));
-
180 }
-
181
-
182 // Each k_{i+1} is dependent on k_i, so outer loop is not parallelizable
-
183 for (size_t i = 0; i < 4; i++) {
-
184 // Inner loop is able to be parallelized
-
185#pragma omp parallel for
-
186 for (size_t j = 0; j < size; j++) {
-
187 this->k_v[i][j] = (this->*force)(j) / this->particles[j].m;
-
188 this->k_r[i][j] = this->particles[j].v_vec;
-
189
-
190 tmp_particles[j].v_vec =
-
191 original_particles[j].v_vec + this->v_func(i, j, dt);
-
192 tmp_particles[j].r_vec =
-
193 original_particles[j].r_vec + this->r_func(i, j, dt);
-
194 }
-
195 this->particles = tmp_particles;
-
196 }
-
197
-
198 this->t += dt;
-
199}
-
200
-
201void PenningTrap::evolve_forward_euler(double dt, bool particle_interaction)
-
202{
-
203 size_t size = this->particles.size();
-
204 vec3 force_res[size];
-
205
-
206 vec3 (PenningTrap::*force)(uint) = particle_interaction
- - -
209
-
210 // Calculating the force for each particle is independent and therefore
-
211 // a good candidate for parallel execution
-
212#pragma omp parallel for
-
213 for (size_t i = 0; i < size; i++) {
-
214 force_res[i] = (this->*force)(i);
-
215 }
+
175 // Keep original particles
+
176 std::vector<Particle> original_particles = this->particles;
+
177 std::vector<Particle> tmp_particles = this->particles;
+
178
+
179 vec3 (PenningTrap::*force)(uint) =
+
180 particle_interaction ? &PenningTrap::total_force
+ +
182
+
183 size_t size = this->particles.size();
+
184
+
185 // Allocating takes a long time, so reuse sim_arr if possible
+
186 if (this->k_v.size() != 4 || this->k_r.size() != 4
+
187 || this->k_v[0].size() != size || this->k_r[0].size() != size) {
+
188 this->k_v = sim_arr(4, sim_cols(size));
+
189 this->k_r = sim_arr(4, sim_cols(size));
+
190 }
+
191
+
192 // Each k_{i+1} is dependent on k_i, so outer loop is not parallelizable
+
193 for (size_t i = 0; i < 4; i++) {
+
194 // Inner loop is able to be parallelized
+
195#pragma omp parallel for private(p)
+
196 for (size_t j = 0; j < size; j++) {
+
197 this->k_v[i][j] = (this->*force)(j) / this->particles[j].m;
+
198 this->k_r[i][j] = this->particles[j].v_vec;
+
199
+
200 p = &tmp_particles[j];
+
201
+
202 p->v_vec = original_particles[j].v_vec + this->v_func(i, j, dt);
+
203 p->r_vec = original_particles[j].r_vec + this->r_func(i, j, dt);
+
204 }
+
205 this->particles = tmp_particles;
+
206 }
+
207
+
208 this->t += dt;
+
209}
+
210
+
211void PenningTrap::evolve_forward_euler(double dt, bool particle_interaction)
+
212{
+
213 size_t size = this->particles.size();
+
214 vec3 force_res[size];
+
215 Particle *p;
216
-
217 // Updating the particles is also independent, so we can parallelize
-
218 // this as well
-
219#pragma omp parallel for
-
220 for (size_t i = 0; i < size; i++) {
-
221 this->particles[i].r_vec += dt * this->particles[i].v_vec;
-
222 this->particles[i].v_vec += dt * force_res[i] / this->particles[i].m;
-
223 }
-
224
-
225 this->t += dt;
-
226}
+
217 vec3 (PenningTrap::*force)(uint) =
+
218 particle_interaction ? &PenningTrap::total_force
+ +
220
+
221 // Calculating the force for each particle is independent and therefore
+
222 // a good candidate for parallel execution
+
223#pragma omp parallel for
+
224 for (size_t i = 0; i < size; i++) {
+
225 force_res[i] = (this->*force)(i);
+
226 }
227
-
228simulation_t PenningTrap::simulate(double time, uint steps, std::string method,
-
229 bool particle_interaction)
-
230{
-
231 double dt = time / (double)steps;
-
232
-
233 uint size = this->particles.size();
-
234
-
235 simulation_t res{sim_arr(size, sim_cols(steps)),
-
236 sim_arr(size, sim_cols(steps))};
-
237
-
238 void (PenningTrap::*func)(double, bool);
-
239 if (method == "rk4") {
- -
241 } else if (method == "euler") {
- -
243 } else {
-
244 std::cout << "Not a valid method!" << std::endl;
-
245 abort();
-
246 }
+
228 // Updating the particles is also independent, so we can parallelize
+
229 // this as well
+
230#pragma omp parallel for
+
231 for (size_t i = 0; i < size; i++) {
+
232 p = &this->particles[i];
+
233 p->r_vec += dt * p->v_vec;
+
234 p->v_vec += dt * force_res[i] / p->m;
+
235 }
+
236
+
237 this->t += dt;
+
238}
+
239
+
240simulation_t PenningTrap::simulate(double time, uint steps, std::string method,
+
241 bool particle_interaction)
+
242{
+
243 Particle *p;
+
244 double dt = time / (double)steps;
+
245
+
246 uint size = this->particles.size();
247
-
248 for (size_t j = 0; j < steps; j++) {
-
249 for (size_t i = 0; i < size; i++) {
-
250 res.r_vecs[i][j] = this->particles[i].r_vec;
-
251 res.v_vecs[i][j] = this->particles[i].v_vec;
-
252 }
-
253 (this->*func)(dt, particle_interaction);
-
254 }
-
255
-
256 return res;
-
257}
-
258
-
259void PenningTrap::write_simulation_to_dir(std::string path, double time,
-
260 uint steps, std::string method,
-
261 bool particle_interaction)
-
262{
-
263 if (path.back() != '/') {
-
264 path += '/';
-
265 }
-
266 if (mkpath(path, 0777) != 0) {
-
267 std::cout << "Failed to make path" << std::endl;
-
268 abort();
-
269 }
-
270
-
271 simulation_t res =
-
272 this->simulate(time, steps, method, particle_interaction);
-
273
-
274 std::ofstream ofile;
-
275
-
276 // Writing each particle to its own file is independent and can be run in
-
277 // parallel.
-
278#pragma omp parallel for private(ofile)
-
279 for (size_t i = 0; i < this->particles.size(); i++) {
-
280 ofile.open(path + "particle_" + std::to_string(i) + "_r.txt");
-
281 for (vec3 &vec : res.r_vecs[i]) {
-
282 ofile << scientific_format(vec(0), 10, 8) << ','
-
283 << scientific_format(vec(1), 10, 8) << ','
-
284 << scientific_format(vec(2), 10, 8) << '\n';
-
285 }
-
286 ofile.close();
-
287 ofile.open(path + "particle_" + std::to_string(i) + "_v.txt");
-
288 for (vec3 &vec : res.v_vecs[i]) {
-
289 ofile << scientific_format(vec(0), 10, 8) << ','
-
290 << scientific_format(vec(1), 10, 8) << ','
-
291 << scientific_format(vec(2), 10, 8) << '\n';
-
292 }
-
293 ofile.close();
-
294 }
-
295}
-
296
-
297double PenningTrap::fraction_of_particles_left(double time, uint steps,
-
298 std::string method,
-
299 bool particle_interaction)
-
300{
-
301 double dt = time / (double)steps;
-
302
-
303 void (PenningTrap::*func)(double, bool);
-
304 if (method == "rk4") {
- -
306 } else if (method == "euler") {
- -
308 } else {
-
309 std::cout << "Not a valid method!" << std::endl;
-
310 abort();
-
311 }
-
312
-
313 for (size_t j = 0; j < steps; j++) {
-
314 (this->*func)(dt, particle_interaction);
-
315 }
+
248 simulation_t res{sim_arr(size, sim_cols(steps)),
+
249 sim_arr(size, sim_cols(steps))};
+
250
+
251 void (PenningTrap::*func)(double, bool);
+
252 if (method == "rk4") {
+ +
254 } else if (method == "euler") {
+ +
256 } else {
+
257 std::cout << "Not a valid method!" << std::endl;
+
258 abort();
+
259 }
+
260
+
261 for (size_t j = 0; j < steps; j++) {
+
262 for (size_t i = 0; i < size; i++) {
+
263 p = &this->particles[i];
+
264 res.r_vecs[i][j] = p->r_vec;
+
265 res.v_vecs[i][j] = p->v_vec;
+
266 }
+
267 (this->*func)(dt, particle_interaction);
+
268 }
+
269
+
270 return res;
+
271}
+
272
+
273void PenningTrap::write_simulation_to_dir(std::string path, double time,
+
274 uint steps, std::string method,
+
275 bool particle_interaction)
+
276{
+
277 if (path.back() != '/') {
+
278 path += '/';
+
279 }
+
280 if (mkpath(path, 0777) != 0) {
+
281 std::cout << "Failed to make path" << std::endl;
+
282 abort();
+
283 }
+
284
+
285 simulation_t res =
+
286 this->simulate(time, steps, method, particle_interaction);
+
287
+
288 std::ofstream ofile;
+
289
+
290 // Writing each particle to its own file is independent and can be run in
+
291 // parallel.
+
292#pragma omp parallel for private(ofile)
+
293 for (size_t i = 0; i < this->particles.size(); i++) {
+
294 ofile.open(path + "particle_" + std::to_string(i) + "_r.txt");
+
295 for (vec3 &vec : res.r_vecs[i]) {
+
296 ofile << scientific_format(vec(0), 10, 8) << ','
+
297 << scientific_format(vec(1), 10, 8) << ','
+
298 << scientific_format(vec(2), 10, 8) << '\n';
+
299 }
+
300 ofile.close();
+
301 ofile.open(path + "particle_" + std::to_string(i) + "_v.txt");
+
302 for (vec3 &vec : res.v_vecs[i]) {
+
303 ofile << scientific_format(vec(0), 10, 8) << ','
+
304 << scientific_format(vec(1), 10, 8) << ','
+
305 << scientific_format(vec(2), 10, 8) << '\n';
+
306 }
+
307 ofile.close();
+
308 }
+
309}
+
310
+
311double PenningTrap::fraction_of_particles_left(double time, uint steps,
+
312 std::string method,
+
313 bool particle_interaction)
+
314{
+
315 double dt = time / (double)steps;
316
-
317 int particles_left = 0;
-
318
-
319 // A reduction is perfect here
-
320#pragma omp parallel for reduction(+ : particles_left)
-
321 for (size_t i = 0; i < this->particles.size(); i++) {
-
322 if (arma::norm(this->particles[i].r_vec) < this->d) {
-
323 particles_left++;
-
324 }
+
317 void (PenningTrap::*func)(double, bool);
+
318 if (method == "rk4") {
+ +
320 } else if (method == "euler") {
+ +
322 } else {
+
323 std::cout << "Not a valid method!" << std::endl;
+
324 abort();
325 }
326
-
327 return (double)particles_left / (double)this->particles.size();
-
328}
+
327 for (size_t j = 0; j < steps; j++) {
+
328 (this->*func)(dt, particle_interaction);
+
329 }
+
330
+
331 int particles_left = 0;
+
332
+
333 // A reduction is perfect here
+
334#pragma omp parallel for reduction(+ : particles_left)
+
335 for (size_t i = 0; i < this->particles.size(); i++) {
+
336 if (arma::norm(this->particles[i].r_vec) < this->d) {
+
337 particles_left++;
+
338 }
+
339 }
+
340
+
341 return (double)particles_left / (double)this->particles.size();
+
342}
A class for simulating a Penning trap.
A class that holds attributes of a particle.
Definition: Particle.hpp:23
vec3 r_vec
position
Definition: Particle.hpp:25
vec3 v_vec
velocity
Definition: Particle.hpp:26
double q
Charge.
Definition: Particle.hpp:27
+
double m
Mass.
Definition: Particle.hpp:28
A class that simulates a Penning trap.
Definition: PenningTrap.hpp:32
std::vector< Particle > particles
The particles in the Penning trap.
Definition: PenningTrap.hpp:42
double B_0
Magnetic field strength.
Definition: PenningTrap.hpp:37
-
vec3 total_force_external(uint i)
Calculate the total external force on a particle.
Definition: PenningTrap.cpp:82
+
vec3 total_force_external(uint i)
Calculate the total external force on a particle.
Definition: PenningTrap.cpp:83
sim_arr k_r
A 2D vector containing all where is the index of a particle.
Definition: PenningTrap.hpp:52
-
vec3 total_force_particles(uint i)
Calculate the total force on a particle p_i from other particles.
Definition: PenningTrap.cpp:95
-
vec3 external_B_field(vec3 r)
Calculate B at point r.
Definition: PenningTrap.cpp:66
-
void evolve_RK4(double dt, bool particle_interaction=true)
Go forward one timestep using the RK4 method.
-
vec3 v_func(uint i, uint j, double dt)
Helper for evolve_RK4 when calculating values.
Definition: PenningTrap.cpp:20
-
vec3 external_E_field(vec3 r)
Calculate E at point r.
Definition: PenningTrap.cpp:58
-
PenningTrap(double B_0=T, double V_0=(25. *V)/1000., double d=500., double t=0.)
Constructor for the PenningTrap class.
+
vec3 total_force_particles(uint i)
Calculate the total force on a particle p_i from other particles.
Definition: PenningTrap.cpp:92
+
vec3 external_B_field(vec3 r)
Calculate B at point r.
Definition: PenningTrap.cpp:67
+
void evolve_RK4(double dt, bool particle_interaction=true)
Go forward one timestep using the RK4 method.
+
vec3 v_func(uint i, uint j, double dt)
Helper for evolve_RK4 when calculating values.
Definition: PenningTrap.cpp:21
+
vec3 external_E_field(vec3 r)
Calculate E at point r.
Definition: PenningTrap.cpp:59
+
PenningTrap(double B_0=T, double V_0=(25. *V)/1000., double d=500., double t=0.)
Constructor for the PenningTrap class.
+
vec3 total_force_no_interaction(uint i)
calculate the total force on a particle p_i without interaction
double d
Characteristic dimension.
Definition: PenningTrap.hpp:40
-
void add_particle(Particle particle)
Add a particle to the system.
+
void add_particle(Particle particle)
Add a particle to the system.
double V_0
Applied potential.
Definition: PenningTrap.hpp:38
-
simulation_t simulate(double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate the particle system inside the Penning trap over a certain amount of time.
-
vec3 force_on_particle(uint i, uint j)
Calculate the force between 2 particles.
Definition: PenningTrap.cpp:71
-
vec3 r_func(uint i, uint j, double dt)
Helper for evolve_RK4 when calculating values.
Definition: PenningTrap.cpp:39
+
simulation_t simulate(double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate the particle system inside the Penning trap over a certain amount of time.
+
vec3 force_on_particle(uint i, uint j)
Calculate the force between 2 particles.
Definition: PenningTrap.cpp:72
+
vec3 r_func(uint i, uint j, double dt)
Helper for evolve_RK4 when calculating values.
Definition: PenningTrap.cpp:40
double t
Current time.
Definition: PenningTrap.hpp:41
-
vec3 total_force(uint i)
calculate the total force on a particle p_i.
-
void set_pertubation(double f, double omega_V)
Time dependent perturbation to V_0.
-
void reinitialize(double f, double omega_V, double t=0.)
Give all particles new positions and velocities, and change t and V_0.
-
void evolve_forward_euler(double dt, bool particle_interaction=true)
Go forward one timestep using the forward Euler method.
-
double fraction_of_particles_left(double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate and calculate what fraction of particles are still left inside the Penning trap after the si...
-
void write_simulation_to_dir(std::string path, double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate and write the displacement of all particles to files.
+
vec3 total_force(uint i)
calculate the total force on a particle p_i.
+
void set_pertubation(double f, double omega_V)
Time dependent perturbation to V_0.
+
void reinitialize(double f, double omega_V, double t=0.)
Give all particles new positions and velocities, and change t and V_0.
+
void evolve_forward_euler(double dt, bool particle_interaction=true)
Go forward one timestep using the forward Euler method.
+
double fraction_of_particles_left(double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate and calculate what fraction of particles are still left inside the Penning trap after the si...
+
void write_simulation_to_dir(std::string path, double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate and write the displacement of all particles to files.
std::function< double(double)> perturbation
Time-dependent perturbation.
Definition: PenningTrap.hpp:39
sim_arr k_v
A 2D vector containing all where is the index of a particle.
Definition: PenningTrap.hpp:47
#define K_E
Coulomb constant. unit: .
Definition: constants.hpp:17
diff --git a/docs/PenningTrap_8hpp_source.html b/docs/PenningTrap_8hpp_source.html index 50f6910..9c94007 100644 --- a/docs/PenningTrap_8hpp_source.html +++ b/docs/PenningTrap_8hpp_source.html @@ -147,66 +147,69 @@ $(document).ready(function(){initNavTree('PenningTrap_8hpp_source.html',''); ini
125
132 vec3 total_force(uint i);
133
-
134public:
-
142 PenningTrap(double B_0 = T, double V_0 = (25. * V) / 1000., double d = 500.,
-
143 double t = 0.);
-
144
-
153 PenningTrap(uint i, double B_0 = T, double V_0 = (25. * V) / 1000.,
-
154 double d = 500., double t = 0.);
-
155
-
164 PenningTrap(std::vector<Particle> particles, double B_0 = T,
-
165 double V_0 = (25. * V) / 1000., double d = 500., double t = 0.);
-
166
-
172 void set_pertubation(double f, double omega_V);
-
173
-
180 void reinitialize(double f, double omega_V, double t = 0.);
+ +
141
+
142public:
+
150 PenningTrap(double B_0 = T, double V_0 = (25. * V) / 1000., double d = 500.,
+
151 double t = 0.);
+
152
+
161 PenningTrap(uint i, double B_0 = T, double V_0 = (25. * V) / 1000.,
+
162 double d = 500., double t = 0.);
+
163
+
172 PenningTrap(std::vector<Particle> particles, double B_0 = T,
+
173 double V_0 = (25. * V) / 1000., double d = 500., double t = 0.);
+
174
+
180 void set_pertubation(double f, double omega_V);
181
-
186 void add_particle(Particle particle);
-
187
-
193 void evolve_RK4(double dt, bool particle_interaction = true);
-
194
-
200 void evolve_forward_euler(double dt, bool particle_interaction = true);
-
201
-
212 simulation_t simulate(double time, uint steps, std::string method = "rk4",
-
213 bool particle_interaction = true);
-
214
-
223 void write_simulation_to_dir(std::string path, double time, uint steps,
-
224 std::string method = "rk4",
-
225 bool particle_interaction = true);
-
226
-
237 double fraction_of_particles_left(double time, uint steps,
-
238 std::string method = "rk4",
-
239 bool particle_interaction = true);
-
240
-
241};
-
242
-
243#endif
+
188 void reinitialize(double f, double omega_V, double t = 0.);
+
189
+
194 void add_particle(Particle particle);
+
195
+
201 void evolve_RK4(double dt, bool particle_interaction = true);
+
202
+
208 void evolve_forward_euler(double dt, bool particle_interaction = true);
+
209
+
220 simulation_t simulate(double time, uint steps, std::string method = "rk4",
+
221 bool particle_interaction = true);
+
222
+
231 void write_simulation_to_dir(std::string path, double time, uint steps,
+
232 std::string method = "rk4",
+
233 bool particle_interaction = true);
+
234
+
245 double fraction_of_particles_left(double time, uint steps,
+
246 std::string method = "rk4",
+
247 bool particle_interaction = true);
+
248
+
249};
+
250
+
251#endif
A class that holds the properties of a particle.
A class that holds attributes of a particle.
Definition: Particle.hpp:23
Test class for the Penning trap.
Definition: test_suite.cpp:24
A class that simulates a Penning trap.
Definition: PenningTrap.hpp:32
std::vector< Particle > particles
The particles in the Penning trap.
Definition: PenningTrap.hpp:42
double B_0
Magnetic field strength.
Definition: PenningTrap.hpp:37
-
vec3 total_force_external(uint i)
Calculate the total external force on a particle.
Definition: PenningTrap.cpp:82
+
vec3 total_force_external(uint i)
Calculate the total external force on a particle.
Definition: PenningTrap.cpp:83
sim_arr k_r
A 2D vector containing all where is the index of a particle.
Definition: PenningTrap.hpp:52
-
vec3 total_force_particles(uint i)
Calculate the total force on a particle p_i from other particles.
Definition: PenningTrap.cpp:95
-
vec3 external_B_field(vec3 r)
Calculate B at point r.
Definition: PenningTrap.cpp:66
-
void evolve_RK4(double dt, bool particle_interaction=true)
Go forward one timestep using the RK4 method.
-
vec3 v_func(uint i, uint j, double dt)
Helper for evolve_RK4 when calculating values.
Definition: PenningTrap.cpp:20
-
vec3 external_E_field(vec3 r)
Calculate E at point r.
Definition: PenningTrap.cpp:58
+
vec3 total_force_particles(uint i)
Calculate the total force on a particle p_i from other particles.
Definition: PenningTrap.cpp:92
+
vec3 external_B_field(vec3 r)
Calculate B at point r.
Definition: PenningTrap.cpp:67
+
void evolve_RK4(double dt, bool particle_interaction=true)
Go forward one timestep using the RK4 method.
+
vec3 v_func(uint i, uint j, double dt)
Helper for evolve_RK4 when calculating values.
Definition: PenningTrap.cpp:21
+
vec3 external_E_field(vec3 r)
Calculate E at point r.
Definition: PenningTrap.cpp:59
+
vec3 total_force_no_interaction(uint i)
calculate the total force on a particle p_i without interaction
double d
Characteristic dimension.
Definition: PenningTrap.hpp:40
-
void add_particle(Particle particle)
Add a particle to the system.
+
void add_particle(Particle particle)
Add a particle to the system.
double V_0
Applied potential.
Definition: PenningTrap.hpp:38
-
simulation_t simulate(double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate the particle system inside the Penning trap over a certain amount of time.
-
vec3 force_on_particle(uint i, uint j)
Calculate the force between 2 particles.
Definition: PenningTrap.cpp:71
-
vec3 r_func(uint i, uint j, double dt)
Helper for evolve_RK4 when calculating values.
Definition: PenningTrap.cpp:39
+
simulation_t simulate(double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate the particle system inside the Penning trap over a certain amount of time.
+
vec3 force_on_particle(uint i, uint j)
Calculate the force between 2 particles.
Definition: PenningTrap.cpp:72
+
vec3 r_func(uint i, uint j, double dt)
Helper for evolve_RK4 when calculating values.
Definition: PenningTrap.cpp:40
double t
Current time.
Definition: PenningTrap.hpp:41
-
vec3 total_force(uint i)
calculate the total force on a particle p_i.
-
void set_pertubation(double f, double omega_V)
Time dependent perturbation to V_0.
-
void reinitialize(double f, double omega_V, double t=0.)
Give all particles new positions and velocities, and change t and V_0.
-
void evolve_forward_euler(double dt, bool particle_interaction=true)
Go forward one timestep using the forward Euler method.
-
double fraction_of_particles_left(double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate and calculate what fraction of particles are still left inside the Penning trap after the si...
-
void write_simulation_to_dir(std::string path, double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate and write the displacement of all particles to files.
+
vec3 total_force(uint i)
calculate the total force on a particle p_i.
+
void set_pertubation(double f, double omega_V)
Time dependent perturbation to V_0.
+
void reinitialize(double f, double omega_V, double t=0.)
Give all particles new positions and velocities, and change t and V_0.
+
void evolve_forward_euler(double dt, bool particle_interaction=true)
Go forward one timestep using the forward Euler method.
+
double fraction_of_particles_left(double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate and calculate what fraction of particles are still left inside the Penning trap after the si...
+
void write_simulation_to_dir(std::string path, double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate and write the displacement of all particles to files.
std::function< double(double)> perturbation
Time-dependent perturbation.
Definition: PenningTrap.hpp:39
sim_arr k_v
A 2D vector containing all where is the index of a particle.
Definition: PenningTrap.hpp:47
Library of constants.
diff --git a/docs/bug.html b/docs/bug.html index 8ed5241..561a815 100644 --- a/docs/bug.html +++ b/docs/bug.html @@ -104,22 +104,24 @@ $(document).ready(function(){initNavTree('bug.html',''); initResizable(); });
File constants.hpp
No known bugs
-
File main.cpp
+
File frequency_narrow_sweeps_long.cpp
No known bugs
-
File Particle.cpp
+
File main.cpp
No known bugs
+
File Particle.cpp
+
No known bugs
File Particle.hpp
No known bugs
File PenningTrap.cpp
-
No known bugs
+
No known bugs
File PenningTrap.hpp
No known bugs
File test_suite.cpp
-
No known bugs
+
No known bugs
File typedefs.hpp
No known bugs
File utils.cpp
-
No known bugs
+
No known bugs
File utils.hpp
No known bugs
diff --git a/docs/classPenningTrap-members.html b/docs/classPenningTrap-members.html index f7e9ce3..7e5d5c4 100644 --- a/docs/classPenningTrap-members.html +++ b/docs/classPenningTrap-members.html @@ -128,10 +128,11 @@ $(document).ready(function(){initNavTree('classPenningTrap.html',''); initResiza tPenningTrapprivate total_force(uint i)PenningTrapprivate total_force_external(uint i)PenningTrapprivate - total_force_particles(uint i)PenningTrapprivate - V_0PenningTrapprivate - v_func(uint i, uint j, double dt)PenningTrapprivate - write_simulation_to_dir(std::string path, double time, uint steps, std::string method="rk4", bool particle_interaction=true)PenningTrap + total_force_no_interaction(uint i)PenningTrapprivate + total_force_particles(uint i)PenningTrapprivate + V_0PenningTrapprivate + v_func(uint i, uint j, double dt)PenningTrapprivate + write_simulation_to_dir(std::string path, double time, uint steps, std::string method="rk4", bool particle_interaction=true)PenningTrap
diff --git a/docs/classPenningTrap.html b/docs/classPenningTrap.html index 3cac359..8879bd4 100644 --- a/docs/classPenningTrap.html +++ b/docs/classPenningTrap.html @@ -175,6 +175,9 @@ Private Member Functions vec3 total_force (uint i)  calculate the total force on a particle p_i.
  +vec3 total_force_no_interaction (uint i) + calculate the total force on a particle p_i without interaction
+  @@ -264,7 +267,7 @@ Friends -

Definition at line 115 of file PenningTrap.cpp.

+

Definition at line 120 of file PenningTrap.cpp.

@@ -324,7 +327,7 @@ Friends -

Definition at line 124 of file PenningTrap.cpp.

+

Definition at line 129 of file PenningTrap.cpp.

@@ -384,7 +387,7 @@ Friends -

Definition at line 134 of file PenningTrap.cpp.

+

Definition at line 139 of file PenningTrap.cpp.

@@ -413,7 +416,7 @@ Friends -

Definition at line 158 of file PenningTrap.cpp.

+

Definition at line 166 of file PenningTrap.cpp.

@@ -452,7 +455,7 @@ Friends -

Definition at line 201 of file PenningTrap.cpp.

+

Definition at line 211 of file PenningTrap.cpp.

@@ -491,7 +494,7 @@ Friends -

Definition at line 163 of file PenningTrap.cpp.

+

Definition at line 171 of file PenningTrap.cpp.

@@ -528,7 +531,7 @@ Friends
Returns
vec3
-

Definition at line 66 of file PenningTrap.cpp.

+

Definition at line 67 of file PenningTrap.cpp.

@@ -565,7 +568,7 @@ Friends
Returns
vec3
-

Definition at line 58 of file PenningTrap.cpp.

+

Definition at line 59 of file PenningTrap.cpp.

@@ -614,7 +617,7 @@ Friends
Returns
vec3
-

Definition at line 71 of file PenningTrap.cpp.

+

Definition at line 72 of file PenningTrap.cpp.

@@ -668,7 +671,7 @@ Friends
Returns
double
-

Definition at line 297 of file PenningTrap.cpp.

+

Definition at line 311 of file PenningTrap.cpp.

@@ -724,7 +727,7 @@ Friends
Returns
vec3
-

Definition at line 39 of file PenningTrap.cpp.

+

Definition at line 40 of file PenningTrap.cpp.

@@ -769,7 +772,7 @@ Friends -

Definition at line 148 of file PenningTrap.cpp.

+

Definition at line 153 of file PenningTrap.cpp.

@@ -807,7 +810,7 @@ Friends -

Definition at line 141 of file PenningTrap.cpp.

+

Definition at line 146 of file PenningTrap.cpp.

@@ -861,7 +864,7 @@ Friends
Returns
simulation_t
-

Definition at line 228 of file PenningTrap.cpp.

+

Definition at line 240 of file PenningTrap.cpp.

@@ -898,7 +901,7 @@ Friends
Returns
vec3
-

Definition at line 107 of file PenningTrap.cpp.

+

Definition at line 104 of file PenningTrap.cpp.

@@ -936,7 +939,44 @@ Friends
Returns
vec3
-

Definition at line 82 of file PenningTrap.cpp.

+

Definition at line 83 of file PenningTrap.cpp.

+ + + + +

◆ total_force_no_interaction()

+ +
+
+

Private Attributes

+ + + + +
+ + + + + + + + +
vec3 PenningTrap::total_force_no_interaction (uint i)
+
+private
+
+ +

calculate the total force on a particle p_i without interaction

+
Parameters
+ + +
iThe index of particle p_i
+
+
+
Returns
vec3
+ +

Definition at line 112 of file PenningTrap.cpp.

@@ -973,7 +1013,7 @@ Friends
Returns
vec3
-

Definition at line 95 of file PenningTrap.cpp.

+

Definition at line 92 of file PenningTrap.cpp.

@@ -1029,7 +1069,7 @@ Friends
Returns
vec3
-

Definition at line 20 of file PenningTrap.cpp.

+

Definition at line 21 of file PenningTrap.cpp.

@@ -1089,7 +1129,7 @@ Friends -

Definition at line 259 of file PenningTrap.cpp.

+

Definition at line 273 of file PenningTrap.cpp.

diff --git a/docs/classPenningTrap.js b/docs/classPenningTrap.js index 6e5d013..38310ad 100644 --- a/docs/classPenningTrap.js +++ b/docs/classPenningTrap.js @@ -16,6 +16,7 @@ var classPenningTrap = [ "simulate", "classPenningTrap.html#a7a1d9f0528a12308de25bc30718da20a", null ], [ "total_force", "classPenningTrap.html#a9a301b0540078c36697880ef204afdf3", null ], [ "total_force_external", "classPenningTrap.html#a2c01108b52c8e2a003cf9170da9e7682", null ], + [ "total_force_no_interaction", "classPenningTrap.html#a6069f82d8dbc7cadaebd228dbcd95018", null ], [ "total_force_particles", "classPenningTrap.html#a2fe1cefbae18fa5808155ee0d2df713c", null ], [ "v_func", "classPenningTrap.html#a3c0a44e4e0a94366ff609e81fe463fa2", null ], [ "write_simulation_to_dir", "classPenningTrap.html#ad8bc4df7ab3eed53b16cfdff38e7760b", null ], diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html index a595b88..22ec43b 100644 --- a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -102,13 +102,11 @@ $(document).ready(function(){initNavTree('dir_68267d1309a1af8e8297ef4c3efbcdba.h
- - - -

-Directories

directory  scripts
 
+ + + diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js index b85a8c3..f3209f1 100644 --- a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js +++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js @@ -1,6 +1,6 @@ var dir_68267d1309a1af8e8297ef4c3efbcdba = [ - [ "scripts", "dir_634e799a3947388232110823971192a8.html", "dir_634e799a3947388232110823971192a8" ], + [ "frequency_narrow_sweeps_long.cpp", "frequency__narrow__sweeps__long_8cpp.html", "frequency__narrow__sweeps__long_8cpp" ], [ "main.cpp", "main_8cpp.html", "main_8cpp" ], [ "Particle.cpp", "Particle_8cpp.html", null ], [ "PenningTrap.cpp", "PenningTrap_8cpp.html", null ], diff --git a/docs/files.html b/docs/files.html index 0176ee4..7537f24 100644 --- a/docs/files.html +++ b/docs/files.html @@ -102,7 +102,7 @@ $(document).ready(function(){initNavTree('files.html',''); initResizable(); });
Here is a list of all documented files with brief descriptions:
-
[detail level 123]

Files

file  frequency_narrow_sweeps_long.cpp [code]
 Sweep of the frequencies from 1.1 to 1.7 using a small time step.
 
file  main.cpp [code]
 The main program for this project.
 
+
[detail level 12]
@@ -110,19 +110,12 @@ $(document).ready(function(){initNavTree('files.html',''); initResizable(); }); - - - - - - - - - - - - - + + + + + +
  include
 constants.hppLibrary of constants
 Particle.hppA class that holds the properties of a particle
 typedefs.hppUseful typedefs for cleaner code
 utils.hppFunction prototypes and macros that are useful
  src
  scripts
 animate_100_particles.py
 plot_2_particles.py
 plot_3d.py
 plot_particles_left.py
 plot_phase_space.py
 plot_relative_error.py
 plot_single_particle.py
 main.cppThe main program for this project
 Particle.cppThe implementation of the Particle class
 PenningTrap.cppThe implementation of the PenningTrap class
 test_suite.cppThe test suite for the project
 utils.cppImplementation of the utils
 frequency_narrow_sweeps_long.cppSweep of the frequencies from 1.1 to 1.7 using a small time step
 main.cppThe main program for this project
 Particle.cppThe implementation of the Particle class
 PenningTrap.cppThe implementation of the PenningTrap class
 test_suite.cppThe test suite for the project
 utils.cppImplementation of the utils
diff --git a/docs/frequency__narrow__sweeps__long_8cpp.html b/docs/frequency__narrow__sweeps__long_8cpp.html new file mode 100644 index 0000000..be73962 --- /dev/null +++ b/docs/frequency__narrow__sweeps__long_8cpp.html @@ -0,0 +1,256 @@ + + + + + + + +Penning Trap Simulation: src/frequency_narrow_sweeps_long.cpp File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Penning Trap Simulation +
+
Simulate particle behavior inside a Penning Trap
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
frequency_narrow_sweeps_long.cpp File Reference
+
+
+ +

Sweep of the frequencies from 1.1 to 1.7 using a small time step. +More...

+
#include <cmath>
+#include <complex>
+#include <fstream>
+#include <omp.h>
+#include <string>
+#include <vector>
+#include "PenningTrap.hpp"
+#include "constants.hpp"
+#include "utils.hpp"
+
+

Go to the source code of this file.

+ + + + + + +

+Macros

#define PARTICLES   100
 
#define N   40000
 
+ + + + + + + + + +

+Functions

void potential_resonance_narrow_sweep ()
 Simulate 100 particles over 500 \( \mu s \) using a time dependent potential.
 
void potential_resonance_narrow_sweep_interaction ()
 Simulate 100 particles over 500 \( \mu s \) using a time dependent potential.
 
int main ()
 
+

Detailed Description

+

Sweep of the frequencies from 1.1 to 1.7 using a small time step.

+
Author
Cory Alexander Balaton (coryab)
+
+Janita Ovidie Sandtrøen Willumsen (janitaws)
+
Version
1.0
+
Bug:
No known bugs
+ +

Definition in file frequency_narrow_sweeps_long.cpp.

+

Macro Definition Documentation

+ +

◆ N

+ +
+
+ + + + +
#define N   40000
+
+ +

Definition at line 25 of file frequency_narrow_sweeps_long.cpp.

+ +
+
+ +

◆ PARTICLES

+ +
+
+ + + + +
#define PARTICLES   100
+
+ +

Definition at line 24 of file frequency_narrow_sweeps_long.cpp.

+ +
+
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 139 of file frequency_narrow_sweeps_long.cpp.

+ +
+
+ +

◆ potential_resonance_narrow_sweep()

+ +
+
+ + + + + + + +
void potential_resonance_narrow_sweep ()
+
+ +

Simulate 100 particles over 500 \( \mu s \) using a time dependent potential.

+

The simulation sweeps over different frequencies in [1., 1.7] MHz.

+ +

Definition at line 34 of file frequency_narrow_sweeps_long.cpp.

+ +
+
+ +

◆ potential_resonance_narrow_sweep_interaction()

+ +
+
+ + + + + + + +
void potential_resonance_narrow_sweep_interaction ()
+
+ +

Simulate 100 particles over 500 \( \mu s \) using a time dependent potential.

+

The simulation sweeps over different frequencies in [1., 1.7] MHz.

+ +

Definition at line 91 of file frequency_narrow_sweeps_long.cpp.

+ +
+
+
+
+ + + + diff --git a/docs/frequency__narrow__sweeps__long_8cpp.js b/docs/frequency__narrow__sweeps__long_8cpp.js new file mode 100644 index 0000000..c5b9bb8 --- /dev/null +++ b/docs/frequency__narrow__sweeps__long_8cpp.js @@ -0,0 +1,5 @@ +var frequency__narrow__sweeps__long_8cpp = +[ + [ "potential_resonance_narrow_sweep", "frequency__narrow__sweeps__long_8cpp.html#a33d9b1c76c3c80902f89a58b1a6d96ea", null ], + [ "potential_resonance_narrow_sweep_interaction", "frequency__narrow__sweeps__long_8cpp.html#ac1816f70ec612edc27848ef7f0875fdb", null ] +]; \ No newline at end of file diff --git a/docs/frequency__narrow__sweeps__long_8cpp_source.html b/docs/frequency__narrow__sweeps__long_8cpp_source.html new file mode 100644 index 0000000..983bcdf --- /dev/null +++ b/docs/frequency__narrow__sweeps__long_8cpp_source.html @@ -0,0 +1,252 @@ + + + + + + + +Penning Trap Simulation: src/frequency_narrow_sweeps_long.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Penning Trap Simulation +
+
Simulate particle behavior inside a Penning Trap
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
frequency_narrow_sweeps_long.cpp
+
+
+Go to the documentation of this file.
1
+
13#include <cmath>
+
14#include <complex>
+
15#include <fstream>
+
16#include <omp.h>
+
17#include <string>
+
18#include <vector>
+
19
+
20#include "PenningTrap.hpp"
+
21#include "constants.hpp"
+
22#include "utils.hpp"
+
23
+
24#define PARTICLES 100
+
25#define N 40000
+
26
+ +
35{
+
36 double time = 500.;
+
37
+
38 double amplitudes[]{.1, .4, .7};
+
39
+
40 double freq_start = 1.1;
+
41 double freq_end = 1.7;
+
42 double freq_increment = .0005;
+
43 size_t freq_iterations =
+
44 (size_t)((freq_end - freq_start) / freq_increment) + 1;
+
45
+
46 double res[4][freq_iterations];
+
47
+
48 std::string path = "output/time_dependent_potential/";
+
49 mkpath(path);
+
50
+
51 std::ofstream ofile;
+
52
+
53#pragma omp parallel for
+
54 // Insert frequencies
+
55 for (size_t i = 0; i < freq_iterations; i++) {
+
56 res[0][i] = freq_start + freq_increment * i;
+
57 }
+
58
+
59#pragma omp parallel
+
60 {
+
61 // Each thread creates a PenningTrap instance and reuses it throughout
+
62 // the sweep.
+
63 PenningTrap trap((uint)PARTICLES);
+
64#pragma omp for collapse(2)
+
65 for (size_t i = 0; i < 3; i++) {
+
66 for (size_t j = 0; j < freq_iterations; j++) {
+
67 // Reset particles and give new time dependent potential.
+
68 trap.reinitialize(amplitudes[i], res[0][j]);
+
69 res[i + 1][j] =
+
70 trap.fraction_of_particles_left(time, N, "rk4", false);
+
71 }
+
72 }
+
73 }
+
74
+
75 // Write results to file
+
76 ofile.open(path + "narrow_sweep_fine.txt");
+
77 for (size_t i = 0; i < freq_iterations; i++) {
+
78 ofile << res[0][i] << ',' << res[1][i] << ',' << res[2][i] << ','
+
79 << res[3][i] << '\n';
+
80 }
+
81 ofile.close();
+
82}
+
83
+ +
92{
+
93 double time = 500.;
+
94
+
95 double amplitudes[]{.1, .4, .7};
+
96
+
97 double freq_start = 1.1;
+
98 double freq_end = 1.7;
+
99 double freq_increment = .0005;
+
100 size_t freq_iterations =
+
101 (size_t)((freq_end - freq_start) / freq_increment) + 1;
+
102
+
103 double res[4][freq_iterations];
+
104
+
105 std::string path = "output/time_dependent_potential/";
+
106 mkpath(path);
+
107
+
108 std::ofstream ofile;
+
109
+
110#pragma omp parallel for
+
111 for (size_t i = 0; i < freq_iterations; i++) {
+
112 res[0][i] = freq_start + freq_increment * i;
+
113 }
+
114
+
115#pragma omp parallel
+
116 {
+
117 // Each thread creates a PenningTrap instance and reuses it throughout
+
118 // the sweep.
+
119 PenningTrap trap((uint)PARTICLES);
+
120#pragma omp for collapse(2)
+
121 for (size_t i = 0; i < 3; i++) {
+
122 for (size_t j = 0; j < freq_iterations; j++) {
+
123 // Reset particles and give new time dependent potential.
+
124 trap.reinitialize(amplitudes[i], res[0][j]);
+
125 res[i + 1][j] = trap.fraction_of_particles_left(time, N);
+
126 }
+
127 }
+
128 }
+
129
+
130 // Write results to file
+
131 ofile.open(path + "narrow_sweep_interactions_fine.txt");
+
132 for (size_t i = 0; i < freq_iterations; i++) {
+
133 ofile << res[0][i] << ',' << res[1][i] << ',' << res[2][i] << ','
+
134 << res[3][i] << '\n';
+
135 }
+
136 ofile.close();
+
137}
+
138
+
139int main()
+
140{
+
141 double start, end;
+
142
+
143 start = omp_get_wtime();
+
144
+ +
146
+ +
148
+
149 end = omp_get_wtime();
+
150
+
151 std::cout << "Time: " << end - start << " seconds" << std::endl;
+
152
+
153 return 0;
+
154}
+
A class for simulating a Penning trap.
+
A class that simulates a Penning trap.
Definition: PenningTrap.hpp:32
+
void reinitialize(double f, double omega_V, double t=0.)
Give all particles new positions and velocities, and change t and V_0.
+
double fraction_of_particles_left(double time, uint steps, std::string method="rk4", bool particle_interaction=true)
Simulate and calculate what fraction of particles are still left inside the Penning trap after the si...
+
Library of constants.
+
void potential_resonance_narrow_sweep()
Simulate 100 particles over 500 using a time dependent potential.
+
void potential_resonance_narrow_sweep_interaction()
Simulate 100 particles over 500 using a time dependent potential.
+
Function prototypes and macros that are useful.
+
bool mkpath(std::string path, int mode=0777)
Make path given.
Definition: utils.cpp:72
+
+
+ + + + diff --git a/docs/functions.html b/docs/functions.html index 86b463b..ff9a215 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -176,6 +176,7 @@ $(document).ready(function(){initNavTree('functions.html',''); initResizable();
  • test_total_force_particles() : PenningTrapTest
  • total_force() : PenningTrap
  • total_force_external() : PenningTrap
  • +
  • total_force_no_interaction() : PenningTrap
  • total_force_particles() : PenningTrap
  • diff --git a/docs/functions_func.html b/docs/functions_func.html index 1b82d50..e821456 100644 --- a/docs/functions_func.html +++ b/docs/functions_func.html @@ -119,6 +119,7 @@ $(document).ready(function(){initNavTree('functions_func.html',''); initResizabl
  • test_total_force_particles() : PenningTrapTest
  • total_force() : PenningTrap
  • total_force_external() : PenningTrap
  • +
  • total_force_no_interaction() : PenningTrap
  • total_force_particles() : PenningTrap
  • v_func() : PenningTrap
  • write_simulation_to_dir() : PenningTrap
  • diff --git a/docs/globals.html b/docs/globals.html index 23a1b12..98cafee 100644 --- a/docs/globals.html +++ b/docs/globals.html @@ -137,8 +137,8 @@ $(document).ready(function(){initNavTree('globals.html',''); initResizable(); })

    - p -

    diff --git a/docs/globals_func.html b/docs/globals_func.html index 376c50c..5d664cd 100644 --- a/docs/globals_func.html +++ b/docs/globals_func.html @@ -103,8 +103,8 @@ $(document).ready(function(){initNavTree('globals_func.html',''); initResizable(
  • close_to() : utils.hpp, utils.cpp
  • m_assert() : utils.hpp, utils.cpp
  • mkpath() : utils.hpp, utils.cpp
  • -
  • potential_resonance_narrow_sweep() : main.cpp
  • -
  • potential_resonance_narrow_sweep_interaction() : main.cpp
  • +
  • potential_resonance_narrow_sweep() : frequency_narrow_sweeps_long.cpp, main.cpp
  • +
  • potential_resonance_narrow_sweep_interaction() : frequency_narrow_sweeps_long.cpp, main.cpp
  • potential_resonance_wide_sweep() : main.cpp
  • scientific_format() : utils.hpp, utils.cpp
  • simulate_100_particles() : main.cpp
  • diff --git a/docs/index.html b/docs/index.html index b9d7673..4015ebb 100644 --- a/docs/index.html +++ b/docs/index.html @@ -126,6 +126,16 @@ Operating systems

    +Tools

    + +

    Libraries

    -

    +

    Compiling

    Compiling is as easy as running this command while being inside the src directory:

    make
    -

    +

    Running programs

    -

    +

    C++ binaries

    To run main or test_suite, just run this command while being inside src:

    ./<program-name>
    -

    +

    Python scripts

    -

    +

    Install libraries

    Before running the scripts, make sure that all libraries are installed. Using pip, you can install all requirements like this:

    pip install -r requirements.txt

    This recursively install all the packages that are listed in requirements.txt.

    -

    +

    Running scripts

    For the Python scripts, run them from the src directory like this:

    python scripts/<script-name>

    If you have any problems running the scripts, you might have to run this instead:

    python3 scripts/<script-name>
    -

    +

    +Batch system

    +

    For the frequency_narrow_sweeps_long program, the is a script called job.script that comes along with it. This is to be able to run it on a batch system using Slurm if you have access to one. This is the recommended way to use this program as it takes approximately 90 minutes to complete when using 16 cores.

    +

    If you happen to have such a system available to you, then you should clone this repo on that system, then compile it by running:

    +
    make frequency_narrow_sweeps_long
    +

    You might have to load the Armadillo library before compiling.

    +

    After compiling, you can schedule it by running:

    +
    sbatch job.script
    +

    +Performance

    +

    This section aims to give an idea to the time it takes for the program to run so that you know a bit what to expect if you decide to run it for yourself.

    +

    +CPU

    +

    The times mentioned here are times achieved on a computer with these specifications:

    + +

    +Times

    +

    All times mentioned use the evolve_RK4 method.

    +

    Running a simulation with 100 particles without particle interactions over 40000 steps takes around 1.8 seconds. With particle interactions, it takes around 4.8 seconds.

    +

    potential_resonance_wide_sweep takes around 56 seconds to complete.

    +

    potential_resonance_narrow_sweep takes around 172 seconds to complete.

    +

    potential_resonance_narrow_sweep_interaction takes around 936 seconds to complete.

    +

    Credits

    The Doxygen theme used here is doxygen-awesome-css.

    diff --git a/docs/main_8cpp.html b/docs/main_8cpp.html index 5edc69f..dab738a 100644 --- a/docs/main_8cpp.html +++ b/docs/main_8cpp.html @@ -173,7 +173,7 @@ Variables
    Janita Ovidie Sandtrøen Willumsen (janitaws)
    Version
    1.0
    -
    Bug:
    No known bugs
    +
    Bug:
    No known bugs

    Definition in file main.cpp.

    Macro Definition Documentation

    @@ -254,7 +254,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
    -

    Definition at line 309 of file main.cpp.

    +

    Definition at line 314 of file main.cpp.

    @@ -276,7 +276,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)

    Simulate 100 particles over 500 \( \mu s \) using a time dependent potential.

    The simulation sweeps over different frequencies in [1., 1.7] MHz.

    -

    Definition at line 206 of file main.cpp.

    +

    Definition at line 209 of file main.cpp.

    @@ -298,7 +298,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)

    Simulate 100 particles over 500 \( \mu s \) using a time dependent potential.

    The simulation sweeps over different frequencies in [1., 1.7] MHz.

    -

    Definition at line 262 of file main.cpp.

    +

    Definition at line 266 of file main.cpp.

    @@ -320,7 +320,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)

    Simulate 100 particles over 500 \( \mu s \) using a time dependent potential.

    The simulation sweeps over different frequencies in [0.2, 2.5] MHz.

    -

    Definition at line 149 of file main.cpp.

    +

    Definition at line 152 of file main.cpp.

    @@ -341,7 +341,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)

    Simulate 100 particles over 50 \( \mu s \).

    -

    Definition at line 132 of file main.cpp.

    +

    Definition at line 134 of file main.cpp.

    @@ -362,7 +362,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)

    Simulate a single particle over the period of 50 \( \mu s \).

    -

    Definition at line 54 of file main.cpp.

    +

    Definition at line 55 of file main.cpp.

    @@ -383,7 +383,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)

    Simulate a single particle over 50 \( \mu s \) using different amount of steps and different methods.

    -

    Definition at line 87 of file main.cpp.

    +

    Definition at line 88 of file main.cpp.

    @@ -404,7 +404,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)

    Simulate 2 particles over the period of 50 \( \mu s \) with and without particle interactions.

    -

    Definition at line 69 of file main.cpp.

    +

    Definition at line 70 of file main.cpp.

    diff --git a/docs/main_8cpp_source.html b/docs/main_8cpp_source.html index ecc9633..22654cb 100644 --- a/docs/main_8cpp_source.html +++ b/docs/main_8cpp_source.html @@ -128,317 +128,367 @@ $(document).ready(function(){initNavTree('main_8cpp_source.html',''); initResiza
    42 double w_n = (w_0 - std::sqrt(w_0 * w_0 - 2. * w_z2)) / 2.;
    43 double A_p = (25. + w_n * 20.) / (w_n - w_p);
    44 double A_n = -(25. + w_p * 20.) / (w_n - w_p);
    -
    45 std::complex<double> f =
    -
    46 A_p * std::exp(std::complex<double>(0., -w_p * t))
    -
    47 + A_n * std::exp(std::complex<double>(0., -w_n * t));
    -
    48 vec3 res{std::real(f), std::imag(f), 20. * std::cos(std::sqrt(w_z2) * t)};
    -
    49 return res;
    -
    50}
    -
    51
    -
    54void simulate_single_particle()
    -
    55{
    -
    56 // Initialize trap with particle 1
    -
    57 PenningTrap trap(std::vector<Particle>{p1});
    -
    58
    -
    59 double time = 50.; // microseconds
    -
    60
    -
    61 // Simulate and write results to file
    -
    62 trap.write_simulation_to_dir("output/simulate_single_particle", time, N,
    -
    63 "rk4", false);
    -
    64}
    -
    65
    -
    69void simulate_two_particles()
    -
    70{
    -
    71 // Initialize traps with particles
    -
    72 PenningTrap trap_no_interaction(std::vector<Particle>{p1, p2});
    -
    73 PenningTrap trap_with_interaction(std::vector<Particle>{p1, p2});
    -
    74
    -
    75 double time = 50.; // microseconds
    -
    76
    -
    77 // Simulate and write results to files
    -
    78 trap_no_interaction.write_simulation_to_dir(
    -
    79 "output/simulate_2_particles/no_interaction", time, N, "rk4", false);
    -
    80 trap_with_interaction.write_simulation_to_dir(
    -
    81 "output/simulate_2_particles/with_interaction", time, N);
    -
    82}
    -
    83
    -
    87void simulate_single_particle_with_different_steps()
    -
    88{
    -
    89 double time = 50.; // microseconds
    -
    90
    -
    91 std::ofstream ofile;
    -
    92
    -
    93 // Calculate relative error for RK4
    -
    94 std::string path = "output/relative_error/RK4/";
    -
    95 mkpath(path);
    -
    96#pragma omp parallel for
    -
    97 for (int i = 0; i < 4; i++) {
    -
    98 int steps = 4000 * std::pow(2, i);
    -
    99 double dt = time / (double)steps;
    -
    100 ofile.open(path + std::to_string(steps) + "_steps.txt");
    -
    101 PenningTrap trap(std::vector<Particle>{p1});
    -
    102 simulation_t res = trap.simulate(time, steps, "rk4", false);
    -
    103 for (int i = 0; i < steps; i++) {
    -
    104 ofile << arma::norm(res.r_vecs[0][i]
    -
    105 - analytical_solution_particle_1(dt * i))
    -
    106 << '\n';
    -
    107 }
    -
    108 ofile.close();
    -
    109 }
    -
    110
    -
    111 // Calculate relative error for forward Euler
    -
    112 path = "output/relative_error/euler/";
    -
    113 mkpath(path);
    -
    114#pragma omp parallel for
    -
    115 for (int i = 0; i < 4; i++) {
    -
    116 int steps = 4000 * std::pow(2, i);
    -
    117 double dt = time / (double)steps;
    -
    118 ofile.open(path + std::to_string(steps) + "_steps.txt");
    -
    119 PenningTrap trap(std::vector<Particle>{p1});
    -
    120 simulation_t res = trap.simulate(time, steps, "euler", false);
    -
    121 for (int i = 0; i < steps; i++) {
    -
    122 ofile << arma::norm(res.r_vecs[0][i]
    -
    123 - analytical_solution_particle_1(dt * i))
    -
    124 << '\n';
    -
    125 }
    -
    126 ofile.close();
    -
    127 }
    -
    128}
    -
    129
    -
    132void simulate_100_particles()
    -
    133{
    -
    134 PenningTrap trap((unsigned)100);
    -
    135
    -
    136 double time = 50.; // microseconds
    +
    45 std::cout << A_p << "," << A_n << std::endl;
    +
    46 std::complex<double> f =
    +
    47 A_p * std::exp(std::complex<double>(0., -w_p * t))
    +
    48 + A_n * std::exp(std::complex<double>(0., -w_n * t));
    +
    49 vec3 res{std::real(f), std::imag(f), 20. * std::cos(std::sqrt(w_z2) * t)};
    +
    50 return res;
    +
    51}
    +
    52
    +
    55void simulate_single_particle()
    +
    56{
    +
    57 // Initialize trap with particle 1
    +
    58 PenningTrap trap(std::vector<Particle>{p1});
    +
    59
    +
    60 double time = 50.; // microseconds
    +
    61
    +
    62 // Simulate and write results to file
    +
    63 trap.write_simulation_to_dir("output/simulate_single_particle", time, N,
    +
    64 "rk4", false);
    +
    65}
    +
    66
    +
    70void simulate_two_particles()
    +
    71{
    +
    72 // Initialize traps with particles
    +
    73 PenningTrap trap_no_interaction(std::vector<Particle>{p1, p2});
    +
    74 PenningTrap trap_with_interaction(std::vector<Particle>{p1, p2});
    +
    75
    +
    76 double time = 50.; // microseconds
    +
    77
    +
    78 // Simulate and write results to files
    +
    79 trap_no_interaction.write_simulation_to_dir(
    +
    80 "output/simulate_2_particles/no_interaction", time, N, "rk4", false);
    +
    81 trap_with_interaction.write_simulation_to_dir(
    +
    82 "output/simulate_2_particles/with_interaction", time, N);
    +
    83}
    +
    84
    +
    88void simulate_single_particle_with_different_steps()
    +
    89{
    +
    90 double time = 50.; // microseconds
    +
    91
    +
    92 std::ofstream ofile;
    +
    93
    +
    94 // Calculate relative error for RK4
    +
    95 std::string path = "output/relative_error/RK4/";
    +
    96 mkpath(path);
    +
    97#pragma omp parallel for private(ofile)
    +
    98 for (int i = 0; i < 4; i++) {
    +
    99 int steps = 4000 * std::pow(2, i);
    +
    100 std::cout << steps << std::endl;
    +
    101 double dt = time / (double)steps;
    +
    102 ofile.open(path + std::to_string(steps) + "_steps.txt");
    +
    103 PenningTrap trap(std::vector<Particle>{p1});
    +
    104 simulation_t res = trap.simulate(time, steps, "rk4", false);
    +
    105 for (int i = 0; i < steps; i++) {
    +
    106 ofile << arma::norm(res.r_vecs[0][i]
    +
    107 - analytical_solution_particle_1(dt * i))
    +
    108 << '\n';
    +
    109 }
    +
    110 ofile.close();
    +
    111 }
    +
    112
    +
    113 // Calculate relative error for forward Euler
    +
    114 path = "output/relative_error/euler/";
    +
    115 mkpath(path);
    +
    116#pragma omp parallel for private(ofile)
    +
    117 for (int i = 0; i < 4; i++) {
    +
    118 int steps = 4000 * std::pow(2, i);
    +
    119 double dt = time / (double)steps;
    +
    120 ofile.open(path + std::to_string(steps) + "_steps.txt");
    +
    121 PenningTrap trap(std::vector<Particle>{p1});
    +
    122 simulation_t res = trap.simulate(time, steps, "euler", false);
    +
    123 for (int i = 0; i < steps; i++) {
    +
    124 ofile << arma::norm(res.r_vecs[0][i]
    +
    125 - analytical_solution_particle_1(dt * i))
    +
    126 << '\n';
    +
    127 }
    +
    128 ofile.close();
    +
    129 }
    +
    130}
    +
    131
    +
    134void simulate_100_particles()
    +
    135{
    +
    136 PenningTrap trap((unsigned)100);
    137
    -
    138 trap.write_simulation_to_dir("output/simulate_100_particles", time, N,
    -
    139 "rk4", false);
    -
    140}
    -
    141
    -
    149void potential_resonance_wide_sweep()
    -
    150{
    -
    151 double time = 500.;
    -
    152
    -
    153 double amplitudes[]{.1, .4, .7};
    -
    154
    -
    155 double freq_start = .2;
    -
    156 double freq_end = 2.5;
    -
    157 double freq_increment = .02;
    -
    158 size_t freq_iterations =
    -
    159 (size_t)((freq_end - freq_start) / freq_increment) + 1;
    -
    160
    -
    161 double res[4][freq_iterations];
    -
    162
    -
    163 std::string path = "output/time_dependent_potential/";
    -
    164 mkpath(path);
    +
    138 double time = 50.; // microseconds
    +
    139
    +
    140 // trap.write_simulation_to_dir("output/simulate_100_particles", time, N,
    +
    141 //"rk4", false);
    +
    142 trap.simulate(time, N, "rk4", true);
    +
    143}
    +
    144
    +
    152void potential_resonance_wide_sweep()
    +
    153{
    +
    154 double time = 500.;
    +
    155
    +
    156 double amplitudes[]{.1, .4, .7};
    +
    157
    +
    158 double freq_start = .2;
    +
    159 double freq_end = 2.5;
    +
    160 double freq_increment = .02;
    +
    161 size_t freq_iterations =
    +
    162 (size_t)((freq_end - freq_start) / freq_increment) + 1;
    +
    163
    +
    164 double res[4][freq_iterations];
    165
    -
    166 std::ofstream ofile;
    -
    167
    -
    168#pragma omp parallel for
    -
    169 // Insert frequencies
    -
    170 for (size_t i = 0; i < freq_iterations; i++) {
    -
    171 res[0][i] = freq_start + freq_increment * i;
    -
    172 }
    -
    173
    -
    174#pragma omp parallel
    -
    175 {
    -
    176 // Each thread creates a PenningTrap instance and reuses it throughout
    -
    177 // the sweep.
    -
    178 PenningTrap trap((uint)100);
    -
    179#pragma omp for collapse(2)
    -
    180 for (size_t i = 0; i < 3; i++) {
    -
    181 for (size_t j = 0; j < freq_iterations; j++) {
    -
    182 // Reset particles and give new time dependent potential.
    -
    183 trap.reinitialize(amplitudes[i], res[0][j]);
    -
    184 res[i + 1][j] =
    -
    185 trap.fraction_of_particles_left(time, N, "rk4", false);
    -
    186 }
    -
    187 }
    -
    188 }
    -
    189
    -
    190 // Write results to file
    -
    191 ofile.open(path + "wide_sweep.txt");
    -
    192 for (size_t i = 0; i < freq_iterations; i++) {
    -
    193 ofile << res[0][i] << ',' << res[1][i] << ',' << res[2][i] << ','
    -
    194 << res[3][i] << '\n';
    -
    195 }
    -
    196 ofile.close();
    -
    197}
    -
    198
    -
    206void potential_resonance_narrow_sweep()
    -
    207{
    -
    208 double time = 500.;
    -
    209
    -
    210 double amplitudes[]{.1, .4, .7};
    -
    211
    -
    212 double freq_start = 1.;
    -
    213 double freq_end = 1.7;
    -
    214 double freq_increment = .002;
    -
    215 size_t freq_iterations = (size_t)((freq_end - freq_start) / freq_increment);
    -
    216
    -
    217 double res[4][freq_iterations];
    -
    218
    -
    219 std::string path = "output/time_dependent_potential/";
    -
    220 mkpath(path);
    -
    221
    -
    222 std::ofstream ofile;
    -
    223
    -
    224#pragma omp parallel for
    -
    225 // Insert frequencies
    -
    226 for (size_t i = 0; i < freq_iterations; i++) {
    -
    227 res[0][i] = freq_start + freq_increment * i;
    -
    228 }
    -
    229
    -
    230#pragma omp parallel
    -
    231 {
    -
    232 // Each thread creates a PenningTrap instance and reuses it throughout
    -
    233 // the sweep.
    -
    234 PenningTrap trap((uint)100);
    -
    235#pragma omp for collapse(2)
    -
    236 for (size_t i = 0; i < 3; i++) {
    -
    237 for (size_t j = 0; j < freq_iterations; j++) {
    -
    238 // Reset particles and give new time dependent potential.
    -
    239 trap.reinitialize(amplitudes[i], res[0][j]);
    -
    240 res[i + 1][j] =
    -
    241 trap.fraction_of_particles_left(time, N, "rk4", false);
    -
    242 }
    -
    243 }
    -
    244 }
    -
    245
    -
    246 // Write results to file
    -
    247 ofile.open(path + "narrow_sweep.txt");
    -
    248 for (size_t i = 0; i < freq_iterations; i++) {
    -
    249 ofile << res[0][i] << ',' << res[1][i] << ',' << res[2][i] << ','
    -
    250 << res[3][i] << '\n';
    -
    251 }
    -
    252 ofile.close();
    -
    253}
    -
    254
    -
    262void potential_resonance_narrow_sweep_interaction()
    -
    263{
    -
    264 double time = 500.;
    -
    265
    -
    266 double amplitudes[]{.1, .4, .7};
    -
    267
    -
    268 double freq_start = 1.;
    -
    269 double freq_end = 1.7;
    -
    270 double freq_increment = .002;
    -
    271 size_t freq_iterations = (size_t)((freq_end - freq_start) / freq_increment);
    -
    272
    -
    273 double res[4][freq_iterations];
    -
    274
    -
    275 std::string path = "output/time_dependent_potential/";
    -
    276 mkpath(path);
    +
    166 std::string path = "output/time_dependent_potential/";
    +
    167 mkpath(path);
    +
    168
    +
    169 std::ofstream ofile;
    +
    170
    +
    171#pragma omp parallel for
    +
    172 // Insert frequencies
    +
    173 for (size_t i = 0; i < freq_iterations; i++) {
    +
    174 res[0][i] = freq_start + freq_increment * i;
    +
    175 }
    +
    176
    +
    177#pragma omp parallel
    +
    178 {
    +
    179 // Each thread creates a PenningTrap instance and reuses it throughout
    +
    180 // the sweep.
    +
    181 PenningTrap trap((uint)100);
    +
    182#pragma omp for collapse(2)
    +
    183 for (size_t i = 0; i < 3; i++) {
    +
    184 for (size_t j = 0; j < freq_iterations; j++) {
    +
    185 // Reset particles and give new time dependent potential.
    +
    186 trap.reinitialize(amplitudes[i], res[0][j]);
    +
    187 res[i + 1][j] =
    +
    188 trap.fraction_of_particles_left(time, N, "rk4", false);
    +
    189 }
    +
    190 }
    +
    191 }
    +
    192
    +
    193 // Write results to file
    +
    194 ofile.open(path + "wide_sweep.txt");
    +
    195 for (size_t i = 0; i < freq_iterations; i++) {
    +
    196 ofile << res[0][i] << ',' << res[1][i] << ',' << res[2][i] << ','
    +
    197 << res[3][i] << '\n';
    +
    198 }
    +
    199 ofile.close();
    +
    200}
    +
    201
    +
    209void potential_resonance_narrow_sweep()
    +
    210{
    +
    211 double time = 500.;
    +
    212
    +
    213 double amplitudes[]{.1, .4, .7};
    +
    214
    +
    215 double freq_start = 1.1;
    +
    216 double freq_end = 1.7;
    +
    217 double freq_increment = .002;
    +
    218 size_t freq_iterations =
    +
    219 (size_t)((freq_end - freq_start) / freq_increment) + 1;
    +
    220
    +
    221 double res[4][freq_iterations];
    +
    222
    +
    223 std::string path = "output/time_dependent_potential/";
    +
    224 mkpath(path);
    +
    225
    +
    226 std::ofstream ofile;
    +
    227
    +
    228#pragma omp parallel for
    +
    229 // Insert frequencies
    +
    230 for (size_t i = 0; i < freq_iterations; i++) {
    +
    231 res[0][i] = freq_start + freq_increment * i;
    +
    232 }
    +
    233
    +
    234#pragma omp parallel
    +
    235 {
    +
    236 // Each thread creates a PenningTrap instance and reuses it throughout
    +
    237 // the sweep.
    +
    238 PenningTrap trap((uint)100);
    +
    239#pragma omp for collapse(2)
    +
    240 for (size_t i = 0; i < 3; i++) {
    +
    241 for (size_t j = 0; j < freq_iterations; j++) {
    +
    242 // Reset particles and give new time dependent potential.
    +
    243 trap.reinitialize(amplitudes[i], res[0][j]);
    +
    244 res[i + 1][j] =
    +
    245 trap.fraction_of_particles_left(time, N, "rk4", false);
    +
    246 }
    +
    247 }
    +
    248 }
    +
    249
    +
    250 // Write results to file
    +
    251 ofile.open(path + "narrow_sweep.txt");
    +
    252 for (size_t i = 0; i < freq_iterations; i++) {
    +
    253 ofile << res[0][i] << ',' << res[1][i] << ',' << res[2][i] << ','
    +
    254 << res[3][i] << '\n';
    +
    255 }
    +
    256 ofile.close();
    +
    257}
    +
    258
    +
    266void potential_resonance_narrow_sweep_interaction()
    +
    267{
    +
    268 double time = 500.;
    +
    269
    +
    270 double amplitudes[]{.1, .4, .7};
    +
    271
    +
    272 double freq_start = 1.1;
    +
    273 double freq_end = 1.7;
    +
    274 double freq_increment = .002;
    +
    275 size_t freq_iterations =
    +
    276 (size_t)((freq_end - freq_start) / freq_increment) + 1;
    277
    -
    278 std::ofstream ofile;
    +
    278 double res[4][freq_iterations];
    279
    -
    280#pragma omp parallel for
    -
    281 for (size_t i = 0; i < freq_iterations; i++) {
    -
    282 res[0][i] = freq_start + freq_increment * i;
    -
    283 }
    +
    280 std::string path = "output/time_dependent_potential/";
    +
    281 mkpath(path);
    +
    282
    +
    283 std::ofstream ofile;
    284
    -
    285#pragma omp parallel
    -
    286 {
    -
    287 // Each thread creates a PenningTrap instance and reuses it throughout
    -
    288 // the sweep.
    -
    289 PenningTrap trap((uint)100);
    -
    290#pragma omp for collapse(2)
    -
    291 for (size_t i = 0; i < 3; i++) {
    -
    292 for (size_t j = 0; j < freq_iterations; j++) {
    -
    293 // Reset particles and give new time dependent potential.
    -
    294 trap.reinitialize(amplitudes[i], res[0][j]);
    -
    295 res[i + 1][j] = trap.fraction_of_particles_left(time, N);
    -
    296 }
    -
    297 }
    -
    298 }
    -
    299
    -
    300 // Write results to file
    -
    301 ofile.open(path + "narrow_sweep_interactions.txt");
    -
    302 for (size_t i = 0; i < freq_iterations; i++) {
    -
    303 ofile << res[0][i] << ',' << res[1][i] << ',' << res[2][i] << ','
    -
    304 << res[3][i] << '\n';
    -
    305 }
    -
    306 ofile.close();
    -
    307}
    -
    308
    -
    309int main()
    -
    310{
    -
    311 double start, end, t1, t2;
    -
    312 start = omp_get_wtime();
    +
    285#pragma omp parallel for
    +
    286 for (size_t i = 0; i < freq_iterations; i++) {
    +
    287 res[0][i] = freq_start + freq_increment * i;
    +
    288 }
    +
    289
    +
    290#pragma omp parallel
    +
    291 {
    +
    292 // Each thread creates a PenningTrap instance and reuses it throughout
    +
    293 // the sweep.
    +
    294 PenningTrap trap((uint)100);
    +
    295#pragma omp for collapse(2)
    +
    296 for (size_t i = 0; i < 3; i++) {
    +
    297 for (size_t j = 0; j < freq_iterations; j++) {
    +
    298 // Reset particles and give new time dependent potential.
    +
    299 trap.reinitialize(amplitudes[i], res[0][j]);
    +
    300 res[i + 1][j] = trap.fraction_of_particles_left(time, N);
    +
    301 }
    +
    302 }
    +
    303 }
    +
    304
    +
    305 // Write results to file
    +
    306 ofile.open(path + "narrow_sweep_interactions.txt");
    +
    307 for (size_t i = 0; i < freq_iterations; i++) {
    +
    308 ofile << res[0][i] << ',' << res[1][i] << ',' << res[2][i] << ','
    +
    309 << res[3][i] << '\n';
    +
    310 }
    +
    311 ofile.close();
    +
    312}
    313
    -
    314 simulate_single_particle();
    -
    315
    -
    316 simulate_two_particles();
    -
    317
    -
    318 simulate_single_particle_with_different_steps();
    -
    319
    -
    320 t2 = omp_get_wtime();
    -
    321
    -
    322 std::cout << "Time single and double : " << (t2 - start)
    -
    323 << " seconds" << std::endl;
    -
    324
    -
    325 t1 = omp_get_wtime();
    -
    326
    -
    327 simulate_100_particles();
    -
    328
    -
    329 t2 = omp_get_wtime();
    -
    330
    -
    331 std::cout << "Time 100 particles : " << (t2 - t1)
    -
    332 << " seconds" << std::endl;
    -
    333
    -
    334 t1 = omp_get_wtime();
    -
    335
    -
    336 potential_resonance_wide_sweep();
    -
    337
    -
    338 t2 = omp_get_wtime();
    -
    339
    -
    340 std::cout << "Time wide sweep : " << (t2 - t1)
    -
    341 << " seconds" << std::endl;
    -
    342
    -
    343 t1 = omp_get_wtime();
    -
    344
    -
    345 potential_resonance_narrow_sweep();
    -
    346
    -
    347 t2 = omp_get_wtime();
    -
    348
    -
    349 std::cout << "Time narrow sweep no interaction : " << (t2 - t1)
    -
    350 << " seconds" << std::endl;
    -
    351
    -
    352 t1 = omp_get_wtime();
    +
    314int main()
    +
    315{
    +
    316 int option = 1;
    +
    317 bool chosen = false;
    +
    318
    +
    319 system("clear");
    +
    320 std::cout << "(1) All (default)\n"
    +
    321 << "(2) Simulate single particle\n"
    +
    322 << "(3) simulate 2 particles\n"
    +
    323 << "(4) Simulate single particle with different time steps\n"
    +
    324 << "(5) Simulate 100 particles\n"
    +
    325 << "(6) Potential resonance wide sweep\n"
    +
    326 << "(7) Potential resonance narrow sweep without particle "
    +
    327 "interactions\n"
    +
    328 << "(8) Potential resonance narrow sweep with particle "
    +
    329 "interaction\n"
    +
    330 << "Select what to run: ";
    +
    331 std::cin >> std::noskipws;
    +
    332 do {
    +
    333 if (!(std::cin >> option) || option < 1 || option > 8) {
    +
    334 std::cin.clear();
    +
    335 std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
    +
    336 system("clear");
    +
    337 std::cout
    +
    338 << "(1) All (default)\n"
    +
    339 << "(2) Simulate single particle\n"
    +
    340 << "(3) simulate 2 particles\n"
    +
    341 << "(4) Simulate single particle with different time steps\n"
    +
    342 << "(5) Simulate 100 particles\n"
    +
    343 << "(6) Potential resonance wide sweep\n"
    +
    344 << "(7) Potential resonance narrow sweep without particle "
    +
    345 "interactions\n"
    +
    346 << "(8) Potential resonance narrow sweep with particle "
    +
    347 "interaction\n"
    +
    348 << "Not a valid option, please enter a valid number: ";
    +
    349 } else {
    +
    350 chosen = true;
    +
    351 }
    +
    352 } while (!chosen);
    353
    -
    354 potential_resonance_narrow_sweep_interaction();
    +
    354 double start, end;
    355
    -
    356 t2 = omp_get_wtime();
    +
    356 system("clear");
    357
    -
    358 std::cout << "Time narrow sweep with interaction: " << (t2 - t1)
    -
    359 << " seconds" << std::endl;
    -
    360
    -
    361 end = omp_get_wtime();
    -
    362
    -
    363 std::cout << "Time : " << (end - start)
    -
    364 << " seconds" << std::endl;
    -
    365
    -
    366 return 0;
    -
    367}
    +
    358 start = omp_get_wtime();
    +
    359 switch (option) {
    +
    360 case 1:
    +
    361 std::cout << "Running simulate_single_particle\n";
    +
    362 simulate_single_particle();
    +
    363
    +
    364 std::cout << "Running simulate_two_particles\n";
    +
    365 simulate_two_particles();
    +
    366
    +
    367 std::cout << "Running simulate_single_particle_with_different_steps\n";
    +
    368 simulate_single_particle_with_different_steps();
    +
    369
    +
    370 std::cout << "Running simulate_100_particles\n";
    +
    371 simulate_100_particles();
    +
    372
    +
    373 std::cout << "Running potential_resonance_wide_sweep\n";
    +
    374 potential_resonance_wide_sweep();
    +
    375
    +
    376 std::cout << "Running potential_resonance_narrow_sweep\n";
    +
    377 potential_resonance_narrow_sweep();
    +
    378
    +
    379 std::cout << "Running potential_resonance_narrow_sweep_interaction\n";
    +
    380 potential_resonance_narrow_sweep_interaction();
    +
    381 break;
    +
    382 case 2:
    +
    383 std::cout << "Running simulate_single_particle\n";
    +
    384 simulate_single_particle();
    +
    385 break;
    +
    386 case 3:
    +
    387 std::cout << "Running simulate_two_particles\n";
    +
    388 simulate_two_particles();
    +
    389 break;
    +
    390 case 4:
    +
    391 std::cout << "Running simulate_single_particle_with_different_steps\n";
    +
    392 simulate_single_particle_with_different_steps();
    +
    393 break;
    +
    394 case 5:
    +
    395 std::cout << "Running simulate_100_particles\n";
    +
    396 simulate_100_particles();
    +
    397 break;
    +
    398 case 6:
    +
    399 std::cout << "Running potential_resonance_wide_sweep\n";
    +
    400 potential_resonance_wide_sweep();
    +
    401 break;
    +
    402 case 7:
    +
    403 std::cout << "Running potential_resonance_narrow_sweep\n";
    +
    404 potential_resonance_narrow_sweep();
    +
    405 break;
    +
    406 case 8:
    +
    407 std::cout << "Running potential_resonance_narrow_sweep_interaction\n";
    +
    408 potential_resonance_narrow_sweep_interaction();
    +
    409 break;
    +
    410 }
    +
    411 end = omp_get_wtime();
    +
    412
    +
    413 std::cout << "Time: " << end - start << " seconds" << std::endl;
    +
    414
    +
    415 return 0;
    +
    416}
    PenningTrap.hpp
    A class for simulating a Penning trap.
    Particle
    A class that holds attributes of a particle.
    Definition: Particle.hpp:23
    PenningTrap
    A class that simulates a Penning trap.
    Definition: PenningTrap.hpp:32
    -
    PenningTrap::reinitialize
    void reinitialize(double f, double omega_V, double t=0.)
    Give all particles new positions and velocities, and change t and V_0.
    Definition: PenningTrap.cpp:148
    -
    PenningTrap::fraction_of_particles_left
    double fraction_of_particles_left(double time, uint steps, std::string method="rk4", bool particle_interaction=true)
    Simulate and calculate what fraction of particles are still left inside the Penning trap after the si...
    Definition: PenningTrap.cpp:297
    -
    PenningTrap::write_simulation_to_dir
    void write_simulation_to_dir(std::string path, double time, uint steps, std::string method="rk4", bool particle_interaction=true)
    Simulate and write the displacement of all particles to files.
    Definition: PenningTrap.cpp:259
    +
    PenningTrap::simulate
    simulation_t simulate(double time, uint steps, std::string method="rk4", bool particle_interaction=true)
    Simulate the particle system inside the Penning trap over a certain amount of time.
    Definition: PenningTrap.cpp:240
    +
    PenningTrap::reinitialize
    void reinitialize(double f, double omega_V, double t=0.)
    Give all particles new positions and velocities, and change t and V_0.
    Definition: PenningTrap.cpp:153
    +
    PenningTrap::fraction_of_particles_left
    double fraction_of_particles_left(double time, uint steps, std::string method="rk4", bool particle_interaction=true)
    Simulate and calculate what fraction of particles are still left inside the Penning trap after the si...
    Definition: PenningTrap.cpp:311
    +
    PenningTrap::write_simulation_to_dir
    void write_simulation_to_dir(std::string path, double time, uint steps, std::string method="rk4", bool particle_interaction=true)
    Simulate and write the displacement of all particles to files.
    Definition: PenningTrap.cpp:273
    constants.hpp
    Library of constants.
    T
    #define T
    1 Tesla. unit:
    Definition: constants.hpp:21
    CA_MASS
    #define CA_MASS
    Mass of a single calcium ion. unit: amu.
    Definition: constants.hpp:29
    V
    #define V
    1 Volt. unit:
    Definition: constants.hpp:25
    -
    simulate_100_particles
    void simulate_100_particles()
    Simulate 100 particles over 50 .
    Definition: main.cpp:132
    +
    simulate_100_particles
    void simulate_100_particles()
    Simulate 100 particles over 50 .
    Definition: main.cpp:134
    p1
    Particle p1(vec3{20., 0., 20.}, vec3{0., 25., 0.})
    Particle 1.
    -
    potential_resonance_narrow_sweep
    void potential_resonance_narrow_sweep()
    Simulate 100 particles over 500 using a time dependent potential.
    Definition: main.cpp:206
    -
    potential_resonance_wide_sweep
    void potential_resonance_wide_sweep()
    Simulate 100 particles over 500 using a time dependent potential.
    Definition: main.cpp:149
    -
    simulate_two_particles
    void simulate_two_particles()
    Simulate 2 particles over the period of 50 with and without particle interactions.
    Definition: main.cpp:69
    +
    potential_resonance_narrow_sweep
    void potential_resonance_narrow_sweep()
    Simulate 100 particles over 500 using a time dependent potential.
    Definition: main.cpp:209
    +
    potential_resonance_wide_sweep
    void potential_resonance_wide_sweep()
    Simulate 100 particles over 500 using a time dependent potential.
    Definition: main.cpp:152
    +
    simulate_two_particles
    void simulate_two_particles()
    Simulate 2 particles over the period of 50 with and without particle interactions.
    Definition: main.cpp:70
    analytical_solution_particle_1
    vec3 analytical_solution_particle_1(double t)
    The analytical solution for particle p1.
    Definition: main.cpp:37
    -
    simulate_single_particle
    void simulate_single_particle()
    Simulate a single particle over the period of 50 .
    Definition: main.cpp:54
    -
    potential_resonance_narrow_sweep_interaction
    void potential_resonance_narrow_sweep_interaction()
    Simulate 100 particles over 500 using a time dependent potential.
    Definition: main.cpp:262
    -
    simulate_single_particle_with_different_steps
    void simulate_single_particle_with_different_steps()
    Simulate a single particle over 50 using different amount of steps and different methods.
    Definition: main.cpp:87
    +
    simulate_single_particle
    void simulate_single_particle()
    Simulate a single particle over the period of 50 .
    Definition: main.cpp:55
    +
    potential_resonance_narrow_sweep_interaction
    void potential_resonance_narrow_sweep_interaction()
    Simulate 100 particles over 500 using a time dependent potential.
    Definition: main.cpp:266
    +
    simulate_single_particle_with_different_steps
    void simulate_single_particle_with_different_steps()
    Simulate a single particle over 50 using different amount of steps and different methods.
    Definition: main.cpp:88
    p2
    Particle p2(vec3{25., 25., 0.}, vec3{0., 40., 5.})
    Particle 2.
    simulation
    Typedef for PenningTrap::simulation return value.
    Definition: typedefs.hpp:40
    vec3
    arma::vec::fixed< 3 > vec3
    Typedef for a fixed 3d arma vector.
    Definition: typedefs.hpp:23
    diff --git a/docs/navtreedata.js b/docs/navtreedata.js index 6156c4d..681af00 100644 --- a/docs/navtreedata.js +++ b/docs/navtreedata.js @@ -27,17 +27,23 @@ var NAVTREE = [ "Penning Trap Simulation", "index.html", [ [ "Requirements", "index.html#autotoc_md1", [ [ "Operating systems", "index.html#autotoc_md2", null ], - [ "Libraries", "index.html#autotoc_md3", null ] + [ "Tools", "index.html#autotoc_md3", null ], + [ "Libraries", "index.html#autotoc_md4", null ] ] ], - [ "Compiling", "index.html#autotoc_md4", null ], - [ "Running programs", "index.html#autotoc_md5", [ - [ "C++ binaries", "index.html#autotoc_md6", null ], - [ "Python scripts", "index.html#autotoc_md7", [ - [ "Install libraries", "index.html#autotoc_md8", null ], - [ "Running scripts", "index.html#autotoc_md9", null ] - ] ] + [ "Compiling", "index.html#autotoc_md5", null ], + [ "Running programs", "index.html#autotoc_md6", [ + [ "C++ binaries", "index.html#autotoc_md7", null ], + [ "Python scripts", "index.html#autotoc_md8", [ + [ "Install libraries", "index.html#autotoc_md9", null ], + [ "Running scripts", "index.html#autotoc_md10", null ] + ] ], + [ "Batch system", "index.html#autotoc_md11", null ] ] ], - [ "Credits", "index.html#autotoc_md10", null ], + [ "Performance", "index.html#autotoc_md12", [ + [ "CPU", "index.html#autotoc_md13", null ], + [ "Times", "index.html#autotoc_md14", null ] + ] ], + [ "Credits", "index.html#autotoc_md15", null ], [ "Bug List", "bug.html", null ], [ "Classes", "annotated.html", [ [ "Class List", "annotated.html", "annotated_dup" ], diff --git a/docs/navtreeindex0.js b/docs/navtreeindex0.js index 68d8951..1a1652f 100644 --- a/docs/navtreeindex0.js +++ b/docs/navtreeindex0.js @@ -1,134 +1,136 @@ var NAVTREEINDEX0 = { -"Particle_8cpp.html":[6,0,1,2], -"Particle_8cpp_source.html":[6,0,1,2], -"Particle_8hpp.html":[6,0,0,1], -"Particle_8hpp_source.html":[6,0,0,1], -"PenningTrap_8cpp.html":[6,0,1,3], -"PenningTrap_8cpp_source.html":[6,0,1,3], -"PenningTrap_8hpp.html":[6,0,0,2], -"PenningTrap_8hpp_source.html":[6,0,0,2], -"animate__100__particles_8py_source.html":[6,0,1,0,0], -"annotated.html":[5,0], -"bug.html":[4], -"classParticle.html":[5,0,0], -"classParticle.html#a1c59101411db43624828b766f87ad460":[5,0,0,4], -"classParticle.html#a3a10400add8dd22b8031330c2aafb6fe":[5,0,0,5], -"classParticle.html#a566dcc1de4bdc01251776948798ea8e1":[5,0,0,3], -"classParticle.html#aa797d319549dc2a0beb06cdbfd430232":[5,0,0,1], -"classParticle.html#aedcc7e1bc53b0e2b1a4a07c9a1b47563":[5,0,0,2], -"classParticle.html#af1d7535fb8311eaa77d2b7b345882ec4":[5,0,0,0], -"classPenningTrap.html":[5,0,1], -"classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f":[5,0,1,24], -"classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716":[5,0,1,20], -"classPenningTrap.html#a2c01108b52c8e2a003cf9170da9e7682":[5,0,1,15], -"classPenningTrap.html#a2f168622587709b9e3c49077f0b9a640":[5,0,1,22], -"classPenningTrap.html#a2fe1cefbae18fa5808155ee0d2df713c":[5,0,1,16], -"classPenningTrap.html#a361f2c4862c90b5e8e2a2f50c6a95655":[5,0,1,6], -"classPenningTrap.html#a36946152fd951b1f7c346c51ff900d8e":[5,0,1,5], -"classPenningTrap.html#a3c0a44e4e0a94366ff609e81fe463fa2":[5,0,1,17], -"classPenningTrap.html#a5846c8f75cdc543fd9cf0b2185a3ef22":[5,0,1,7], -"classPenningTrap.html#a5b6c6d4636f3a6e279ccde59d4a345e8":[5,0,1,0], -"classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2":[5,0,1,21], -"classPenningTrap.html#a6e9776ff5b149f01080800716455d7c8":[5,0,1,3], -"classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89":[5,0,1,27], -"classPenningTrap.html#a7a1d9f0528a12308de25bc30718da20a":[5,0,1,13], -"classPenningTrap.html#a7f210bb2768a5d79ced4b0df0df97598":[5,0,1,8], -"classPenningTrap.html#a826b7fa8e709d481eb1dee7d0c2cdc08":[5,0,1,10], -"classPenningTrap.html#a830be1b8cbf59664e060b6edbeaa302f":[5,0,1,1], -"classPenningTrap.html#a869f032f37d0569ed16f224b4c4356ae":[5,0,1,19], -"classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e":[5,0,1,26], -"classPenningTrap.html#a9a301b0540078c36697880ef204afdf3":[5,0,1,14], -"classPenningTrap.html#a9d1d8e90ca839b928aee1ad0cd4aff43":[5,0,1,12], -"classPenningTrap.html#aaee129f177657455348d0c8ae1441dea":[5,0,1,11], -"classPenningTrap.html#ab9ea97a406534bbe621a95215144875e":[5,0,1,4], -"classPenningTrap.html#ac529aa26c288f34eae184a67e6bac41f":[5,0,1,9], -"classPenningTrap.html#ad8bc4df7ab3eed53b16cfdff38e7760b":[5,0,1,18], -"classPenningTrap.html#addc96789dcfec07b75156e19fee82f4f":[5,0,1,2], -"classPenningTrap.html#ae915f6ad0eef1fb46530e836b6e071e5":[5,0,1,25], -"classPenningTrap.html#ae9b5afdaa5cd366e94bd294452a1eed4":[5,0,1,23], -"classPenningTrapTest.html":[5,0,2], -"classPenningTrapTest.html#a5f4f0b150e54ce463bb29f76d49883f9":[5,0,2,2], -"classPenningTrapTest.html#a68449d508e66205bc8b27fa5f60db508":[5,0,2,4], -"classPenningTrapTest.html#a6a303be62039ca2ecccd8252744d4dc8":[5,0,2,1], -"classPenningTrapTest.html#ad668d7d875bdc1909a42426bf9dead9e":[5,0,2,0], -"classPenningTrapTest.html#ae6d0c8e0d80338fb7c7edefc97331046":[5,0,2,3], -"classes.html":[5,1], -"constants_8hpp.html":[6,0,0,0], -"constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5":[6,0,0,0,3], -"constants_8hpp.html#a2ff491cc7958ffd5e749c518a4a60ec8":[6,0,0,0,1], -"constants_8hpp.html#a4e451456ad7e9276ed0afa42826e7ccb":[6,0,0,0,2], -"constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb":[6,0,0,0,4], -"constants_8hpp.html#af7602a3a314957137ad1cd719aa23789":[6,0,0,0,0], -"constants_8hpp_source.html":[6,0,0,0], -"dir_634e799a3947388232110823971192a8.html":[6,0,1,0], -"dir_68267d1309a1af8e8297ef4c3efbcdba.html":[6,0,1], -"dir_d44c64559bbebec7f509842c48db8b23.html":[6,0,0], -"files.html":[6,0], -"functions.html":[5,2,0], -"functions_func.html":[5,2,1], -"functions_rela.html":[5,2,3], -"functions_vars.html":[5,2,2], -"globals.html":[6,1,0], -"globals_defs.html":[6,1,4], -"globals_func.html":[6,1,1], -"globals_type.html":[6,1,3], -"globals_vars.html":[6,1,2], +"Particle_8cpp.html":[7,0,1,2], +"Particle_8cpp_source.html":[7,0,1,2], +"Particle_8hpp.html":[7,0,0,1], +"Particle_8hpp_source.html":[7,0,0,1], +"PenningTrap_8cpp.html":[7,0,1,3], +"PenningTrap_8cpp_source.html":[7,0,1,3], +"PenningTrap_8hpp.html":[7,0,0,2], +"PenningTrap_8hpp_source.html":[7,0,0,2], +"annotated.html":[6,0], +"bug.html":[5], +"classParticle.html":[6,0,0], +"classParticle.html#a1c59101411db43624828b766f87ad460":[6,0,0,4], +"classParticle.html#a3a10400add8dd22b8031330c2aafb6fe":[6,0,0,5], +"classParticle.html#a566dcc1de4bdc01251776948798ea8e1":[6,0,0,3], +"classParticle.html#aa797d319549dc2a0beb06cdbfd430232":[6,0,0,1], +"classParticle.html#aedcc7e1bc53b0e2b1a4a07c9a1b47563":[6,0,0,2], +"classParticle.html#af1d7535fb8311eaa77d2b7b345882ec4":[6,0,0,0], +"classPenningTrap.html":[6,0,1], +"classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f":[6,0,1,25], +"classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716":[6,0,1,21], +"classPenningTrap.html#a2c01108b52c8e2a003cf9170da9e7682":[6,0,1,15], +"classPenningTrap.html#a2f168622587709b9e3c49077f0b9a640":[6,0,1,23], +"classPenningTrap.html#a2fe1cefbae18fa5808155ee0d2df713c":[6,0,1,17], +"classPenningTrap.html#a361f2c4862c90b5e8e2a2f50c6a95655":[6,0,1,6], +"classPenningTrap.html#a36946152fd951b1f7c346c51ff900d8e":[6,0,1,5], +"classPenningTrap.html#a3c0a44e4e0a94366ff609e81fe463fa2":[6,0,1,18], +"classPenningTrap.html#a5846c8f75cdc543fd9cf0b2185a3ef22":[6,0,1,7], +"classPenningTrap.html#a5b6c6d4636f3a6e279ccde59d4a345e8":[6,0,1,0], +"classPenningTrap.html#a6069f82d8dbc7cadaebd228dbcd95018":[6,0,1,16], +"classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2":[6,0,1,22], +"classPenningTrap.html#a6e9776ff5b149f01080800716455d7c8":[6,0,1,3], +"classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89":[6,0,1,28], +"classPenningTrap.html#a7a1d9f0528a12308de25bc30718da20a":[6,0,1,13], +"classPenningTrap.html#a7f210bb2768a5d79ced4b0df0df97598":[6,0,1,8], +"classPenningTrap.html#a826b7fa8e709d481eb1dee7d0c2cdc08":[6,0,1,10], +"classPenningTrap.html#a830be1b8cbf59664e060b6edbeaa302f":[6,0,1,1], +"classPenningTrap.html#a869f032f37d0569ed16f224b4c4356ae":[6,0,1,20], +"classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e":[6,0,1,27], +"classPenningTrap.html#a9a301b0540078c36697880ef204afdf3":[6,0,1,14], +"classPenningTrap.html#a9d1d8e90ca839b928aee1ad0cd4aff43":[6,0,1,12], +"classPenningTrap.html#aaee129f177657455348d0c8ae1441dea":[6,0,1,11], +"classPenningTrap.html#ab9ea97a406534bbe621a95215144875e":[6,0,1,4], +"classPenningTrap.html#ac529aa26c288f34eae184a67e6bac41f":[6,0,1,9], +"classPenningTrap.html#ad8bc4df7ab3eed53b16cfdff38e7760b":[6,0,1,19], +"classPenningTrap.html#addc96789dcfec07b75156e19fee82f4f":[6,0,1,2], +"classPenningTrap.html#ae915f6ad0eef1fb46530e836b6e071e5":[6,0,1,26], +"classPenningTrap.html#ae9b5afdaa5cd366e94bd294452a1eed4":[6,0,1,24], +"classPenningTrapTest.html":[6,0,2], +"classPenningTrapTest.html#a5f4f0b150e54ce463bb29f76d49883f9":[6,0,2,2], +"classPenningTrapTest.html#a68449d508e66205bc8b27fa5f60db508":[6,0,2,4], +"classPenningTrapTest.html#a6a303be62039ca2ecccd8252744d4dc8":[6,0,2,1], +"classPenningTrapTest.html#ad668d7d875bdc1909a42426bf9dead9e":[6,0,2,0], +"classPenningTrapTest.html#ae6d0c8e0d80338fb7c7edefc97331046":[6,0,2,3], +"classes.html":[6,1], +"constants_8hpp.html":[7,0,0,0], +"constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5":[7,0,0,0,3], +"constants_8hpp.html#a2ff491cc7958ffd5e749c518a4a60ec8":[7,0,0,0,1], +"constants_8hpp.html#a4e451456ad7e9276ed0afa42826e7ccb":[7,0,0,0,2], +"constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb":[7,0,0,0,4], +"constants_8hpp.html#af7602a3a314957137ad1cd719aa23789":[7,0,0,0,0], +"constants_8hpp_source.html":[7,0,0,0], +"dir_68267d1309a1af8e8297ef4c3efbcdba.html":[7,0,1], +"dir_d44c64559bbebec7f509842c48db8b23.html":[7,0,0], +"files.html":[7,0], +"frequency__narrow__sweeps__long_8cpp.html":[7,0,1,0], +"frequency__narrow__sweeps__long_8cpp.html#a33d9b1c76c3c80902f89a58b1a6d96ea":[7,0,1,0,0], +"frequency__narrow__sweeps__long_8cpp.html#ac1816f70ec612edc27848ef7f0875fdb":[7,0,1,0,1], +"frequency__narrow__sweeps__long_8cpp_source.html":[7,0,1,0], +"functions.html":[6,2,0], +"functions_func.html":[6,2,1], +"functions_rela.html":[6,2,3], +"functions_vars.html":[6,2,2], +"globals.html":[7,1,0], +"globals_defs.html":[7,1,4], +"globals_func.html":[7,1,1], +"globals_type.html":[7,1,3], +"globals_vars.html":[7,1,2], "index.html":[], "index.html#autotoc_md1":[0], -"index.html#autotoc_md10":[3], +"index.html#autotoc_md10":[2,1,1], +"index.html#autotoc_md11":[2,2], +"index.html#autotoc_md12":[3], +"index.html#autotoc_md13":[3,0], +"index.html#autotoc_md14":[3,1], +"index.html#autotoc_md15":[4], "index.html#autotoc_md2":[0,0], "index.html#autotoc_md3":[0,1], -"index.html#autotoc_md4":[1], -"index.html#autotoc_md5":[2], -"index.html#autotoc_md6":[2,0], -"index.html#autotoc_md7":[2,1], -"index.html#autotoc_md8":[2,1,0], -"index.html#autotoc_md9":[2,1,1], -"main_8cpp.html":[6,0,1,1], -"main_8cpp.html#a213713d6ecc02a32b588ffd179dc7513":[6,0,1,1,4], -"main_8cpp.html#a2efa69bb9d93049429ce4637075f1d30":[6,0,1,1,8], -"main_8cpp.html#a33d9b1c76c3c80902f89a58b1a6d96ea":[6,0,1,1,1], -"main_8cpp.html#a6b38b477c18e2f4268779751a88edab1":[6,0,1,1,3], -"main_8cpp.html#a783789519f97c6430081171cacb0ffb1":[6,0,1,1,7], -"main_8cpp.html#a8d92fb2ad085065fbd14718647551657":[6,0,1,1,0], -"main_8cpp.html#a8fdbe2d5a872e50ef5ec1263243589d6":[6,0,1,1,5], -"main_8cpp.html#ac1816f70ec612edc27848ef7f0875fdb":[6,0,1,1,2], -"main_8cpp.html#ac67e0d59227856c4d42e7d01c75e0ad2":[6,0,1,1,6], -"main_8cpp.html#ac70b61df65f4336f57ea9b4c35250df7":[6,0,1,1,9], -"main_8cpp_source.html":[6,0,1,1], +"index.html#autotoc_md4":[0,2], +"index.html#autotoc_md5":[1], +"index.html#autotoc_md6":[2], +"index.html#autotoc_md7":[2,0], +"index.html#autotoc_md8":[2,1], +"index.html#autotoc_md9":[2,1,0], +"main_8cpp.html":[7,0,1,1], +"main_8cpp.html#a213713d6ecc02a32b588ffd179dc7513":[7,0,1,1,4], +"main_8cpp.html#a2efa69bb9d93049429ce4637075f1d30":[7,0,1,1,8], +"main_8cpp.html#a33d9b1c76c3c80902f89a58b1a6d96ea":[7,0,1,1,1], +"main_8cpp.html#a6b38b477c18e2f4268779751a88edab1":[7,0,1,1,3], +"main_8cpp.html#a783789519f97c6430081171cacb0ffb1":[7,0,1,1,7], +"main_8cpp.html#a8d92fb2ad085065fbd14718647551657":[7,0,1,1,0], +"main_8cpp.html#a8fdbe2d5a872e50ef5ec1263243589d6":[7,0,1,1,5], +"main_8cpp.html#ac1816f70ec612edc27848ef7f0875fdb":[7,0,1,1,2], +"main_8cpp.html#ac67e0d59227856c4d42e7d01c75e0ad2":[7,0,1,1,6], +"main_8cpp.html#ac70b61df65f4336f57ea9b4c35250df7":[7,0,1,1,9], +"main_8cpp_source.html":[7,0,1,1], "pages.html":[], -"plot__2__particles_8py_source.html":[6,0,1,0,1], -"plot__3d_8py_source.html":[6,0,1,0,2], -"plot__particles__left_8py_source.html":[6,0,1,0,3], -"plot__phase__space_8py_source.html":[6,0,1,0,4], -"plot__relative__error_8py_source.html":[6,0,1,0,5], -"plot__single__particle_8py_source.html":[6,0,1,0,6], -"structsimulation.html":[5,0,3], -"test__suite_8cpp.html":[6,0,1,4], -"test__suite_8cpp_source.html":[6,0,1,4], -"typedefs_8hpp.html":[6,0,0,3], -"typedefs_8hpp.html#a33418f31f28663b8414c8f7182998c22":[6,0,0,3,3], -"typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea":[6,0,0,3,5], -"typedefs_8hpp.html#a46482a2697556c00556c9d73f461784f":[6,0,0,3,2], -"typedefs_8hpp.html#a784799c37b5e4fb8bf4f6368e004dec6":[6,0,0,3,4], -"typedefs_8hpp.html#aec69d34220fff45de238b9e01f2686af":[6,0,0,3,1], -"typedefs_8hpp_source.html":[6,0,0,3], -"utils_8cpp.html":[6,0,1,5], -"utils_8cpp.html#a58565270b643b24e3132f38c653e0199":[6,0,1,5,3], -"utils_8cpp.html#a6be6f938bcbb235ebb6a2ed9d08411b2":[6,0,1,5,0], -"utils_8cpp.html#acd2a9c7a7d5a7fe9163be8c4cc110746":[6,0,1,5,4], -"utils_8cpp.html#acf13f4e492199cb7231bfa646dbd08de":[6,0,1,5,2], -"utils_8cpp.html#aff5e07c3c1d321709b0cc38e999f427b":[6,0,1,5,1], -"utils_8cpp_source.html":[6,0,1,5], -"utils_8hpp.html":[6,0,0,4], -"utils_8hpp.html#a2cc3a2cdb635bac3c8b02e89d4d6af38":[6,0,0,4,4], -"utils_8hpp.html#a60dca3177fb9cb5256609adc7af55168":[6,0,0,4,0], -"utils_8hpp.html#a6fdd7217b750aff5b6295ece7cbdeffa":[6,0,0,4,5], -"utils_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9":[6,0,0,4,1], -"utils_8hpp.html#ab3e0cf669bddc59bd53998490ffb68b9":[6,0,0,4,3], -"utils_8hpp.html#ad54b96a1074f9df4dc892a41d115b72d":[6,0,0,4,6], -"utils_8hpp.html#adfb618b2fdff47ef30a4a2b62c04f384":[6,0,0,4,7], -"utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b":[6,0,0,4,2], -"utils_8hpp_source.html":[6,0,0,4] +"structsimulation.html":[6,0,3], +"test__suite_8cpp.html":[7,0,1,4], +"test__suite_8cpp_source.html":[7,0,1,4], +"typedefs_8hpp.html":[7,0,0,3], +"typedefs_8hpp.html#a33418f31f28663b8414c8f7182998c22":[7,0,0,3,3], +"typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea":[7,0,0,3,5], +"typedefs_8hpp.html#a46482a2697556c00556c9d73f461784f":[7,0,0,3,2], +"typedefs_8hpp.html#a784799c37b5e4fb8bf4f6368e004dec6":[7,0,0,3,4], +"typedefs_8hpp.html#aec69d34220fff45de238b9e01f2686af":[7,0,0,3,1], +"typedefs_8hpp_source.html":[7,0,0,3], +"utils_8cpp.html":[7,0,1,5], +"utils_8cpp.html#a58565270b643b24e3132f38c653e0199":[7,0,1,5,3], +"utils_8cpp.html#a6be6f938bcbb235ebb6a2ed9d08411b2":[7,0,1,5,0], +"utils_8cpp.html#acd2a9c7a7d5a7fe9163be8c4cc110746":[7,0,1,5,4], +"utils_8cpp.html#acf13f4e492199cb7231bfa646dbd08de":[7,0,1,5,2], +"utils_8cpp.html#aff5e07c3c1d321709b0cc38e999f427b":[7,0,1,5,1], +"utils_8cpp_source.html":[7,0,1,5], +"utils_8hpp.html":[7,0,0,4], +"utils_8hpp.html#a2cc3a2cdb635bac3c8b02e89d4d6af38":[7,0,0,4,4], +"utils_8hpp.html#a60dca3177fb9cb5256609adc7af55168":[7,0,0,4,0], +"utils_8hpp.html#a6fdd7217b750aff5b6295ece7cbdeffa":[7,0,0,4,5], +"utils_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9":[7,0,0,4,1], +"utils_8hpp.html#ab3e0cf669bddc59bd53998490ffb68b9":[7,0,0,4,3], +"utils_8hpp.html#ad54b96a1074f9df4dc892a41d115b72d":[7,0,0,4,6], +"utils_8hpp.html#adfb618b2fdff47ef30a4a2b62c04f384":[7,0,0,4,7], +"utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b":[7,0,0,4,2], +"utils_8hpp_source.html":[7,0,0,4] }; diff --git a/docs/search/all_6.js b/docs/search/all_6.js index e6919eb..074618b 100644 --- a/docs/search/all_6.js +++ b/docs/search/all_6.js @@ -1,5 +1,6 @@ var searchData= [ ['force_5fon_5fparticle_0',['force_on_particle',['../classPenningTrap.html#a7f210bb2768a5d79ced4b0df0df97598',1,'PenningTrap']]], - ['fraction_5fof_5fparticles_5fleft_1',['fraction_of_particles_left',['../classPenningTrap.html#ac529aa26c288f34eae184a67e6bac41f',1,'PenningTrap']]] + ['fraction_5fof_5fparticles_5fleft_1',['fraction_of_particles_left',['../classPenningTrap.html#ac529aa26c288f34eae184a67e6bac41f',1,'PenningTrap']]], + ['frequency_5fnarrow_5fsweeps_5flong_2ecpp_2',['frequency_narrow_sweeps_long.cpp',['../frequency__narrow__sweeps__long_8cpp.html',1,'']]] ]; diff --git a/docs/search/all_9.js b/docs/search/all_9.js index 8d94e1e..d2c560d 100644 --- a/docs/search/all_9.js +++ b/docs/search/all_9.js @@ -7,12 +7,12 @@ var searchData= ['particle_2ehpp_4',['Particle.hpp',['../Particle_8hpp.html',1,'']]], ['particles_5',['particles',['../classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f',1,'PenningTrap']]], ['penning_20trap_20simulation_6',['Penning trap simulation',['../index.html',1,'']]], - ['penningtrap_7',['PenningTrap',['../classPenningTrap.html#a5b6c6d4636f3a6e279ccde59d4a345e8',1,'PenningTrap::PenningTrap(double B_0=T, double V_0=(25. *V)/1000., double d=500., double t=0.)'],['../classPenningTrap.html#addc96789dcfec07b75156e19fee82f4f',1,'PenningTrap::PenningTrap(std::vector< Particle > particles, double B_0=T, double V_0=(25. *V)/1000., double d=500., double t=0.)'],['../classPenningTrap.html#a830be1b8cbf59664e060b6edbeaa302f',1,'PenningTrap::PenningTrap(uint i, double B_0=T, double V_0=(25. *V)/1000., double d=500., double t=0.)'],['../classParticle.html#aa797d319549dc2a0beb06cdbfd430232',1,'Particle::PenningTrap()'],['../classPenningTrap.html',1,'PenningTrap']]], + ['penningtrap_7',['PenningTrap',['../classPenningTrap.html#a830be1b8cbf59664e060b6edbeaa302f',1,'PenningTrap::PenningTrap(uint i, double B_0=T, double V_0=(25. *V)/1000., double d=500., double t=0.)'],['../classPenningTrap.html#addc96789dcfec07b75156e19fee82f4f',1,'PenningTrap::PenningTrap(std::vector< Particle > particles, double B_0=T, double V_0=(25. *V)/1000., double d=500., double t=0.)'],['../classPenningTrap.html#a5b6c6d4636f3a6e279ccde59d4a345e8',1,'PenningTrap::PenningTrap(double B_0=T, double V_0=(25. *V)/1000., double d=500., double t=0.)'],['../classParticle.html#aa797d319549dc2a0beb06cdbfd430232',1,'Particle::PenningTrap()'],['../classPenningTrap.html',1,'PenningTrap']]], ['penningtrap_2ecpp_8',['PenningTrap.cpp',['../PenningTrap_8cpp.html',1,'']]], ['penningtrap_2ehpp_9',['PenningTrap.hpp',['../PenningTrap_8hpp.html',1,'']]], ['penningtraptest_10',['PenningTrapTest',['../classPenningTrap.html#a869f032f37d0569ed16f224b4c4356ae',1,'PenningTrap::PenningTrapTest()'],['../classPenningTrapTest.html',1,'PenningTrapTest']]], ['perturbation_11',['perturbation',['../classPenningTrap.html#ae915f6ad0eef1fb46530e836b6e071e5',1,'PenningTrap']]], - ['potential_5fresonance_5fnarrow_5fsweep_12',['potential_resonance_narrow_sweep',['../main_8cpp.html#a33d9b1c76c3c80902f89a58b1a6d96ea',1,'main.cpp']]], - ['potential_5fresonance_5fnarrow_5fsweep_5finteraction_13',['potential_resonance_narrow_sweep_interaction',['../main_8cpp.html#ac1816f70ec612edc27848ef7f0875fdb',1,'main.cpp']]], + ['potential_5fresonance_5fnarrow_5fsweep_12',['potential_resonance_narrow_sweep',['../frequency__narrow__sweeps__long_8cpp.html#a33d9b1c76c3c80902f89a58b1a6d96ea',1,'potential_resonance_narrow_sweep(): frequency_narrow_sweeps_long.cpp'],['../main_8cpp.html#a33d9b1c76c3c80902f89a58b1a6d96ea',1,'potential_resonance_narrow_sweep(): main.cpp']]], + ['potential_5fresonance_5fnarrow_5fsweep_5finteraction_13',['potential_resonance_narrow_sweep_interaction',['../frequency__narrow__sweeps__long_8cpp.html#ac1816f70ec612edc27848ef7f0875fdb',1,'potential_resonance_narrow_sweep_interaction(): frequency_narrow_sweeps_long.cpp'],['../main_8cpp.html#ac1816f70ec612edc27848ef7f0875fdb',1,'potential_resonance_narrow_sweep_interaction(): main.cpp']]], ['potential_5fresonance_5fwide_5fsweep_14',['potential_resonance_wide_sweep',['../main_8cpp.html#a6b38b477c18e2f4268779751a88edab1',1,'main.cpp']]] ]; diff --git a/docs/search/all_d.js b/docs/search/all_d.js index 4af72aa..80bb0f1 100644 --- a/docs/search/all_d.js +++ b/docs/search/all_d.js @@ -10,6 +10,7 @@ var searchData= ['test_5ftotal_5fforce_5fparticles_7',['test_total_force_particles',['../classPenningTrapTest.html#a68449d508e66205bc8b27fa5f60db508',1,'PenningTrapTest']]], ['total_5fforce_8',['total_force',['../classPenningTrap.html#a9a301b0540078c36697880ef204afdf3',1,'PenningTrap']]], ['total_5fforce_5fexternal_9',['total_force_external',['../classPenningTrap.html#a2c01108b52c8e2a003cf9170da9e7682',1,'PenningTrap']]], - ['total_5fforce_5fparticles_10',['total_force_particles',['../classPenningTrap.html#a2fe1cefbae18fa5808155ee0d2df713c',1,'PenningTrap']]], - ['typedefs_2ehpp_11',['typedefs.hpp',['../typedefs_8hpp.html',1,'']]] + ['total_5fforce_5fno_5finteraction_10',['total_force_no_interaction',['../classPenningTrap.html#a6069f82d8dbc7cadaebd228dbcd95018',1,'PenningTrap']]], + ['total_5fforce_5fparticles_11',['total_force_particles',['../classPenningTrap.html#a2fe1cefbae18fa5808155ee0d2df713c',1,'PenningTrap']]], + ['typedefs_2ehpp_12',['typedefs.hpp',['../typedefs_8hpp.html',1,'']]] ]; diff --git a/docs/search/files_1.js b/docs/search/files_1.js index 695b4fd..9000051 100644 --- a/docs/search/files_1.js +++ b/docs/search/files_1.js @@ -1,4 +1,4 @@ var searchData= [ - ['main_2ecpp_0',['main.cpp',['../main_8cpp.html',1,'']]] + ['frequency_5fnarrow_5fsweeps_5flong_2ecpp_0',['frequency_narrow_sweeps_long.cpp',['../frequency__narrow__sweeps__long_8cpp.html',1,'']]] ]; diff --git a/docs/search/files_2.js b/docs/search/files_2.js index 8fae0fa..695b4fd 100644 --- a/docs/search/files_2.js +++ b/docs/search/files_2.js @@ -1,7 +1,4 @@ var searchData= [ - ['particle_2ecpp_0',['Particle.cpp',['../Particle_8cpp.html',1,'']]], - ['particle_2ehpp_1',['Particle.hpp',['../Particle_8hpp.html',1,'']]], - ['penningtrap_2ecpp_2',['PenningTrap.cpp',['../PenningTrap_8cpp.html',1,'']]], - ['penningtrap_2ehpp_3',['PenningTrap.hpp',['../PenningTrap_8hpp.html',1,'']]] + ['main_2ecpp_0',['main.cpp',['../main_8cpp.html',1,'']]] ]; diff --git a/docs/search/files_3.js b/docs/search/files_3.js index 5e3fea9..8fae0fa 100644 --- a/docs/search/files_3.js +++ b/docs/search/files_3.js @@ -1,5 +1,7 @@ var searchData= [ - ['test_5fsuite_2ecpp_0',['test_suite.cpp',['../test__suite_8cpp.html',1,'']]], - ['typedefs_2ehpp_1',['typedefs.hpp',['../typedefs_8hpp.html',1,'']]] + ['particle_2ecpp_0',['Particle.cpp',['../Particle_8cpp.html',1,'']]], + ['particle_2ehpp_1',['Particle.hpp',['../Particle_8hpp.html',1,'']]], + ['penningtrap_2ecpp_2',['PenningTrap.cpp',['../PenningTrap_8cpp.html',1,'']]], + ['penningtrap_2ehpp_3',['PenningTrap.hpp',['../PenningTrap_8hpp.html',1,'']]] ]; diff --git a/docs/search/files_4.js b/docs/search/files_4.js index cd921db..5e3fea9 100644 --- a/docs/search/files_4.js +++ b/docs/search/files_4.js @@ -1,5 +1,5 @@ var searchData= [ - ['utils_2ecpp_0',['utils.cpp',['../utils_8cpp.html',1,'']]], - ['utils_2ehpp_1',['utils.hpp',['../utils_8hpp.html',1,'']]] + ['test_5fsuite_2ecpp_0',['test_suite.cpp',['../test__suite_8cpp.html',1,'']]], + ['typedefs_2ehpp_1',['typedefs.hpp',['../typedefs_8hpp.html',1,'']]] ]; diff --git a/docs/search/files_5.js b/docs/search/files_5.js new file mode 100644 index 0000000..cd921db --- /dev/null +++ b/docs/search/files_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['utils_2ecpp_0',['utils.cpp',['../utils_8cpp.html',1,'']]], + ['utils_2ehpp_1',['utils.hpp',['../utils_8hpp.html',1,'']]] +]; diff --git a/docs/search/functions_5.js b/docs/search/functions_5.js index f49bd4c..ae92b61 100644 --- a/docs/search/functions_5.js +++ b/docs/search/functions_5.js @@ -2,7 +2,7 @@ var searchData= [ ['particle_0',['Particle',['../classParticle.html#af1d7535fb8311eaa77d2b7b345882ec4',1,'Particle']]], ['penningtrap_1',['PenningTrap',['../classPenningTrap.html#a5b6c6d4636f3a6e279ccde59d4a345e8',1,'PenningTrap::PenningTrap(double B_0=T, double V_0=(25. *V)/1000., double d=500., double t=0.)'],['../classPenningTrap.html#a830be1b8cbf59664e060b6edbeaa302f',1,'PenningTrap::PenningTrap(uint i, double B_0=T, double V_0=(25. *V)/1000., double d=500., double t=0.)'],['../classPenningTrap.html#addc96789dcfec07b75156e19fee82f4f',1,'PenningTrap::PenningTrap(std::vector< Particle > particles, double B_0=T, double V_0=(25. *V)/1000., double d=500., double t=0.)']]], - ['potential_5fresonance_5fnarrow_5fsweep_2',['potential_resonance_narrow_sweep',['../main_8cpp.html#a33d9b1c76c3c80902f89a58b1a6d96ea',1,'main.cpp']]], - ['potential_5fresonance_5fnarrow_5fsweep_5finteraction_3',['potential_resonance_narrow_sweep_interaction',['../main_8cpp.html#ac1816f70ec612edc27848ef7f0875fdb',1,'main.cpp']]], + ['potential_5fresonance_5fnarrow_5fsweep_2',['potential_resonance_narrow_sweep',['../frequency__narrow__sweeps__long_8cpp.html#a33d9b1c76c3c80902f89a58b1a6d96ea',1,'potential_resonance_narrow_sweep(): frequency_narrow_sweeps_long.cpp'],['../main_8cpp.html#a33d9b1c76c3c80902f89a58b1a6d96ea',1,'potential_resonance_narrow_sweep(): main.cpp']]], + ['potential_5fresonance_5fnarrow_5fsweep_5finteraction_3',['potential_resonance_narrow_sweep_interaction',['../frequency__narrow__sweeps__long_8cpp.html#ac1816f70ec612edc27848ef7f0875fdb',1,'potential_resonance_narrow_sweep_interaction(): frequency_narrow_sweeps_long.cpp'],['../main_8cpp.html#ac1816f70ec612edc27848ef7f0875fdb',1,'potential_resonance_narrow_sweep_interaction(): main.cpp']]], ['potential_5fresonance_5fwide_5fsweep_4',['potential_resonance_wide_sweep',['../main_8cpp.html#a6b38b477c18e2f4268779751a88edab1',1,'main.cpp']]] ]; diff --git a/docs/search/functions_8.js b/docs/search/functions_8.js index 6ad3539..14193ad 100644 --- a/docs/search/functions_8.js +++ b/docs/search/functions_8.js @@ -7,5 +7,6 @@ var searchData= ['test_5ftotal_5fforce_5fparticles_4',['test_total_force_particles',['../classPenningTrapTest.html#a68449d508e66205bc8b27fa5f60db508',1,'PenningTrapTest']]], ['total_5fforce_5',['total_force',['../classPenningTrap.html#a9a301b0540078c36697880ef204afdf3',1,'PenningTrap']]], ['total_5fforce_5fexternal_6',['total_force_external',['../classPenningTrap.html#a2c01108b52c8e2a003cf9170da9e7682',1,'PenningTrap']]], - ['total_5fforce_5fparticles_7',['total_force_particles',['../classPenningTrap.html#a2fe1cefbae18fa5808155ee0d2df713c',1,'PenningTrap']]] + ['total_5fforce_5fno_5finteraction_7',['total_force_no_interaction',['../classPenningTrap.html#a6069f82d8dbc7cadaebd228dbcd95018',1,'PenningTrap']]], + ['total_5fforce_5fparticles_8',['total_force_particles',['../classPenningTrap.html#a2fe1cefbae18fa5808155ee0d2df713c',1,'PenningTrap']]] ]; diff --git a/docs/search/searchdata.js b/docs/search/searchdata.js index 8aa7be2..dafc861 100644 --- a/docs/search/searchdata.js +++ b/docs/search/searchdata.js @@ -2,7 +2,7 @@ var indexSectionsWithContent = { 0: "_abcdefkmpqrstuvw", 1: "ps", - 2: "cmptu", + 2: "cfmptu", 3: "acefmprstvw", 4: "bdkmpqrtv", 5: "sv", diff --git a/docs/test__suite_8cpp.html b/docs/test__suite_8cpp.html index 6211476..bae411e 100644 --- a/docs/test__suite_8cpp.html +++ b/docs/test__suite_8cpp.html @@ -133,7 +133,7 @@ Functions
    Janita Ovidie Sandtrøen Willumsen (janitaws)
    Version
    1.0
    -
    Bug:
    No known bugs
    +
    Bug:
    No known bugs

    Definition in file test_suite.cpp.

    Function Documentation

    diff --git a/docs/test__suite_8cpp_source.html b/docs/test__suite_8cpp_source.html index 0e0fee5..9247504 100644 --- a/docs/test__suite_8cpp_source.html +++ b/docs/test__suite_8cpp_source.html @@ -239,12 +239,12 @@ $(document).ready(function(){initNavTree('test__suite_8cpp_source.html',''); ini
    PenningTrapTest::test_external_B_field
    void test_external_B_field()
    Test that the external B field gives correct values.
    Definition: test_suite.cpp:66
    PenningTrapTest::test_total_force_external
    void test_total_force_external()
    Test that the total external force returns expected results.
    Definition: test_suite.cpp:107
    PenningTrap
    A class that simulates a Penning trap.
    Definition: PenningTrap.hpp:32
    -
    PenningTrap::total_force_external
    vec3 total_force_external(uint i)
    Calculate the total external force on a particle.
    Definition: PenningTrap.cpp:82
    -
    PenningTrap::total_force_particles
    vec3 total_force_particles(uint i)
    Calculate the total force on a particle p_i from other particles.
    Definition: PenningTrap.cpp:95
    -
    PenningTrap::external_B_field
    vec3 external_B_field(vec3 r)
    Calculate B at point r.
    Definition: PenningTrap.cpp:66
    -
    PenningTrap::external_E_field
    vec3 external_E_field(vec3 r)
    Calculate E at point r.
    Definition: PenningTrap.cpp:58
    -
    PenningTrap::add_particle
    void add_particle(Particle particle)
    Add a particle to the system.
    Definition: PenningTrap.cpp:158
    -
    PenningTrap::force_on_particle
    vec3 force_on_particle(uint i, uint j)
    Calculate the force between 2 particles.
    Definition: PenningTrap.cpp:71
    +
    PenningTrap::total_force_external
    vec3 total_force_external(uint i)
    Calculate the total external force on a particle.
    Definition: PenningTrap.cpp:83
    +
    PenningTrap::total_force_particles
    vec3 total_force_particles(uint i)
    Calculate the total force on a particle p_i from other particles.
    Definition: PenningTrap.cpp:92
    +
    PenningTrap::external_B_field
    vec3 external_B_field(vec3 r)
    Calculate B at point r.
    Definition: PenningTrap.cpp:67
    +
    PenningTrap::external_E_field
    vec3 external_E_field(vec3 r)
    Calculate E at point r.
    Definition: PenningTrap.cpp:59
    +
    PenningTrap::add_particle
    void add_particle(Particle particle)
    Add a particle to the system.
    Definition: PenningTrap.cpp:166
    +
    PenningTrap::force_on_particle
    vec3 force_on_particle(uint i, uint j)
    Calculate the force between 2 particles.
    Definition: PenningTrap.cpp:72
    constants.hpp
    Library of constants.
    T
    #define T
    1 Tesla. unit:
    Definition: constants.hpp:21
    vec3
    arma::vec::fixed< 3 > vec3
    Typedef for a fixed 3d arma vector.
    Definition: typedefs.hpp:23
    diff --git a/docs/utils_8cpp.html b/docs/utils_8cpp.html index d94bebf..89ca470 100644 --- a/docs/utils_8cpp.html +++ b/docs/utils_8cpp.html @@ -134,7 +134,7 @@ Functions
    Janita Ovidie Sandtrøen Willumsen (janitaws)
    Version
    1.0
    -
    Bug:
    No known bugs
    +
    Bug:
    No known bugs

    Definition in file utils.cpp.

    Function Documentation