diff --git a/docs/Particle_8cpp.html b/docs/Particle_8cpp.html
index b3fd0e9..e5f553c 100644
--- a/docs/Particle_8cpp.html
+++ b/docs/Particle_8cpp.html
@@ -112,7 +112,7 @@ $(document).ready(function(){initNavTree('Particle_8cpp.html',''); initResizable
Magnetic field strength.
-Characteristic dimension.
-The particles in the Penning trap.
-Current time.
-
- __METHOD_NAME__ : utils.hpp
- ASSERT : utils.hpp
+- CA_CHARGE : constants.hpp
+- CA_MASS : constants.hpp
- DEBUG : utils.hpp
- K_E : constants.hpp
- T : constants.hpp
diff --git a/docs/globals_func.html b/docs/globals_func.html
index f5caf56..376c50c 100644
--- a/docs/globals_func.html
+++ b/docs/globals_func.html
@@ -99,13 +99,15 @@ $(document).ready(function(){initNavTree('globals_func.html',''); initResizable(
-- analytical_solution_particle_1() : main.cpp
+- analytical_solution_particle_1() : main.cpp
- 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_wide_sweep() : main.cpp
- scientific_format() : utils.hpp, utils.cpp
- simulate_100_particles() : main.cpp
-- simulate_100_particles_with_time_potential() : main.cpp
- simulate_single_particle() : main.cpp
- simulate_single_particle_with_different_steps() : main.cpp
- simulate_two_particles() : main.cpp
diff --git a/docs/globals_type.html b/docs/globals_type.html
index 775a687..9d20f34 100644
--- a/docs/globals_type.html
+++ b/docs/globals_type.html
@@ -100,10 +100,10 @@ $(document).ready(function(){initNavTree('globals_type.html',''); initResizable(
diff --git a/docs/globals_vars.html b/docs/globals_vars.html
index 2c80e49..4cbef9c 100644
--- a/docs/globals_vars.html
+++ b/docs/globals_vars.html
@@ -99,8 +99,8 @@ $(document).ready(function(){initNavTree('globals_vars.html',''); initResizable(
diff --git a/docs/main_8cpp.html b/docs/main_8cpp.html
index c7ad43a..5edc69f 100644
--- a/docs/main_8cpp.html
+++ b/docs/main_8cpp.html
@@ -115,6 +115,7 @@ $(document).ready(function(){initNavTree('main_8cpp.html',''); initResizable();
#include <string>
#include <vector>
#include "PenningTrap.hpp"
+#include "constants.hpp"
#include "utils.hpp"
Go to the source code of this file.
@@ -125,16 +126,12 @@ Macros
| |
| #define | N 40000 |
| |
-| #define | CHARGE 1. |
-| |
-| #define | MASS 40. |
-| |
|
-|
-Particle | p1 (CHARGE, MASS, vec_3d{20., 0., 20.}, vec_3d{0., 25., 0.}) |
-| | Particle 1.
|
-| |
-|
-Particle | p2 (CHARGE, MASS, vec_3d{25., 25., 0.}, vec_3d{0., 40., 5.}) |
-| | Particle 2.
|
-| |
+|
+Particle | p1 (vec3{20., 0., 20.}, vec3{0., 25., 0.}) |
+| | Particle 1.
|
+| |
+|
+Particle | p2 (vec3{25., 25., 0.}, vec3{0., 40., 5.}) |
+| | Particle 2.
|
+| |
The main program for this project.
- Author
- Cory Alexander Balaton (coryab)
-
Janita Ovidie Sandtrøen Willumsen (janitaws)
-
- Version
- 0.1
+
- Version
- 1.0
- Bug:
- No known bugs
Definition in file main.cpp.
-
-◆ CHARGE
-
-
-
-
-
- | #define CHARGE 1. |
-
-
-
-
-
-◆ MASS
-
-
@@ -218,7 +189,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
@@ -234,19 +205,19 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
-◆ analytical_solution_particle_1()
+
+◆ analytical_solution_particle_1()
- | vec_3d analytical_solution_particle_1 |
+ vec3 analytical_solution_particle_1 |
( |
double |
t | ) |
@@ -262,9 +233,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
- Returns
- vec_3d
+
- Returns
- vec3
-
Definition at line 38 of file main.cpp.
+
Definition at line 37 of file main.cpp.
@@ -283,7 +254,73 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
+
+
+◆ 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 206 of file main.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 262 of file main.cpp.
+
+
+
+
+◆ potential_resonance_wide_sweep()
+
+
+
+
+
+ | void potential_resonance_wide_sweep |
+ ( |
+ | ) |
+ |
+
+
+
+
+
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.
@@ -304,29 +341,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
Simulate 100 particles over 50 \( \mu s \).
-Definition at line 131 of file main.cpp.
-
-
-
-
-◆ simulate_100_particles_with_time_potential()
-
-
-
-
-
- | void simulate_100_particles_with_time_potential |
- ( |
- | ) |
- |
-
-
-
-
-
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 146 of file main.cpp.
+
Definition at line 132 of file main.cpp.
@@ -347,7 +362,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
Simulate a single particle over the period of 50 \( \mu s \).
-Definition at line 55 of file main.cpp.
+Definition at line 54 of file main.cpp.
@@ -368,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 88 of file main.cpp.
+Definition at line 87 of file main.cpp.
@@ -389,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 70 of file main.cpp.
+Definition at line 69 of file main.cpp.
diff --git a/docs/main_8cpp.js b/docs/main_8cpp.js
index 8b2b87e..fad5ed2 100644
--- a/docs/main_8cpp.js
+++ b/docs/main_8cpp.js
@@ -1,11 +1,13 @@
var main_8cpp =
[
- [ "analytical_solution_particle_1", "main_8cpp.html#a6451833d72816ef393087956c766125b", null ],
+ [ "analytical_solution_particle_1", "main_8cpp.html#a8d92fb2ad085065fbd14718647551657", null ],
+ [ "potential_resonance_narrow_sweep", "main_8cpp.html#a33d9b1c76c3c80902f89a58b1a6d96ea", null ],
+ [ "potential_resonance_narrow_sweep_interaction", "main_8cpp.html#ac1816f70ec612edc27848ef7f0875fdb", null ],
+ [ "potential_resonance_wide_sweep", "main_8cpp.html#a6b38b477c18e2f4268779751a88edab1", null ],
[ "simulate_100_particles", "main_8cpp.html#a213713d6ecc02a32b588ffd179dc7513", null ],
- [ "simulate_100_particles_with_time_potential", "main_8cpp.html#a330668384dc073980ba11116309bacc5", null ],
[ "simulate_single_particle", "main_8cpp.html#a8fdbe2d5a872e50ef5ec1263243589d6", null ],
[ "simulate_single_particle_with_different_steps", "main_8cpp.html#ac67e0d59227856c4d42e7d01c75e0ad2", null ],
[ "simulate_two_particles", "main_8cpp.html#a783789519f97c6430081171cacb0ffb1", null ],
- [ "p1", "main_8cpp.html#a87da4ef9f2cd753579484824310467b8", null ],
- [ "p2", "main_8cpp.html#a90f661586eb3c318fdca6f95ebc4fc46", null ]
+ [ "p1", "main_8cpp.html#a2efa69bb9d93049429ce4637075f1d30", null ],
+ [ "p2", "main_8cpp.html#ac70b61df65f4336f57ea9b4c35250df7", null ]
];
\ No newline at end of file
diff --git a/docs/main_8cpp_source.html b/docs/main_8cpp_source.html
index 276eed1..cbf1d30 100644
--- a/docs/main_8cpp_source.html
+++ b/docs/main_8cpp_source.html
@@ -110,78 +110,78 @@ $(document).ready(function(){initNavTree('main_8cpp_source.html',''); initResiza
-
-
-
-
-
-
-
-
-
-
-
-
-
- 40 double w_0 =
T / MASS;
- 41 double w_z2 = (50. *
V / 1000.) / (MASS * 500. * 500.);
- 42 double w_p = (w_0 + std::sqrt(w_0 * w_0 - 2. * w_z2)) / 2.;
- 43 double w_n = (w_0 - std::sqrt(w_0 * w_0 - 2. * w_z2)) / 2.;
- 44 double A_p = (25. + w_n * 20.) / (w_n - w_p);
- 45 double A_n = -(25. + w_p * 20.) / (w_n - w_p);
- 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 vec_3d res{std::real(f), std::imag(f), 20. * std::cos(std::sqrt(w_z2) * t)};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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);
-
-
-
-
-
-
-
-
-
- 95 std::string path =
"output/relative_error/RK4/";
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 40 double w_z2 = (50. *
V / 1000.) / (
CA_MASS * 500. * 500.);
+ 41 double w_p = (w_0 + std::sqrt(w_0 * w_0 - 2. * w_z2)) / 2.;
+ 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)};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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);
+
+
+
+
+
+
+
+
+
+ 94 std::string path =
"output/relative_error/RK4/";
+
+ 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");
-
+
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] -
-
-
+ 104 ofile << arma::norm(res.r_vecs[0][i]
+
+
@@ -189,119 +189,261 @@ $(document).ready(function(){initNavTree('main_8cpp_source.html',''); initResiza
112 path =
"output/relative_error/euler/";
- 114 for (
int i = 0; i < 4; i++) {
- 115 int steps = 4000 * std::pow(2, i);
- 116 double dt = time / (double)steps;
- 117 ofile.open(path + std::to_string(steps) +
"_steps.txt");
-
- 119 simulation_t res = trap.simulate(time, steps,
"euler",
false);
- 120 for (
int i = 0; i < steps; i++) {
- 121 ofile << arma::norm(res.r_vecs[0][i] -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 150 double amplitudes[]{.1, .4, .7};
-
- 152 double freq_start = .2;
- 153 double freq_end = 2.5;
- 154 double freq_increment = .02;
- 155 size_t freq_iterations = (size_t)((freq_end - freq_start) / freq_increment);
-
- 157 double res[4][freq_iterations];
-
- 159 std::string path =
"output/time_dependent_potential/";
-
-
-
-
- 164 double freq = freq_start;
- 165 for (
size_t i = 0; i < freq_iterations; i++) {
-
- 167 freq += freq_increment;
-
-
- 170#pragma omp parallel for collapse(2) num_threads(4)
- 171 for (
size_t i = 0; i < 3; i++) {
- 172 for (
size_t j = 0; j < freq_iterations; j++) {
-
-
-
- 176 [](
double f,
double r,
double t) {
- 177 return (25. *
V / 1000.) * (1. + f * std::cos(r * t));
-
- 179 amplitudes[i], res[0][j], std::placeholders::_1),
-
-
-
-
-
-
- 186 ofile.open(path +
"res.txt");
- 187 for (
size_t i = 0; i < freq_iterations; i++) {
- 188 ofile << res[0][i] <<
"," << res[1][i] <<
"," << res[2][i] <<
","
- 189 << res[3][i] <<
"\n";
-
-
-
-
-
-
- 196 double t0 = omp_get_wtime();
-
-
-
-
-
-
-
- 204 double t1 = omp_get_wtime();
-
-
-
-
+ 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");
+
+ 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]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 153 double amplitudes[]{.1, .4, .7};
+
+ 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;
+
+ 161 double res[4][freq_iterations];
+
+ 163 std::string path =
"output/time_dependent_potential/";
+
+
+
+
+ 168#pragma omp parallel for
+
+ 170 for (
size_t i = 0; i < freq_iterations; i++) {
+ 171 res[0][i] = freq_start + freq_increment * i;
+
+
+
+
+
+
+
+ 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++) {
+
+
+
+
+
+
+
+
+
+ 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';
+
+
+
+
+
+
+
- 210 double end = omp_get_wtime();
+ 210 double amplitudes[]{.1, .4, .7};
- 212 std::cout <<
"Time: " << (end - t1) <<
" seconds" << std::endl;
-
-
-
+ 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);
+
+ 217 double res[4][freq_iterations];
+
+ 219 std::string path =
"output/time_dependent_potential/";
+
+
+
+
+ 224#pragma omp parallel for
+
+ 226 for (
size_t i = 0; i < freq_iterations; i++) {
+ 227 res[0][i] = freq_start + freq_increment * i;
+
+
+
+
+
+
+
+ 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++) {
+
+
+
+
+
+
+
+
+
+ 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';
+
+
+
+
+
+
+
+
+ 266 double amplitudes[]{.1, .4, .7};
+
+ 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);
+
+ 273 double res[4][freq_iterations];
+
+ 275 std::string path =
"output/time_dependent_potential/";
+
+
+
+
+ 280#pragma omp parallel for
+ 281 for (
size_t i = 0; i < freq_iterations; i++) {
+ 282 res[0][i] = freq_start + freq_increment * i;
+
+
+
+
+
+
+
+ 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++) {
+
+
+
+
+
+
+
+
+ 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';
+
+
+
+
+
+
+ 311 double start, end, t1, t2;
+ 312 start = omp_get_wtime();
+
+
+
+
+
+
+
+ 320 t2 = omp_get_wtime();
+
+ 322 std::cout <<
"Time single and double : " << (t2 - start)
+ 323 <<
" seconds" << std::endl;
+
+ 325 t1 = omp_get_wtime();
+
+
+
+ 329 t2 = omp_get_wtime();
+
+ 331 std::cout <<
"Time 100 particles : " << (t2 - t1)
+ 332 <<
" seconds" << std::endl;
+
+ 334 t1 = omp_get_wtime();
+
+
+
+ 338 t2 = omp_get_wtime();
+
+ 340 std::cout <<
"Time wide sweep : " << (t2 - t1)
+ 341 <<
" seconds" << std::endl;
+
+ 343 t1 = omp_get_wtime();
+
+
+
+ 347 t2 = omp_get_wtime();
+
+ 349 std::cout <<
"Time narrow sweep no interaction : " << (t2 - t1)
+ 350 <<
" seconds" << std::endl;
+
+ 352 t1 = omp_get_wtime();
+
+
+
+ 356 t2 = omp_get_wtime();
+
+ 358 std::cout <<
"Time narrow sweep with interaction: " << (t2 - t1)
+ 359 <<
" seconds" << std::endl;
+
+ 361 end = omp_get_wtime();
+
+ 363 std::cout <<
"Time : " << (end - start)
+ 364 <<
" seconds" << std::endl;
+
+
+
A class for simulating a Penning trap.
-A class that holds attributes of a particle.
-A class that simulates a Penning trap.
-double fraction_of_particles_left(double time, unsigned int 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, unsigned int steps, std::string method="rk4", bool particle_interaction=true)
Simulate and write the displacement of all particles to files.
-
-
-void simulate_100_particles()
Simulate 100 particles over 50 .
-void simulate_100_particles_with_time_potential()
Simulate 100 particles over 500 using a time dependent potential.
-vec_3d analytical_solution_particle_1(double t)
The analytical solution for particle p1.
-void simulate_two_particles()
Simulate 2 particles over the period of 50 with and without particle interactions.
-Particle p1(CHARGE, MASS, vec_3d{20., 0., 20.}, vec_3d{0., 25., 0.})
Particle 1.
-void simulate_single_particle()
Simulate a single particle over the period of 50 .
-Particle p2(CHARGE, MASS, vec_3d{25., 25., 0.}, vec_3d{0., 40., 5.})
Particle 2.
-void simulate_single_particle_with_different_steps()
Simulate a single particle over 50 using different amount of steps and different methods.
+A class that holds attributes of a particle.
+A class that simulates a Penning trap.
+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...
+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.
+
+
+#define CA_MASS
Mass of a single calcium ion. unit: amu.
+
+void simulate_100_particles()
Simulate 100 particles over 50 .
+Particle p1(vec3{20., 0., 20.}, vec3{0., 25., 0.})
Particle 1.
+void potential_resonance_narrow_sweep()
Simulate 100 particles over 500 using a time dependent potential.
+void potential_resonance_wide_sweep()
Simulate 100 particles over 500 using a time dependent potential.
+void simulate_two_particles()
Simulate 2 particles over the period of 50 with and without particle interactions.
+vec3 analytical_solution_particle_1(double t)
The analytical solution for particle p1.
+void simulate_single_particle()
Simulate a single particle over the period of 50 .
+void potential_resonance_narrow_sweep_interaction()
Simulate 100 particles over 500 using a time dependent potential.
+void simulate_single_particle_with_different_steps()
Simulate a single particle over 50 using different amount of steps and different methods.
+Particle p2(vec3{25., 25., 0.}, vec3{0., 40., 5.})
Particle 2.
Typedef for PenningTrap::simulation return value.
-arma::vec::fixed< 3 > vec_3d
Typedef for a fixed 3d arma vector.
+arma::vec::fixed< 3 > vec3
Typedef for a fixed 3d arma vector.
Function prototypes and macros that are useful.
-bool mkpath(std::string path, int mode=0777)
Make path given.
+bool mkpath(std::string path, int mode=0777)
Make path given.
diff --git a/docs/menudata.js b/docs/menudata.js
index 84356c6..51a28c4 100644
--- a/docs/menudata.js
+++ b/docs/menudata.js
@@ -50,7 +50,17 @@ var menudata={children:[
{text:"Files",url:"files.html",children:[
{text:"File List",url:"files.html"},
{text:"File Members",url:"globals.html",children:[
-{text:"All",url:"globals.html"},
+{text:"All",url:"globals.html",children:[
+{text:"_",url:"globals.html#index__5F"},
+{text:"a",url:"globals.html#index_a"},
+{text:"c",url:"globals.html#index_c"},
+{text:"d",url:"globals.html#index_d"},
+{text:"k",url:"globals.html#index_k"},
+{text:"m",url:"globals.html#index_m"},
+{text:"p",url:"globals.html#index_p"},
+{text:"s",url:"globals.html#index_s"},
+{text:"t",url:"globals.html#index_t"},
+{text:"v",url:"globals.html#index_v"}]},
{text:"Functions",url:"globals_func.html"},
{text:"Variables",url:"globals_vars.html"},
{text:"Typedefs",url:"globals_type.html"},
diff --git a/docs/navtreeindex0.js b/docs/navtreeindex0.js
index d727fc6..38ecabb 100644
--- a/docs/navtreeindex0.js
+++ b/docs/navtreeindex0.js
@@ -12,43 +12,53 @@ var NAVTREEINDEX0 =
"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#a7af9f8d1fef63dd7643b06629ac7bef4":[5,0,0,0],
-"classParticle.html#a879692772803d6ab65fa4993b54aea6e":[5,0,0,5],
"classParticle.html#aa797d319549dc2a0beb06cdbfd430232":[5,0,0,1],
"classParticle.html#aedcc7e1bc53b0e2b1a4a07c9a1b47563":[5,0,0,2],
-"classParticle.html#af9497cd8f2dcad0fad54f571ddb383e6":[5,0,0,4],
+"classParticle.html#af1d7535fb8311eaa77d2b7b345882ec4":[5,0,0,0],
"classPenningTrap.html":[5,0,1],
-"classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f":[5,0,1,21],
-"classPenningTrap.html#a0194be61c956a9259c747c23e4163c5b":[5,0,1,9],
-"classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716":[5,0,1,17],
-"classPenningTrap.html#a1d58feaa2c9e34cbf26b1c5ed75ca9d9":[5,0,1,7],
-"classPenningTrap.html#a1f668c4433421136ad51741741aa1bc8":[5,0,1,12],
-"classPenningTrap.html#a2f168622587709b9e3c49077f0b9a640":[5,0,1,19],
+"classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f":[5,0,1,23],
+"classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716":[5,0,1,19],
+"classPenningTrap.html#a2c01108b52c8e2a003cf9170da9e7682":[5,0,1,15],
+"classPenningTrap.html#a2f168622587709b9e3c49077f0b9a640":[5,0,1,21],
+"classPenningTrap.html#a2fe1cefbae18fa5808155ee0d2df713c":[5,0,1,16],
+"classPenningTrap.html#a361f2c4862c90b5e8e2a2f50c6a95655":[5,0,1,6],
"classPenningTrap.html#a36946152fd951b1f7c346c51ff900d8e":[5,0,1,5],
-"classPenningTrap.html#a43e74792ab4b3f9299f35cb64bdb2648":[5,0,1,10],
-"classPenningTrap.html#a46a954a0946def199e30fb300ba1c47b":[5,0,1,14],
-"classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2":[5,0,1,18],
-"classPenningTrap.html#a67139e04ef69c0bcffde8f30f67cbf73":[5,0,1,2],
+"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,20],
"classPenningTrap.html#a6e9776ff5b149f01080800716455d7c8":[5,0,1,3],
-"classPenningTrap.html#a763700316b502d5900e587c1f61e6bf1":[5,0,1,1],
-"classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e":[5,0,1,22],
-"classPenningTrap.html#a9ae34ad740a230e667e96bc6ee8730ce":[5,0,1,8],
-"classPenningTrap.html#aaf105828121c4a33cc2b217453c20317":[5,0,1,23],
+"classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89":[5,0,1,26],
+"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#a8ca4e21291f60fde619c14099d8c4e8e":[5,0,1,25],
+"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#abbb832a85139b1a56ebde57d7b8f9a57":[5,0,1,16],
-"classPenningTrap.html#acbf065c9c125682329ad82a8d166554c":[5,0,1,6],
-"classPenningTrap.html#ae09ef9cfa7e4ed1c108c8576405b3599":[5,0,1,11],
-"classPenningTrap.html#ae670d7de621acdb343b01af098086f63":[5,0,1,0],
-"classPenningTrap.html#ae72d203b0bfa1b9e72bea28cb2863c56":[5,0,1,13],
-"classPenningTrap.html#ae9b5afdaa5cd366e94bd294452a1eed4":[5,0,1,20],
-"classPenningTrap.html#af98a720da60b0e1a62aefa5f5cb37c1e":[5,0,1,15],
+"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,24],
+"classPenningTrap.html#ae9b5afdaa5cd366e94bd294452a1eed4":[5,0,1,22],
"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,1],
-"constants_8hpp.html#a4e451456ad7e9276ed0afa42826e7ccb":[6,0,0,0,0],
-"constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb":[6,0,0,0,2],
+"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],
@@ -75,14 +85,16 @@ var NAVTREEINDEX0 =
"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,1],
-"main_8cpp.html#a330668384dc073980ba11116309bacc5":[6,0,1,1,2],
-"main_8cpp.html#a6451833d72816ef393087956c766125b":[6,0,1,1,0],
-"main_8cpp.html#a783789519f97c6430081171cacb0ffb1":[6,0,1,1,5],
-"main_8cpp.html#a87da4ef9f2cd753579484824310467b8":[6,0,1,1,6],
-"main_8cpp.html#a8fdbe2d5a872e50ef5ec1263243589d6":[6,0,1,1,3],
-"main_8cpp.html#a90f661586eb3c318fdca6f95ebc4fc46":[6,0,1,1,7],
-"main_8cpp.html#ac67e0d59227856c4d42e7d01c75e0ad2":[6,0,1,1,4],
+"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],
"pages.html":[],
"plot__2__particles_8py_source.html":[6,0,1,0,1],
@@ -95,10 +107,10 @@ var NAVTREEINDEX0 =
"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#a7c2dfa854274262c4e00e4ef0ab2ce23":[6,0,0,3,2],
-"typedefs_8hpp.html#a8502989b1b361725834fc185bd575f66":[6,0,0,3,3],
-"typedefs_8hpp.html#a9f33f4962c8fb62cc5ccd0e4e039a8df":[6,0,0,3,5],
"typedefs_8hpp.html#aec69d34220fff45de238b9e01f2686af":[6,0,0,3,1],
"typedefs_8hpp_source.html":[6,0,0,3],
"utils_8cpp.html":[6,0,1,5],
diff --git a/docs/plot__particles__left_8py_source.html b/docs/plot__particles__left_8py_source.html
index 33e15f0..4e37019 100644
--- a/docs/plot__particles__left_8py_source.html
+++ b/docs/plot__particles__left_8py_source.html
@@ -102,35 +102,73 @@ $(document).ready(function(){initNavTree('plot__particles__left_8py_source.html'
1import matplotlib.pyplot
as plt
-
-
-
4 with open(
"output/time_dependent_potential/res.txt")
as f:
-
-
-
-
-
-
-
11 l = line.strip().split(
",")
-
-
13 y1.append(float(l[1]))
-
14 y2.append(float(l[2]))
-
15 y3.append(float(l[3]))
+
+
+
+
+
6 "font.family":
"Serif",
+
+
+
9 "axes.titlesize":
"large",
+
10 "axes.labelsize":
"large",
+
11 "xtick.labelsize":
"large",
+
12 "ytick.labelsize":
"large",
+
13 "legend.fontsize":
"medium"
+
+
15plt.rcParams.update(params)
-
17 plt.plot(x,y1,label=f
"amplitude: 0.1")
-
18 plt.plot(x,y2,label=f
"amplitude: 0.4")
-
19 plt.plot(x,y3,label=f
"amplitude: 0.7")
-
-
21 plt.xlabel(
r"$\omega_V$ (MHz)")
-
22 plt.ylabel(
r"Fraction of particles left")
-
23 plt.title(
r"The fraction of particles left in the Penning trap "
-
24 "after 500 microseconds for different amplitudes and frequencies")
-
-
-
27 plt.savefig(
"../latex/images/particles_left.pdf")
-
-
29if __name__ ==
"__main__":
-
+
+
+
+
+
+
+
+
+
+
+
27 "output/time_dependent_potential/wide_sweep.txt",
+
28 "output/time_dependent_potential/narrow_sweep.txt",
+
29 "output/time_dependent_potential/narrow_sweep_interactions.txt",
+
+
+
32 "../latex/images/wide_sweep.pdf",
+
33 "../latex/images/narrow_sweep.pdf",
+
34 "../latex/images/narrow_sweep_interactions.pdf",
+
+
36 for file, output
in zip(files, outputs):
+
+
+
+
+
+
+
+
44 l = line.strip().split(
",")
+
+
46 y1.append(float(l[1]))
+
47 y2.append(float(l[2]))
+
48 y3.append(float(l[3]))
+
+
50 fig, ax = plt.subplots()
+
51 ax.plot(x, y1, label=
r"$f_{1} = 0.1$", color=colors[0])
+
52 ax.plot(x, y2, label=
r"$f_{2} = 0.4$", color=colors[2])
+
53 ax.plot(x, y3, label=
r"$f_{3} = 0.7$", color=colors[4])
+
+
55 ax.set_xlabel(
r"Frequency $\omega_V$ (MHz)")
+
+
57 ax.set_ylabel(
r"Fraction of particles left")
+
+
+
+
+
62 ax.legend(loc=
"upper right")
+
+
+
65 fig.savefig(output, bbox_inches=
"tight")
+
+
67if __name__ ==
"__main__":
+
diff --git a/docs/search/all_1.js b/docs/search/all_1.js
index 027119f..6effb5c 100644
--- a/docs/search/all_1.js
+++ b/docs/search/all_1.js
@@ -1,6 +1,6 @@
var searchData=
[
['add_5fparticle_0',['add_particle',['../classPenningTrap.html#a6e9776ff5b149f01080800716455d7c8',1,'PenningTrap']]],
- ['analytical_5fsolution_5fparticle_5f1_1',['analytical_solution_particle_1',['../main_8cpp.html#a6451833d72816ef393087956c766125b',1,'main.cpp']]],
+ ['analytical_5fsolution_5fparticle_5f1_1',['analytical_solution_particle_1',['../main_8cpp.html#a8d92fb2ad085065fbd14718647551657',1,'main.cpp']]],
['assert_2',['ASSERT',['../utils_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9',1,'utils.hpp']]]
];
diff --git a/docs/search/all_10.js b/docs/search/all_10.js
index 1b9fc74..209042a 100644
--- a/docs/search/all_10.js
+++ b/docs/search/all_10.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['write_5fsimulation_5fto_5fdir_0',['write_simulation_to_dir',['../classPenningTrap.html#abbb832a85139b1a56ebde57d7b8f9a57',1,'PenningTrap']]]
+ ['write_5fsimulation_5fto_5fdir_0',['write_simulation_to_dir',['../classPenningTrap.html#ad8bc4df7ab3eed53b16cfdff38e7760b',1,'PenningTrap']]]
];
diff --git a/docs/search/all_3.js b/docs/search/all_3.js
index f292435..ecb5965 100644
--- a/docs/search/all_3.js
+++ b/docs/search/all_3.js
@@ -1,5 +1,7 @@
var searchData=
[
- ['close_5fto_0',['close_to',['../utils_8hpp.html#ab3e0cf669bddc59bd53998490ffb68b9',1,'close_to(arma::vec &a, arma::vec &b, double tol=1e-8): utils.cpp'],['../utils_8cpp.html#a6be6f938bcbb235ebb6a2ed9d08411b2',1,'close_to(arma::vec &a, arma::vec &b, double tol): utils.cpp']]],
- ['constants_2ehpp_1',['constants.hpp',['../constants_8hpp.html',1,'']]]
+ ['ca_5fcharge_0',['CA_CHARGE',['../constants_8hpp.html#af7602a3a314957137ad1cd719aa23789',1,'constants.hpp']]],
+ ['ca_5fmass_1',['CA_MASS',['../constants_8hpp.html#a2ff491cc7958ffd5e749c518a4a60ec8',1,'constants.hpp']]],
+ ['close_5fto_2',['close_to',['../utils_8hpp.html#ab3e0cf669bddc59bd53998490ffb68b9',1,'close_to(arma::vec &a, arma::vec &b, double tol=1e-8): utils.cpp'],['../utils_8cpp.html#a6be6f938bcbb235ebb6a2ed9d08411b2',1,'close_to(arma::vec &a, arma::vec &b, double tol): utils.cpp']]],
+ ['constants_2ehpp_3',['constants.hpp',['../constants_8hpp.html',1,'']]]
];
diff --git a/docs/search/all_5.js b/docs/search/all_5.js
index c4c479f..e8152c7 100644
--- a/docs/search/all_5.js
+++ b/docs/search/all_5.js
@@ -2,6 +2,6 @@ var searchData=
[
['evolve_5fforward_5feuler_0',['evolve_forward_euler',['../classPenningTrap.html#ab9ea97a406534bbe621a95215144875e',1,'PenningTrap']]],
['evolve_5frk4_1',['evolve_RK4',['../classPenningTrap.html#a36946152fd951b1f7c346c51ff900d8e',1,'PenningTrap']]],
- ['external_5fb_5ffield_2',['external_B_field',['../classPenningTrap.html#acbf065c9c125682329ad82a8d166554c',1,'PenningTrap']]],
- ['external_5fe_5ffield_3',['external_E_field',['../classPenningTrap.html#a1d58feaa2c9e34cbf26b1c5ed75ca9d9',1,'PenningTrap']]]
+ ['external_5fb_5ffield_2',['external_B_field',['../classPenningTrap.html#a361f2c4862c90b5e8e2a2f50c6a95655',1,'PenningTrap']]],
+ ['external_5fe_5ffield_3',['external_E_field',['../classPenningTrap.html#a5846c8f75cdc543fd9cf0b2185a3ef22',1,'PenningTrap']]]
];
diff --git a/docs/search/all_6.js b/docs/search/all_6.js
index d1d9acc..e6919eb 100644
--- a/docs/search/all_6.js
+++ b/docs/search/all_6.js
@@ -1,5 +1,5 @@
var searchData=
[
- ['force_5fon_5fparticle_0',['force_on_particle',['../classPenningTrap.html#a9ae34ad740a230e667e96bc6ee8730ce',1,'PenningTrap']]],
- ['fraction_5fof_5fparticles_5fleft_1',['fraction_of_particles_left',['../classPenningTrap.html#a0194be61c956a9259c747c23e4163c5b',1,'PenningTrap']]]
+ ['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']]]
];
diff --git a/docs/search/all_9.js b/docs/search/all_9.js
index a9cb3b3..7a16618 100644
--- a/docs/search/all_9.js
+++ b/docs/search/all_9.js
@@ -1,14 +1,18 @@
var searchData=
[
- ['p1_0',['p1',['../main_8cpp.html#a87da4ef9f2cd753579484824310467b8',1,'main.cpp']]],
- ['p2_1',['p2',['../main_8cpp.html#a90f661586eb3c318fdca6f95ebc4fc46',1,'main.cpp']]],
- ['particle_2',['Particle',['../classParticle.html',1,'Particle'],['../classParticle.html#a7af9f8d1fef63dd7643b06629ac7bef4',1,'Particle::Particle()']]],
+ ['p1_0',['p1',['../main_8cpp.html#a2efa69bb9d93049429ce4637075f1d30',1,'main.cpp']]],
+ ['p2_1',['p2',['../main_8cpp.html#ac70b61df65f4336f57ea9b4c35250df7',1,'main.cpp']]],
+ ['particle_2',['Particle',['../classParticle.html#af1d7535fb8311eaa77d2b7b345882ec4',1,'Particle::Particle()'],['../classParticle.html',1,'Particle']]],
['particle_2ecpp_3',['Particle.cpp',['../Particle_8cpp.html',1,'']]],
['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',1,'PenningTrap'],['../classParticle.html#aa797d319549dc2a0beb06cdbfd430232',1,'Particle::PenningTrap()'],['../classPenningTrap.html#ae670d7de621acdb343b01af098086f63',1,'PenningTrap::PenningTrap(double B_0=T, std::function< double(double)> V_0=[](double t) { return 25. *V/1000.;}, double d=500., double t=0.)'],['../classPenningTrap.html#a763700316b502d5900e587c1f61e6bf1',1,'PenningTrap::PenningTrap(unsigned int i, double B_0=T, std::function< double(double)> V_0=[](double t) { return 25. *V/1000.;}, double d=500., double t=0.)'],['../classPenningTrap.html#a67139e04ef69c0bcffde8f30f67cbf73',1,'PenningTrap::PenningTrap(std::vector< Particle > particles, double B_0=T, std::function< double(double)> V_0=[](double t) { return 25. *V/1000.;}, double d=500., double t=0.)']]],
+ ['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_2ecpp_8',['PenningTrap.cpp',['../PenningTrap_8cpp.html',1,'']]],
['penningtrap_2ehpp_9',['PenningTrap.hpp',['../PenningTrap_8hpp.html',1,'']]],
- ['penningtraptest_10',['PenningTrapTest',['../classPenningTrapTest.html',1,'']]]
+ ['penningtraptest_10',['PenningTrapTest',['../classPenningTrapTest.html',1,'']]],
+ ['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_5fwide_5fsweep_14',['potential_resonance_wide_sweep',['../main_8cpp.html#a6b38b477c18e2f4268779751a88edab1',1,'main.cpp']]]
];
diff --git a/docs/search/all_b.js b/docs/search/all_b.js
index fb8b113..3d33231 100644
--- a/docs/search/all_b.js
+++ b/docs/search/all_b.js
@@ -1,5 +1,6 @@
var searchData=
[
- ['r_5ffunc_0',['r_func',['../classPenningTrap.html#a43e74792ab4b3f9299f35cb64bdb2648',1,'PenningTrap']]],
- ['r_5fvec_1',['r_vec',['../classParticle.html#af9497cd8f2dcad0fad54f571ddb383e6',1,'Particle']]]
+ ['r_5ffunc_0',['r_func',['../classPenningTrap.html#a826b7fa8e709d481eb1dee7d0c2cdc08',1,'PenningTrap']]],
+ ['r_5fvec_1',['r_vec',['../classParticle.html#a1c59101411db43624828b766f87ad460',1,'Particle']]],
+ ['reinitialize_2',['reinitialize',['../classPenningTrap.html#aaee129f177657455348d0c8ae1441dea',1,'PenningTrap']]]
];
diff --git a/docs/search/all_c.js b/docs/search/all_c.js
index 86b3940..e3fbf37 100644
--- a/docs/search/all_c.js
+++ b/docs/search/all_c.js
@@ -1,12 +1,12 @@
var searchData=
[
['scientific_5fformat_0',['scientific_format',['../utils_8hpp.html#adfb618b2fdff47ef30a4a2b62c04f384',1,'scientific_format(double d, int width=20, int prec=10): utils.cpp'],['../utils_8hpp.html#ad54b96a1074f9df4dc892a41d115b72d',1,'scientific_format(const std::vector< double > &v, int width=20, int prec=10): utils.cpp'],['../utils_8cpp.html#acd2a9c7a7d5a7fe9163be8c4cc110746',1,'scientific_format(double d, int width, int prec): utils.cpp'],['../utils_8cpp.html#a58565270b643b24e3132f38c653e0199',1,'scientific_format(const std::vector< double > &v, int width, int prec): utils.cpp']]],
- ['sim_5farr_1',['sim_arr',['../typedefs_8hpp.html#aec69d34220fff45de238b9e01f2686af',1,'typedefs.hpp']]],
- ['sim_5fcols_2',['sim_cols',['../typedefs_8hpp.html#a7c2dfa854274262c4e00e4ef0ab2ce23',1,'typedefs.hpp']]],
- ['sim_5frows_3',['sim_rows',['../typedefs_8hpp.html#a8502989b1b361725834fc185bd575f66',1,'typedefs.hpp']]],
- ['simulate_4',['simulate',['../classPenningTrap.html#ae09ef9cfa7e4ed1c108c8576405b3599',1,'PenningTrap']]],
- ['simulate_5f100_5fparticles_5',['simulate_100_particles',['../main_8cpp.html#a213713d6ecc02a32b588ffd179dc7513',1,'main.cpp']]],
- ['simulate_5f100_5fparticles_5fwith_5ftime_5fpotential_6',['simulate_100_particles_with_time_potential',['../main_8cpp.html#a330668384dc073980ba11116309bacc5',1,'main.cpp']]],
+ ['set_5fpertubation_1',['set_pertubation',['../classPenningTrap.html#a9d1d8e90ca839b928aee1ad0cd4aff43',1,'PenningTrap']]],
+ ['sim_5farr_2',['sim_arr',['../typedefs_8hpp.html#aec69d34220fff45de238b9e01f2686af',1,'typedefs.hpp']]],
+ ['sim_5fcols_3',['sim_cols',['../typedefs_8hpp.html#a46482a2697556c00556c9d73f461784f',1,'typedefs.hpp']]],
+ ['sim_5frows_4',['sim_rows',['../typedefs_8hpp.html#a33418f31f28663b8414c8f7182998c22',1,'typedefs.hpp']]],
+ ['simulate_5',['simulate',['../classPenningTrap.html#a7a1d9f0528a12308de25bc30718da20a',1,'PenningTrap']]],
+ ['simulate_5f100_5fparticles_6',['simulate_100_particles',['../main_8cpp.html#a213713d6ecc02a32b588ffd179dc7513',1,'main.cpp']]],
['simulate_5fsingle_5fparticle_7',['simulate_single_particle',['../main_8cpp.html#a8fdbe2d5a872e50ef5ec1263243589d6',1,'main.cpp']]],
['simulate_5fsingle_5fparticle_5fwith_5fdifferent_5fsteps_8',['simulate_single_particle_with_different_steps',['../main_8cpp.html#ac67e0d59227856c4d42e7d01c75e0ad2',1,'main.cpp']]],
['simulate_5ftwo_5fparticles_9',['simulate_two_particles',['../main_8cpp.html#a783789519f97c6430081171cacb0ffb1',1,'main.cpp']]],
diff --git a/docs/search/all_d.js b/docs/search/all_d.js
index d8c5a50..4af72aa 100644
--- a/docs/search/all_d.js
+++ b/docs/search/all_d.js
@@ -2,14 +2,14 @@ var searchData=
[
['t_0',['t',['../classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e',1,'PenningTrap']]],
['t_1',['T',['../constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5',1,'constants.hpp']]],
- ['test_5fexternal_5fb_5ffield_2',['test_external_B_field',['../classPenningTrapTest.html#acb806e49a688424588e0c501bc57a230',1,'PenningTrapTest']]],
- ['test_5fexternal_5fe_5ffield_3',['test_external_E_field',['../classPenningTrapTest.html#a542996d72c713636b95e0aa9118f7901',1,'PenningTrapTest']]],
- ['test_5fforce_5fon_5fparticle_4',['test_force_on_particle',['../classPenningTrapTest.html#addf81fa5692d8146cce5571ccdc5999b',1,'PenningTrapTest']]],
+ ['test_5fexternal_5fb_5ffield_2',['test_external_B_field',['../classPenningTrapTest.html#ad668d7d875bdc1909a42426bf9dead9e',1,'PenningTrapTest']]],
+ ['test_5fexternal_5fe_5ffield_3',['test_external_E_field',['../classPenningTrapTest.html#a6a303be62039ca2ecccd8252744d4dc8',1,'PenningTrapTest']]],
+ ['test_5fforce_5fon_5fparticle_4',['test_force_on_particle',['../classPenningTrapTest.html#a5f4f0b150e54ce463bb29f76d49883f9',1,'PenningTrapTest']]],
['test_5fsuite_2ecpp_5',['test_suite.cpp',['../test__suite_8cpp.html',1,'']]],
- ['test_5ftotal_5fforce_5fexternal_6',['test_total_force_external',['../classPenningTrapTest.html#ae104e04dcd21ac63281c908132fdf255',1,'PenningTrapTest']]],
- ['test_5ftotal_5fforce_5fparticles_7',['test_total_force_particles',['../classPenningTrapTest.html#a0ee2bbf5e26c115164208b89c5a29e3d',1,'PenningTrapTest']]],
- ['total_5fforce_8',['total_force',['../classPenningTrap.html#a1f668c4433421136ad51741741aa1bc8',1,'PenningTrap']]],
- ['total_5fforce_5fexternal_9',['total_force_external',['../classPenningTrap.html#ae72d203b0bfa1b9e72bea28cb2863c56',1,'PenningTrap']]],
- ['total_5fforce_5fparticles_10',['total_force_particles',['../classPenningTrap.html#a46a954a0946def199e30fb300ba1c47b',1,'PenningTrap']]],
+ ['test_5ftotal_5fforce_5fexternal_6',['test_total_force_external',['../classPenningTrapTest.html#ae6d0c8e0d80338fb7c7edefc97331046',1,'PenningTrapTest']]],
+ ['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,'']]]
];
diff --git a/docs/search/all_f.js b/docs/search/all_f.js
index bb9c0eb..d989494 100644
--- a/docs/search/all_f.js
+++ b/docs/search/all_f.js
@@ -1,8 +1,8 @@
var searchData=
[
['v_0',['V',['../constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb',1,'constants.hpp']]],
- ['v_5f0_1',['V_0',['../classPenningTrap.html#aaf105828121c4a33cc2b217453c20317',1,'PenningTrap']]],
- ['v_5ffunc_2',['v_func',['../classPenningTrap.html#af98a720da60b0e1a62aefa5f5cb37c1e',1,'PenningTrap']]],
- ['v_5fvec_3',['v_vec',['../classParticle.html#a879692772803d6ab65fa4993b54aea6e',1,'Particle']]],
- ['vec_5f3d_4',['vec_3d',['../typedefs_8hpp.html#a9f33f4962c8fb62cc5ccd0e4e039a8df',1,'typedefs.hpp']]]
+ ['v_5f0_1',['V_0',['../classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89',1,'PenningTrap']]],
+ ['v_5ffunc_2',['v_func',['../classPenningTrap.html#a3c0a44e4e0a94366ff609e81fe463fa2',1,'PenningTrap']]],
+ ['v_5fvec_3',['v_vec',['../classParticle.html#a3a10400add8dd22b8031330c2aafb6fe',1,'Particle']]],
+ ['vec3_4',['vec3',['../typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea',1,'typedefs.hpp']]]
];
diff --git a/docs/search/defines_2.js b/docs/search/defines_2.js
index c6466cb..835b733 100644
--- a/docs/search/defines_2.js
+++ b/docs/search/defines_2.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['debug_0',['DEBUG',['../utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b',1,'utils.hpp']]]
+ ['ca_5fcharge_0',['CA_CHARGE',['../constants_8hpp.html#af7602a3a314957137ad1cd719aa23789',1,'constants.hpp']]],
+ ['ca_5fmass_1',['CA_MASS',['../constants_8hpp.html#a2ff491cc7958ffd5e749c518a4a60ec8',1,'constants.hpp']]]
];
diff --git a/docs/search/defines_3.js b/docs/search/defines_3.js
index cb8673f..c6466cb 100644
--- a/docs/search/defines_3.js
+++ b/docs/search/defines_3.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['k_5fe_0',['K_E',['../constants_8hpp.html#a4e451456ad7e9276ed0afa42826e7ccb',1,'constants.hpp']]]
+ ['debug_0',['DEBUG',['../utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b',1,'utils.hpp']]]
];
diff --git a/docs/search/defines_4.js b/docs/search/defines_4.js
index 6eef01f..cb8673f 100644
--- a/docs/search/defines_4.js
+++ b/docs/search/defines_4.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['t_0',['T',['../constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5',1,'constants.hpp']]]
+ ['k_5fe_0',['K_E',['../constants_8hpp.html#a4e451456ad7e9276ed0afa42826e7ccb',1,'constants.hpp']]]
];
diff --git a/docs/search/defines_5.js b/docs/search/defines_5.js
index 06f433f..6eef01f 100644
--- a/docs/search/defines_5.js
+++ b/docs/search/defines_5.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['v_0',['V',['../constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb',1,'constants.hpp']]]
+ ['t_0',['T',['../constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5',1,'constants.hpp']]]
];
diff --git a/docs/search/defines_6.js b/docs/search/defines_6.js
new file mode 100644
index 0000000..06f433f
--- /dev/null
+++ b/docs/search/defines_6.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['v_0',['V',['../constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb',1,'constants.hpp']]]
+];
diff --git a/docs/search/functions_0.js b/docs/search/functions_0.js
index 2162ba3..693aa36 100644
--- a/docs/search/functions_0.js
+++ b/docs/search/functions_0.js
@@ -1,5 +1,5 @@
var searchData=
[
['add_5fparticle_0',['add_particle',['../classPenningTrap.html#a6e9776ff5b149f01080800716455d7c8',1,'PenningTrap']]],
- ['analytical_5fsolution_5fparticle_5f1_1',['analytical_solution_particle_1',['../main_8cpp.html#a6451833d72816ef393087956c766125b',1,'main.cpp']]]
+ ['analytical_5fsolution_5fparticle_5f1_1',['analytical_solution_particle_1',['../main_8cpp.html#a8d92fb2ad085065fbd14718647551657',1,'main.cpp']]]
];
diff --git a/docs/search/functions_2.js b/docs/search/functions_2.js
index c4c479f..e8152c7 100644
--- a/docs/search/functions_2.js
+++ b/docs/search/functions_2.js
@@ -2,6 +2,6 @@ var searchData=
[
['evolve_5fforward_5feuler_0',['evolve_forward_euler',['../classPenningTrap.html#ab9ea97a406534bbe621a95215144875e',1,'PenningTrap']]],
['evolve_5frk4_1',['evolve_RK4',['../classPenningTrap.html#a36946152fd951b1f7c346c51ff900d8e',1,'PenningTrap']]],
- ['external_5fb_5ffield_2',['external_B_field',['../classPenningTrap.html#acbf065c9c125682329ad82a8d166554c',1,'PenningTrap']]],
- ['external_5fe_5ffield_3',['external_E_field',['../classPenningTrap.html#a1d58feaa2c9e34cbf26b1c5ed75ca9d9',1,'PenningTrap']]]
+ ['external_5fb_5ffield_2',['external_B_field',['../classPenningTrap.html#a361f2c4862c90b5e8e2a2f50c6a95655',1,'PenningTrap']]],
+ ['external_5fe_5ffield_3',['external_E_field',['../classPenningTrap.html#a5846c8f75cdc543fd9cf0b2185a3ef22',1,'PenningTrap']]]
];
diff --git a/docs/search/functions_3.js b/docs/search/functions_3.js
index d1d9acc..e6919eb 100644
--- a/docs/search/functions_3.js
+++ b/docs/search/functions_3.js
@@ -1,5 +1,5 @@
var searchData=
[
- ['force_5fon_5fparticle_0',['force_on_particle',['../classPenningTrap.html#a9ae34ad740a230e667e96bc6ee8730ce',1,'PenningTrap']]],
- ['fraction_5fof_5fparticles_5fleft_1',['fraction_of_particles_left',['../classPenningTrap.html#a0194be61c956a9259c747c23e4163c5b',1,'PenningTrap']]]
+ ['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']]]
];
diff --git a/docs/search/functions_5.js b/docs/search/functions_5.js
index 852716e..f49bd4c 100644
--- a/docs/search/functions_5.js
+++ b/docs/search/functions_5.js
@@ -1,5 +1,8 @@
var searchData=
[
- ['particle_0',['Particle',['../classParticle.html#a7af9f8d1fef63dd7643b06629ac7bef4',1,'Particle']]],
- ['penningtrap_1',['PenningTrap',['../classPenningTrap.html#ae670d7de621acdb343b01af098086f63',1,'PenningTrap::PenningTrap(double B_0=T, std::function< double(double)> V_0=[](double t) { return 25. *V/1000.;}, double d=500., double t=0.)'],['../classPenningTrap.html#a763700316b502d5900e587c1f61e6bf1',1,'PenningTrap::PenningTrap(unsigned int i, double B_0=T, std::function< double(double)> V_0=[](double t) { return 25. *V/1000.;}, double d=500., double t=0.)'],['../classPenningTrap.html#a67139e04ef69c0bcffde8f30f67cbf73',1,'PenningTrap::PenningTrap(std::vector< Particle > particles, double B_0=T, std::function< double(double)> V_0=[](double t) { return 25. *V/1000.;}, double d=500., double t=0.)']]]
+ ['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_5fwide_5fsweep_4',['potential_resonance_wide_sweep',['../main_8cpp.html#a6b38b477c18e2f4268779751a88edab1',1,'main.cpp']]]
];
diff --git a/docs/search/functions_6.js b/docs/search/functions_6.js
index 07b3041..f9fecdd 100644
--- a/docs/search/functions_6.js
+++ b/docs/search/functions_6.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['r_5ffunc_0',['r_func',['../classPenningTrap.html#a43e74792ab4b3f9299f35cb64bdb2648',1,'PenningTrap']]]
+ ['r_5ffunc_0',['r_func',['../classPenningTrap.html#a826b7fa8e709d481eb1dee7d0c2cdc08',1,'PenningTrap']]],
+ ['reinitialize_1',['reinitialize',['../classPenningTrap.html#aaee129f177657455348d0c8ae1441dea',1,'PenningTrap']]]
];
diff --git a/docs/search/functions_7.js b/docs/search/functions_7.js
index d253bda..eb77e26 100644
--- a/docs/search/functions_7.js
+++ b/docs/search/functions_7.js
@@ -1,9 +1,9 @@
var searchData=
[
['scientific_5fformat_0',['scientific_format',['../utils_8hpp.html#adfb618b2fdff47ef30a4a2b62c04f384',1,'scientific_format(double d, int width=20, int prec=10): utils.cpp'],['../utils_8hpp.html#ad54b96a1074f9df4dc892a41d115b72d',1,'scientific_format(const std::vector< double > &v, int width=20, int prec=10): utils.cpp'],['../utils_8cpp.html#acd2a9c7a7d5a7fe9163be8c4cc110746',1,'scientific_format(double d, int width, int prec): utils.cpp'],['../utils_8cpp.html#a58565270b643b24e3132f38c653e0199',1,'scientific_format(const std::vector< double > &v, int width, int prec): utils.cpp']]],
- ['simulate_1',['simulate',['../classPenningTrap.html#ae09ef9cfa7e4ed1c108c8576405b3599',1,'PenningTrap']]],
- ['simulate_5f100_5fparticles_2',['simulate_100_particles',['../main_8cpp.html#a213713d6ecc02a32b588ffd179dc7513',1,'main.cpp']]],
- ['simulate_5f100_5fparticles_5fwith_5ftime_5fpotential_3',['simulate_100_particles_with_time_potential',['../main_8cpp.html#a330668384dc073980ba11116309bacc5',1,'main.cpp']]],
+ ['set_5fpertubation_1',['set_pertubation',['../classPenningTrap.html#a9d1d8e90ca839b928aee1ad0cd4aff43',1,'PenningTrap']]],
+ ['simulate_2',['simulate',['../classPenningTrap.html#a7a1d9f0528a12308de25bc30718da20a',1,'PenningTrap']]],
+ ['simulate_5f100_5fparticles_3',['simulate_100_particles',['../main_8cpp.html#a213713d6ecc02a32b588ffd179dc7513',1,'main.cpp']]],
['simulate_5fsingle_5fparticle_4',['simulate_single_particle',['../main_8cpp.html#a8fdbe2d5a872e50ef5ec1263243589d6',1,'main.cpp']]],
['simulate_5fsingle_5fparticle_5fwith_5fdifferent_5fsteps_5',['simulate_single_particle_with_different_steps',['../main_8cpp.html#ac67e0d59227856c4d42e7d01c75e0ad2',1,'main.cpp']]],
['simulate_5ftwo_5fparticles_6',['simulate_two_particles',['../main_8cpp.html#a783789519f97c6430081171cacb0ffb1',1,'main.cpp']]]
diff --git a/docs/search/functions_8.js b/docs/search/functions_8.js
index d230e8d..6ad3539 100644
--- a/docs/search/functions_8.js
+++ b/docs/search/functions_8.js
@@ -1,11 +1,11 @@
var searchData=
[
- ['test_5fexternal_5fb_5ffield_0',['test_external_B_field',['../classPenningTrapTest.html#acb806e49a688424588e0c501bc57a230',1,'PenningTrapTest']]],
- ['test_5fexternal_5fe_5ffield_1',['test_external_E_field',['../classPenningTrapTest.html#a542996d72c713636b95e0aa9118f7901',1,'PenningTrapTest']]],
- ['test_5fforce_5fon_5fparticle_2',['test_force_on_particle',['../classPenningTrapTest.html#addf81fa5692d8146cce5571ccdc5999b',1,'PenningTrapTest']]],
- ['test_5ftotal_5fforce_5fexternal_3',['test_total_force_external',['../classPenningTrapTest.html#ae104e04dcd21ac63281c908132fdf255',1,'PenningTrapTest']]],
- ['test_5ftotal_5fforce_5fparticles_4',['test_total_force_particles',['../classPenningTrapTest.html#a0ee2bbf5e26c115164208b89c5a29e3d',1,'PenningTrapTest']]],
- ['total_5fforce_5',['total_force',['../classPenningTrap.html#a1f668c4433421136ad51741741aa1bc8',1,'PenningTrap']]],
- ['total_5fforce_5fexternal_6',['total_force_external',['../classPenningTrap.html#ae72d203b0bfa1b9e72bea28cb2863c56',1,'PenningTrap']]],
- ['total_5fforce_5fparticles_7',['total_force_particles',['../classPenningTrap.html#a46a954a0946def199e30fb300ba1c47b',1,'PenningTrap']]]
+ ['test_5fexternal_5fb_5ffield_0',['test_external_B_field',['../classPenningTrapTest.html#ad668d7d875bdc1909a42426bf9dead9e',1,'PenningTrapTest']]],
+ ['test_5fexternal_5fe_5ffield_1',['test_external_E_field',['../classPenningTrapTest.html#a6a303be62039ca2ecccd8252744d4dc8',1,'PenningTrapTest']]],
+ ['test_5fforce_5fon_5fparticle_2',['test_force_on_particle',['../classPenningTrapTest.html#a5f4f0b150e54ce463bb29f76d49883f9',1,'PenningTrapTest']]],
+ ['test_5ftotal_5fforce_5fexternal_3',['test_total_force_external',['../classPenningTrapTest.html#ae6d0c8e0d80338fb7c7edefc97331046',1,'PenningTrapTest']]],
+ ['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']]]
];
diff --git a/docs/search/functions_9.js b/docs/search/functions_9.js
index 8d7b6ff..df5f413 100644
--- a/docs/search/functions_9.js
+++ b/docs/search/functions_9.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['v_5ffunc_0',['v_func',['../classPenningTrap.html#af98a720da60b0e1a62aefa5f5cb37c1e',1,'PenningTrap']]]
+ ['v_5ffunc_0',['v_func',['../classPenningTrap.html#a3c0a44e4e0a94366ff609e81fe463fa2',1,'PenningTrap']]]
];
diff --git a/docs/search/functions_a.js b/docs/search/functions_a.js
index 1b9fc74..209042a 100644
--- a/docs/search/functions_a.js
+++ b/docs/search/functions_a.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['write_5fsimulation_5fto_5fdir_0',['write_simulation_to_dir',['../classPenningTrap.html#abbb832a85139b1a56ebde57d7b8f9a57',1,'PenningTrap']]]
+ ['write_5fsimulation_5fto_5fdir_0',['write_simulation_to_dir',['../classPenningTrap.html#ad8bc4df7ab3eed53b16cfdff38e7760b',1,'PenningTrap']]]
];
diff --git a/docs/search/searchdata.js b/docs/search/searchdata.js
index a67f3d1..8aa7be2 100644
--- a/docs/search/searchdata.js
+++ b/docs/search/searchdata.js
@@ -7,7 +7,7 @@ var indexSectionsWithContent =
4: "bdkmpqrtv",
5: "sv",
6: "p",
- 7: "_adktv",
+ 7: "_acdktv",
8: "bp"
};
diff --git a/docs/search/typedefs_0.js b/docs/search/typedefs_0.js
index 75b98c8..39ee307 100644
--- a/docs/search/typedefs_0.js
+++ b/docs/search/typedefs_0.js
@@ -1,7 +1,7 @@
var searchData=
[
['sim_5farr_0',['sim_arr',['../typedefs_8hpp.html#aec69d34220fff45de238b9e01f2686af',1,'typedefs.hpp']]],
- ['sim_5fcols_1',['sim_cols',['../typedefs_8hpp.html#a7c2dfa854274262c4e00e4ef0ab2ce23',1,'typedefs.hpp']]],
- ['sim_5frows_2',['sim_rows',['../typedefs_8hpp.html#a8502989b1b361725834fc185bd575f66',1,'typedefs.hpp']]],
+ ['sim_5fcols_1',['sim_cols',['../typedefs_8hpp.html#a46482a2697556c00556c9d73f461784f',1,'typedefs.hpp']]],
+ ['sim_5frows_2',['sim_rows',['../typedefs_8hpp.html#a33418f31f28663b8414c8f7182998c22',1,'typedefs.hpp']]],
['simulation_5ft_3',['simulation_t',['../typedefs_8hpp.html#a784799c37b5e4fb8bf4f6368e004dec6',1,'typedefs.hpp']]]
];
diff --git a/docs/search/typedefs_1.js b/docs/search/typedefs_1.js
index fe88abf..d34d7e2 100644
--- a/docs/search/typedefs_1.js
+++ b/docs/search/typedefs_1.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['vec_5f3d_0',['vec_3d',['../typedefs_8hpp.html#a9f33f4962c8fb62cc5ccd0e4e039a8df',1,'typedefs.hpp']]]
+ ['vec3_0',['vec3',['../typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea',1,'typedefs.hpp']]]
];
diff --git a/docs/search/variables_4.js b/docs/search/variables_4.js
index 89df031..081d653 100644
--- a/docs/search/variables_4.js
+++ b/docs/search/variables_4.js
@@ -1,6 +1,7 @@
var searchData=
[
- ['p1_0',['p1',['../main_8cpp.html#a87da4ef9f2cd753579484824310467b8',1,'main.cpp']]],
- ['p2_1',['p2',['../main_8cpp.html#a90f661586eb3c318fdca6f95ebc4fc46',1,'main.cpp']]],
- ['particles_2',['particles',['../classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f',1,'PenningTrap']]]
+ ['p1_0',['p1',['../main_8cpp.html#a2efa69bb9d93049429ce4637075f1d30',1,'main.cpp']]],
+ ['p2_1',['p2',['../main_8cpp.html#ac70b61df65f4336f57ea9b4c35250df7',1,'main.cpp']]],
+ ['particles_2',['particles',['../classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f',1,'PenningTrap']]],
+ ['perturbation_3',['perturbation',['../classPenningTrap.html#ae915f6ad0eef1fb46530e836b6e071e5',1,'PenningTrap']]]
];
diff --git a/docs/search/variables_6.js b/docs/search/variables_6.js
index fa44d82..d549400 100644
--- a/docs/search/variables_6.js
+++ b/docs/search/variables_6.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['r_5fvec_0',['r_vec',['../classParticle.html#af9497cd8f2dcad0fad54f571ddb383e6',1,'Particle']]]
+ ['r_5fvec_0',['r_vec',['../classParticle.html#a1c59101411db43624828b766f87ad460',1,'Particle']]]
];
diff --git a/docs/search/variables_8.js b/docs/search/variables_8.js
index 601b41d..d107c7d 100644
--- a/docs/search/variables_8.js
+++ b/docs/search/variables_8.js
@@ -1,5 +1,5 @@
var searchData=
[
- ['v_5f0_0',['V_0',['../classPenningTrap.html#aaf105828121c4a33cc2b217453c20317',1,'PenningTrap']]],
- ['v_5fvec_1',['v_vec',['../classParticle.html#a879692772803d6ab65fa4993b54aea6e',1,'Particle']]]
+ ['v_5f0_0',['V_0',['../classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89',1,'PenningTrap']]],
+ ['v_5fvec_1',['v_vec',['../classParticle.html#a3a10400add8dd22b8031330c2aafb6fe',1,'Particle']]]
];
diff --git a/docs/test__suite_8cpp.html b/docs/test__suite_8cpp.html
index ccc234d..6211476 100644
--- a/docs/test__suite_8cpp.html
+++ b/docs/test__suite_8cpp.html
@@ -111,6 +111,7 @@ $(document).ready(function(){initNavTree('test__suite_8cpp.html',''); initResiza
#include <sstream>
#include <string>
#include "PenningTrap.hpp"
+#include "constants.hpp"
#include "utils.hpp"
Go to the source code of this file.
@@ -131,7 +132,7 @@ Functions
- Author
- Cory Alexander Balaton (coryab)
-
Janita Ovidie Sandtrøen Willumsen (janitaws)
-- Version
- 0.1
+- Version
- 1.0
- Bug:
- No known bugs
Definition in file test_suite.cpp.
@@ -151,7 +152,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
diff --git a/docs/test__suite_8cpp.js b/docs/test__suite_8cpp.js
index 5bace7d..0a487ff 100644
--- a/docs/test__suite_8cpp.js
+++ b/docs/test__suite_8cpp.js
@@ -1,4 +1,4 @@
var test__suite_8cpp =
[
- [ "PenningTrapTest", "classPenningTrapTest.html", null ]
+ [ "PenningTrapTest", "classPenningTrapTest.html", "classPenningTrapTest" ]
];
\ No newline at end of file
diff --git a/docs/test__suite_8cpp_source.html b/docs/test__suite_8cpp_source.html
index 5341d26..8374f2c 100644
--- a/docs/test__suite_8cpp_source.html
+++ b/docs/test__suite_8cpp_source.html
@@ -107,152 +107,150 @@ $(document).ready(function(){initNavTree('test__suite_8cpp_source.html',''); ini
-
-
-
-
-
-
-
-
-
- 31 std::vector<std::pair<vec_3d, vec_3d>> tests;
-
-
-
-
- 36 tests.push_back(std::make_pair(
vec_3d{10., 0., 0.},
- 37 vec_3d{96.4852558, 0., 0.}));
-
- 39 tests.push_back(std::make_pair(
vec_3d{10., 0., 0.},
- 40 vec_3d{96.4852558, 0., 0.}));
-
- 42 tests.push_back(std::make_pair(
vec_3d{0., 10., 0.},
- 43 vec_3d{0., 96.4852558, 0.}));
-
- 45 tests.push_back(std::make_pair(
vec_3d{0., 0., 10.},
- 46 vec_3d{0., 0., -192.9705116}));
-
-
-
- 50 std::stringstream msg;
- 51 for (
size_t i = 0; i < tests.size(); i++) {
- 52 v = tests.at(i).first;
-
-
-
- 56 msg <<
"Testing the external E field at (" << std::setprecision(2)
- 57 << v(0) <<
"," << v(1) <<
"," << v(2) <<
").";
-
-
-
-
-
-
-
-
-
-
-
-
-
- 73 "Testing the external B field at (0,0,0)");
-
-
-
-
-
-
-
-
-
-
-
-
-
- 89 vec_3d expected{-1., 0., 0.};
-
-
- 92 "Testing the force on a particle at (0,0,0) from a "
- 93 "particle at (1,0,0).");
-
-
- 96 expected =
vec_3d{0, -.024, -.032};
-
-
- 99 "Testing the force on a particle at (0,0,0) from a "
- 100 "particle at (0,3,4).");
-
-
-
-
-
-
-
-
- 111 vec_3d expected{395.58954878, -270.15871624, -57.89115348};
-
-
- 114 "Testing the total external force on a particle at "
- 115 "(1,2,3) with velocity (3,4,5)");
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 33 std::vector<std::pair<vec3, vec3>> tests;
+
+ 35 tests.push_back(std::make_pair(
vec3{0., 0., 0.},
vec3{0., 0., 0.}));
+
+
+ 38 std::make_pair(
vec3{10., 0., 0.},
vec3{96.4852558, 0., 0.}));
+
+
+ 41 std::make_pair(
vec3{10., 0., 0.},
vec3{96.4852558, 0., 0.}));
+
+
+ 44 std::make_pair(
vec3{0., 10., 0.},
vec3{0., 96.4852558, 0.}));
+
+
+ 47 std::make_pair(
vec3{0., 0., 10.},
vec3{0., 0., -192.9705116}));
+
+
+
+ 51 std::stringstream msg;
+ 52 for (
size_t i = 0; i < tests.size(); i++) {
+ 53 v = tests.at(i).first;
+
+
+
+ 57 msg <<
"Testing the external E field at (" << std::setprecision(2)
+ 58 << v(0) <<
"," << v(1) <<
"," << v(2) <<
").";
+
+
+
+
+
+
+
+
+
+
+ 71 vec3 expected{0., 0.,
T};
+
+
+ 74 "Testing the external B field at (0,0,0)");
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 91 vec3 expected{-1., 0., 0.};
+
+
+ 94 "Testing the force on a particle at (0,0,0) from a "
+ 95 "particle at (1,0,0).");
+
+
+ 98 expected =
vec3{0, -.024, -.032};
+
+
+ 101 "Testing the force on a particle at (0,0,0) from a "
+ 102 "particle at (0,3,4).");
+
+
+
+
+
+
+
+ 112 vec3 expected{395.58954878, -270.15871624, -57.89115348};
+
+
+ 115 "Testing the total external force on a particle at "
+ 116 "(1,2,3) with velocity (3,4,5)");
+
+
+
+
+
+
- 127 vec_3d expected{0., 0., 0.};
-
+ 127 vec3 expected{0., 0., 0.};
+
130 "Testing the total force of all particles on particle 0 "
131 "with only a single particle");
-
-
-
-
-
-
-
- 140 expected =
vec_3d().fill(-3473.383325);
-
-
- 143 "Testing the total force of all particles on particle 0 "
- 144 "with 3 other particles.");
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ 137 expected =
vec3().fill(-138935.333);
+
+
+ 140 "Testing the total force of all particles on particle 0 "
+ 141 "with 3 other particles.");
+
+
+
+
+
+
+
+
+
+
+
+
+
A class for simulating a Penning trap.
-A class that holds attributes of a particle.
-Test class for the Penning trap.
-static void test_total_force_particles()
Test that the total force of all particles on a single particle returns expected results.
-static void test_external_E_field()
Test that the external E field gives correct values.
-static void test_external_B_field()
Test that the external B field gives correct values.
-static void test_force_on_particle()
Test that the force between particles gives expected results.
-static void test_total_force_external()
Test that the total external force returns expected results.
-A class that simulates a Penning trap.
-vec_3d external_E_field(vec_3d r)
Calculate E at point r.
-vec_3d total_force_particles(unsigned int i)
Calculate the total force on a particle p_i from other particles.
-void add_particle(Particle particle)
Add a particle to the system.
-vec_3d force_on_particle(unsigned int i, unsigned int j)
Calculate the force between 2 particles.
-vec_3d external_B_field(vec_3d r)
Calculate B at point r.
-vec_3d total_force_external(unsigned int i)
Calculate the total external force on a particle.
-
-arma::vec::fixed< 3 > vec_3d
Typedef for a fixed 3d arma vector.
+A class that holds attributes of a particle.
+Test class for the Penning trap.
+void test_force_on_particle()
Test that the force between particles gives expected results.
+void test_total_force_particles()
Test that the total force of all particles on a single particle returns expected results.
+void test_external_E_field()
Test that the external E field gives correct values.
+void test_external_B_field()
Test that the external B field gives correct values.
+void test_total_force_external()
Test that the total external force returns expected results.
+A class that simulates a Penning trap.
+vec3 total_force_external(uint i)
Calculate the total external force on a particle.
+vec3 total_force_particles(uint i)
Calculate the total force on a particle p_i from other particles.
+vec3 external_B_field(vec3 r)
Calculate B at point r.
+vec3 external_E_field(vec3 r)
Calculate E at point r.
+void add_particle(Particle particle)
Add a particle to the system.
+vec3 force_on_particle(uint i, uint j)
Calculate the force between 2 particles.
+
+
+arma::vec::fixed< 3 > vec3
Typedef for a fixed 3d arma vector.
Function prototypes and macros that are useful.
#define ASSERT(expr, msg)
A prettier assertion function.
-bool close_to(arma::vec &a, arma::vec &b, double tol=1e-8)
Test if two armadillo vectors are close to each other.
+bool close_to(arma::vec &a, arma::vec &b, double tol=1e-8)
Test if two armadillo vectors are close to each other.
diff --git a/docs/typedefs_8hpp.html b/docs/typedefs_8hpp.html
index 1225a91..60e3c9c 100644
--- a/docs/typedefs_8hpp.html
+++ b/docs/typedefs_8hpp.html
@@ -120,18 +120,18 @@ Classes
|
-| typedef std::vector< arma::vec::fixed< 3 > > | sim_cols |
-| | Typedef for the column of the result vector from simulating particles.
|
-| |
-| typedef std::vector< arma::vec::fixed< 3 > > | sim_rows |
-| | Typedef for the row of the result vector from simulating particles.
|
-| |
-| typedef std::vector< sim_cols > | sim_arr |
+| typedef arma::vec::fixed< 3 > | vec3 |
+| | Typedef for a fixed 3d arma vector.
|
+| |
+| typedef std::vector< vec3 > | sim_cols |
+| | Typedef for the column of the result vector from simulating particles.
|
+| |
+| typedef std::vector< vec3 > | sim_rows |
+| | Typedef for the row of the result vector from simulating particles.
|
+| |
+| typedef std::vector< sim_cols > | sim_arr |
| | Typedef for the result of the simulate method.
|
| |
-| typedef arma::vec::fixed< 3 > | vec_3d |
-| | Typedef for a fixed 3d arma vector.
|
-| |
|
typedef struct simulation | simulation_t |
| | Typedef for PenningTrap::simulation return value.
|
@@ -155,68 +155,68 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
-◆ sim_cols
+
+◆ sim_cols
Typedef for the column of the result vector from simulating particles.
-
Definition at line 24 of file typedefs.hpp.
+
Definition at line 28 of file typedefs.hpp.
-
-◆ sim_rows
+
+◆ sim_rows
Typedef for the row of the result vector from simulating particles.
-
Definition at line 28 of file typedefs.hpp.
+
Definition at line 32 of file typedefs.hpp.
-
-◆ vec_3d
+
+◆ vec3
- | typedef arma::vec::fixed<3> vec_3d |
+ typedef arma::vec::fixed<3> vec3 |
diff --git a/docs/typedefs_8hpp.js b/docs/typedefs_8hpp.js
index ddf845a..3b3b8bd 100644
--- a/docs/typedefs_8hpp.js
+++ b/docs/typedefs_8hpp.js
@@ -2,8 +2,8 @@ var typedefs_8hpp =
[
[ "simulation", "structsimulation.html", null ],
[ "sim_arr", "typedefs_8hpp.html#aec69d34220fff45de238b9e01f2686af", null ],
- [ "sim_cols", "typedefs_8hpp.html#a7c2dfa854274262c4e00e4ef0ab2ce23", null ],
- [ "sim_rows", "typedefs_8hpp.html#a8502989b1b361725834fc185bd575f66", null ],
+ [ "sim_cols", "typedefs_8hpp.html#a46482a2697556c00556c9d73f461784f", null ],
+ [ "sim_rows", "typedefs_8hpp.html#a33418f31f28663b8414c8f7182998c22", null ],
[ "simulation_t", "typedefs_8hpp.html#a784799c37b5e4fb8bf4f6368e004dec6", null ],
- [ "vec_3d", "typedefs_8hpp.html#a9f33f4962c8fb62cc5ccd0e4e039a8df", null ]
+ [ "vec3", "typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea", null ]
];
\ No newline at end of file
diff --git a/docs/typedefs_8hpp_source.html b/docs/typedefs_8hpp_source.html
index b7cf904..3cb6d86 100644
--- a/docs/typedefs_8hpp_source.html
+++ b/docs/typedefs_8hpp_source.html
@@ -108,13 +108,13 @@ $(document).ready(function(){initNavTree('typedefs_8hpp_source.html',''); initRe
- 24typedef std::vector<arma::vec::fixed<3>>
sim_cols;
-
- 28typedef std::vector<arma::vec::fixed<3>>
sim_rows;
+ 23typedef arma::vec::fixed<3>
vec3;
+
+
-
+
-
+
@@ -123,11 +123,11 @@ $(document).ready(function(){initNavTree('typedefs_8hpp_source.html',''); initRe
Typedef for PenningTrap::simulation return value.
+std::vector< vec3 > sim_rows
Typedef for the row of the result vector from simulating particles.
+arma::vec::fixed< 3 > vec3
Typedef for a fixed 3d arma vector.
+std::vector< vec3 > sim_cols
Typedef for the column of the result vector from simulating particles.
struct simulation simulation_t
Typedef for PenningTrap::simulation return value.
-std::vector< arma::vec::fixed< 3 > > sim_cols
Typedef for the column of the result vector from simulating particles.
-std::vector< arma::vec::fixed< 3 > > sim_rows
Typedef for the row of the result vector from simulating particles.
-arma::vec::fixed< 3 > vec_3d
Typedef for a fixed 3d arma vector.
-std::vector< sim_cols > sim_arr
Typedef for the result of the simulate method.
+std::vector< sim_cols > sim_arr
Typedef for the result of the simulate method.
diff --git a/docs/utils_8cpp.html b/docs/utils_8cpp.html
index f76d7e7..d94bebf 100644
--- a/docs/utils_8cpp.html
+++ b/docs/utils_8cpp.html
@@ -182,7 +182,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
- Returns
- bool
-Definition at line 60 of file utils.cpp.
+Definition at line 58 of file utils.cpp.
@@ -250,7 +250,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-Definition at line 41 of file utils.cpp.
+Definition at line 40 of file utils.cpp.
@@ -291,7 +291,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
- Returns
- bool Success/Fail
-Definition at line 74 of file utils.cpp.
+Definition at line 72 of file utils.cpp.
diff --git a/docs/utils_8cpp_source.html b/docs/utils_8cpp_source.html
index 24a0002..f124b46 100644
--- a/docs/utils_8cpp_source.html
+++ b/docs/utils_8cpp_source.html
@@ -124,73 +124,71 @@ $(document).ready(function(){initNavTree('utils_8cpp_source.html',''); initResiz
34 std::cout <<
"message: " << msg <<
"\n\n";
-
-
-
-
-
-
- 41void m_assert(
bool expr, std::string expr_str, std::string f, std::string file,
- 42 int line, std::string msg)
-
- 44 std::string new_assert(f.size() + (expr ? 4 : 6),
'-');
- 45 std::cout <<
"\x1B[36m" << new_assert <<
"\033[0m\n";
- 46 std::cout << f <<
": ";
-
- 48 std::cout <<
"\x1B[32mOK\033[0m\n";
-
-
-
- 52 std::cout <<
"\x1B[31mFAIL\033[0m\n";
-
- 54 std::cout << file <<
" " << line <<
": Assertion \"" << expr_str
-
-
-
-
-
- 60bool close_to(arma::vec &a, arma::vec &b,
double tol)
-
- 62 if (a.n_elem != b.n_elem) {
-
-
-
- 66 for (
size_t i = 0; i < a.n_elem; i++) {
- 67 if (std::abs(a(i) - b(i)) >= tol) {
-
-
-
-
-
-
- 74bool mkpath(std::string path,
int mode)
-
-
- 77 std::string::size_type pos = -1;
-
-
- 80 if (path.back() !=
'/') {
-
-
-
-
- 85 pos = path.find(
'/', pos);
- 86 if (pos != std::string::npos) {
- 87 cur_dir = path.substr(0, pos);
- 88 if (mkdir(cur_dir.c_str(), mode) != 0 && stat(cur_dir.c_str(), &buf) != 0) {
-
-
-
-
-
-
-
-
-
-bool close_to(arma::vec &a, arma::vec &b, double tol)
Test if two armadillo vectors are close to each other.
+
+
+
+
+
+ 40void m_assert(
bool expr, std::string expr_str, std::string f, std::string file,
+ 41 int line, std::string msg)
+
+ 43 std::string new_assert(f.size() + (expr ? 4 : 6),
'-');
+ 44 std::cout <<
"\x1B[36m" << new_assert <<
"\033[0m\n";
+ 45 std::cout << f <<
": ";
+
+ 47 std::cout <<
"\x1B[32mOK\033[0m\n";
+
+
+ 50 std::cout <<
"\x1B[31mFAIL\033[0m\n";
+
+ 52 std::cout << file <<
" " << line <<
": Assertion \"" << expr_str
+
+
+
+
+
+ 58bool close_to(arma::vec &a, arma::vec &b,
double tol)
+
+ 60 if (a.n_elem != b.n_elem) {
+
+
+
+ 64 for (
size_t i = 0; i < a.n_elem; i++) {
+ 65 if (std::abs(a(i) - b(i)) >= tol) {
+
+
+
+
+
+
+ 72bool mkpath(std::string path,
int mode)
+
+
+ 75 std::string::size_type pos = -1;
+
+
+ 78 if (path.back() !=
'/') {
+
+
+
+
+ 83 pos = path.find(
'/', pos);
+ 84 if (pos != std::string::npos) {
+ 85 cur_dir = path.substr(0, pos);
+ 86 if (mkdir(cur_dir.c_str(), mode) != 0
+ 87 && stat(cur_dir.c_str(), &buf) != 0) {
+
+
+
+
+
+
+
+
+bool close_to(arma::vec &a, arma::vec &b, double tol)
Test if two armadillo vectors are close to each other.
std::string scientific_format(double d, int width, int prec)
Turns a double into a string written in scientific format.
-bool mkpath(std::string path, int mode)
Make path given.
-void m_assert(bool expr, std::string expr_str, std::string f, std::string file, int line, std::string msg)
Test an expression, confirm that test is ok, or abort execution.
+bool mkpath(std::string path, int mode)
Make path given.
+void m_assert(bool expr, std::string expr_str, std::string f, std::string file, int line, std::string msg)
Test an expression, confirm that test is ok, or abort execution.
Function prototypes and macros that are useful.
diff --git a/docs/utils_8hpp.html b/docs/utils_8hpp.html
index 129e846..44e8275 100644
--- a/docs/utils_8hpp.html
+++ b/docs/utils_8hpp.html
@@ -121,7 +121,7 @@ Macros
| #define | DEBUG(msg) |
| | Writes a debug message.
|
| |
-| #define | ASSERT(expr, msg) |
+| #define | ASSERT(expr, msg) m_assert(expr, #expr, __METHOD_NAME__, __FILE__, __LINE__, msg) |
| | A prettier assertion function.
|
| |
| #define | __METHOD_NAME__ methodName(__PRETTY_FUNCTION__) |
@@ -196,15 +196,11 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
|
) |
- | |
+ | m_assert(expr, #expr, __METHOD_NAME__, __FILE__, __LINE__, msg) |
-
Value:
-
__LINE__, msg)
-
void m_assert(bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg)
Test an expression, confirm that test is ok, or abort execution.
-
#define __METHOD_NAME__
Get the name of the current method/function without the return type.
-
+
A prettier assertion function.
This macro calls the m_assert function which is a more informative assertion function than the regular assert function from cassert.
@@ -280,7 +276,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
- Returns
- bool
-
Definition at line 60 of file utils.cpp.
+
Definition at line 58 of file utils.cpp.
@@ -348,7 +344,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-Definition at line 41 of file utils.cpp.
+Definition at line 40 of file utils.cpp.
@@ -389,7 +385,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
- Returns
- bool Success/Fail
-Definition at line 74 of file utils.cpp.
+Definition at line 72 of file utils.cpp.
diff --git a/docs/utils_8hpp_source.html b/docs/utils_8hpp_source.html
index 23a5d44..576b8d7 100644
--- a/docs/utils_8hpp_source.html
+++ b/docs/utils_8hpp_source.html
@@ -113,53 +113,42 @@ $(document).ready(function(){initNavTree('utils_8hpp_source.html',''); initResiz
- 34 #define DEBUG(msg) std::cout << __FILE__ << " " << __LINE__ << ": " \
-
+
+ 35 std::cout << __FILE__ << " " << __LINE__ << ": " << msg << std::endl
-
+
- 46#define ASSERT(expr, msg) m_assert(expr, #expr, __METHOD_NAME__, __FILE__, \
-
+ 46#define ASSERT(expr, msg) \
+ 47 m_assert(expr, #expr, __METHOD_NAME__, __FILE__, __LINE__, msg)
52#define __METHOD_NAME__ methodName(__PRETTY_FUNCTION__)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 114bool close_to(arma::vec &a, arma::vec &b,
double tol=1e-8);
-
-
- 127static inline std::string methodName(
const std::string& pretty_function)
-
- 129 size_t colons = pretty_function.find(
"::");
- 130 size_t begin = pretty_function.substr(0,colons).rfind(
" ") + 1;
- 131 size_t end = pretty_function.rfind(
"(") - begin;
-
- 133 return pretty_function.substr(begin,end) +
"()";
-
-
-
- 147bool mkpath(std::string path,
int mode = 0777);
-
-
-void m_assert(bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg)
Test an expression, confirm that test is ok, or abort execution.
-bool mkpath(std::string path, int mode=0777)
Make path given.
-bool close_to(arma::vec &a, arma::vec &b, double tol=1e-8)
Test if two armadillo vectors are close to each other.
+
+
+
+
+
+ 92void m_assert(
bool expr, std::string expr_str, std::string func,
+ 93 std::string file,
int line, std::string msg);
+
+ 106bool close_to(arma::vec &a, arma::vec &b,
double tol = 1e-8);
+
+ 118static inline std::string methodName(
const std::string &pretty_function)
+
+ 120 size_t colons = pretty_function.find(
"::");
+ 121 size_t begin = pretty_function.substr(0, colons).rfind(
" ") + 1;
+ 122 size_t end = pretty_function.rfind(
"(") - begin;
+
+ 124 return pretty_function.substr(begin, end) +
"()";
+
+
+ 137bool mkpath(std::string path,
int mode = 0777);
+
+
+void m_assert(bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg)
Test an expression, confirm that test is ok, or abort execution.
+bool mkpath(std::string path, int mode=0777)
Make path given.
+bool close_to(arma::vec &a, arma::vec &b, double tol=1e-8)
Test if two armadillo vectors are close to each other.
std::string scientific_format(double d, int width=20, int prec=10)
Turns a double into a string written in scientific format.