diff --git a/docs/100_particles.gif b/docs/100_particles.gif
index 3dde053..337c6e5 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 98aaf8d..b3fd0e9 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 0.1
-Bug: No known bugs
+Bug: No known bugs
Definition in file Particle.cpp .
diff --git a/docs/Particle_8cpp_source.html b/docs/Particle_8cpp_source.html
index 2eaf72e..13c1950 100644
--- a/docs/Particle_8cpp_source.html
+++ b/docs/Particle_8cpp_source.html
@@ -102,24 +102,24 @@ $(document).ready(function(){initNavTree('Particle_8cpp_source.html',''); initRe
Go to the documentation of this file.
-
-
-
-
17 arma::vec::fixed<3> r_vec,
-
18 arma::vec::fixed<3> v_vec)
-
-
-
-
-
-
-
+
+
+
+
16 arma::vec::fixed<3> r_vec,
+
17 arma::vec::fixed<3> v_vec)
+
+
+
+
+
+
+
A class that holds the properties of a particle.
-
Particle(double q, double m, arma::vec::fixed< 3 > r_vec, arma::vec::fixed< 3 > v_vec)
Initialize the particle.
-
arma::vec::fixed< 3 > v_vec
velocity
-
-
arma::vec::fixed< 3 > r_vec
position
-
+
+
Particle(double q, double m, vec_3d r_vec, vec_3d v_vec)
Initialize the particle.
+
+
+
diff --git a/docs/Particle_8hpp.html b/docs/Particle_8hpp.html
index 3516260..00fc0e2 100644
--- a/docs/Particle_8hpp.html
+++ b/docs/Particle_8hpp.html
@@ -107,6 +107,7 @@ $(document).ready(function(){initNavTree('Particle_8hpp.html',''); initResizable
A class that holds the properties of a particle.
More...
#include <armadillo>
+
#include "typedefs.hpp "
Go to the source code of this file.
diff --git a/docs/Particle_8hpp_source.html b/docs/Particle_8hpp_source.html
index dbb28de..f3339f5 100644
--- a/docs/Particle_8hpp_source.html
+++ b/docs/Particle_8hpp_source.html
@@ -107,28 +107,30 @@ $(document).ready(function(){initNavTree('Particle_8hpp_source.html',''); initRe
-
-
-
-
-
-
-
-
-
- 33 arma::vec::fixed<3>
r_vec ,
- 34 arma::vec::fixed<3>
v_vec );
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-A class that holds attributes of a particle.
-arma::vec::fixed< 3 > v_vec
velocity
-
-arma::vec::fixed< 3 > r_vec
position
-
-A class that simulates a Penning trap.
+
+
+
+
+A class that holds attributes of a particle.
+
+
+
+
+A class that simulates a Penning trap.
+Useful typedefs for cleaner code.
+arma::vec::fixed< 3 > vec_3d
Typedef for a fixed 3d arma vector.
diff --git a/docs/PenningTrap_8cpp.html b/docs/PenningTrap_8cpp.html
index 62355e1..5817ff6 100644
--- a/docs/PenningTrap_8cpp.html
+++ b/docs/PenningTrap_8cpp.html
@@ -106,6 +106,7 @@ $(document).ready(function(){initNavTree('PenningTrap_8cpp.html',''); initResiza
More...
Go to the source code of this file.
@@ -115,10 +116,7 @@ $(document).ready(function(){initNavTree('PenningTrap_8cpp.html',''); initResiza
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 0.1
-Bug: No known bugs
-Todo: Implement evolve_RK4
-Implement evolve_forward_euler
-
+Bug: No known bugs
Definition in file PenningTrap.cpp .
diff --git a/docs/PenningTrap_8cpp_source.html b/docs/PenningTrap_8cpp_source.html
index 993de8e..282e5c2 100644
--- a/docs/PenningTrap_8cpp_source.html
+++ b/docs/PenningTrap_8cpp_source.html
@@ -102,205 +102,311 @@ $(document).ready(function(){initNavTree('PenningTrap_8cpp_source.html',''); ini
Go to the documentation of this file.
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
34 arma::vec::fixed<3> res;
-
35 double f = this->
V_0 / (this->
d * this->
d );
-
-
-
-
-
-
-
-
-
-
45 arma::vec::fixed<3> res{0., 0., this->
B_0 };
-
-
-
-
-
-
-
-
53 arma::vec::fixed<3> res =
-
-
-
-
57 double norm = arma::norm(res);
-
-
-
60 res *= this->
particles .at(j).q / (norm * norm * norm);
-
-
-
-
-
-
-
-
-
-
-
71 arma::vec::fixed<3> v_cross_B{p.
v_vec (1) * B(2) - p.
v_vec (2) * B(1),
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
86 for (
int j = 0; j < this->
particles .size(); j++) {
-
-
-
-
-
-
-
-
94 res *=
K_E * (p.
q / p.
m );
-
-
-
-
-
-
-
-
-
-
-
-
106 std::vector<Particle> tmp_particles = this->
particles ;
-
-
108 arma::vec::fixed<3> *k_v =
new arma::vec::fixed<3>[this->
particles .size()*4];
-
109 arma::vec::fixed<3> *k_r =
new arma::vec::fixed<3>[this->
particles .size()*4];
+
+
28 std::function<
double (
double )> V_0,
double d,
double t)
+
+
+
+
32 for (
size_t j = 0; j < i; j++) {
+
33 r =
vec_3d ().randn() * .1 * this->
d ;
+
34 v =
vec_3d ().randn() * .1 * this->
d ;
+
+
+
+
+
+
40 std::function<
double (
double )> V_0,
double d,
double t)
+
+
+
+
+
+
+
+
+
+
50 return .5 * dt * this->
k_v [0][j];
+
+
52 return .5 * dt * this->k_v[1][j];
+
+
54 return dt * this->k_v[2][j];
+
+
56 return (dt / 6.) * (this->k_v[0][j].eval() + this->k_v[1][j].eval() +
+
57 this->k_v[2][j].eval() + this->k_v[3][j].eval());
+
+
59 std::cout <<
"Not valid!" << std::endl;
+
+
+
+
+
+
+
+
+
68 return .5 * dt * this->
k_r [0][j];
+
+
70 return .5 * dt * this->k_r[1][j];
+
+
72 return dt * this->k_r[2][j];
+
+
74 return (dt / 6.) * (this->k_r[0][j].eval() + this->k_r[1][j].eval() +
+
75 this->k_r[2][j].eval() + this->k_r[3][j].eval());
+
+
77 std::cout <<
"Not valid!" << std::endl;
+
+
+
+
+
+
+
84 this->particles.push_back(particle);
+
+
+
+
+
+
90 double f = this->
V_0 (this->
t ) / (this->
d * this->
d );
+
+
+
+
+
+
+
97 return vec_3d {0., 0., this->B_0};
+
+
+
+
+
+
+
+
+
+
107 double norm = arma::norm(res, 2);
+
+
-
-
-
113 for (
int i=0; i<size; i++) {
-
-
-
+
111 return vec_3d (res * p_j.
q / (norm * norm * norm));
+
+
+
+
+
-
118 for (
int i=0; i<size; i++) {
-
-
-
121 p->
v_vec = tmp_particles.at(i).v_vec + (dt/2)*k_v[i];
-
122 p->
r_vec = tmp_particles.at(i).r_vec + (dt/2)*k_r[i];
-
-
+
118 if (arma::norm(p.
r_vec ) > this->d) {
+
119 return vec_3d {0., 0., 0.};
+
+
+
+
+
124 arma::cross(p.
v_vec , this->external_B_field(p.
r_vec )));
-
126 for (
int i=0; i<size; i++) {
-
-
128 k_r[1*size + i] = this->
particles .at(i).v_vec;
-
-
-
131 for (
int i=0; i<size; i++) {
-
-
-
134 p->
v_vec = tmp_particles.at(i).v_vec + (dt/2)*k_v[1*size + i];
-
135 p->
r_vec = tmp_particles.at(i).r_vec + (dt/2)*k_r[1*size + i];
-
-
-
138 for (
int i=0; i<size; i++) {
-
-
140 k_r[2*size + i] = this->
particles .at(i).v_vec;
+
+
+
+
+
+
+
+
+
+
135 for (
size_t j = 0; j < this->particles.size(); j++) {
+
+
+
+
+
-
143 for (
int i=0; i<size; i++) {
-
+
+
-
146 p->
v_vec = tmp_particles.at(i).v_vec + dt*k_v[2*size + i];
-
147 p->
r_vec = tmp_particles.at(i).r_vec + dt*k_r[2*size + i];
-
-
+
+
+
+
-
151 for (
int i=0; i<size; i++) {
-
-
153 k_r[3*size + i] = this->
particles .at(i).v_vec;
-
-
-
156 for (
int i=0; i<size; i++) {
-
-
-
159 p->
v_vec = tmp_particles.at(i).v_vec + dt*(k_v[i] + k_v[size + i] + k_v[2*size + i] + k_v[3*size + i])/6;
-
160 p->
r_vec = tmp_particles.at(i).r_vec + dt*(k_r[i] + k_r[size + i] + k_r[2*size + i] + k_r[3*size + i])/6;
-
-
-
-
-
+
+
+
+
154 std::vector<Particle> original_particles = this->
particles ;
+
155 std::vector<Particle> tmp_particles = this->
particles ;
+
+
+
158 if (particle_interaction) {
+
+
+
+
+
+
+
165 size_t size = this->particles.size();
-
-
-
169 std::vector<Particle> new_state = this->
particles ;
-
-
-
-
173 #pragma omp parallel for private(p)
-
174 for (
int i = 0; i < this->
particles .size(); i++) {
-
175 p = &new_state.at(i);
-
-
-
-
-
-
-
-
183 arma::vec PenningTrap::get_particle(
int i)
-
-
-
-
-
188 double PenningTrap::get_d()
-
-
-
+
+
+
+
170 for (
size_t i = 0; i < 4; i++) {
+
171 #pragma omp parallel for
+
172 for (
size_t j = 0; j < this->particles.size(); j++) {
+
173 this->
k_v [i][j] = (this->*force)(j) / this->particles[j].m;
+
174 this->
k_r [i][j] = this->particles[j].v_vec;
+
+
+
+
178 p->
v_vec = original_particles[j].v_vec + this->
v_func (i, j, dt);
+
179 p->
r_vec = original_particles[j].r_vec + this->
r_func (i, j, dt);
+
+
181 this->particles = tmp_particles;
+
+
+
+
+
+
+
188 std::vector<Particle> new_state = this->
particles ;
+
+
+
+
+
193 if (particle_interaction) {
+
+
+
+
+
+
+
200 #pragma omp parallel for private(p)
+
201 for (
size_t i = 0; i < this->particles.size(); i++) {
+
+
203 p->
v_vec += dt * (this->*force)(i) / p->
m ;
+
204 p->
r_vec += dt * this->particles[i].v_vec;
+
+
+
207 this->particles = new_state;
+
+
+
+
+
212 std::string method,
bool particle_interaction)
+
+
214 double dt = time / (double)steps;
+
+
+
+
+
219 if (method ==
"rk4" ) {
+
+
+
222 else if (method ==
"euler" ) {
+
+
+
+
226 std::cout <<
"Not a valid method!" << std::endl;
+
+
+
+
230 for (
size_t j = 0; j < steps; j++) {
+
231 for (
size_t i = 0; i < this->particles.size(); i++) {
+
232 res[i][j] = this->particles[i].r_vec;
+
+
234 (this->*func)(dt, particle_interaction);
+
+
+
+
+
+
+
241 int steps, std::string method,
+
242 bool particle_interaction)
+
+
244 if (path.back() !=
'/' ) {
+
+
+
247 if (
mkpath (path, 0777) != 0) {
+
248 std::cout <<
"Hello" << std::endl;
+
+
+
+
252 sim_arr res = this->
simulate (time, steps, method, particle_interaction);
+
+
+
+
256 #pragma omp parallel for private(ofile)
+
257 for (
size_t i = 0; i < this->particles.size(); i++) {
+
258 ofile.open(path +
"particle_" + std::to_string(i) +
".txt" );
+
259 for (
vec_3d &vec : res[i]) {
+
260 ofile << vec(0) <<
"," << vec(1) <<
"," << vec(2) <<
"\n" ;
+
+
+
+
+
+
+
+
268 sim_arr res = this->
simulate (time, steps, method, particle_interaction);
+
+
270 int particles_left = 0;
+
+
272 for (
Particle p : this->particles) {
+
273 if (arma::norm(p.r_vec) < this->d) {
+
+
+
+
+
278 return (
double ) particles_left / (double) this->particles.size();
+
+
A class for simulating a Penning trap.
-
A class that holds attributes of a particle.
-
arma::vec::fixed< 3 > v_vec
velocity
-
-
arma::vec::fixed< 3 > r_vec
position
-
-
std::vector< Particle > particles
The particles in the Penning trap.
-
arma::vec total_force_external(int i)
Calculate the total external force on a particle.
-
double B_0
Magnetic field strength.
-
arma::vec total_force_particles(int i)
Calculate the total force on a particle from other particles.
-
arma::vec external_B_field(arma::vec r)
Calculate B at point r.
-
arma::vec force_on_particle(int i, int j)
Calculate the force between 2 particles.
-
void evolve_forward_euler(double dt)
Go forward one timestep using the forward Euler method.
-
double d
Characteristic dimension.
-
void add_particle(Particle particle)
Add a particle to the system.
-
double V_0
Applied potential.
-
PenningTrap(double B_0=T, double V_0=25.*V/1000., double d=500.)
Set B_0, V_0 and d.
-
arma::vec total_force(int i)
calculate the total force on a particle.
-
arma::vec external_E_field(arma::vec r)
Calculate E at point r.
-
void evolve_RK4(double dt)
Go forward one timestep using the RK4 method.
+
A class that holds attributes of a particle.
+
+
+
+
+
A class that simulates a Penning trap.
+
std::vector< Particle > particles
The particles in the 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...
+
double B_0
Magnetic field strength.
+
vec_3d external_E_field(vec_3d r)
Calculate E at point r.
+
vec_3d total_force(unsigned int i)
calculate the total force on a particle p_i.
+
+
void evolve_RK4(double dt, bool particle_interaction=true)
Go forward one timestep using the RK4 method.
+
vec_3d r_func(unsigned int i, unsigned int j, double dt)
Helper for evolve_RK4 when calculating values.
+
vec_3d total_force_particles(unsigned int i)
Calculate the total force on a particle p_i from other particles.
+
sim_arr simulate(double time, unsigned int steps, std::string method="rk4", bool particle_interaction=true)
Simulate the particle system inside the Penning trap over a certain amount of time.
+
double d
Characteristic dimension.
+
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.
+
std::function< double(double)> V_0
Applied potential.
+
void evolve_forward_euler(double dt, bool particle_interaction=true)
Go forward one timestep using the forward Euler method.
+
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.
+
vec_3d external_B_field(vec_3d r)
Calculate B at point r.
+
PenningTrap(double B_0=T, std::function< double(double)> V_0=[](double t) { return 25. *V/1000.;}, double d=500., double t=0.)
Constructor for the PenningTrap class.
+
vec_3d total_force_external(unsigned int i)
Calculate the total external force on a particle.
+
+
vec_3d v_func(unsigned int i, unsigned int j, double dt)
Helper for evolve_RK4 when calculating values.
#define K_E
Coulomb constant. unit: .
+
Useful typedefs for cleaner code.
+
std::vector< arma::vec::fixed< 3 > > sim_cols
Typedef for the column 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.
Function prototypes and macros that are useful.
+
bool mkpath(std::string path, int mode=0777)
Make path given.
diff --git a/docs/PenningTrap_8hpp.html b/docs/PenningTrap_8hpp.html
index 306bc89..5f6ee45 100644
--- a/docs/PenningTrap_8hpp.html
+++ b/docs/PenningTrap_8hpp.html
@@ -110,6 +110,7 @@ $(document).ready(function(){initNavTree('PenningTrap_8hpp.html',''); initResiza
#include <omp.h>
#include "Particle.hpp "
#include "constants.hpp "
+#include "typedefs.hpp "
Go to the source code of this file.
diff --git a/docs/PenningTrap_8hpp_source.html b/docs/PenningTrap_8hpp_source.html
index 02b2aed..dfdddbe 100644
--- a/docs/PenningTrap_8hpp_source.html
+++ b/docs/PenningTrap_8hpp_source.html
@@ -110,63 +110,106 @@ $(document).ready(function(){initNavTree('PenningTrap_8hpp_source.html',''); ini
-
- 21 #pragma omp declare reduction( + : arma::vec : omp_out += omp_in ) \
- 22 initializer( omp_priv = omp_orig )
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 83 arma::vec get_particle(
int i);
-
-
-
-
-
+
+
+ 22 #pragma omp declare reduction(+ : vec_3d : omp_out += omp_in) \
+ 23 initializer(omp_priv = omp_orig)
+
+
+
+
+ 33 std::function<double(
double )>
V_0 ;
+
+
+
+
+
+
+ 52 vec_3d v_func (
unsigned int i,
unsigned int j,
double dt);
+
+ 64 vec_3d r_func (
unsigned int i,
unsigned int j,
double dt);
+
+
+
+
+ 76 std::function<
double (
double )>
V_0 =
+ 77 [](
double t ) {
return 25. *
V / 1000.; },
+ 78 double d = 500.,
double t = 0.);
+
+
+ 89 unsigned int i,
double B_0 =
T ,
+ 90 std::function<
double (
double )>
V_0 =
+ 91 [](
double t ) {
return 25. *
V / 1000.; },
+ 92 double d = 500.,
double t = 0.);
+
+
+
+ 104 std::function<
double (
double )>
V_0 =
+ 105 [](
double t ) {
return 25. *
V / 1000.; },
+ 106 double d = 500.,
double t = 0.);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 174 void evolve_RK4 (
double dt,
bool particle_interaction =
true );
+
+
+
+
+ 192 std::string method =
"rk4" ,
+ 193 bool particle_interaction =
true );
+
+
+ 204 unsigned int steps, std::string method =
"rk4" ,
+ 205 bool particle_interaction =
true );
+
+
+ 218 std::string method =
"rk4" ,
+ 219 bool particle_interaction =
true );
+
+
+
A class that holds the properties of a particle.
-A class that holds attributes of a particle.
-A class that simulates a Penning trap.
-std::vector< Particle > particles
The particles in the Penning trap.
-arma::vec total_force_external(int i)
Calculate the total external force on a particle.
-double B_0
Magnetic field strength.
-arma::vec total_force_particles(int i)
Calculate the total force on a particle from other particles.
-arma::vec external_B_field(arma::vec r)
Calculate B at point r.
-arma::vec force_on_particle(int i, int j)
Calculate the force between 2 particles.
-void evolve_forward_euler(double dt)
Go forward one timestep using the forward Euler method.
-double d
Characteristic dimension.
-void add_particle(Particle particle)
Add a particle to the system.
-double V_0
Applied potential.
-arma::vec total_force(int i)
calculate the total force on a particle.
-arma::vec external_E_field(arma::vec r)
Calculate E at point r.
-void evolve_RK4(double dt)
Go forward one timestep using the RK4 method.
+A class that holds attributes of a particle.
+A class that simulates a Penning trap.
+std::vector< Particle > particles
The particles in the 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...
+double B_0
Magnetic field strength.
+vec_3d external_E_field(vec_3d r)
Calculate E at point r.
+vec_3d total_force(unsigned int i)
calculate the total force on a particle p_i.
+
+void evolve_RK4(double dt, bool particle_interaction=true)
Go forward one timestep using the RK4 method.
+vec_3d r_func(unsigned int i, unsigned int j, double dt)
Helper for evolve_RK4 when calculating values.
+vec_3d total_force_particles(unsigned int i)
Calculate the total force on a particle p_i from other particles.
+sim_arr simulate(double time, unsigned int steps, std::string method="rk4", bool particle_interaction=true)
Simulate the particle system inside the Penning trap over a certain amount of time.
+double d
Characteristic dimension.
+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.
+std::function< double(double)> V_0
Applied potential.
+void evolve_forward_euler(double dt, bool particle_interaction=true)
Go forward one timestep using the forward Euler method.
+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.
+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.
+
+vec_3d v_func(unsigned int i, unsigned int j, double dt)
Helper for evolve_RK4 when calculating values.
+Useful typedefs for cleaner code.
+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.
diff --git a/docs/animate__100__particles_8py_source.html b/docs/animate__100__particles_8py_source.html
index 80feb43..af734ca 100644
--- a/docs/animate__100__particles_8py_source.html
+++ b/docs/animate__100__particles_8py_source.html
@@ -103,68 +103,75 @@ $(document).ready(function(){initNavTree('animate__100__particles_8py_source.htm
1 import matplotlib.pyplot
as plt
-
3 from mpl_toolkits.mplot3d
import Axes3D
-
4 from matplotlib
import animation
+
3 from matplotlib
import animation
+
4 from mpl_toolkits.mplot3d
import Axes3D
-
-
-
-
-
10 with open(file, encoding=
"utf8" )
as f:
-
-
-
-
14 xi,yi,zi = map(float, line.strip().split(
"," ))
-
-
-
-
-
-
-
-
22 def update(num, lines, arr):
-
23 for line, a
in zip(lines, arr):
-
24 line.set_data(a[:2, num])
-
25 line.set_3d_properties(a[2, num])
-
-
+
+
+
+
+
+
11 with open(file, encoding=
"utf8" )
as f:
+
+
+
+
15 xi, yi, zi = map(float, line.strip().split(
"," ))
+
+
+
+
+
+
+
+
+
24 def update(num, lines, arr):
+
25 for line, a
in zip(lines, arr):
+
26 line.set_data(a[:2, num - 1 : num])
+
27 line.set_3d_properties(a[2, num])
-
-
30 plt.style.use(
"dark_background" )
-
-
32 ax = fig.add_subplot(projection=
"3d" )
-
+
+
+
31 plt.style.use(
"dark_background" )
+
+
33 ax = fig.add_subplot(projection=
"3d" )
-
35 arr = get_data([f
"output/p{i}_RK4.txt" for i
in range(100)])
+
35 arr = get_data([f
"output/simulate_100_particles/particle_{i}.txt" for i
in range(100)])
-
+
-
41 lines = [ax.plot(*a[:,1],
"o" )[0]
for a
in arr]
+
41 lines = [ax.plot(*a[:, 1],
"o" )[0]
for a
in arr]
-
43 ax.set_xlim3d([-500.0, 500.0])
-
-
-
46 ax.set_ylim3d([-500.0, 500.0])
-
-
-
49 ax.set_zlim3d([-500.0, 500.0])
-
-
-
52 ani = animation.FuncAnimation(fig, update, N, fargs=(lines, arr),
-
-
+
43 ax.set_title(
"100 particles inside a Penning trap" )
+
+
+
+
47 "100 randomly generated particles "
+
48 "evolving over a time of 50 microseconds." ,
+
+
50 horizontalalignment=
"center" ,
+
+
+
53 ax.set_xlim3d([-500.0, 500.0])
+
54 ax.set_xlabel(
"X (micrometers)" )
-
-
57 ani.save(
"100_particles.gif" , writer=animation.FFMpegFileWriter(fps=30))
-
-
-
-
61 if __name__ ==
"__main__" :
-
-
-
+
56 ax.set_ylim3d([-500.0, 500.0])
+
57 ax.set_ylabel(
"Y (micrometers)" )
+
+
59 ax.set_zlim3d([-500.0, 500.0])
+
60 ax.set_zlabel(
"Z (micrometers)" )
+
+
62 ani = animation.FuncAnimation(
+
63 fig, update, N, fargs=(lines, arr), interval=1, blit=
False
+
+
+
+
+
+
+
70 if __name__ ==
"__main__" :
+
diff --git a/docs/bug.html b/docs/bug.html
index bbcbbea..8ed5241 100644
--- a/docs/bug.html
+++ b/docs/bug.html
@@ -105,21 +105,23 @@ $(document).ready(function(){initNavTree('bug.html',''); initResizable(); });
File constants.hpp
No known bugs
File main.cpp
- No known bugs
+ No known bugs
File Particle.cpp
- No known bugs
+ 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
-File utils.cpp
No known bugs
+File typedefs.hpp
+ No known bugs
+File utils.cpp
+ No known bugs
File utils.hpp
- No known bugs
+ No known bugs
diff --git a/docs/classParticle-members.html b/docs/classParticle-members.html
index 02f2b23..b3fc92b 100644
--- a/docs/classParticle-members.html
+++ b/docs/classParticle-members.html
@@ -105,11 +105,11 @@ $(document).ready(function(){initNavTree('classParticle.html',''); initResizable
This is the complete list of members for Particle , including all inherited members.
diff --git a/docs/classParticle.html b/docs/classParticle.html
index 997eb37..271a213 100644
--- a/docs/classParticle.html
+++ b/docs/classParticle.html
@@ -114,9 +114,9 @@ $(document).ready(function(){initNavTree('classParticle.html',''); initResizable
@@ -126,12 +126,12 @@ Private Attributes
double m
Mass.
-arma::vec::fixed< 3 > r_vec
- position
-
-arma::vec::fixed< 3 > v_vec
- velocity
-
+vec_3d r_vec
+ position
+
+vec_3d v_vec
+ velocity
+
@@ -142,10 +142,10 @@ Friends
A class that holds attributes of a particle.
-
Definition at line 19 of file Particle.hpp .
+
Definition at line 21 of file Particle.hpp .
-
-◆ Particle()
+
+◆ Particle()
@@ -165,13 +165,13 @@ Friends
- arma::vec::fixed< 3 >
+ vec_3d
r_vec ,
- arma::vec::fixed< 3 >
+ vec_3d
v_vec
@@ -183,9 +183,18 @@ Friends
Initialize the particle.
-
Initialize the particle with a charge, mass, position and velocity.
+
Initialize the particle with a charge, mass, position and velocity.
+
Parameters
+
+ q The charge of the particle
+ m The mass of the particle
+ r_vec The initial position of the particle
+ v_vec The initial velocity of the particle
+
+
+
-
Definition at line 16 of file Particle.cpp .
+
Definition at line 15 of file Particle.cpp .
@@ -212,7 +221,7 @@ Friends
Make private attributes available for PenningTrap .
-Definition at line 38 of file Particle.hpp .
+Definition at line 43 of file Particle.hpp .
@@ -239,7 +248,7 @@ Friends
Mass.
-Definition at line 22 of file Particle.hpp .
+Definition at line 24 of file Particle.hpp .
@@ -265,12 +274,12 @@ Friends
Charge.
-Definition at line 21 of file Particle.hpp .
+Definition at line 23 of file Particle.hpp .
-
-◆ r_vec
+
+◆ r_vec
@@ -279,7 +288,7 @@ Friends
- arma::vec::fixed<3> Particle::r_vec
+ vec_3d Particle::r_vec
@@ -291,12 +300,12 @@ Friends
position
-
Definition at line 23 of file Particle.hpp .
+
Definition at line 25 of file Particle.hpp .
-
-◆ v_vec
+
+◆ v_vec
@@ -305,7 +314,7 @@ Friends
- arma::vec::fixed<3> Particle::v_vec
+ vec_3d Particle::v_vec
@@ -317,7 +326,7 @@ Friends
velocity
-
Definition at line 24 of file Particle.hpp .
+
Definition at line 26 of file Particle.hpp .
diff --git a/docs/classParticle.js b/docs/classParticle.js
index 113132c..71255c1 100644
--- a/docs/classParticle.js
+++ b/docs/classParticle.js
@@ -1,9 +1,9 @@
var classParticle =
[
- [ "Particle", "classParticle.html#a00e108823877a25513ccae7cac011b4c", null ],
+ [ "Particle", "classParticle.html#a7af9f8d1fef63dd7643b06629ac7bef4", null ],
[ "PenningTrap", "classParticle.html#aa797d319549dc2a0beb06cdbfd430232", null ],
[ "m", "classParticle.html#aedcc7e1bc53b0e2b1a4a07c9a1b47563", null ],
[ "q", "classParticle.html#a566dcc1de4bdc01251776948798ea8e1", null ],
- [ "r_vec", "classParticle.html#acf1a0f3c978b06d76df5bb4279594467", null ],
- [ "v_vec", "classParticle.html#a4a5d22c7aeca66f67d083f270cba25df", null ]
+ [ "r_vec", "classParticle.html#af9497cd8f2dcad0fad54f571ddb383e6", null ],
+ [ "v_vec", "classParticle.html#a879692772803d6ab65fa4993b54aea6e", null ]
];
\ No newline at end of file
diff --git a/docs/classPenningTrap-members.html b/docs/classPenningTrap-members.html
index 5a26d52..859c052 100644
--- a/docs/classPenningTrap-members.html
+++ b/docs/classPenningTrap-members.html
@@ -107,19 +107,27 @@ $(document).ready(function(){initNavTree('classPenningTrap.html',''); initResiza
add_particle (Particle particle)PenningTrap
B_0 PenningTrap private
d PenningTrap private
- evolve_forward_euler (double dt)PenningTrap
- evolve_RK4 (double dt)PenningTrap
- external_B_field (arma::vec r)PenningTrap
- external_E_field (arma::vec r)PenningTrap
- force_on_particle (int i, int j)PenningTrap
- get_d () (defined in PenningTrap )PenningTrap
- get_particle (int i) (defined in PenningTrap )PenningTrap
- particles PenningTrap private
- PenningTrap (double B_0=T, double V_0=25.*V/1000., double d=500.)PenningTrap
- total_force (int i)PenningTrap
- total_force_external (int i)PenningTrap
- total_force_particles (int i)PenningTrap
- V_0 PenningTrap private
+ evolve_forward_euler (double dt, bool particle_interaction=true)PenningTrap
+ evolve_RK4 (double dt, bool particle_interaction=true)PenningTrap
+ external_B_field (vec_3d r)PenningTrap
+ external_E_field (vec_3d r)PenningTrap
+ force_on_particle (unsigned int i, unsigned int j)PenningTrap
+ fraction_of_particles_left (double time, unsigned int steps, std::string method="rk4", bool particle_interaction=true)PenningTrap
+ k_r PenningTrap private
+ k_v PenningTrap private
+ particles PenningTrap private
+ PenningTrap (double B_0=T, std::function< double(double)> V_0=[](double t) { return 25. *V/1000.;}, double d=500., double t=0.)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.)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
+ r_func (unsigned int i, unsigned int j, double dt)PenningTrap private
+ simulate (double time, unsigned int steps, std::string method="rk4", bool particle_interaction=true)PenningTrap
+ t PenningTrap private
+ total_force (unsigned int i)PenningTrap
+ total_force_external (unsigned int i)PenningTrap
+ total_force_particles (unsigned int i)PenningTrap
+ V_0 PenningTrap private
+ v_func (unsigned int i, unsigned int j, double dt)PenningTrap private
+ write_simulation_to_dir (std::string path, double time, unsigned int steps, std::string method="rk4", bool particle_interaction=true)PenningTrap
diff --git a/docs/classPenningTrap.html b/docs/classPenningTrap.html
index af62e25..9afb617 100644
--- a/docs/classPenningTrap.html
+++ b/docs/classPenningTrap.html
@@ -100,6 +100,7 @@ $(document).ready(function(){initNavTree('classPenningTrap.html',''); initResiza
-
Set B_0, V_0 and d.
+
Constructor for the PenningTrap class.
+
Parameters
+
+ B_0 The magnetic field strength
+ V_0 The time dependent applied potential
+ d The characteristic dimension
+ t The starting time
+
+
+
-
Definition at line 20 of file PenningTrap.cpp .
+
Definition at line 18 of file PenningTrap.cpp .
+
+
+
+
+◆ PenningTrap() [2/3]
+
+
+
+
+
+ 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.
+
+
+
+ )
+
+
+
+
+
+
Constructor for the PenningTrap class.
+
Parameters
+
+ i The number of particles to generate
+ B_0 The magnetic field strength
+ V_0 The time dependent applied potential
+ d The characteristic dimension
+ t The starting time
+
+
+
+
+
Definition at line 27 of file PenningTrap.cpp .
+
+
+
+
+◆ PenningTrap() [3/3]
+
+
+
+
+
+ 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.
+
+
+
+ )
+
+
+
+
+
+
Constructor for the PenningTrap class.
+
Parameters
+
+ particles The starting particles
+ B_0 The magnetic field strength
+ V_0 The time dependent applied potential
+ d The characteristic dimension
+ t The starting time
+
+
+
+
+
Definition at line 39 of file PenningTrap.cpp .
@@ -225,13 +388,19 @@ Private Attributes
Add a particle to the system.
+
Parameters
+
+ particle The particle to add to the Penning trap
+
+
+
-
Definition at line 27 of file PenningTrap.cpp .
+
Definition at line 82 of file PenningTrap.cpp .
-
-◆ evolve_forward_euler()
+
+◆ evolve_forward_euler()
@@ -240,20 +409,37 @@ Private Attributes
void PenningTrap::evolve_forward_euler
(
double
- dt )
+ dt ,
+
+
+
+ bool
+ particle_interaction = true
+
+
+
+ )
+
Go forward one timestep using the forward Euler method.
+
Parameters
+
+ dt The step length
+ particle_interaction Turn particle interactions on/off
+
+
+
-
Definition at line 167 of file PenningTrap.cpp .
+
Definition at line 186 of file PenningTrap.cpp .
-
-◆ evolve_RK4()
+
+◆ evolve_RK4()
@@ -262,28 +448,45 @@ Private Attributes
void PenningTrap::evolve_RK4
(
double
- dt )
+ dt ,
+
+
+
+ bool
+ particle_interaction = true
+
+
+
+ )
+
Go forward one timestep using the RK4 method.
+
Parameters
+
+ dt The step length
+ particle_interaction Turn particle interactions on/off
+
+
+
-
Definition at line 104 of file PenningTrap.cpp .
+
Definition at line 151 of file PenningTrap.cpp .
-
-◆ external_B_field()
+
+◆ external_B_field()
- arma::vec PenningTrap::external_B_field
+ vec_3d PenningTrap::external_B_field
(
- arma::vec
+ vec_3d
r )
@@ -291,21 +494,28 @@ Private Attributes
Calculate B at point r.
+
Parameters
+
+ r The position where we want to calculate the B field
+
+
+
+
Returns vec_3d
-
Definition at line 43 of file PenningTrap.cpp .
+
Definition at line 95 of file PenningTrap.cpp .
-
-◆ external_E_field()
+
+◆ external_E_field()
- arma::vec PenningTrap::external_E_field
+ vec_3d PenningTrap::external_E_field
(
- arma::vec
+ vec_3d
r )
@@ -313,27 +523,34 @@ Private Attributes
Calculate E at point r.
+
Parameters
+
+ r The position where we want to calculate the E field
+
+
+
+
Returns vec_3d
-
Definition at line 32 of file PenningTrap.cpp .
+
Definition at line 87 of file PenningTrap.cpp .
-
-◆ force_on_particle()
+
+◆ force_on_particle()
- arma::vec PenningTrap::force_on_particle
+ vec_3d PenningTrap::force_on_particle
(
- int
+ unsigned int
i ,
- int
+ unsigned int
j
@@ -345,83 +562,222 @@ Private Attributes
Calculate the force between 2 particles.
-
Calculate the force exhibited on particle p_i from particle p_j.
+
Calculate the force exhibited on particle p_i from particle p_j.
+
Parameters
+
+ i The index of particle p_i
+ j The index of particle p_j
+
+
+
+
Returns vec_3d
-
Definition at line 50 of file PenningTrap.cpp .
+
Definition at line 100 of file PenningTrap.cpp .
-
-◆ get_d()
+
+◆ fraction_of_particles_left()
- double PenningTrap::get_d
+ double PenningTrap::fraction_of_particles_left
(
- )
+ double
+ time ,
+
+
+
+ unsigned int
+ steps ,
+
+
+
+
+ std::string
+ method = "rk4",
+
+
+
+
+ bool
+ particle_interaction = true
+
+
+
+ )
+
-
Definition at line 188 of file PenningTrap.cpp .
+
Simulate and calculate what fraction of particles are still left inside the Penning trap after the simulation.
+
Parameters
+
+ time The time to simulate in microseconds
+ steps The amount of steps for the whole simulation
+ method The method to use when moving forward a timestep
+ particle_interaction Turn particle interactions on/off
+
+
+
+
Returns double
+
+
Definition at line 266 of file PenningTrap.cpp .
-
-◆ get_particle()
+
+◆ r_func()
+
+
+
+
+
+
+
+
+ vec_3d PenningTrap::r_func
+ (
+ unsigned int
+ i ,
+
+
+
+
+ unsigned int
+ j ,
+
+
+
+
+ double
+ dt
+
+
+
+ )
+
+
+
+
+
+private
+
+
+
+
+
Helper for evolve_RK4 when calculating \(k_{r,i,j}\) values.
+
Something
+
Parameters
+
+ i Index i for \(k_{r,i,j}\)
+ j Index j for \(k_{r,i,j}\)
+ dt the step length (delta time)
+
+
+
+
Returns vec_3d
+
+
Definition at line 64 of file PenningTrap.cpp .
+
+
+
+
+◆ simulate()
- arma::vec PenningTrap::get_particle
+ sim_arr PenningTrap::simulate
(
- int
+ double
+ time ,
+
+
+
+
+ unsigned int
+ steps ,
+
+
+
+
+ std::string
+ method = "rk4",
+
+
+
+
+ bool
+ particle_interaction = true
+
+
+
+ )
+
+
+
+
+
+
Simulate the particle system inside the Penning trap over a certain amount of time.
+
Parameters
+
+ time The time to simulate in microseconds
+ steps The amount of steps for the whole simulation
+ method The method to use when moving forward a timestep
+ particle_interaction Turn particle interactions on/off
+
+
+
+
+
Definition at line 211 of file PenningTrap.cpp .
+
+
+
+
+◆ total_force()
+
+
+
+
+
+ vec_3d PenningTrap::total_force
+ (
+ unsigned int
i )
-
Definition at line 183 of file PenningTrap.cpp .
+
calculate the total force on a particle p_i.
+
Parameters
+
+ i The index of particle p_i
+
+
+
+
Returns vec_3d
+
+
Definition at line 146 of file PenningTrap.cpp .
-
-◆ total_force()
+
+◆ total_force_external()
- arma::vec PenningTrap::total_force
+ vec_3d PenningTrap::total_force_external
(
- int
- i )
-
-
-
-
-
-
calculate the total force on a particle.
-
-
Definition at line 99 of file PenningTrap.cpp .
-
-
-
-
-◆ total_force_external()
-
-
-
-
-
- arma::vec PenningTrap::total_force_external
- (
- int
+ unsigned int
i )
@@ -429,31 +785,161 @@ Private Attributes
Calculate the total external force on a particle.
-
Calculate the total amount of force that E and B exhibits on particle p_i.
+
Calculate the total amount of force that E and B exhibits on particle p_i.
+
Parameters
+
+ i The index of particle p_i
+
+
+
+
Returns vec_3d
-
Definition at line 65 of file PenningTrap.cpp .
+
Definition at line 114 of file PenningTrap.cpp .
-
-◆ total_force_particles()
+
+◆ total_force_particles()
- arma::vec PenningTrap::total_force_particles
+ vec_3d PenningTrap::total_force_particles
(
- int
+ unsigned int
i )
-
Calculate the total force on a particle from other particles.
+
Calculate the total force on a particle p_i from other particles.
+
Parameters
+
+ i The index of particle p_i
+
+
+
+
Returns vec_3d
-
Definition at line 80 of file PenningTrap.cpp .
+
Definition at line 129 of file PenningTrap.cpp .
+
+
+
+
+◆ v_func()
+
+
+
+
+
+
+
+
+ vec_3d PenningTrap::v_func
+ (
+ unsigned int
+ i ,
+
+
+
+
+ unsigned int
+ j ,
+
+
+
+
+ double
+ dt
+
+
+
+ )
+
+
+
+
+
+private
+
+
+
+
+
Helper for evolve_RK4 when calculating \(k_{v,i,j}\) values.
+
Something
+
Parameters
+
+ i Index i for \(k_{v,i,j}\)
+ j Index j for \(k_{v,i,j}\)
+ dt the step length (delta time)
+
+
+
+
Returns vec_3d
+
+
Definition at line 46 of file PenningTrap.cpp .
+
+
+
+
+◆ write_simulation_to_dir()
+
+
+
+
+
+ void PenningTrap::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.
+
Parameters
+
+ path The directory to save the data
+ time The time to simulate in microseconds
+ steps The amount of steps for the whole simulation
+ method The method to use when moving forward a timestep
+ particle_interaction Turn particle interactions on/off
+
+
+
+
+
Definition at line 240 of file PenningTrap.cpp .
@@ -480,7 +966,7 @@ Private Attributes
Magnetic field strength.
-Definition at line 31 of file PenningTrap.hpp .
+Definition at line 32 of file PenningTrap.hpp .
@@ -506,7 +992,57 @@ Private Attributes
Characteristic dimension.
-Definition at line 33 of file PenningTrap.hpp .
+Definition at line 34 of file PenningTrap.hpp .
+
+
+
+
+◆ k_r
+
+
+
+
A 2D vector containing all \(k_{i,j}\) where \(j\) is the index of a particle
+
+
Definition at line 39 of file PenningTrap.hpp .
+
+
+
+
+◆ k_v
+
+
+
+
A 2D vector containing all \(k_{i,j}\) where \(j\) is the index of a particle
+
+
Definition at line 37 of file PenningTrap.hpp .
@@ -532,12 +1068,12 @@ Private Attributes
The particles in the Penning trap.
-Definition at line 34 of file PenningTrap.hpp .
+Definition at line 36 of file PenningTrap.hpp .
-
-◆ V_0
+
+
@@ -546,7 +1082,33 @@ Private Attributes
- double PenningTrap::V_0
+ double PenningTrap::t
+
+
+
+
+private
+
+
+
+
+
+◆ V_0
+
+
+
+
+
+
+
+
+ std::function<double(double)> PenningTrap::V_0
@@ -558,7 +1120,7 @@ Private Attributes
Applied potential.
-Definition at line 32 of file PenningTrap.hpp .
+Definition at line 33 of file PenningTrap.hpp .
diff --git a/docs/classPenningTrap.js b/docs/classPenningTrap.js
index 743d3ea..0fd7f36 100644
--- a/docs/classPenningTrap.js
+++ b/docs/classPenningTrap.js
@@ -1,17 +1,27 @@
var classPenningTrap =
[
- [ "PenningTrap", "classPenningTrap.html#a81add5063bd5f29d77f0b5c299c6c560", null ],
+ [ "PenningTrap", "classPenningTrap.html#ae670d7de621acdb343b01af098086f63", null ],
+ [ "PenningTrap", "classPenningTrap.html#a763700316b502d5900e587c1f61e6bf1", null ],
+ [ "PenningTrap", "classPenningTrap.html#a67139e04ef69c0bcffde8f30f67cbf73", null ],
[ "add_particle", "classPenningTrap.html#a6e9776ff5b149f01080800716455d7c8", null ],
- [ "evolve_forward_euler", "classPenningTrap.html#a56544b6f4befb42984e9650cf2a40965", null ],
- [ "evolve_RK4", "classPenningTrap.html#ab891b839c40eeb38d8a2a636c70090a9", null ],
- [ "external_B_field", "classPenningTrap.html#a2a3e7f480ba52e9f24d4c50c3981a784", null ],
- [ "external_E_field", "classPenningTrap.html#a978a2e2026a4b5308d5184712f81704b", null ],
- [ "force_on_particle", "classPenningTrap.html#a4790f41e4fbc6ede4991aa7bbda92182", null ],
- [ "total_force", "classPenningTrap.html#a83cc7a04dae009ed8e75453c38fdf8be", null ],
- [ "total_force_external", "classPenningTrap.html#a045adb85e97a8e0c38fb36d2fd74eeee", null ],
- [ "total_force_particles", "classPenningTrap.html#a135db7d991d9b88b00fde4edee71f78d", null ],
+ [ "evolve_forward_euler", "classPenningTrap.html#ab9ea97a406534bbe621a95215144875e", null ],
+ [ "evolve_RK4", "classPenningTrap.html#a36946152fd951b1f7c346c51ff900d8e", null ],
+ [ "external_B_field", "classPenningTrap.html#acbf065c9c125682329ad82a8d166554c", null ],
+ [ "external_E_field", "classPenningTrap.html#a1d58feaa2c9e34cbf26b1c5ed75ca9d9", null ],
+ [ "force_on_particle", "classPenningTrap.html#a9ae34ad740a230e667e96bc6ee8730ce", null ],
+ [ "fraction_of_particles_left", "classPenningTrap.html#a0194be61c956a9259c747c23e4163c5b", null ],
+ [ "r_func", "classPenningTrap.html#a43e74792ab4b3f9299f35cb64bdb2648", null ],
+ [ "simulate", "classPenningTrap.html#a5331837e6dd7bce807a99edd2ba7e854", null ],
+ [ "total_force", "classPenningTrap.html#a1f668c4433421136ad51741741aa1bc8", null ],
+ [ "total_force_external", "classPenningTrap.html#ae72d203b0bfa1b9e72bea28cb2863c56", null ],
+ [ "total_force_particles", "classPenningTrap.html#a46a954a0946def199e30fb300ba1c47b", null ],
+ [ "v_func", "classPenningTrap.html#af98a720da60b0e1a62aefa5f5cb37c1e", null ],
+ [ "write_simulation_to_dir", "classPenningTrap.html#abbb832a85139b1a56ebde57d7b8f9a57", null ],
[ "B_0", "classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716", null ],
[ "d", "classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2", null ],
+ [ "k_r", "classPenningTrap.html#a2f168622587709b9e3c49077f0b9a640", null ],
+ [ "k_v", "classPenningTrap.html#ae9b5afdaa5cd366e94bd294452a1eed4", null ],
[ "particles", "classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f", null ],
- [ "V_0", "classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89", null ]
+ [ "t", "classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e", null ],
+ [ "V_0", "classPenningTrap.html#aaf105828121c4a33cc2b217453c20317", null ]
];
\ No newline at end of file
diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html
index 81efd6b..4313bbd 100644
--- a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html
+++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html
@@ -115,6 +115,8 @@ Files
file PenningTrap.cpp [code]
The implementation of the PenningTrap class.
+file plot_particles_left.py [code]
+
file test_suite.cpp [code]
The test suite for the project.
diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js
index 13a8a58..64ce7a5 100644
--- a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js
+++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js
@@ -4,6 +4,7 @@ var dir_68267d1309a1af8e8297ef4c3efbcdba =
[ "main.cpp", "main_8cpp.html", null ],
[ "Particle.cpp", "Particle_8cpp.html", null ],
[ "PenningTrap.cpp", "PenningTrap_8cpp.html", null ],
+ [ "plot_particles_left.py", "plot__particles__left_8py_source.html", null ],
[ "test_suite.cpp", "test__suite_8cpp.html", "test__suite_8cpp" ],
[ "utils.cpp", "utils_8cpp.html", "utils_8cpp" ]
];
\ No newline at end of file
diff --git a/docs/dir_d44c64559bbebec7f509842c48db8b23.html b/docs/dir_d44c64559bbebec7f509842c48db8b23.html
index 21e883c..289eee3 100644
--- a/docs/dir_d44c64559bbebec7f509842c48db8b23.html
+++ b/docs/dir_d44c64559bbebec7f509842c48db8b23.html
@@ -113,6 +113,9 @@ Files
file PenningTrap.hpp [code]
A class for simulating a Penning trap.
+file typedefs.hpp [code]
+ Useful typedefs for cleaner code.
+
file utils.hpp [code]
Function prototypes and macros that are useful.
diff --git a/docs/dir_d44c64559bbebec7f509842c48db8b23.js b/docs/dir_d44c64559bbebec7f509842c48db8b23.js
index 48feb88..192eaa8 100644
--- a/docs/dir_d44c64559bbebec7f509842c48db8b23.js
+++ b/docs/dir_d44c64559bbebec7f509842c48db8b23.js
@@ -3,5 +3,6 @@ var dir_d44c64559bbebec7f509842c48db8b23 =
[ "constants.hpp", "constants_8hpp.html", "constants_8hpp" ],
[ "Particle.hpp", "Particle_8hpp.html", "Particle_8hpp" ],
[ "PenningTrap.hpp", "PenningTrap_8hpp.html", "PenningTrap_8hpp" ],
+ [ "typedefs.hpp", "typedefs_8hpp.html", "typedefs_8hpp" ],
[ "utils.hpp", "utils_8hpp.html", "utils_8hpp" ]
];
\ No newline at end of file
diff --git a/docs/files.html b/docs/files.html
index b07cc8d..e842a47 100644
--- a/docs/files.html
+++ b/docs/files.html
@@ -107,14 +107,16 @@ $(document).ready(function(){initNavTree('files.html',''); initResizable(); });
constants.hpp Library of constants
Particle.hpp A class that holds the properties of a particle
PenningTrap.hpp A class for simulating a Penning trap
- utils.hpp Function prototypes and macros that are useful
- ▼ src
- animate_100_particles.py
- main.cpp The main program for this project
- Particle.cpp The implementation of the Particle class
- PenningTrap.cpp The implementation of the PenningTrap class
- test_suite.cpp The test suite for the project
- utils.cpp Implementation of the utils
+ typedefs.hpp Useful typedefs for cleaner code
+ utils.hpp Function prototypes and macros that are useful
+ ▼ src
+ animate_100_particles.py
+ main.cpp The main program for this project
+ Particle.cpp The implementation of the Particle class
+ PenningTrap.cpp The implementation of the PenningTrap class
+ plot_particles_left.py
+ test_suite.cpp The test suite for the project
+ utils.cpp Implementation of the utils
diff --git a/docs/functions.html b/docs/functions.html
index eb473bb..a2f04ea 100644
--- a/docs/functions.html
+++ b/docs/functions.html
@@ -102,22 +102,30 @@ $(document).ready(function(){initNavTree('functions.html',''); initResizable();
add_particle() : PenningTrap
B_0 : PenningTrap
d : PenningTrap
-evolve_forward_euler() : PenningTrap
-evolve_RK4() : PenningTrap
-external_B_field() : PenningTrap
-external_E_field() : PenningTrap
-force_on_particle() : PenningTrap
+evolve_forward_euler() : PenningTrap
+evolve_RK4() : PenningTrap
+external_B_field() : PenningTrap
+external_E_field() : PenningTrap
+force_on_particle() : PenningTrap
+fraction_of_particles_left() : PenningTrap
+k_r : PenningTrap
+k_v : PenningTrap
m : Particle
-Particle() : Particle
+Particle() : Particle
particles : PenningTrap
-PenningTrap : Particle , PenningTrap
+PenningTrap : Particle , PenningTrap
q : Particle
-r_vec : Particle
-total_force() : PenningTrap
-total_force_external() : PenningTrap
-total_force_particles() : PenningTrap
-V_0 : PenningTrap
-v_vec : Particle
+r_func() : PenningTrap
+r_vec : Particle
+simulate() : PenningTrap
+t : PenningTrap
+total_force() : PenningTrap
+total_force_external() : PenningTrap
+total_force_particles() : PenningTrap
+V_0 : PenningTrap
+v_func() : PenningTrap
+v_vec : Particle
+write_simulation_to_dir() : PenningTrap
diff --git a/docs/functions_func.html b/docs/functions_func.html
index 4a36dd3..1182b1d 100644
--- a/docs/functions_func.html
+++ b/docs/functions_func.html
@@ -100,16 +100,21 @@ $(document).ready(function(){initNavTree('functions_func.html',''); initResizabl
diff --git a/docs/functions_vars.html b/docs/functions_vars.html
index 8c0729a..3ca2e5b 100644
--- a/docs/functions_vars.html
+++ b/docs/functions_vars.html
@@ -101,12 +101,15 @@ $(document).ready(function(){initNavTree('functions_vars.html',''); initResizabl
diff --git a/docs/globals.html b/docs/globals.html
index 9107eef..19a9638 100644
--- a/docs/globals.html
+++ b/docs/globals.html
@@ -99,14 +99,20 @@ $(document).ready(function(){initNavTree('globals.html',''); initResizable(); })
Here is a list of all documented file members with links to the documentation:
diff --git a/docs/globals_defs.html b/docs/globals_defs.html
index 332fce0..c7eb483 100644
--- a/docs/globals_defs.html
+++ b/docs/globals_defs.html
@@ -99,6 +99,7 @@ $(document).ready(function(){initNavTree('globals_defs.html',''); initResizable(
+__METHOD_NAME__ : utils.hpp
ASSERT : utils.hpp
DEBUG : utils.hpp
K_E : constants.hpp
diff --git a/docs/globals_func.html b/docs/globals_func.html
index e38f2c1..c73a436 100644
--- a/docs/globals_func.html
+++ b/docs/globals_func.html
@@ -101,6 +101,7 @@ $(document).ready(function(){initNavTree('globals_func.html',''); initResizable(
diff --git a/docs/globals_type.html b/docs/globals_type.html
new file mode 100644
index 0000000..b7735cc
--- /dev/null
+++ b/docs/globals_type.html
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+Penning Trap Simulation: File Members
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Penning Trap Simulation
+
+ Simulate particle behavior inside a Penning Trap
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/main_8cpp.html b/docs/main_8cpp.html
index 5e67722..b83f224 100644
--- a/docs/main_8cpp.html
+++ b/docs/main_8cpp.html
@@ -100,17 +100,22 @@ $(document).ready(function(){initNavTree('main_8cpp.html',''); initResizable();
The main program for this project.
More...
-
#include <fstream>
+
#include <cmath>
+
#include <fstream>
#include <omp.h>
+
#include <string>
#include <sys/stat.h>
+
#include <vector>
#include "PenningTrap.hpp "
+
#include "utils.hpp "
Go to the source code of this file.
@@ -127,10 +132,27 @@ Macros
+
+
+Particle p1 (CHARGE, MASS, vec_3d {20., 0., 20.}, vec_3d {0., 25., 0.})
+
+
+Particle p2 (CHARGE, MASS, vec_3d {25., 25., 0.}, vec_3d {0., 40., 5.})
+
The main program for this project.
@@ -138,7 +160,7 @@ Functions
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 0.1
-
Bug: No known bugs
+
Bug: No known bugs
Definition in file main.cpp .
@@ -154,7 +176,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
@@ -170,7 +192,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
@@ -186,7 +208,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
@@ -202,7 +224,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
@@ -222,7 +244,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
@@ -241,7 +263,83 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
+
+
+◆ simulate_100_particles_with_time_potential()
+
+
+
+
+
+ void simulate_100_particles_with_time_potential
+ (
+ )
+
+
+
+
+
+
+◆ simulate_single_particle()
+
+
+
+
+
+ void simulate_single_particle
+ (
+ )
+
+
+
+
+
+
+◆ simulate_single_particle_with_different_steps()
+
+
+
+
+
+ void simulate_single_particle_with_different_steps
+ (
+ )
+
+
+
+
+
+
+◆ simulate_two_particles()
+
+
+
+
+
+ void simulate_two_particles
+ (
+ )
+
+
+
+
diff --git a/docs/main_8cpp_source.html b/docs/main_8cpp_source.html
index 5542b5a..d437689 100644
--- a/docs/main_8cpp_source.html
+++ b/docs/main_8cpp_source.html
@@ -102,87 +102,149 @@ $(document).ready(function(){initNavTree('main_8cpp_source.html',''); initResiza
Go to the documentation of this file.
-
-
-
-
-
-
-
-
-
-
-
-
24 void simulate_100_particles()
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
29 for (
int i = 0; i < PARTICLES; i++) {
-
30 arma::vec r = arma::vec(3).randn() * 0.1 *
-
-
32 arma::vec v = arma::vec(3).randn() * 0.1 *
-
-
-
-
-
-
38 double dt = time / (double)N;
-
-
40 auto res =
new arma::vec::fixed<3>[PARTICLES][N];
+
+
+
+
31 void simulate_single_particle()
+
+
33 DEBUG (
"Inside single particle sim" );
+
+
+
+
+
38 DEBUG (
"Write to dir" );
+
39 trap.write_simulation_to_dir(
"output/simulate_single_particle" , time, N);
+
-
-
-
-
45 for (
int j = 0; j < N; j++) {
-
46 #pragma omp parallel for
-
47 for (
int i = 0; i < PARTICLES; i++) {
-
48 res[i][j] = trap.get_particle(i);
-
-
-
-
-
53 std::cout << counter << std::endl;
+
42 void simulate_two_particles()
+
+
44 PenningTrap trap_no_interaction(std::vector<Particle>{p1, p2});
+
45 PenningTrap trap_with_interaction(std::vector<Particle>{p1, p2});
+
+
+
+
+
50 "output/simulate_2_particles/no_interaction" , time, N,
"rk4" ,
false );
+
51 trap_with_interaction.write_simulation_to_dir(
+
52 "output/simulate_2_particles/with_interaction" , time, N);
+
-
55 arma::vec::fixed<3> *cur_row;
-
56 arma::vec::fixed<3> cur_elem;
+
55 void simulate_single_particle_with_different_steps()
+
-
58 mkdir(
"output" , 0777);
-
59 mkdir(
"output/simulate_100_particles" , 0777);
-
-
-
-
-
64 #pragma omp parallel for private(cur_row, cur_elem, ofile)
-
65 for (
int i = 0; i < PARTICLES; i++) {
-
-
67 ofile.open(
"output/simulate_100_particles/p" + std::to_string(i) +
".txt" );
-
68 for (
int j = 0; j < N; j++) {
-
69 cur_elem = cur_row[j];
-
70 ofile << cur_elem(0) <<
"," << cur_elem(1) <<
"," << cur_elem(2)
-
-
-
+
+
+
60 for (
int i = 0; i < 4; i++) {
+
61 int steps = 4000 * (i + 1);
+
+
+
64 std::to_string(steps) +
"_steps" ,
+
65 time, steps,
"rk4" ,
false );
+
+
+
68 for (
int i = 0; i < 4; i++) {
+
69 int steps = 4000 * (i + 1);
+
+
+
72 std::to_string(steps) +
"_steps" ,
+
73 time, steps,
"euler" ,
false );
-
+
77 void simulate_100_particles()
-
79 double start = omp_get_wtime();
-
-
81 simulate_100_particles();
-
-
83 double end = omp_get_wtime();
-
-
85 std::cout <<
"Time: " << end - start <<
" seconds" << std::endl;
-
-
-
+
+
+
81 return 25. *
V / 1000. *
+
82 (1. + .4 * std::cos(1.5 * t));
+
+
+
+
+
+
+
+
+
91 void simulate_100_particles_with_time_potential()
+
+
93 double amplitudes[]{.1, .4, .7};
+
+
95 double freq_start = .2;
+
96 double freq_end = 2.5;
+
97 double freq_increment = .02;
+
98 size_t freq_iterations = (size_t) ((freq_end - freq_start) / freq_increment);
+
+
100 std::string path =
"output/time_dependent_potential/" ;
+
+
+
+
+
105 for (
double f : amplitudes) {
+
106 ofile.open(path +
"f_" + std::to_string(f) +
".txt" );
+
107 #pragma omp parallel for ordered schedule(static, 1)
+
108 for (
size_t i=0; i < freq_iterations; i++) {
+
109 double freq = freq_start + i*freq_increment;
+
+
111 [f, freq](
double t) {
+
112 return (25. *
V / 1000.) *
+
113 (1. + f * std::cos(freq * t));
+
+
+
+
+
118 ofile << freq <<
"," << res <<
"\n" ;
+
+
+
+
+
+
+
+
+
127 simulate_single_particle();
+
+
129 simulate_two_particles();
+
+
131 simulate_single_particle_with_different_steps();
+
+
133 double start = omp_get_wtime();
+
+
+
+
137 simulate_100_particles_with_time_potential();
+
+
139 double end = omp_get_wtime();
+
+
141 std::cout <<
"Time: " << end - start <<
" 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.
-
void add_particle(Particle particle)
Add a particle to the system.
-
void evolve_RK4(double dt)
Go forward one timestep using the RK4 method.
+
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.
+
+
+
arma::vec::fixed< 3 > vec_3d
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.
+
#define DEBUG(msg)
Writes a debug message.
diff --git a/docs/menudata.js b/docs/menudata.js
index 88ec31f..74c1d7b 100644
--- a/docs/menudata.js
+++ b/docs/menudata.js
@@ -38,4 +38,5 @@ var menudata={children:[
{text:"File Members",url:"globals.html",children:[
{text:"All",url:"globals.html"},
{text:"Functions",url:"globals_func.html"},
+{text:"Typedefs",url:"globals_type.html"},
{text:"Macros",url:"globals_defs.html"}]}]}]}
diff --git a/docs/navtreedata.js b/docs/navtreedata.js
index 10ee5ad..9640812 100644
--- a/docs/navtreedata.js
+++ b/docs/navtreedata.js
@@ -27,7 +27,6 @@ var NAVTREE =
[ "Penning Trap Simulation", "index.html", [
[ "Credits", "index.html#autotoc_md1", null ],
[ "Bug List", "bug.html", null ],
- [ "Todo List", "todo.html", null ],
[ "Classes", "annotated.html", [
[ "Class List", "annotated.html", "annotated_dup" ],
[ "Class Index", "classes.html", null ],
@@ -43,6 +42,7 @@ var NAVTREE =
[ "File Members", "globals.html", [
[ "All", "globals.html", null ],
[ "Functions", "globals_func.html", null ],
+ [ "Typedefs", "globals_type.html", null ],
[ "Macros", "globals_defs.html", null ]
] ]
] ]
diff --git a/docs/navtreeindex0.js b/docs/navtreeindex0.js
index 27aef05..16caa0e 100644
--- a/docs/navtreeindex0.js
+++ b/docs/navtreeindex0.js
@@ -1,75 +1,95 @@
var NAVTREEINDEX0 =
{
-"Particle_8cpp.html":[4,0,1,2],
-"Particle_8cpp_source.html":[4,0,1,2],
-"Particle_8hpp.html":[4,0,0,1],
-"Particle_8hpp_source.html":[4,0,0,1],
-"PenningTrap_8cpp.html":[4,0,1,3],
-"PenningTrap_8cpp_source.html":[4,0,1,3],
-"PenningTrap_8hpp.html":[4,0,0,2],
-"PenningTrap_8hpp_source.html":[4,0,0,2],
-"animate__100__particles_8py_source.html":[4,0,1,0],
-"annotated.html":[3,0],
+"Particle_8cpp.html":[3,0,1,2],
+"Particle_8cpp_source.html":[3,0,1,2],
+"Particle_8hpp.html":[3,0,0,1],
+"Particle_8hpp_source.html":[3,0,0,1],
+"PenningTrap_8cpp.html":[3,0,1,3],
+"PenningTrap_8cpp_source.html":[3,0,1,3],
+"PenningTrap_8hpp.html":[3,0,0,2],
+"PenningTrap_8hpp_source.html":[3,0,0,2],
+"animate__100__particles_8py_source.html":[3,0,1,0],
+"annotated.html":[2,0],
"bug.html":[1],
-"classParticle.html":[3,0,0],
-"classParticle.html#a00e108823877a25513ccae7cac011b4c":[3,0,0,0],
-"classParticle.html#a4a5d22c7aeca66f67d083f270cba25df":[3,0,0,5],
-"classParticle.html#a566dcc1de4bdc01251776948798ea8e1":[3,0,0,3],
-"classParticle.html#aa797d319549dc2a0beb06cdbfd430232":[3,0,0,1],
-"classParticle.html#acf1a0f3c978b06d76df5bb4279594467":[3,0,0,4],
-"classParticle.html#aedcc7e1bc53b0e2b1a4a07c9a1b47563":[3,0,0,2],
-"classPenningTrap.html":[3,0,1],
-"classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f":[3,0,1,12],
-"classPenningTrap.html#a045adb85e97a8e0c38fb36d2fd74eeee":[3,0,1,8],
-"classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716":[3,0,1,10],
-"classPenningTrap.html#a135db7d991d9b88b00fde4edee71f78d":[3,0,1,9],
-"classPenningTrap.html#a2a3e7f480ba52e9f24d4c50c3981a784":[3,0,1,4],
-"classPenningTrap.html#a4790f41e4fbc6ede4991aa7bbda92182":[3,0,1,6],
-"classPenningTrap.html#a56544b6f4befb42984e9650cf2a40965":[3,0,1,2],
-"classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2":[3,0,1,11],
-"classPenningTrap.html#a6e9776ff5b149f01080800716455d7c8":[3,0,1,1],
-"classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89":[3,0,1,13],
-"classPenningTrap.html#a81add5063bd5f29d77f0b5c299c6c560":[3,0,1,0],
-"classPenningTrap.html#a83cc7a04dae009ed8e75453c38fdf8be":[3,0,1,7],
-"classPenningTrap.html#a978a2e2026a4b5308d5184712f81704b":[3,0,1,5],
-"classPenningTrap.html#ab891b839c40eeb38d8a2a636c70090a9":[3,0,1,3],
-"classPenningTrapTest.html":[3,0,2],
-"classes.html":[3,1],
-"constants_8hpp.html":[4,0,0,0],
-"constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5":[4,0,0,0,1],
-"constants_8hpp.html#a4e451456ad7e9276ed0afa42826e7ccb":[4,0,0,0,0],
-"constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb":[4,0,0,0,2],
-"constants_8hpp_source.html":[4,0,0,0],
-"dir_68267d1309a1af8e8297ef4c3efbcdba.html":[4,0,1],
-"dir_d44c64559bbebec7f509842c48db8b23.html":[4,0,0],
-"files.html":[4,0],
-"functions.html":[3,2,0],
-"functions_func.html":[3,2,1],
-"functions_rela.html":[3,2,3],
-"functions_vars.html":[3,2,2],
-"globals.html":[4,1,0],
-"globals_defs.html":[4,1,2],
-"globals_func.html":[4,1,1],
+"classParticle.html":[2,0,0],
+"classParticle.html#a566dcc1de4bdc01251776948798ea8e1":[2,0,0,3],
+"classParticle.html#a7af9f8d1fef63dd7643b06629ac7bef4":[2,0,0,0],
+"classParticle.html#a879692772803d6ab65fa4993b54aea6e":[2,0,0,5],
+"classParticle.html#aa797d319549dc2a0beb06cdbfd430232":[2,0,0,1],
+"classParticle.html#aedcc7e1bc53b0e2b1a4a07c9a1b47563":[2,0,0,2],
+"classParticle.html#af9497cd8f2dcad0fad54f571ddb383e6":[2,0,0,4],
+"classPenningTrap.html":[2,0,1],
+"classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f":[2,0,1,21],
+"classPenningTrap.html#a0194be61c956a9259c747c23e4163c5b":[2,0,1,9],
+"classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716":[2,0,1,17],
+"classPenningTrap.html#a1d58feaa2c9e34cbf26b1c5ed75ca9d9":[2,0,1,7],
+"classPenningTrap.html#a1f668c4433421136ad51741741aa1bc8":[2,0,1,12],
+"classPenningTrap.html#a2f168622587709b9e3c49077f0b9a640":[2,0,1,19],
+"classPenningTrap.html#a36946152fd951b1f7c346c51ff900d8e":[2,0,1,5],
+"classPenningTrap.html#a43e74792ab4b3f9299f35cb64bdb2648":[2,0,1,10],
+"classPenningTrap.html#a46a954a0946def199e30fb300ba1c47b":[2,0,1,14],
+"classPenningTrap.html#a5331837e6dd7bce807a99edd2ba7e854":[2,0,1,11],
+"classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2":[2,0,1,18],
+"classPenningTrap.html#a67139e04ef69c0bcffde8f30f67cbf73":[2,0,1,2],
+"classPenningTrap.html#a6e9776ff5b149f01080800716455d7c8":[2,0,1,3],
+"classPenningTrap.html#a763700316b502d5900e587c1f61e6bf1":[2,0,1,1],
+"classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e":[2,0,1,22],
+"classPenningTrap.html#a9ae34ad740a230e667e96bc6ee8730ce":[2,0,1,8],
+"classPenningTrap.html#aaf105828121c4a33cc2b217453c20317":[2,0,1,23],
+"classPenningTrap.html#ab9ea97a406534bbe621a95215144875e":[2,0,1,4],
+"classPenningTrap.html#abbb832a85139b1a56ebde57d7b8f9a57":[2,0,1,16],
+"classPenningTrap.html#acbf065c9c125682329ad82a8d166554c":[2,0,1,6],
+"classPenningTrap.html#ae670d7de621acdb343b01af098086f63":[2,0,1,0],
+"classPenningTrap.html#ae72d203b0bfa1b9e72bea28cb2863c56":[2,0,1,13],
+"classPenningTrap.html#ae9b5afdaa5cd366e94bd294452a1eed4":[2,0,1,20],
+"classPenningTrap.html#af98a720da60b0e1a62aefa5f5cb37c1e":[2,0,1,15],
+"classPenningTrapTest.html":[2,0,2],
+"classes.html":[2,1],
+"constants_8hpp.html":[3,0,0,0],
+"constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5":[3,0,0,0,1],
+"constants_8hpp.html#a4e451456ad7e9276ed0afa42826e7ccb":[3,0,0,0,0],
+"constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb":[3,0,0,0,2],
+"constants_8hpp_source.html":[3,0,0,0],
+"dir_68267d1309a1af8e8297ef4c3efbcdba.html":[3,0,1],
+"dir_d44c64559bbebec7f509842c48db8b23.html":[3,0,0],
+"files.html":[3,0],
+"functions.html":[2,2,0],
+"functions_func.html":[2,2,1],
+"functions_rela.html":[2,2,3],
+"functions_vars.html":[2,2,2],
+"globals.html":[3,1,0],
+"globals_defs.html":[3,1,3],
+"globals_func.html":[3,1,1],
+"globals_type.html":[3,1,2],
"index.html":[],
"index.html#autotoc_md1":[0],
-"main_8cpp.html":[4,0,1,1],
-"main_8cpp_source.html":[4,0,1,1],
+"main_8cpp.html":[3,0,1,1],
+"main_8cpp_source.html":[3,0,1,1],
"pages.html":[],
-"test__suite_8cpp.html":[4,0,1,4],
-"test__suite_8cpp_source.html":[4,0,1,4],
-"todo.html":[2],
-"utils_8cpp.html":[4,0,1,5],
-"utils_8cpp.html#a58565270b643b24e3132f38c653e0199":[4,0,1,5,2],
-"utils_8cpp.html#a5d2e1e032fd19614f2fbb58149a7b02a":[4,0,1,5,0],
-"utils_8cpp.html#acd2a9c7a7d5a7fe9163be8c4cc110746":[4,0,1,5,3],
-"utils_8cpp.html#aff5e07c3c1d321709b0cc38e999f427b":[4,0,1,5,1],
-"utils_8cpp_source.html":[4,0,1,5],
-"utils_8hpp.html":[4,0,0,3],
-"utils_8hpp.html#a0c95c4791692b06f8811905a76dbd772":[4,0,0,3,2],
-"utils_8hpp.html#a2cc3a2cdb635bac3c8b02e89d4d6af38":[4,0,0,3,3],
-"utils_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9":[4,0,0,3,0],
-"utils_8hpp.html#ad54b96a1074f9df4dc892a41d115b72d":[4,0,0,3,4],
-"utils_8hpp.html#adfb618b2fdff47ef30a4a2b62c04f384":[4,0,0,3,5],
-"utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b":[4,0,0,3,1],
-"utils_8hpp_source.html":[4,0,0,3]
+"plot__particles__left_8py_source.html":[3,0,1,4],
+"test__suite_8cpp.html":[3,0,1,5],
+"test__suite_8cpp_source.html":[3,0,1,5],
+"typedefs_8hpp.html":[3,0,0,3],
+"typedefs_8hpp.html#a7c2dfa854274262c4e00e4ef0ab2ce23":[3,0,0,3,1],
+"typedefs_8hpp.html#a8502989b1b361725834fc185bd575f66":[3,0,0,3,2],
+"typedefs_8hpp.html#a9f33f4962c8fb62cc5ccd0e4e039a8df":[3,0,0,3,3],
+"typedefs_8hpp.html#aec69d34220fff45de238b9e01f2686af":[3,0,0,3,0],
+"typedefs_8hpp_source.html":[3,0,0,3],
+"utils_8cpp.html":[3,0,1,6],
+"utils_8cpp.html#a58565270b643b24e3132f38c653e0199":[3,0,1,6,3],
+"utils_8cpp.html#a5d2e1e032fd19614f2fbb58149a7b02a":[3,0,1,6,0],
+"utils_8cpp.html#acd2a9c7a7d5a7fe9163be8c4cc110746":[3,0,1,6,4],
+"utils_8cpp.html#acf13f4e492199cb7231bfa646dbd08de":[3,0,1,6,2],
+"utils_8cpp.html#aff5e07c3c1d321709b0cc38e999f427b":[3,0,1,6,1],
+"utils_8cpp_source.html":[3,0,1,6],
+"utils_8hpp.html":[3,0,0,4],
+"utils_8hpp.html#a0c95c4791692b06f8811905a76dbd772":[3,0,0,4,3],
+"utils_8hpp.html#a2cc3a2cdb635bac3c8b02e89d4d6af38":[3,0,0,4,4],
+"utils_8hpp.html#a60dca3177fb9cb5256609adc7af55168":[3,0,0,4,0],
+"utils_8hpp.html#a6fdd7217b750aff5b6295ece7cbdeffa":[3,0,0,4,5],
+"utils_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9":[3,0,0,4,1],
+"utils_8hpp.html#ad54b96a1074f9df4dc892a41d115b72d":[3,0,0,4,6],
+"utils_8hpp.html#adfb618b2fdff47ef30a4a2b62c04f384":[3,0,0,4,7],
+"utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b":[3,0,0,4,2],
+"utils_8hpp_source.html":[3,0,0,4]
};
diff --git a/docs/pages.html b/docs/pages.html
index eb4abe8..a84d908 100644
--- a/docs/pages.html
+++ b/docs/pages.html
@@ -104,7 +104,6 @@ $(document).ready(function(){initNavTree('pages.html',''); initResizable(); });
Here is a list of all related documentation pages:
diff --git a/docs/plot__particles__left_8py_source.html b/docs/plot__particles__left_8py_source.html
new file mode 100644
index 0000000..c9ab258
--- /dev/null
+++ b/docs/plot__particles__left_8py_source.html
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+Penning Trap Simulation: src/plot_particles_left.py Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Penning Trap Simulation
+
+ Simulate particle behavior inside a Penning Trap
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
1 import matplotlib.pyplot
as plt
+
+
+
+
5 "output/time_dependent_potential/f_0.100000.txt" ,
+
6 "output/time_dependent_potential/f_0.400000.txt" ,
+
7 "output/time_dependent_potential/f_0.700000.txt" ,
+
+
+
+
+
+
+
+
15 with open(files[i])
as f:
+
+
+
+
+
20 a,b = line.strip().split(
"," )
+
+
+
23 plt.plot(x,y,label=f
"amplitude: {vals[i]}" )
+
+
25 plt.xlabel(
r"$\omega_V$" )
+
26 plt.ylabel(
r"Fraction of particles left" )
+
27 plt.title(
r"The fraction of particles left in the Penning trap "
+
28 "after 500 microseconds for different amplitudes and frequencies" )
+
+
+
+
32 if __name__ ==
"__main__" :
+
+
+
+
+
+
+ src plot_particles_left.py
+
+
+
+
+
diff --git a/docs/search/all_0.js b/docs/search/all_0.js
index 4fc815a..1e5c227 100644
--- a/docs/search/all_0.js
+++ b/docs/search/all_0.js
@@ -1,6 +1,4 @@
var searchData=
[
- ['add_5fparticle_0',['add_particle',['../classPenningTrap.html#a6e9776ff5b149f01080800716455d7c8',1,'PenningTrap']]],
- ['arma_5fvector_5fclose_5fto_1',['arma_vector_close_to',['../utils_8hpp.html#a0c95c4791692b06f8811905a76dbd772',1,'arma_vector_close_to(arma::vec &a, arma::vec &b, double tol=1e-8): utils.cpp'],['../utils_8cpp.html#a5d2e1e032fd19614f2fbb58149a7b02a',1,'arma_vector_close_to(arma::vec &a, arma::vec &b, double tol): utils.cpp']]],
- ['assert_2',['ASSERT',['../utils_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9',1,'utils.hpp']]]
+ ['_5f_5fmethod_5fname_5f_5f_0',['__METHOD_NAME__',['../utils_8hpp.html#a60dca3177fb9cb5256609adc7af55168',1,'utils.hpp']]]
];
diff --git a/docs/search/all_1.js b/docs/search/all_1.js
index 80ed042..4fc815a 100644
--- a/docs/search/all_1.js
+++ b/docs/search/all_1.js
@@ -1,5 +1,6 @@
var searchData=
[
- ['b_5f0_0',['B_0',['../classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716',1,'PenningTrap']]],
- ['bug_20list_1',['Bug List',['../bug.html',1,'']]]
+ ['add_5fparticle_0',['add_particle',['../classPenningTrap.html#a6e9776ff5b149f01080800716455d7c8',1,'PenningTrap']]],
+ ['arma_5fvector_5fclose_5fto_1',['arma_vector_close_to',['../utils_8hpp.html#a0c95c4791692b06f8811905a76dbd772',1,'arma_vector_close_to(arma::vec &a, arma::vec &b, double tol=1e-8): utils.cpp'],['../utils_8cpp.html#a5d2e1e032fd19614f2fbb58149a7b02a',1,'arma_vector_close_to(arma::vec &a, arma::vec &b, double tol): utils.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
new file mode 100644
index 0000000..1b9fc74
--- /dev/null
+++ b/docs/search/all_10.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['write_5fsimulation_5fto_5fdir_0',['write_simulation_to_dir',['../classPenningTrap.html#abbb832a85139b1a56ebde57d7b8f9a57',1,'PenningTrap']]]
+];
diff --git a/docs/search/all_2.js b/docs/search/all_2.js
index 0648f09..80ed042 100644
--- a/docs/search/all_2.js
+++ b/docs/search/all_2.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['constants_2ehpp_0',['constants.hpp',['../constants_8hpp.html',1,'']]]
+ ['b_5f0_0',['B_0',['../classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716',1,'PenningTrap']]],
+ ['bug_20list_1',['Bug List',['../bug.html',1,'']]]
];
diff --git a/docs/search/all_3.js b/docs/search/all_3.js
index e50dce3..0648f09 100644
--- a/docs/search/all_3.js
+++ b/docs/search/all_3.js
@@ -1,5 +1,4 @@
var searchData=
[
- ['d_0',['d',['../classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2',1,'PenningTrap']]],
- ['debug_1',['DEBUG',['../utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b',1,'utils.hpp']]]
+ ['constants_2ehpp_0',['constants.hpp',['../constants_8hpp.html',1,'']]]
];
diff --git a/docs/search/all_4.js b/docs/search/all_4.js
index c031fe4..e50dce3 100644
--- a/docs/search/all_4.js
+++ b/docs/search/all_4.js
@@ -1,7 +1,5 @@
var searchData=
[
- ['evolve_5fforward_5feuler_0',['evolve_forward_euler',['../classPenningTrap.html#a56544b6f4befb42984e9650cf2a40965',1,'PenningTrap']]],
- ['evolve_5frk4_1',['evolve_RK4',['../classPenningTrap.html#ab891b839c40eeb38d8a2a636c70090a9',1,'PenningTrap']]],
- ['external_5fb_5ffield_2',['external_B_field',['../classPenningTrap.html#a2a3e7f480ba52e9f24d4c50c3981a784',1,'PenningTrap']]],
- ['external_5fe_5ffield_3',['external_E_field',['../classPenningTrap.html#a978a2e2026a4b5308d5184712f81704b',1,'PenningTrap']]]
+ ['d_0',['d',['../classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2',1,'PenningTrap']]],
+ ['debug_1',['DEBUG',['../utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b',1,'utils.hpp']]]
];
diff --git a/docs/search/all_5.js b/docs/search/all_5.js
index ccf47d2..c4c479f 100644
--- a/docs/search/all_5.js
+++ b/docs/search/all_5.js
@@ -1,4 +1,7 @@
var searchData=
[
- ['force_5fon_5fparticle_0',['force_on_particle',['../classPenningTrap.html#a4790f41e4fbc6ede4991aa7bbda92182',1,'PenningTrap']]]
+ ['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']]]
];
diff --git a/docs/search/all_6.js b/docs/search/all_6.js
index cb8673f..d1d9acc 100644
--- a/docs/search/all_6.js
+++ b/docs/search/all_6.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['k_5fe_0',['K_E',['../constants_8hpp.html#a4e451456ad7e9276ed0afa42826e7ccb',1,'constants.hpp']]]
+ ['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']]]
];
diff --git a/docs/search/all_7.js b/docs/search/all_7.js
index 959abdd..6af262e 100644
--- a/docs/search/all_7.js
+++ b/docs/search/all_7.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['m_0',['m',['../classParticle.html#aedcc7e1bc53b0e2b1a4a07c9a1b47563',1,'Particle']]],
- ['m_5fassert_1',['m_assert',['../utils_8hpp.html#a2cc3a2cdb635bac3c8b02e89d4d6af38',1,'m_assert(bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg): utils.cpp'],['../utils_8cpp.html#aff5e07c3c1d321709b0cc38e999f427b',1,'m_assert(bool expr, std::string expr_str, std::string f, std::string file, int line, std::string msg): utils.cpp']]],
- ['main_2ecpp_2',['main.cpp',['../main_8cpp.html',1,'']]]
+ ['k_5fe_0',['K_E',['../constants_8hpp.html#a4e451456ad7e9276ed0afa42826e7ccb',1,'constants.hpp']]],
+ ['k_5fr_1',['k_r',['../classPenningTrap.html#a2f168622587709b9e3c49077f0b9a640',1,'PenningTrap']]],
+ ['k_5fv_2',['k_v',['../classPenningTrap.html#ae9b5afdaa5cd366e94bd294452a1eed4',1,'PenningTrap']]]
];
diff --git a/docs/search/all_8.js b/docs/search/all_8.js
index 3ec818e..d86b301 100644
--- a/docs/search/all_8.js
+++ b/docs/search/all_8.js
@@ -1,12 +1,7 @@
var searchData=
[
- ['particle_0',['Particle',['../classParticle.html',1,'Particle'],['../classParticle.html#a00e108823877a25513ccae7cac011b4c',1,'Particle::Particle()']]],
- ['particle_2ecpp_1',['Particle.cpp',['../Particle_8cpp.html',1,'']]],
- ['particle_2ehpp_2',['Particle.hpp',['../Particle_8hpp.html',1,'']]],
- ['particles_3',['particles',['../classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f',1,'PenningTrap']]],
- ['penning_20trap_20simulation_4',['Penning trap simulation',['../index.html',1,'']]],
- ['penningtrap_5',['PenningTrap',['../classPenningTrap.html',1,'PenningTrap'],['../classParticle.html#aa797d319549dc2a0beb06cdbfd430232',1,'Particle::PenningTrap()'],['../classPenningTrap.html#a81add5063bd5f29d77f0b5c299c6c560',1,'PenningTrap::PenningTrap()']]],
- ['penningtrap_2ecpp_6',['PenningTrap.cpp',['../PenningTrap_8cpp.html',1,'']]],
- ['penningtrap_2ehpp_7',['PenningTrap.hpp',['../PenningTrap_8hpp.html',1,'']]],
- ['penningtraptest_8',['PenningTrapTest',['../classPenningTrapTest.html',1,'']]]
+ ['m_0',['m',['../classParticle.html#aedcc7e1bc53b0e2b1a4a07c9a1b47563',1,'Particle']]],
+ ['m_5fassert_1',['m_assert',['../utils_8hpp.html#a2cc3a2cdb635bac3c8b02e89d4d6af38',1,'m_assert(bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg): utils.cpp'],['../utils_8cpp.html#aff5e07c3c1d321709b0cc38e999f427b',1,'m_assert(bool expr, std::string expr_str, std::string f, std::string file, int line, std::string msg): utils.cpp']]],
+ ['main_2ecpp_2',['main.cpp',['../main_8cpp.html',1,'']]],
+ ['mkpath_3',['mkpath',['../utils_8hpp.html#a6fdd7217b750aff5b6295ece7cbdeffa',1,'mkpath(std::string path, int mode=0777): utils.cpp'],['../utils_8cpp.html#acf13f4e492199cb7231bfa646dbd08de',1,'mkpath(std::string path, int mode): utils.cpp']]]
];
diff --git a/docs/search/all_9.js b/docs/search/all_9.js
index a43f9bc..962dfef 100644
--- a/docs/search/all_9.js
+++ b/docs/search/all_9.js
@@ -1,4 +1,12 @@
var searchData=
[
- ['q_0',['q',['../classParticle.html#a566dcc1de4bdc01251776948798ea8e1',1,'Particle']]]
+ ['particle_0',['Particle',['../classParticle.html',1,'Particle'],['../classParticle.html#a7af9f8d1fef63dd7643b06629ac7bef4',1,'Particle::Particle()']]],
+ ['particle_2ecpp_1',['Particle.cpp',['../Particle_8cpp.html',1,'']]],
+ ['particle_2ehpp_2',['Particle.hpp',['../Particle_8hpp.html',1,'']]],
+ ['particles_3',['particles',['../classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f',1,'PenningTrap']]],
+ ['penning_20trap_20simulation_4',['Penning trap simulation',['../index.html',1,'']]],
+ ['penningtrap_5',['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_2ecpp_6',['PenningTrap.cpp',['../PenningTrap_8cpp.html',1,'']]],
+ ['penningtrap_2ehpp_7',['PenningTrap.hpp',['../PenningTrap_8hpp.html',1,'']]],
+ ['penningtraptest_8',['PenningTrapTest',['../classPenningTrapTest.html',1,'']]]
];
diff --git a/docs/search/all_a.js b/docs/search/all_a.js
index b78ca6a..a43f9bc 100644
--- a/docs/search/all_a.js
+++ b/docs/search/all_a.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['r_5fvec_0',['r_vec',['../classParticle.html#acf1a0f3c978b06d76df5bb4279594467',1,'Particle']]]
+ ['q_0',['q',['../classParticle.html#a566dcc1de4bdc01251776948798ea8e1',1,'Particle']]]
];
diff --git a/docs/search/all_b.js b/docs/search/all_b.js
index bf61385..fb8b113 100644
--- a/docs/search/all_b.js
+++ b/docs/search/all_b.js
@@ -1,4 +1,5 @@
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']]]
+ ['r_5ffunc_0',['r_func',['../classPenningTrap.html#a43e74792ab4b3f9299f35cb64bdb2648',1,'PenningTrap']]],
+ ['r_5fvec_1',['r_vec',['../classParticle.html#af9497cd8f2dcad0fad54f571ddb383e6',1,'Particle']]]
];
diff --git a/docs/search/all_c.js b/docs/search/all_c.js
index 89cf6c6..f0c09d2 100644
--- a/docs/search/all_c.js
+++ b/docs/search/all_c.js
@@ -1,9 +1,8 @@
var searchData=
[
- ['t_0',['T',['../constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5',1,'constants.hpp']]],
- ['test_5fsuite_2ecpp_1',['test_suite.cpp',['../test__suite_8cpp.html',1,'']]],
- ['todo_20list_2',['Todo List',['../todo.html',1,'']]],
- ['total_5fforce_3',['total_force',['../classPenningTrap.html#a83cc7a04dae009ed8e75453c38fdf8be',1,'PenningTrap']]],
- ['total_5fforce_5fexternal_4',['total_force_external',['../classPenningTrap.html#a045adb85e97a8e0c38fb36d2fd74eeee',1,'PenningTrap']]],
- ['total_5fforce_5fparticles_5',['total_force_particles',['../classPenningTrap.html#a135db7d991d9b88b00fde4edee71f78d',1,'PenningTrap']]]
+ ['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#a5331837e6dd7bce807a99edd2ba7e854',1,'PenningTrap']]]
];
diff --git a/docs/search/all_d.js b/docs/search/all_d.js
index cd921db..c04457d 100644
--- a/docs/search/all_d.js
+++ b/docs/search/all_d.js
@@ -1,5 +1,10 @@
var searchData=
[
- ['utils_2ecpp_0',['utils.cpp',['../utils_8cpp.html',1,'']]],
- ['utils_2ehpp_1',['utils.hpp',['../utils_8hpp.html',1,'']]]
+ ['t_0',['t',['../classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e',1,'PenningTrap']]],
+ ['t_1',['T',['../constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5',1,'constants.hpp']]],
+ ['test_5fsuite_2ecpp_2',['test_suite.cpp',['../test__suite_8cpp.html',1,'']]],
+ ['total_5fforce_3',['total_force',['../classPenningTrap.html#a1f668c4433421136ad51741741aa1bc8',1,'PenningTrap']]],
+ ['total_5fforce_5fexternal_4',['total_force_external',['../classPenningTrap.html#ae72d203b0bfa1b9e72bea28cb2863c56',1,'PenningTrap']]],
+ ['total_5fforce_5fparticles_5',['total_force_particles',['../classPenningTrap.html#a46a954a0946def199e30fb300ba1c47b',1,'PenningTrap']]],
+ ['typedefs_2ehpp_6',['typedefs.hpp',['../typedefs_8hpp.html',1,'']]]
];
diff --git a/docs/search/all_e.js b/docs/search/all_e.js
index b447fa7..cd921db 100644
--- a/docs/search/all_e.js
+++ b/docs/search/all_e.js
@@ -1,6 +1,5 @@
var searchData=
[
- ['v_0',['V',['../constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb',1,'constants.hpp']]],
- ['v_5f0_1',['V_0',['../classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89',1,'PenningTrap']]],
- ['v_5fvec_2',['v_vec',['../classParticle.html#a4a5d22c7aeca66f67d083f270cba25df',1,'Particle']]]
+ ['utils_2ecpp_0',['utils.cpp',['../utils_8cpp.html',1,'']]],
+ ['utils_2ehpp_1',['utils.hpp',['../utils_8hpp.html',1,'']]]
];
diff --git a/docs/search/all_f.js b/docs/search/all_f.js
new file mode 100644
index 0000000..bb9c0eb
--- /dev/null
+++ b/docs/search/all_f.js
@@ -0,0 +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']]]
+];
diff --git a/docs/search/defines_0.js b/docs/search/defines_0.js
index 97ce9d9..1e5c227 100644
--- a/docs/search/defines_0.js
+++ b/docs/search/defines_0.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['assert_0',['ASSERT',['../utils_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9',1,'utils.hpp']]]
+ ['_5f_5fmethod_5fname_5f_5f_0',['__METHOD_NAME__',['../utils_8hpp.html#a60dca3177fb9cb5256609adc7af55168',1,'utils.hpp']]]
];
diff --git a/docs/search/defines_1.js b/docs/search/defines_1.js
index c6466cb..97ce9d9 100644
--- a/docs/search/defines_1.js
+++ b/docs/search/defines_1.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['debug_0',['DEBUG',['../utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b',1,'utils.hpp']]]
+ ['assert_0',['ASSERT',['../utils_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9',1,'utils.hpp']]]
];
diff --git a/docs/search/defines_2.js b/docs/search/defines_2.js
index cb8673f..c6466cb 100644
--- a/docs/search/defines_2.js
+++ b/docs/search/defines_2.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_3.js b/docs/search/defines_3.js
index 6eef01f..cb8673f 100644
--- a/docs/search/defines_3.js
+++ b/docs/search/defines_3.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_4.js b/docs/search/defines_4.js
index 06f433f..6eef01f 100644
--- a/docs/search/defines_4.js
+++ b/docs/search/defines_4.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_5.js b/docs/search/defines_5.js
new file mode 100644
index 0000000..06f433f
--- /dev/null
+++ b/docs/search/defines_5.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['v_0',['V',['../constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb',1,'constants.hpp']]]
+];
diff --git a/docs/search/files_3.js b/docs/search/files_3.js
index 1ca9264..5e3fea9 100644
--- a/docs/search/files_3.js
+++ b/docs/search/files_3.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['test_5fsuite_2ecpp_0',['test_suite.cpp',['../test__suite_8cpp.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/functions_1.js b/docs/search/functions_1.js
index c031fe4..c4c479f 100644
--- a/docs/search/functions_1.js
+++ b/docs/search/functions_1.js
@@ -1,7 +1,7 @@
var searchData=
[
- ['evolve_5fforward_5feuler_0',['evolve_forward_euler',['../classPenningTrap.html#a56544b6f4befb42984e9650cf2a40965',1,'PenningTrap']]],
- ['evolve_5frk4_1',['evolve_RK4',['../classPenningTrap.html#ab891b839c40eeb38d8a2a636c70090a9',1,'PenningTrap']]],
- ['external_5fb_5ffield_2',['external_B_field',['../classPenningTrap.html#a2a3e7f480ba52e9f24d4c50c3981a784',1,'PenningTrap']]],
- ['external_5fe_5ffield_3',['external_E_field',['../classPenningTrap.html#a978a2e2026a4b5308d5184712f81704b',1,'PenningTrap']]]
+ ['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']]]
];
diff --git a/docs/search/functions_2.js b/docs/search/functions_2.js
index ccf47d2..d1d9acc 100644
--- a/docs/search/functions_2.js
+++ b/docs/search/functions_2.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['force_5fon_5fparticle_0',['force_on_particle',['../classPenningTrap.html#a4790f41e4fbc6ede4991aa7bbda92182',1,'PenningTrap']]]
+ ['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']]]
];
diff --git a/docs/search/functions_3.js b/docs/search/functions_3.js
index 30ce46b..ffb26d6 100644
--- a/docs/search/functions_3.js
+++ b/docs/search/functions_3.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['m_5fassert_0',['m_assert',['../utils_8hpp.html#a2cc3a2cdb635bac3c8b02e89d4d6af38',1,'m_assert(bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg): utils.cpp'],['../utils_8cpp.html#aff5e07c3c1d321709b0cc38e999f427b',1,'m_assert(bool expr, std::string expr_str, std::string f, std::string file, int line, std::string msg): utils.cpp']]]
+ ['m_5fassert_0',['m_assert',['../utils_8hpp.html#a2cc3a2cdb635bac3c8b02e89d4d6af38',1,'m_assert(bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg): utils.cpp'],['../utils_8cpp.html#aff5e07c3c1d321709b0cc38e999f427b',1,'m_assert(bool expr, std::string expr_str, std::string f, std::string file, int line, std::string msg): utils.cpp']]],
+ ['mkpath_1',['mkpath',['../utils_8hpp.html#a6fdd7217b750aff5b6295ece7cbdeffa',1,'mkpath(std::string path, int mode=0777): utils.cpp'],['../utils_8cpp.html#acf13f4e492199cb7231bfa646dbd08de',1,'mkpath(std::string path, int mode): utils.cpp']]]
];
diff --git a/docs/search/functions_4.js b/docs/search/functions_4.js
index 2dc79c5..852716e 100644
--- a/docs/search/functions_4.js
+++ b/docs/search/functions_4.js
@@ -1,5 +1,5 @@
var searchData=
[
- ['particle_0',['Particle',['../classParticle.html#a00e108823877a25513ccae7cac011b4c',1,'Particle']]],
- ['penningtrap_1',['PenningTrap',['../classPenningTrap.html#a81add5063bd5f29d77f0b5c299c6c560',1,'PenningTrap']]]
+ ['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.)']]]
];
diff --git a/docs/search/functions_5.js b/docs/search/functions_5.js
index bf61385..07b3041 100644
--- a/docs/search/functions_5.js
+++ b/docs/search/functions_5.js
@@ -1,4 +1,4 @@
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']]]
+ ['r_5ffunc_0',['r_func',['../classPenningTrap.html#a43e74792ab4b3f9299f35cb64bdb2648',1,'PenningTrap']]]
];
diff --git a/docs/search/functions_6.js b/docs/search/functions_6.js
index 83f26c2..a7b65b4 100644
--- a/docs/search/functions_6.js
+++ b/docs/search/functions_6.js
@@ -1,6 +1,5 @@
var searchData=
[
- ['total_5fforce_0',['total_force',['../classPenningTrap.html#a83cc7a04dae009ed8e75453c38fdf8be',1,'PenningTrap']]],
- ['total_5fforce_5fexternal_1',['total_force_external',['../classPenningTrap.html#a045adb85e97a8e0c38fb36d2fd74eeee',1,'PenningTrap']]],
- ['total_5fforce_5fparticles_2',['total_force_particles',['../classPenningTrap.html#a135db7d991d9b88b00fde4edee71f78d',1,'PenningTrap']]]
+ ['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#a5331837e6dd7bce807a99edd2ba7e854',1,'PenningTrap']]]
];
diff --git a/docs/search/functions_7.js b/docs/search/functions_7.js
new file mode 100644
index 0000000..73e1881
--- /dev/null
+++ b/docs/search/functions_7.js
@@ -0,0 +1,6 @@
+var searchData=
+[
+ ['total_5fforce_0',['total_force',['../classPenningTrap.html#a1f668c4433421136ad51741741aa1bc8',1,'PenningTrap']]],
+ ['total_5fforce_5fexternal_1',['total_force_external',['../classPenningTrap.html#ae72d203b0bfa1b9e72bea28cb2863c56',1,'PenningTrap']]],
+ ['total_5fforce_5fparticles_2',['total_force_particles',['../classPenningTrap.html#a46a954a0946def199e30fb300ba1c47b',1,'PenningTrap']]]
+];
diff --git a/docs/search/functions_8.js b/docs/search/functions_8.js
new file mode 100644
index 0000000..8d7b6ff
--- /dev/null
+++ b/docs/search/functions_8.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['v_5ffunc_0',['v_func',['../classPenningTrap.html#af98a720da60b0e1a62aefa5f5cb37c1e',1,'PenningTrap']]]
+];
diff --git a/docs/search/functions_9.js b/docs/search/functions_9.js
new file mode 100644
index 0000000..1b9fc74
--- /dev/null
+++ b/docs/search/functions_9.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['write_5fsimulation_5fto_5fdir_0',['write_simulation_to_dir',['../classPenningTrap.html#abbb832a85139b1a56ebde57d7b8f9a57',1,'PenningTrap']]]
+];
diff --git a/docs/search/searchdata.js b/docs/search/searchdata.js
index 906104d..4d47bbf 100644
--- a/docs/search/searchdata.js
+++ b/docs/search/searchdata.js
@@ -1,13 +1,14 @@
var indexSectionsWithContent =
{
- 0: "abcdefkmpqrstuv",
+ 0: "_abcdefkmpqrstuvw",
1: "p",
2: "cmptu",
- 3: "aefmpst",
- 4: "bdmpqrv",
- 5: "p",
- 6: "adktv",
- 7: "bpt"
+ 3: "aefmprstvw",
+ 4: "bdkmpqrtv",
+ 5: "sv",
+ 6: "p",
+ 7: "_adktv",
+ 8: "bp"
};
var indexSectionNames =
@@ -17,9 +18,10 @@ var indexSectionNames =
2: "files",
3: "functions",
4: "variables",
- 5: "related",
- 6: "defines",
- 7: "pages"
+ 5: "typedefs",
+ 6: "related",
+ 7: "defines",
+ 8: "pages"
};
var indexSectionLabels =
@@ -29,8 +31,9 @@ var indexSectionLabels =
2: "Files",
3: "Functions",
4: "Variables",
- 5: "Friends",
- 6: "Macros",
- 7: "Pages"
+ 5: "Typedefs",
+ 6: "Friends",
+ 7: "Macros",
+ 8: "Pages"
};
diff --git a/docs/search/typedefs_0.js b/docs/search/typedefs_0.js
new file mode 100644
index 0000000..e79ff95
--- /dev/null
+++ b/docs/search/typedefs_0.js
@@ -0,0 +1,6 @@
+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']]]
+];
diff --git a/docs/search/typedefs_1.js b/docs/search/typedefs_1.js
new file mode 100644
index 0000000..fe88abf
--- /dev/null
+++ b/docs/search/typedefs_1.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['vec_5f3d_0',['vec_3d',['../typedefs_8hpp.html#a9f33f4962c8fb62cc5ccd0e4e039a8df',1,'typedefs.hpp']]]
+];
diff --git a/docs/search/variables_2.js b/docs/search/variables_2.js
index 8411aec..7ff6c24 100644
--- a/docs/search/variables_2.js
+++ b/docs/search/variables_2.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['m_0',['m',['../classParticle.html#aedcc7e1bc53b0e2b1a4a07c9a1b47563',1,'Particle']]]
+ ['k_5fr_0',['k_r',['../classPenningTrap.html#a2f168622587709b9e3c49077f0b9a640',1,'PenningTrap']]],
+ ['k_5fv_1',['k_v',['../classPenningTrap.html#ae9b5afdaa5cd366e94bd294452a1eed4',1,'PenningTrap']]]
];
diff --git a/docs/search/variables_3.js b/docs/search/variables_3.js
index c9f603d..8411aec 100644
--- a/docs/search/variables_3.js
+++ b/docs/search/variables_3.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['particles_0',['particles',['../classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f',1,'PenningTrap']]]
+ ['m_0',['m',['../classParticle.html#aedcc7e1bc53b0e2b1a4a07c9a1b47563',1,'Particle']]]
];
diff --git a/docs/search/variables_4.js b/docs/search/variables_4.js
index a43f9bc..c9f603d 100644
--- a/docs/search/variables_4.js
+++ b/docs/search/variables_4.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['q_0',['q',['../classParticle.html#a566dcc1de4bdc01251776948798ea8e1',1,'Particle']]]
+ ['particles_0',['particles',['../classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f',1,'PenningTrap']]]
];
diff --git a/docs/search/variables_5.js b/docs/search/variables_5.js
index b78ca6a..a43f9bc 100644
--- a/docs/search/variables_5.js
+++ b/docs/search/variables_5.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['r_5fvec_0',['r_vec',['../classParticle.html#acf1a0f3c978b06d76df5bb4279594467',1,'Particle']]]
+ ['q_0',['q',['../classParticle.html#a566dcc1de4bdc01251776948798ea8e1',1,'Particle']]]
];
diff --git a/docs/search/variables_6.js b/docs/search/variables_6.js
index 01f3a29..fa44d82 100644
--- a/docs/search/variables_6.js
+++ b/docs/search/variables_6.js
@@ -1,5 +1,4 @@
var searchData=
[
- ['v_5f0_0',['V_0',['../classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89',1,'PenningTrap']]],
- ['v_5fvec_1',['v_vec',['../classParticle.html#a4a5d22c7aeca66f67d083f270cba25df',1,'Particle']]]
+ ['r_5fvec_0',['r_vec',['../classParticle.html#af9497cd8f2dcad0fad54f571ddb383e6',1,'Particle']]]
];
diff --git a/docs/search/variables_7.js b/docs/search/variables_7.js
new file mode 100644
index 0000000..c7c5d99
--- /dev/null
+++ b/docs/search/variables_7.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['t_0',['t',['../classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e',1,'PenningTrap']]]
+];
diff --git a/docs/search/variables_8.js b/docs/search/variables_8.js
new file mode 100644
index 0000000..601b41d
--- /dev/null
+++ b/docs/search/variables_8.js
@@ -0,0 +1,5 @@
+var searchData=
+[
+ ['v_5f0_0',['V_0',['../classPenningTrap.html#aaf105828121c4a33cc2b217453c20317',1,'PenningTrap']]],
+ ['v_5fvec_1',['v_vec',['../classParticle.html#a879692772803d6ab65fa4993b54aea6e',1,'Particle']]]
+];
diff --git a/docs/test__suite_8cpp.html b/docs/test__suite_8cpp.html
index 787939b..7c69921 100644
--- a/docs/test__suite_8cpp.html
+++ b/docs/test__suite_8cpp.html
@@ -131,7 +131,7 @@ Functions
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 0.1
-Bug: No known bugs
+Bug: No known bugs
Definition in file test_suite.cpp .
diff --git a/docs/test__suite_8cpp_source.html b/docs/test__suite_8cpp_source.html
index 3fab92c..b317c82 100644
--- a/docs/test__suite_8cpp_source.html
+++ b/docs/test__suite_8cpp_source.html
@@ -136,9 +136,9 @@ $(document).ready(function(){initNavTree('test__suite_8cpp_source.html',''); ini
46 std::stringstream msg;
- 47 for (
int i = 0; i < tests.size(); i++) {
+ 47 for (
size_t i = 0; i < tests.size(); i++) {
48 v = tests.at(i).first;
-
+
52 msg <<
"Testing the external E field at (" << std::setprecision(2)
@@ -154,7 +154,7 @@ $(document).ready(function(){initNavTree('test__suite_8cpp_source.html',''); ini
64 arma::vec expected{0., 0.,
T };
-
+
67 "Testing the external B field at (0,0,0)" );
@@ -171,14 +171,14 @@ $(document).ready(function(){initNavTree('test__suite_8cpp_source.html',''); ini
81 arma::vec expected{-1., 0., 0.};
-
+
84 "Testing the force on a particle at (0,0,0) from a "
85 "particle at (1,0,0)." );
88 expected = arma::vec{0, -.024, -.032};
-
+
91 "Testing the force on a particle at (0,0,0) from a "
92 "particle at (0,3,4)." );
@@ -191,7 +191,7 @@ $(document).ready(function(){initNavTree('test__suite_8cpp_source.html',''); ini
99 Particle (1., 40., arma::vec{1., 2., 3.}, arma::vec{3., 4., 5.}));
101 arma::vec expected{395.58954878, -270.15871624, -57.89115348};
-
+
104 "Testing the total external force on a particle at "
105 "(1,2,3) with velocity (3,4,5)" );
@@ -204,7 +204,7 @@ $(document).ready(function(){initNavTree('test__suite_8cpp_source.html',''); ini
112 Particle (1., 40., arma::vec{0., 0., 0.}, arma::vec{0., 0., 0.}));
114 arma::vec expected{0., 0., 0.};
-
+
117 "Testing the total force of all particles on particle 0 "
118 "with only a single particle" );
@@ -217,7 +217,7 @@ $(document).ready(function(){initNavTree('test__suite_8cpp_source.html',''); ini
125 Particle (1., 40., arma::vec{0., 0., 1.}, arma::vec{0., 0., 0.}));
127 expected = arma::vec(3, arma::fill::value(-3473.383325));
-
+
130 "Testing the total force of all particles on particle 0 "
131 "with 3 other particles." );
@@ -234,18 +234,18 @@ $(document).ready(function(){initNavTree('test__suite_8cpp_source.html',''); ini
A class for simulating a Penning trap.
-A class that holds attributes of a particle.
+A class that holds attributes of a particle.
-A class that simulates a Penning trap.
-arma::vec total_force_external(int i)
Calculate the total external force on a particle.
-arma::vec total_force_particles(int i)
Calculate the total force on a particle from other particles.
-arma::vec external_B_field(arma::vec r)
Calculate B at point r.
-arma::vec force_on_particle(int i, int j)
Calculate the force between 2 particles.
-void add_particle(Particle particle)
Add a particle to the system.
-arma::vec external_E_field(arma::vec r)
Calculate E at point r.
+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.
Function prototypes and macros that are useful.
-bool arma_vector_close_to(arma::vec &a, arma::vec &b, double tol=1e-8)
Test if two armadillo vectors are close to each other.
+bool arma_vector_close_to(arma::vec &a, arma::vec &b, double tol=1e-8)
Test if two armadillo vectors are close to each other.
#define ASSERT(expr, msg)
A prettier assertion function.
diff --git a/docs/typedefs_8hpp.html b/docs/typedefs_8hpp.html
new file mode 100644
index 0000000..1f2eedb
--- /dev/null
+++ b/docs/typedefs_8hpp.html
@@ -0,0 +1,222 @@
+
+
+
+
+
+
+
+Penning Trap Simulation: include/typedefs.hpp File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Penning Trap Simulation
+
+ Simulate particle behavior inside a Penning Trap
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
Useful typedefs for cleaner code.
+More...
+
#include <vector>
+#include <armadillo>
+
+
Go to the source code of this file.
+
+
+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 for the result of the simulate method.
+
+typedef arma::vec::fixed< 3 > vec_3d
+ Typedef for a fixed 3d arma vector.
+
+
+
+
Useful typedefs for cleaner code.
+
Author Cory Alexander Balaton (coryab)
+
+Janita Ovidie Sandtrøen Willumsen (janitaws)
+
Version 1.0
+
These typedefs make the code more readable and easy to follow along.
+
Bug: No known bugs
+
+
Definition in file typedefs.hpp .
+
+
+
◆ sim_arr
+
+
+
+
+
Typedef for the result of the simulate method.
+
+
Definition at line 32 of file typedefs.hpp .
+
+
+
+
+
◆ sim_cols
+
+
+
+
+
+ typedef std::vector<arma::vec::fixed<3> > sim_cols
+
+
+
+
+
Typedef for the column of the result vector from simulating particles.
+
+
Definition at line 24 of file typedefs.hpp .
+
+
+
+
+
◆ sim_rows
+
+
+
+
+
+ typedef std::vector<arma::vec::fixed<3> > sim_rows
+
+
+
+
+
Typedef for the row of the result vector from simulating particles.
+
+
Definition at line 28 of file typedefs.hpp .
+
+
+
+
+
◆ vec_3d
+
+
+
+
+
+ typedef arma::vec::fixed<3> vec_3d
+
+
+
+
+
Typedef for a fixed 3d arma vector.
+
+
Definition at line 36 of file typedefs.hpp .
+
+
+
+
+
+
+
+
+
diff --git a/docs/typedefs_8hpp.js b/docs/typedefs_8hpp.js
new file mode 100644
index 0000000..d014844
--- /dev/null
+++ b/docs/typedefs_8hpp.js
@@ -0,0 +1,7 @@
+var typedefs_8hpp =
+[
+ [ "sim_arr", "typedefs_8hpp.html#aec69d34220fff45de238b9e01f2686af", null ],
+ [ "sim_cols", "typedefs_8hpp.html#a7c2dfa854274262c4e00e4ef0ab2ce23", null ],
+ [ "sim_rows", "typedefs_8hpp.html#a8502989b1b361725834fc185bd575f66", null ],
+ [ "vec_3d", "typedefs_8hpp.html#a9f33f4962c8fb62cc5ccd0e4e039a8df", null ]
+];
\ No newline at end of file
diff --git a/docs/typedefs_8hpp_source.html b/docs/typedefs_8hpp_source.html
new file mode 100644
index 0000000..475ff07
--- /dev/null
+++ b/docs/typedefs_8hpp_source.html
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+
+Penning Trap Simulation: include/typedefs.hpp Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Penning Trap Simulation
+
+ Simulate particle behavior inside a Penning Trap
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
+
+
+
+
+
+
24 typedef std::vector<arma::vec::fixed<3>>
sim_cols ;
+
+
28 typedef std::vector<arma::vec::fixed<3>>
sim_rows ;
+
+
+
+
+
+
+
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.
+
+
+
+
+
+
diff --git a/docs/utils_8cpp.html b/docs/utils_8cpp.html
index c2ffd2e..9401b51 100644
--- a/docs/utils_8cpp.html
+++ b/docs/utils_8cpp.html
@@ -106,7 +106,8 @@ $(document).ready(function(){initNavTree('utils_8cpp.html',''); initResizable();
Implementation of the utils.
More...
-#include "utils.hpp "
+
#include <sys/stat.h>
+
#include "utils.hpp "
Go to the source code of this file.
@@ -124,6 +125,9 @@ Functions
bool arma_vector_close_to (arma::vec &a, arma::vec &b, double tol)
Test if two armadillo vectors are close to each other.
+bool mkpath (std::string path, int mode)
+ Make path given.
+
Implementation of the utils.
@@ -131,7 +135,7 @@ Functions
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 1.0
-
Bug: No known bugs
+
Bug: No known bugs
Definition in file utils.cpp .
@@ -177,9 +181,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
Returns Boolean
+
Returns bool
-
Definition at line 59 of file utils.cpp .
+
Definition at line 62 of file utils.cpp .
@@ -247,7 +251,48 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-Definition at line 40 of file utils.cpp .
+Definition at line 43 of file utils.cpp .
+
+
+
+
+◆ mkpath()
+
+
+
+
+
+ bool mkpath
+ (
+ std::string
+ path ,
+
+
+
+
+ int
+ mode = 0777
+
+
+
+ )
+
+
+
+
+
+
Make path given.
+
This tries to be the equivalent to "mkdir -p" and creates a new directory whenever it needs to.
+
Parameters
+
+ path The path to be created
+ mode The mode/permissions for all the new directories
+
+
+
+
Returns bool
+
+
Definition at line 76 of file utils.cpp .
@@ -284,6 +329,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
Turns a vector of doubles into a string written in scientific format.
+
The code is stolen from https://github.com/anderkve/FYS3150 .
Parameters
v The vector to stringify
@@ -292,9 +338,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
Returns String
+
Returns std::string
-
Definition at line 21 of file utils.cpp .
+
Definition at line 24 of file utils.cpp .
@@ -331,7 +377,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
diff --git a/docs/utils_8cpp.js b/docs/utils_8cpp.js
index 36c50fa..362b36a 100644
--- a/docs/utils_8cpp.js
+++ b/docs/utils_8cpp.js
@@ -2,6 +2,7 @@ var utils_8cpp =
[
[ "arma_vector_close_to", "utils_8cpp.html#a5d2e1e032fd19614f2fbb58149a7b02a", null ],
[ "m_assert", "utils_8cpp.html#aff5e07c3c1d321709b0cc38e999f427b", null ],
+ [ "mkpath", "utils_8cpp.html#acf13f4e492199cb7231bfa646dbd08de", null ],
[ "scientific_format", "utils_8cpp.html#a58565270b643b24e3132f38c653e0199", null ],
[ "scientific_format", "utils_8cpp.html#acd2a9c7a7d5a7fe9163be8c4cc110746", null ]
];
\ No newline at end of file
diff --git a/docs/utils_8cpp_source.html b/docs/utils_8cpp_source.html
index 069cd7c..5ed9571 100644
--- a/docs/utils_8cpp_source.html
+++ b/docs/utils_8cpp_source.html
@@ -102,69 +102,97 @@ $(document).ready(function(){initNavTree('utils_8cpp_source.html',''); initResiz
Go to the documentation of this file.
-
-
-
-
-
-
17 ss << std::setw(width) << std::setprecision(prec) << std::scientific << d;
-
-
-
-
-
-
-
24 for (
double elem : v) {
-
-
-
-
-
-
30 static void print_message(std::string msg)
-
-
-
33 std::cout <<
"message: " << msg <<
"\n\n" ;
-
-
-
+
+
+
+
+
+
+
+
20 ss << std::setw(width) << std::setprecision(prec) << std::scientific << d;
+
+
+
+
+
+
+
27 for (
double elem : v) {
+
+
+
+
+
+
33 static void print_message(std::string msg)
+
+
+
36 std::cout <<
"message: " << msg <<
"\n\n" ;
-
-
-
40 void 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" ;
-
-
-
-
51 std::cout <<
"\x1B[31mFAIL\033[0m\n" ;
-
-
53 std::cout << file <<
" " << line <<
": Assertion \"" << expr_str
-
-
-
-
-
-
-
-
61 if (a.n_elem != b.n_elem) {
-
-
-
-
65 for (
int i = 0; i < a.n_elem; i++) {
-
66 if (std::abs(a(i) - b(i)) >= tol) {
-
-
-
-
-
-
bool arma_vector_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.
-
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.
+
+
+
+
+
+
43 void m_assert (
bool expr, std::string expr_str, std::string f, std::string file,
+
44 int line, std::string msg)
+
+
46 std::string new_assert(f.size() + (expr ? 4 : 6),
'-' );
+
47 std::cout <<
"\x1B[36m" << new_assert <<
"\033[0m\n" ;
+
48 std::cout << f <<
": " ;
+
+
50 std::cout <<
"\x1B[32mOK\033[0m\n" ;
+
+
+
+
54 std::cout <<
"\x1B[31mFAIL\033[0m\n" ;
+
+
56 std::cout << file <<
" " << line <<
": Assertion \"" << expr_str
+
+
+
+
+
+
+
+
64 if (a.n_elem != b.n_elem) {
+
+
+
+
68 for (
size_t i = 0; i < a.n_elem; i++) {
+
69 if (std::abs(a(i) - b(i)) >= tol) {
+
+
+
+
+
+
+
76 bool mkpath (std::string path,
int mode)
+
+
+
79 std::string::size_type pos = -1;
+
+
+
82 if (path.back() !=
'/' ) {
+
+
+
+
+
87 pos = path.find(
'/' , pos);
+
88 if (pos != std::string::npos) {
+
89 cur_dir = path.substr(0, pos);
+
90 if (mkdir(cur_dir.c_str(), mode) != 0 && stat(cur_dir.c_str(), &buf) != 0) {
+
+
+
+
+
+
+
+
+
+
bool arma_vector_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.
Function prototypes and macros that are useful.
diff --git a/docs/utils_8hpp.html b/docs/utils_8hpp.html
index dea4601..2866ae0 100644
--- a/docs/utils_8hpp.html
+++ b/docs/utils_8hpp.html
@@ -124,6 +124,7 @@ Macros
A prettier assertion function.
#define __METHOD_NAME__ methodName(__PRETTY_FUNCTION__)
+ Get the name of the current method/function.
bool arma_vector_close_to (arma::vec &a, arma::vec &b, double tol=1e-8)
Test if two armadillo vectors are close to each other.
+bool mkpath (std::string path, int mode=0777)
+ Make path given.
+
Function prototypes and macros that are useful.
@@ -148,7 +152,7 @@ Functions
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 1.0
These utility function are mainly for convenience and aren't directly related to the project.
-
Bug: No known bugs
+
Bug: No known bugs
Definition in file utils.hpp .
@@ -164,7 +168,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
Definition at line 48 of file utils.hpp .
+
Get the name of the current method/function.
+
+
Definition at line 51 of file utils.hpp .
@@ -193,9 +199,10 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
Value: m_assert (expr, #expr, __METHOD_NAME__, __FILE__, \
+
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.
+
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.
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.
@@ -270,9 +277,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
Returns Boolean
+
Returns bool
-
Definition at line 59 of file utils.cpp .
+
Definition at line 62 of file utils.cpp .
@@ -340,7 +347,48 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-Definition at line 40 of file utils.cpp .
+Definition at line 43 of file utils.cpp .
+
+
+
+
+◆ mkpath()
+
+
+
+
+
+ bool mkpath
+ (
+ std::string
+ path ,
+
+
+
+
+ int
+ mode = 0777
+
+
+
+ )
+
+
+
+
+
+
Make path given.
+
This tries to be the equivalent to "mkdir -p" and creates a new directory whenever it needs to.
+
Parameters
+
+ path The path to be created
+ mode The mode/permissions for all the new directories
+
+
+
+
Returns bool
+
+
Definition at line 76 of file utils.cpp .
@@ -377,6 +425,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
Turns a vector of doubles into a string written in scientific format.
+
The code is stolen from https://github.com/anderkve/FYS3150 .
Parameters
v The vector to stringify
@@ -385,9 +434,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
Returns String
+
Returns std::string
-
Definition at line 21 of file utils.cpp .
+
Definition at line 24 of file utils.cpp .
@@ -424,7 +473,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
diff --git a/docs/utils_8hpp.js b/docs/utils_8hpp.js
index 34c7b36..68951df 100644
--- a/docs/utils_8hpp.js
+++ b/docs/utils_8hpp.js
@@ -1,9 +1,11 @@
var utils_8hpp =
[
+ [ "__METHOD_NAME__", "utils_8hpp.html#a60dca3177fb9cb5256609adc7af55168", null ],
[ "ASSERT", "utils_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9", null ],
[ "DEBUG", "utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b", null ],
[ "arma_vector_close_to", "utils_8hpp.html#a0c95c4791692b06f8811905a76dbd772", null ],
[ "m_assert", "utils_8hpp.html#a2cc3a2cdb635bac3c8b02e89d4d6af38", null ],
+ [ "mkpath", "utils_8hpp.html#a6fdd7217b750aff5b6295ece7cbdeffa", null ],
[ "scientific_format", "utils_8hpp.html#ad54b96a1074f9df4dc892a41d115b72d", null ],
[ "scientific_format", "utils_8hpp.html#adfb618b2fdff47ef30a4a2b62c04f384", null ]
];
\ No newline at end of file
diff --git a/docs/utils_8hpp_source.html b/docs/utils_8hpp_source.html
index 33ddc52..1c7052d 100644
--- a/docs/utils_8hpp_source.html
+++ b/docs/utils_8hpp_source.html
@@ -121,39 +121,45 @@ $(document).ready(function(){initNavTree('utils_8hpp_source.html',''); initResiz
45 #define ASSERT(expr, msg) m_assert(expr, #expr, __METHOD_NAME__, __FILE__, \
- 48 #define __METHOD_NAME__ methodName(__PRETTY_FUNCTION__)
-
-
+ 51 #define __METHOD_NAME__ methodName(__PRETTY_FUNCTION__)
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 112 static inline std::string methodName(
const std::string& prettyFunction)
-
- 114 size_t colons = prettyFunction.find(
"::" );
- 115 size_t begin = prettyFunction.substr(0,colons).rfind(
" " ) + 1;
- 116 size_t end = prettyFunction.rfind(
"(" ) - begin;
-
- 118 return prettyFunction.substr(begin,end) +
"()" ;
-
-
-
-bool arma_vector_close_to(arma::vec &a, arma::vec &b, double tol=1e-8)
Test if two armadillo vectors are close to each other.
-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.
-std::string scientific_format(double d, int width=20, int prec=10)
Turns a double into a string written in scientific format.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 126 static inline std::string methodName(
const std::string& pretty_function)
+
+ 128 size_t colons = pretty_function.find(
"::" );
+ 129 size_t begin = pretty_function.substr(0,colons).rfind(
" " ) + 1;
+ 130 size_t end = pretty_function.rfind(
"(" ) - begin;
+
+ 132 return pretty_function.substr(begin,end) +
"()" ;
+
+
+
+ 146 bool mkpath (std::string path,
int mode = 0777);
+
+
+bool arma_vector_close_to(arma::vec &a, arma::vec &b, double tol=1e-8)
Test if two armadillo vectors are close to each other.
+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.
+std::string scientific_format(double d, int width=20, int prec=10)
Turns a double into a string written in scientific format.
diff --git a/man_pages/man3/Particle.3 b/man_pages/man3/Particle.3
index f37639d..ebff781 100644
--- a/man_pages/man3/Particle.3
+++ b/man_pages/man3/Particle.3
@@ -1,4 +1,4 @@
-.TH "Particle" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "Particle" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -13,7 +13,7 @@ Particle \- A class that holds attributes of a particle\&.
.in +1c
.ti -1c
-.RI "\fBParticle\fP (double \fBq\fP, double \fBm\fP, arma::vec::fixed< 3 > \fBr_vec\fP, arma::vec::fixed< 3 > \fBv_vec\fP)"
+.RI "\fBParticle\fP (double \fBq\fP, double \fBm\fP, \fBvec_3d\fP \fBr_vec\fP, \fBvec_3d\fP \fBv_vec\fP)"
.br
.RI "Initialize the particle\&. "
.in -1c
@@ -29,11 +29,11 @@ Particle \- A class that holds attributes of a particle\&.
.br
.RI "Mass\&. "
.ti -1c
-.RI "arma::vec::fixed< 3 > \fBr_vec\fP"
+.RI "\fBvec_3d\fP \fBr_vec\fP"
.br
.RI "position "
.ti -1c
-.RI "arma::vec::fixed< 3 > \fBv_vec\fP"
+.RI "\fBvec_3d\fP \fBv_vec\fP"
.br
.RI "velocity "
.in -1c
@@ -49,15 +49,28 @@ Particle \- A class that holds attributes of a particle\&.
.PP
A class that holds attributes of a particle\&.
.PP
-Definition at line \fB19\fP of file \fBParticle\&.hpp\fP\&.
+Definition at line \fB21\fP of file \fBParticle\&.hpp\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
-.SS "Particle::Particle (double q, double m, arma::vec::fixed< 3 > r_vec, arma::vec::fixed< 3 > v_vec)"
+.SS "Particle::Particle (double q, double m, \fBvec_3d\fP r_vec, \fBvec_3d\fP v_vec)"
.PP
-Initialize the particle\&. Initialize the particle with a charge, mass, position and velocity\&.
+Initialize the particle\&. Initialize the particle with a charge, mass, position and velocity\&.
.PP
-Definition at line \fB16\fP of file \fBParticle\&.cpp\fP\&.
+\fBParameters\fP
+.RS 4
+\fIq\fP The charge of the particle
+.br
+\fIm\fP The mass of the particle
+.br
+\fIr_vec\fP The initial position of the particle
+.br
+\fIv_vec\fP The initial velocity of the particle
+.RE
+.PP
+
+.PP
+Definition at line \fB15\fP of file \fBParticle\&.cpp\fP\&.
.SH "Friends And Related Function Documentation"
.PP
.SS "friend class \fBPenningTrap\fP\fC [friend]\fP"
@@ -65,7 +78,7 @@ Definition at line \fB16\fP of file \fBParticle\&.cpp\fP\&.
.PP
Make private attributes available for \fBPenningTrap\fP\&.
.PP
-Definition at line \fB38\fP of file \fBParticle\&.hpp\fP\&.
+Definition at line \fB43\fP of file \fBParticle\&.hpp\fP\&.
.SH "Member Data Documentation"
.PP
.SS "double Particle::m\fC [private]\fP"
@@ -73,25 +86,25 @@ Definition at line \fB38\fP of file \fBParticle\&.hpp\fP\&.
.PP
Mass\&.
.PP
-Definition at line \fB22\fP of file \fBParticle\&.hpp\fP\&.
+Definition at line \fB24\fP of file \fBParticle\&.hpp\fP\&.
.SS "double Particle::q\fC [private]\fP"
.PP
Charge\&.
.PP
-Definition at line \fB21\fP of file \fBParticle\&.hpp\fP\&.
-.SS "arma::vec::fixed<3> Particle::r_vec\fC [private]\fP"
+Definition at line \fB23\fP of file \fBParticle\&.hpp\fP\&.
+.SS "\fBvec_3d\fP Particle::r_vec\fC [private]\fP"
.PP
position
.PP
-Definition at line \fB23\fP of file \fBParticle\&.hpp\fP\&.
-.SS "arma::vec::fixed<3> Particle::v_vec\fC [private]\fP"
+Definition at line \fB25\fP of file \fBParticle\&.hpp\fP\&.
+.SS "\fBvec_3d\fP Particle::v_vec\fC [private]\fP"
.PP
velocity
.PP
-Definition at line \fB24\fP of file \fBParticle\&.hpp\fP\&.
+Definition at line \fB26\fP of file \fBParticle\&.hpp\fP\&.
.SH "Author"
.PP
diff --git a/man_pages/man3/Particle.cpp.3 b/man_pages/man3/Particle.cpp.3
index 7a93b45..904c7a4 100644
--- a/man_pages/man3/Particle.cpp.3
+++ b/man_pages/man3/Particle.cpp.3
@@ -1,4 +1,4 @@
-.TH "src/Particle.cpp" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "src/Particle.cpp" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -31,7 +31,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
.PP
\fBBug\fP
.RS 4
-No known bugs
+No known bugs
.RE
.PP
diff --git a/man_pages/man3/Particle.hpp.3 b/man_pages/man3/Particle.hpp.3
index abb26a7..2033d14 100644
--- a/man_pages/man3/Particle.hpp.3
+++ b/man_pages/man3/Particle.hpp.3
@@ -1,4 +1,4 @@
-.TH "include/Particle.hpp" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "include/Particle.hpp" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -9,6 +9,8 @@ include/Particle.hpp \- A class that holds the properties of a particle\&.
.PP
\fC#include \fP
.br
+\fC#include 'typedefs\&.hpp'\fP
+.br
.SS "Classes"
diff --git a/man_pages/man3/PenningTrap.3 b/man_pages/man3/PenningTrap.3
index 2087bb5..51cca93 100644
--- a/man_pages/man3/PenningTrap.3
+++ b/man_pages/man3/PenningTrap.3
@@ -1,4 +1,4 @@
-.TH "PenningTrap" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "PenningTrap" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -13,51 +13,77 @@ PenningTrap \- A class that simulates a Penning trap\&.
.in +1c
.ti -1c
-.RI "\fBPenningTrap\fP (double \fBB_0\fP=\fBT\fP, double \fBV_0\fP=25\&.*\fBV\fP/1000\&., double \fBd\fP=500\&.)"
+.RI "\fBPenningTrap\fP (double \fBB_0\fP=\fBT\fP, std::function< double(double)> \fBV_0\fP=[](double \fBt\fP) { return 25\&. *\fBV\fP/1000\&.;}, double \fBd\fP=500\&., double \fBt\fP=0\&.)"
.br
-.RI "Set B_0, V_0 and d\&. "
+.RI "Constructor for the \fBPenningTrap\fP class\&. "
+.ti -1c
+.RI "\fBPenningTrap\fP (unsigned int i, double \fBB_0\fP=\fBT\fP, std::function< double(double)> \fBV_0\fP=[](double \fBt\fP) { return 25\&. *\fBV\fP/1000\&.;}, double \fBd\fP=500\&., double \fBt\fP=0\&.)"
+.br
+.RI "Constructor for the \fBPenningTrap\fP class\&. "
+.ti -1c
+.RI "\fBPenningTrap\fP (std::vector< \fBParticle\fP > \fBparticles\fP, double \fBB_0\fP=\fBT\fP, std::function< double(double)> \fBV_0\fP=[](double \fBt\fP) { return 25\&. *\fBV\fP/1000\&.;}, double \fBd\fP=500\&., double \fBt\fP=0\&.)"
+.br
+.RI "Constructor for the \fBPenningTrap\fP class\&. "
.ti -1c
.RI "void \fBadd_particle\fP (\fBParticle\fP particle)"
.br
.RI "Add a particle to the system\&. "
.ti -1c
-.RI "arma::vec \fBexternal_E_field\fP (arma::vec r)"
+.RI "\fBvec_3d\fP \fBexternal_E_field\fP (\fBvec_3d\fP r)"
.br
.RI "Calculate E at point r\&. "
.ti -1c
-.RI "arma::vec \fBexternal_B_field\fP (arma::vec r)"
+.RI "\fBvec_3d\fP \fBexternal_B_field\fP (\fBvec_3d\fP r)"
.br
.RI "Calculate B at point r\&. "
.ti -1c
-.RI "arma::vec \fBforce_on_particle\fP (int i, int j)"
+.RI "\fBvec_3d\fP \fBforce_on_particle\fP (unsigned int i, unsigned int j)"
.br
.RI "Calculate the force between 2 particles\&. "
.ti -1c
-.RI "arma::vec \fBtotal_force_external\fP (int i)"
+.RI "\fBvec_3d\fP \fBtotal_force_external\fP (unsigned int i)"
.br
.RI "Calculate the total external force on a particle\&. "
.ti -1c
-.RI "arma::vec \fBtotal_force_particles\fP (int i)"
+.RI "\fBvec_3d\fP \fBtotal_force_particles\fP (unsigned int i)"
.br
-.RI "Calculate the total force on a particle from other particles\&. "
+.RI "Calculate the total force on a particle p_i from other particles\&. "
.ti -1c
-.RI "arma::vec \fBtotal_force\fP (int i)"
+.RI "\fBvec_3d\fP \fBtotal_force\fP (unsigned int i)"
.br
-.RI "calculate the total force on a particle\&. "
+.RI "calculate the total force on a particle p_i\&. "
.ti -1c
-.RI "void \fBevolve_RK4\fP (double dt)"
+.RI "void \fBevolve_RK4\fP (double dt, bool particle_interaction=true)"
.br
.RI "Go forward one timestep using the RK4 method\&. "
.ti -1c
-.RI "void \fBevolve_forward_euler\fP (double dt)"
+.RI "void \fBevolve_forward_euler\fP (double dt, bool particle_interaction=true)"
.br
.RI "Go forward one timestep using the forward Euler method\&. "
.ti -1c
-.RI "arma::vec \fBget_particle\fP (int i)"
+.RI "\fBsim_arr\fP \fBsimulate\fP (double time, unsigned int steps, std::string method='rk4', bool particle_interaction=true)"
.br
+.RI "Simulate the particle system inside the Penning trap over a certain amount of time\&. "
.ti -1c
-.RI "double \fBget_d\fP ()"
+.RI "void \fBwrite_simulation_to_dir\fP (std::string path, double time, unsigned int steps, std::string method='rk4', bool particle_interaction=true)"
.br
+.RI "Simulate and write the displacement of all particles to files\&. "
+.ti -1c
+.RI "double \fBfraction_of_particles_left\fP (double time, unsigned int steps, std::string method='rk4', bool particle_interaction=true)"
+.br
+.RI "Simulate and calculate what fraction of particles are still left inside the Penning trap after the simulation\&. "
+.in -1c
+.SS "Private Member Functions"
+
+.in +1c
+.ti -1c
+.RI "\fBvec_3d\fP \fBv_func\fP (unsigned int i, unsigned int j, double dt)"
+.br
+.RI "Helper for evolve_RK4 when calculating $k_{v,i,j}$ values\&. "
+.ti -1c
+.RI "\fBvec_3d\fP \fBr_func\fP (unsigned int i, unsigned int j, double dt)"
+.br
+.RI "Helper for evolve_RK4 when calculating $k_{r,i,j}$ values\&. "
.in -1c
.SS "Private Attributes"
@@ -67,7 +93,7 @@ PenningTrap \- A class that simulates a Penning trap\&.
.br
.RI "Magnetic field strength\&. "
.ti -1c
-.RI "double \fBV_0\fP"
+.RI "std::function< double(double)> \fBV_0\fP"
.br
.RI "Applied potential\&. "
.ti -1c
@@ -75,9 +101,19 @@ PenningTrap \- A class that simulates a Penning trap\&.
.br
.RI "Characteristic dimension\&. "
.ti -1c
+.RI "double \fBt\fP"
+.br
+.RI "Current time\&. "
+.ti -1c
.RI "std::vector< \fBParticle\fP > \fBparticles\fP"
.br
.RI "The particles in the Penning trap\&. "
+.ti -1c
+.RI "\fBsim_arr\fP \fBk_v\fP"
+.br
+.ti -1c
+.RI "\fBsim_arr\fP \fBk_r\fP"
+.br
.in -1c
.SH "Detailed Description"
.PP
@@ -85,15 +121,70 @@ A class that simulates a Penning trap\&.
This class simulates a Penning trap\&. It can take in a number of particles and simulate how they would behave inside a Penning trap\&.
.PP
-Definition at line \fB29\fP of file \fBPenningTrap\&.hpp\fP\&.
+Definition at line \fB30\fP of file \fBPenningTrap\&.hpp\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
-.SS "PenningTrap::PenningTrap (double B_0 = \fC\fBT\fP\fP, double V_0 = \fC25\&.*\fBV\fP/1000\&.\fP, double d = \fC500\&.\fP)"
+.SS "PenningTrap::PenningTrap (double B_0 = \fC\fBT\fP\fP, std::function< double(double)> V_0 = \fC[](double \fBt\fP) { return 25\&. * \fBV\fP / 1000\&.; }\fP, double d = \fC500\&.\fP, double t = \fC0\&.\fP)"
.PP
-Set B_0, V_0 and d\&.
+Constructor for the \fBPenningTrap\fP class\&.
.PP
-Definition at line \fB20\fP of file \fBPenningTrap\&.cpp\fP\&.
+\fBParameters\fP
+.RS 4
+\fIB_0\fP The magnetic field strength
+.br
+\fIV_0\fP The time dependent applied potential
+.br
+\fId\fP The characteristic dimension
+.br
+\fIt\fP The starting time
+.RE
+.PP
+
+.PP
+Definition at line \fB18\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "PenningTrap::PenningTrap (unsigned int i, double B_0 = \fC\fBT\fP\fP, std::function< double(double)> V_0 = \fC[](double \fBt\fP) { return 25\&. * \fBV\fP / 1000\&.; }\fP, double d = \fC500\&.\fP, double t = \fC0\&.\fP)"
+
+.PP
+Constructor for the \fBPenningTrap\fP class\&.
+.PP
+\fBParameters\fP
+.RS 4
+\fIi\fP The number of particles to generate
+.br
+\fIB_0\fP The magnetic field strength
+.br
+\fIV_0\fP The time dependent applied potential
+.br
+\fId\fP The characteristic dimension
+.br
+\fIt\fP The starting time
+.RE
+.PP
+
+.PP
+Definition at line \fB27\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "PenningTrap::PenningTrap (std::vector< \fBParticle\fP > particles, double B_0 = \fC\fBT\fP\fP, std::function< double(double)> V_0 = \fC[](double \fBt\fP) { return 25\&. * \fBV\fP / 1000\&.; }\fP, double d = \fC500\&.\fP, double t = \fC0\&.\fP)"
+
+.PP
+Constructor for the \fBPenningTrap\fP class\&.
+.PP
+\fBParameters\fP
+.RS 4
+\fIparticles\fP The starting particles
+.br
+\fIB_0\fP The magnetic field strength
+.br
+\fIV_0\fP The time dependent applied potential
+.br
+\fId\fP The characteristic dimension
+.br
+\fIt\fP The starting time
+.RE
+.PP
+
+.PP
+Definition at line \fB39\fP of file \fBPenningTrap\&.cpp\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void PenningTrap::add_particle (\fBParticle\fP particle)"
@@ -101,63 +192,262 @@ Definition at line \fB20\fP of file \fBPenningTrap\&.cpp\fP\&.
.PP
Add a particle to the system\&.
.PP
-Definition at line \fB27\fP of file \fBPenningTrap\&.cpp\fP\&.
-.SS "void PenningTrap::evolve_forward_euler (double dt)"
+\fBParameters\fP
+.RS 4
+\fIparticle\fP The particle to add to the Penning trap
+.RE
+.PP
+
+.PP
+Definition at line \fB82\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "void PenningTrap::evolve_forward_euler (double dt, bool particle_interaction = \fCtrue\fP)"
.PP
Go forward one timestep using the forward Euler method\&.
.PP
-Definition at line \fB167\fP of file \fBPenningTrap\&.cpp\fP\&.
-.SS "void PenningTrap::evolve_RK4 (double dt)"
+\fBParameters\fP
+.RS 4
+\fIdt\fP The step length
+.br
+\fIparticle_interaction\fP Turn particle interactions on/off
+.RE
+.PP
+
+.PP
+Definition at line \fB186\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "void PenningTrap::evolve_RK4 (double dt, bool particle_interaction = \fCtrue\fP)"
.PP
Go forward one timestep using the RK4 method\&.
.PP
-Definition at line \fB104\fP of file \fBPenningTrap\&.cpp\fP\&.
-.SS "arma::vec PenningTrap::external_B_field (arma::vec r)"
+\fBParameters\fP
+.RS 4
+\fIdt\fP The step length
+.br
+\fIparticle_interaction\fP Turn particle interactions on/off
+.RE
+.PP
+
+.PP
+Definition at line \fB151\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "\fBvec_3d\fP PenningTrap::external_B_field (\fBvec_3d\fP r)"
.PP
Calculate B at point r\&.
.PP
-Definition at line \fB43\fP of file \fBPenningTrap\&.cpp\fP\&.
-.SS "arma::vec PenningTrap::external_E_field (arma::vec r)"
+\fBParameters\fP
+.RS 4
+\fIr\fP The position where we want to calculate the B field
+.RE
+.PP
+\fBReturns\fP
+.RS 4
+vec_3d
+.RE
+.PP
+
+.PP
+Definition at line \fB95\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "\fBvec_3d\fP PenningTrap::external_E_field (\fBvec_3d\fP r)"
.PP
Calculate E at point r\&.
.PP
-Definition at line \fB32\fP of file \fBPenningTrap\&.cpp\fP\&.
-.SS "arma::vec PenningTrap::force_on_particle (int i, int j)"
+\fBParameters\fP
+.RS 4
+\fIr\fP The position where we want to calculate the E field
+.RE
+.PP
+\fBReturns\fP
+.RS 4
+vec_3d
+.RE
+.PP
.PP
-Calculate the force between 2 particles\&. Calculate the force exhibited on particle p_i from particle p_j\&.
-.PP
-Definition at line \fB50\fP of file \fBPenningTrap\&.cpp\fP\&.
-.SS "double PenningTrap::get_d ()"
+Definition at line \fB87\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "\fBvec_3d\fP PenningTrap::force_on_particle (unsigned int i, unsigned int j)"
.PP
-Definition at line \fB188\fP of file \fBPenningTrap\&.cpp\fP\&.
-.SS "arma::vec PenningTrap::get_particle (int i)"
+Calculate the force between 2 particles\&. Calculate the force exhibited on particle p_i from particle p_j\&.
+.PP
+\fBParameters\fP
+.RS 4
+\fIi\fP The index of particle p_i
+.br
+\fIj\fP The index of particle p_j
+.RE
+.PP
+\fBReturns\fP
+.RS 4
+vec_3d
+.RE
+.PP
.PP
-Definition at line \fB183\fP of file \fBPenningTrap\&.cpp\fP\&.
-.SS "arma::vec PenningTrap::total_force (int i)"
+Definition at line \fB100\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "double PenningTrap::fraction_of_particles_left (double time, unsigned int steps, std::string method = \fC'rk4'\fP, bool particle_interaction = \fCtrue\fP)"
.PP
-calculate the total force on a particle\&.
+Simulate and calculate what fraction of particles are still left inside the Penning trap after the simulation\&.
+.PP
+\fBParameters\fP
+.RS 4
+\fItime\fP The time to simulate in microseconds
+.br
+\fIsteps\fP The amount of steps for the whole simulation
+.br
+\fImethod\fP The method to use when moving forward a timestep
+.br
+\fIparticle_interaction\fP Turn particle interactions on/off
+.RE
+.PP
+\fBReturns\fP
+.RS 4
+double
+.RE
.PP
-Definition at line \fB99\fP of file \fBPenningTrap\&.cpp\fP\&.
-.SS "arma::vec PenningTrap::total_force_external (int i)"
.PP
-Calculate the total external force on a particle\&. Calculate the total amount of force that E and B exhibits on particle p_i\&.
-.PP
-Definition at line \fB65\fP of file \fBPenningTrap\&.cpp\fP\&.
-.SS "arma::vec PenningTrap::total_force_particles (int i)"
+Definition at line \fB266\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "\fBvec_3d\fP PenningTrap::r_func (unsigned int i, unsigned int j, double dt)\fC [private]\fP"
.PP
-Calculate the total force on a particle from other particles\&.
+Helper for evolve_RK4 when calculating $k_{r,i,j}$ values\&. Something
.PP
-Definition at line \fB80\fP of file \fBPenningTrap\&.cpp\fP\&.
+\fBParameters\fP
+.RS 4
+\fIi\fP Index i for $k_{r,i,j}$
+.br
+\fIj\fP Index j for $k_{r,i,j}$
+.br
+\fIdt\fP the step length (delta time)
+.RE
+.PP
+\fBReturns\fP
+.RS 4
+vec_3d
+.RE
+.PP
+
+.PP
+Definition at line \fB64\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "\fBsim_arr\fP PenningTrap::simulate (double time, unsigned int steps, std::string method = \fC'rk4'\fP, bool particle_interaction = \fCtrue\fP)"
+
+.PP
+Simulate the particle system inside the Penning trap over a certain amount of time\&.
+.PP
+\fBParameters\fP
+.RS 4
+\fItime\fP The time to simulate in microseconds
+.br
+\fIsteps\fP The amount of steps for the whole simulation
+.br
+\fImethod\fP The method to use when moving forward a timestep
+.br
+\fIparticle_interaction\fP Turn particle interactions on/off
+.RE
+.PP
+
+.PP
+Definition at line \fB211\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "\fBvec_3d\fP PenningTrap::total_force (unsigned int i)"
+
+.PP
+calculate the total force on a particle p_i\&.
+.PP
+\fBParameters\fP
+.RS 4
+\fIi\fP The index of particle p_i
+.RE
+.PP
+\fBReturns\fP
+.RS 4
+vec_3d
+.RE
+.PP
+
+.PP
+Definition at line \fB146\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "\fBvec_3d\fP PenningTrap::total_force_external (unsigned int i)"
+
+.PP
+Calculate the total external force on a particle\&. Calculate the total amount of force that E and B exhibits on particle p_i\&.
+.PP
+\fBParameters\fP
+.RS 4
+\fIi\fP The index of particle p_i
+.RE
+.PP
+\fBReturns\fP
+.RS 4
+vec_3d
+.RE
+.PP
+
+.PP
+Definition at line \fB114\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "\fBvec_3d\fP PenningTrap::total_force_particles (unsigned int i)"
+
+.PP
+Calculate the total force on a particle p_i from other particles\&.
+.PP
+\fBParameters\fP
+.RS 4
+\fIi\fP The index of particle p_i
+.RE
+.PP
+\fBReturns\fP
+.RS 4
+vec_3d
+.RE
+.PP
+
+.PP
+Definition at line \fB129\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "\fBvec_3d\fP PenningTrap::v_func (unsigned int i, unsigned int j, double dt)\fC [private]\fP"
+
+.PP
+Helper for evolve_RK4 when calculating $k_{v,i,j}$ values\&. Something
+.PP
+\fBParameters\fP
+.RS 4
+\fIi\fP Index i for $k_{v,i,j}$
+.br
+\fIj\fP Index j for $k_{v,i,j}$
+.br
+\fIdt\fP the step length (delta time)
+.RE
+.PP
+\fBReturns\fP
+.RS 4
+vec_3d
+.RE
+.PP
+
+.PP
+Definition at line \fB46\fP of file \fBPenningTrap\&.cpp\fP\&.
+.SS "void PenningTrap::write_simulation_to_dir (std::string path, double time, unsigned int steps, std::string method = \fC'rk4'\fP, bool particle_interaction = \fCtrue\fP)"
+
+.PP
+Simulate and write the displacement of all particles to files\&.
+.PP
+\fBParameters\fP
+.RS 4
+\fIpath\fP The directory to save the data
+.br
+\fItime\fP The time to simulate in microseconds
+.br
+\fIsteps\fP The amount of steps for the whole simulation
+.br
+\fImethod\fP The method to use when moving forward a timestep
+.br
+\fIparticle_interaction\fP Turn particle interactions on/off
+.RE
+.PP
+
+.PP
+Definition at line \fB240\fP of file \fBPenningTrap\&.cpp\fP\&.
.SH "Member Data Documentation"
.PP
.SS "double PenningTrap::B_0\fC [private]\fP"
@@ -165,25 +455,39 @@ Definition at line \fB80\fP of file \fBPenningTrap\&.cpp\fP\&.
.PP
Magnetic field strength\&.
.PP
-Definition at line \fB31\fP of file \fBPenningTrap\&.hpp\fP\&.
+Definition at line \fB32\fP of file \fBPenningTrap\&.hpp\fP\&.
.SS "double PenningTrap::d\fC [private]\fP"
.PP
Characteristic dimension\&.
.PP
-Definition at line \fB33\fP of file \fBPenningTrap\&.hpp\fP\&.
+Definition at line \fB34\fP of file \fBPenningTrap\&.hpp\fP\&.
+.SS "\fBsim_arr\fP PenningTrap::k_r\fC [private]\fP"
+A 2D vector containing all $k_{i,j}$ where $j$ is the index of a particle
+.PP
+Definition at line \fB39\fP of file \fBPenningTrap\&.hpp\fP\&.
+.SS "\fBsim_arr\fP PenningTrap::k_v\fC [private]\fP"
+A 2D vector containing all $k_{i,j}$ where $j$ is the index of a particle
+.PP
+Definition at line \fB37\fP of file \fBPenningTrap\&.hpp\fP\&.
.SS "std::vector<\fBParticle\fP> PenningTrap::particles\fC [private]\fP"
.PP
The particles in the Penning trap\&.
.PP
-Definition at line \fB34\fP of file \fBPenningTrap\&.hpp\fP\&.
-.SS "double PenningTrap::V_0\fC [private]\fP"
+Definition at line \fB36\fP of file \fBPenningTrap\&.hpp\fP\&.
+.SS "double PenningTrap::t\fC [private]\fP"
+
+.PP
+Current time\&.
+.PP
+Definition at line \fB35\fP of file \fBPenningTrap\&.hpp\fP\&.
+.SS "std::function PenningTrap::V_0\fC [private]\fP"
.PP
Applied potential\&.
.PP
-Definition at line \fB32\fP of file \fBPenningTrap\&.hpp\fP\&.
+Definition at line \fB33\fP of file \fBPenningTrap\&.hpp\fP\&.
.SH "Author"
.PP
diff --git a/man_pages/man3/PenningTrap.cpp.3 b/man_pages/man3/PenningTrap.cpp.3
index f850299..d080d97 100644
--- a/man_pages/man3/PenningTrap.cpp.3
+++ b/man_pages/man3/PenningTrap.cpp.3
@@ -1,4 +1,4 @@
-.TH "src/PenningTrap.cpp" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "src/PenningTrap.cpp" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -11,6 +11,8 @@ src/PenningTrap.cpp \- The implementation of the \fBPenningTrap\fP class\&.
.br
\fC#include 'constants\&.hpp'\fP
.br
+\fC#include 'typedefs\&.hpp'\fP
+.br
\fC#include 'utils\&.hpp'\fP
.br
@@ -35,15 +37,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
.PP
\fBBug\fP
.RS 4
-No known bugs
-.RE
-.PP
-.PP
-\fBTodo\fP
-.RS 4
-Implement evolve_RK4
-.PP
-Implement evolve_forward_euler
+No known bugs
.RE
.PP
diff --git a/man_pages/man3/PenningTrap.hpp.3 b/man_pages/man3/PenningTrap.hpp.3
index c16a94b..15d155f 100644
--- a/man_pages/man3/PenningTrap.hpp.3
+++ b/man_pages/man3/PenningTrap.hpp.3
@@ -1,4 +1,4 @@
-.TH "include/PenningTrap.hpp" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "include/PenningTrap.hpp" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -15,6 +15,8 @@ include/PenningTrap.hpp \- A class for simulating a Penning trap\&.
.br
\fC#include 'constants\&.hpp'\fP
.br
+\fC#include 'typedefs\&.hpp'\fP
+.br
.SS "Classes"
diff --git a/man_pages/man3/PenningTrapTest.3 b/man_pages/man3/PenningTrapTest.3
index 07c0b75..3bbe27c 100644
--- a/man_pages/man3/PenningTrapTest.3
+++ b/man_pages/man3/PenningTrapTest.3
@@ -1,4 +1,4 @@
-.TH "PenningTrapTest" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "PenningTrapTest" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man_pages/man3/bug.3 b/man_pages/man3/bug.3
index f93d6e3..d21bde1 100644
--- a/man_pages/man3/bug.3
+++ b/man_pages/man3/bug.3
@@ -1,4 +1,4 @@
-.TH "bug" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "bug" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -10,15 +10,17 @@ No known bugs
.IP "\fBFile \fBmain\&.cpp\fP \fP" 1c
No known bugs
.IP "\fBFile \fBParticle\&.cpp\fP \fP" 1c
-No known bugs
+No known bugs
.IP "\fBFile \fBParticle\&.hpp\fP \fP" 1c
No known bugs
.IP "\fBFile \fBPenningTrap\&.cpp\fP \fP" 1c
-No known bugs
+No known bugs
.IP "\fBFile \fBPenningTrap\&.hpp\fP \fP" 1c
No known bugs
.IP "\fBFile \fBtest_suite\&.cpp\fP \fP" 1c
No known bugs
+.IP "\fBFile \fBtypedefs\&.hpp\fP \fP" 1c
+No known bugs
.IP "\fBFile \fButils\&.cpp\fP \fP" 1c
No known bugs
.IP "\fBFile \fButils\&.hpp\fP \fP" 1c
diff --git a/man_pages/man3/constants.hpp.3 b/man_pages/man3/constants.hpp.3
index ed6ff65..b1d978f 100644
--- a/man_pages/man3/constants.hpp.3
+++ b/man_pages/man3/constants.hpp.3
@@ -1,4 +1,4 @@
-.TH "include/constants.hpp" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "include/constants.hpp" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man_pages/man3/main.cpp.3 b/man_pages/man3/main.cpp.3
index e02bbe4..23983a7 100644
--- a/man_pages/man3/main.cpp.3
+++ b/man_pages/man3/main.cpp.3
@@ -1,4 +1,4 @@
-.TH "src/main.cpp" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "src/main.cpp" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -7,14 +7,22 @@ src/main.cpp \- The main program for this project\&.
.SH SYNOPSIS
.br
.PP
+\fC#include \fP
+.br
\fC#include \fP
.br
\fC#include \fP
.br
+\fC#include \fP
+.br
\fC#include \fP
.br
+\fC#include \fP
+.br
\fC#include 'PenningTrap\&.hpp'\fP
.br
+\fC#include 'utils\&.hpp'\fP
+.br
.SS "Macros"
@@ -36,12 +44,34 @@ src/main.cpp \- The main program for this project\&.
.in +1c
.ti -1c
+.RI "void \fBsimulate_single_particle\fP ()"
+.br
+.ti -1c
+.RI "void \fBsimulate_two_particles\fP ()"
+.br
+.ti -1c
+.RI "void \fBsimulate_single_particle_with_different_steps\fP ()"
+.br
+.ti -1c
.RI "void \fBsimulate_100_particles\fP ()"
.br
.ti -1c
+.RI "void \fBsimulate_100_particles_with_time_potential\fP ()"
+.br
+.ti -1c
.RI "int \fBmain\fP ()"
.br
.in -1c
+.SS "Variables"
+
+.in +1c
+.ti -1c
+.RI "\fBParticle\fP \fBp1\fP (CHARGE, MASS, \fBvec_3d\fP{20\&., 0\&., 20\&.}, \fBvec_3d\fP{0\&., 25\&., 0\&.})"
+.br
+.ti -1c
+.RI "\fBParticle\fP \fBp2\fP (CHARGE, MASS, \fBvec_3d\fP{25\&., 25\&., 0\&.}, \fBvec_3d\fP{0\&., 40\&., 5\&.})"
+.br
+.in -1c
.SH "Detailed Description"
.PP
The main program for this project\&.
@@ -74,29 +104,45 @@ Definition in file \fBmain\&.cpp\fP\&.
.SS "#define CHARGE 1\&."
.PP
-Definition at line \fB21\fP of file \fBmain\&.cpp\fP\&.
+Definition at line \fB25\fP of file \fBmain\&.cpp\fP\&.
.SS "#define MASS 40\&."
.PP
-Definition at line \fB22\fP of file \fBmain\&.cpp\fP\&.
+Definition at line \fB26\fP of file \fBmain\&.cpp\fP\&.
.SS "#define N 10000"
.PP
-Definition at line \fB20\fP of file \fBmain\&.cpp\fP\&.
+Definition at line \fB24\fP of file \fBmain\&.cpp\fP\&.
.SS "#define PARTICLES 100"
.PP
-Definition at line \fB19\fP of file \fBmain\&.cpp\fP\&.
+Definition at line \fB23\fP of file \fBmain\&.cpp\fP\&.
.SH "Function Documentation"
.PP
.SS "int main ()"
.PP
-Definition at line \fB77\fP of file \fBmain\&.cpp\fP\&.
+Definition at line \fB124\fP of file \fBmain\&.cpp\fP\&.
.SS "void simulate_100_particles ()"
.PP
-Definition at line \fB24\fP of file \fBmain\&.cpp\fP\&.
+Definition at line \fB77\fP of file \fBmain\&.cpp\fP\&.
+.SS "void simulate_100_particles_with_time_potential ()"
+
+.PP
+Definition at line \fB91\fP of file \fBmain\&.cpp\fP\&.
+.SS "void simulate_single_particle ()"
+
+.PP
+Definition at line \fB31\fP of file \fBmain\&.cpp\fP\&.
+.SS "void simulate_single_particle_with_different_steps ()"
+
+.PP
+Definition at line \fB55\fP of file \fBmain\&.cpp\fP\&.
+.SS "void simulate_two_particles ()"
+
+.PP
+Definition at line \fB42\fP of file \fBmain\&.cpp\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for Penning Trap Simulation from the source code\&.
diff --git a/man_pages/man3/test_suite.cpp.3 b/man_pages/man3/test_suite.cpp.3
index fa522ef..c185469 100644
--- a/man_pages/man3/test_suite.cpp.3
+++ b/man_pages/man3/test_suite.cpp.3
@@ -1,4 +1,4 @@
-.TH "src/test_suite.cpp" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "src/test_suite.cpp" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man_pages/man3/todo.3 b/man_pages/man3/todo.3
index a66e064..ef888e2 100644
--- a/man_pages/man3/todo.3
+++ b/man_pages/man3/todo.3
@@ -1,4 +1,4 @@
-.TH "todo" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "todo" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man_pages/man3/typedefs.hpp.3 b/man_pages/man3/typedefs.hpp.3
new file mode 100644
index 0000000..1933ad3
--- /dev/null
+++ b/man_pages/man3/typedefs.hpp.3
@@ -0,0 +1,92 @@
+.TH "include/typedefs.hpp" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.ad l
+.nh
+.SH NAME
+include/typedefs.hpp \- Useful typedefs for cleaner code\&.
+
+.SH SYNOPSIS
+.br
+.PP
+\fC#include \fP
+.br
+\fC#include \fP
+.br
+
+.SS "Typedefs"
+
+.in +1c
+.ti -1c
+.RI "typedef std::vector< arma::vec::fixed< 3 > > \fBsim_cols\fP"
+.br
+.RI "Typedef for the column of the result vector from simulating particles\&. "
+.ti -1c
+.RI "typedef std::vector< arma::vec::fixed< 3 > > \fBsim_rows\fP"
+.br
+.RI "Typedef for the row of the result vector from simulating particles\&. "
+.ti -1c
+.RI "typedef std::vector< \fBsim_cols\fP > \fBsim_arr\fP"
+.br
+.RI "Typedef for the result of the simulate method\&. "
+.ti -1c
+.RI "typedef arma::vec::fixed< 3 > \fBvec_3d\fP"
+.br
+.RI "Typedef for a fixed 3d arma vector\&. "
+.in -1c
+.SH "Detailed Description"
+.PP
+Useful typedefs for cleaner code\&.
+
+
+.PP
+\fBAuthor\fP
+.RS 4
+Cory Alexander Balaton (coryab)
+.PP
+Janita Ovidie Sandtrøen Willumsen (janitaws)
+.RE
+.PP
+\fBVersion\fP
+.RS 4
+1\&.0
+.RE
+.PP
+.PP
+These typedefs make the code more readable and easy to follow along\&.
+.PP
+\fBBug\fP
+.RS 4
+No known bugs
+.RE
+.PP
+
+.PP
+Definition in file \fBtypedefs\&.hpp\fP\&.
+.SH "Typedef Documentation"
+.PP
+.SS "typedef std::vector<\fBsim_cols\fP> \fBsim_arr\fP"
+
+.PP
+Typedef for the result of the simulate method\&.
+.PP
+Definition at line \fB32\fP of file \fBtypedefs\&.hpp\fP\&.
+.SS "typedef std::vector > \fBsim_cols\fP"
+
+.PP
+Typedef for the column of the result vector from simulating particles\&.
+.PP
+Definition at line \fB24\fP of file \fBtypedefs\&.hpp\fP\&.
+.SS "typedef std::vector > \fBsim_rows\fP"
+
+.PP
+Typedef for the row of the result vector from simulating particles\&.
+.PP
+Definition at line \fB28\fP of file \fBtypedefs\&.hpp\fP\&.
+.SS "typedef arma::vec::fixed<3> \fBvec_3d\fP"
+
+.PP
+Typedef for a fixed 3d arma vector\&.
+.PP
+Definition at line \fB36\fP of file \fBtypedefs\&.hpp\fP\&.
+.SH "Author"
+.PP
+Generated automatically by Doxygen for Penning Trap Simulation from the source code\&.
diff --git a/man_pages/man3/utils.cpp.3 b/man_pages/man3/utils.cpp.3
index 3d60a86..335b5f5 100644
--- a/man_pages/man3/utils.cpp.3
+++ b/man_pages/man3/utils.cpp.3
@@ -1,4 +1,4 @@
-.TH "src/utils.cpp" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "src/utils.cpp" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -7,6 +7,8 @@ src/utils.cpp \- Implementation of the utils\&.
.SH SYNOPSIS
.br
.PP
+\fC#include \fP
+.br
\fC#include 'utils\&.hpp'\fP
.br
@@ -29,6 +31,10 @@ src/utils.cpp \- Implementation of the utils\&.
.RI "bool \fBarma_vector_close_to\fP (arma::vec &a, arma::vec &b, double tol)"
.br
.RI "Test if two armadillo vectors are close to each other\&. "
+.ti -1c
+.RI "bool \fBmkpath\fP (std::string path, int mode)"
+.br
+.RI "Make path given\&. "
.in -1c
.SH "Detailed Description"
.PP
@@ -75,12 +81,12 @@ Test if two armadillo vectors are close to each other\&. This function takes in
.PP
\fBReturns\fP
.RS 4
-Boolean
+bool
.RE
.PP
.PP
-Definition at line \fB59\fP of file \fButils\&.cpp\fP\&.
+Definition at line \fB62\fP of file \fButils\&.cpp\fP\&.
.SS "void m_assert (bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg)"
.PP
@@ -103,11 +109,31 @@ Test an expression, confirm that test is ok, or abort execution\&. This function
.PP
.PP
-Definition at line \fB40\fP of file \fButils\&.cpp\fP\&.
+Definition at line \fB43\fP of file \fButils\&.cpp\fP\&.
+.SS "bool mkpath (std::string path, int mode = \fC0777\fP)"
+
+.PP
+Make path given\&. This tries to be the equivalent to 'mkdir -p' and creates a new directory whenever it needs to\&.
+.PP
+\fBParameters\fP
+.RS 4
+\fIpath\fP The path to be created
+.br
+\fImode\fP The mode/permissions for all the new directories
+.RE
+.PP
+\fBReturns\fP
+.RS 4
+bool
+.RE
+.PP
+
+.PP
+Definition at line \fB76\fP of file \fButils\&.cpp\fP\&.
.SS "std::string scientific_format (const std::vector< double > & v, int width = \fC20\fP, int prec = \fC10\fP)"
.PP
-Turns a vector of doubles into a string written in scientific format\&.
+Turns a vector of doubles into a string written in scientific format\&. The code is stolen from https://github.com/anderkve/FYS3150\&.
.PP
\fBParameters\fP
.RS 4
@@ -120,16 +146,16 @@ Turns a vector of doubles into a string written in scientific format\&.
.PP
\fBReturns\fP
.RS 4
-String
+std::string
.RE
.PP
.PP
-Definition at line \fB21\fP of file \fButils\&.cpp\fP\&.
+Definition at line \fB24\fP of file \fButils\&.cpp\fP\&.
.SS "std::string scientific_format (double d, int width = \fC20\fP, int prec = \fC10\fP)"
.PP
-Turns a double into a string written in scientific format\&. Code stolen from https://github.com/anderkve/FYS3150 Header: https://github.com/anderkve/FYS3150/blob/master/code_examples/compilation_linking/example_1/include/utils.hpp Source: https://github.com/anderkve/FYS3150/blob/master/code_examples/compilation_linking/example_1/src/utils.cpp
+Turns a double into a string written in scientific format\&. The code is stolen from https://github.com/anderkve/FYS3150\&.
.PP
\fBParameters\fP
.RS 4
@@ -142,12 +168,12 @@ Turns a double into a string written in scientific format\&. Code stolen from ht
.PP
\fBReturns\fP
.RS 4
-String
+std::string
.RE
.PP
.PP
-Definition at line \fB14\fP of file \fButils\&.cpp\fP\&.
+Definition at line \fB17\fP of file \fButils\&.cpp\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for Penning Trap Simulation from the source code\&.
diff --git a/man_pages/man3/utils.hpp.3 b/man_pages/man3/utils.hpp.3
index a67beb7..3f934d0 100644
--- a/man_pages/man3/utils.hpp.3
+++ b/man_pages/man3/utils.hpp.3
@@ -1,4 +1,4 @@
-.TH "include/utils.hpp" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
+.TH "include/utils.hpp" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -32,6 +32,7 @@ include/utils.hpp \- Function prototypes and macros that are useful\&.
.ti -1c
.RI "#define \fB__METHOD_NAME__\fP methodName(__PRETTY_FUNCTION__)"
.br
+.RI "Get the name of the current method/function\&. "
.in -1c
.SS "Functions"
@@ -52,6 +53,10 @@ include/utils.hpp \- Function prototypes and macros that are useful\&.
.RI "bool \fBarma_vector_close_to\fP (arma::vec &a, arma::vec &b, double tol=1e\-8)"
.br
.RI "Test if two armadillo vectors are close to each other\&. "
+.ti -1c
+.RI "bool \fBmkpath\fP (std::string path, int mode=0777)"
+.br
+.RI "Make path given\&. "
.in -1c
.SH "Detailed Description"
.PP
@@ -87,7 +92,9 @@ Definition in file \fButils\&.hpp\fP\&.
.SS "#define __METHOD_NAME__ methodName(__PRETTY_FUNCTION__)"
.PP
-Definition at line \fB48\fP of file \fButils\&.hpp\fP\&.
+Get the name of the current method/function\&.
+.PP
+Definition at line \fB51\fP of file \fButils\&.hpp\fP\&.
.SS "#define ASSERT(expr, msg)"
\fBValue:\fP.PP
.nf
@@ -123,12 +130,12 @@ Test if two armadillo vectors are close to each other\&. This function takes in
.PP
\fBReturns\fP
.RS 4
-Boolean
+bool
.RE
.PP
.PP
-Definition at line \fB59\fP of file \fButils\&.cpp\fP\&.
+Definition at line \fB62\fP of file \fButils\&.cpp\fP\&.
.SS "void m_assert (bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg)"
.PP
@@ -151,11 +158,31 @@ Test an expression, confirm that test is ok, or abort execution\&. This function
.PP
.PP
-Definition at line \fB40\fP of file \fButils\&.cpp\fP\&.
+Definition at line \fB43\fP of file \fButils\&.cpp\fP\&.
+.SS "bool mkpath (std::string path, int mode = \fC0777\fP)"
+
+.PP
+Make path given\&. This tries to be the equivalent to 'mkdir -p' and creates a new directory whenever it needs to\&.
+.PP
+\fBParameters\fP
+.RS 4
+\fIpath\fP The path to be created
+.br
+\fImode\fP The mode/permissions for all the new directories
+.RE
+.PP
+\fBReturns\fP
+.RS 4
+bool
+.RE
+.PP
+
+.PP
+Definition at line \fB76\fP of file \fButils\&.cpp\fP\&.
.SS "std::string scientific_format (const std::vector< double > & v, int width = \fC20\fP, int prec = \fC10\fP)"
.PP
-Turns a vector of doubles into a string written in scientific format\&.
+Turns a vector of doubles into a string written in scientific format\&. The code is stolen from https://github.com/anderkve/FYS3150\&.
.PP
\fBParameters\fP
.RS 4
@@ -168,16 +195,16 @@ Turns a vector of doubles into a string written in scientific format\&.
.PP
\fBReturns\fP
.RS 4
-String
+std::string
.RE
.PP
.PP
-Definition at line \fB21\fP of file \fButils\&.cpp\fP\&.
+Definition at line \fB24\fP of file \fButils\&.cpp\fP\&.
.SS "std::string scientific_format (double d, int width = \fC20\fP, int prec = \fC10\fP)"
.PP
-Turns a double into a string written in scientific format\&. Code stolen from https://github.com/anderkve/FYS3150 Header: https://github.com/anderkve/FYS3150/blob/master/code_examples/compilation_linking/example_1/include/utils.hpp Source: https://github.com/anderkve/FYS3150/blob/master/code_examples/compilation_linking/example_1/src/utils.cpp
+Turns a double into a string written in scientific format\&. The code is stolen from https://github.com/anderkve/FYS3150\&.
.PP
\fBParameters\fP
.RS 4
@@ -190,12 +217,12 @@ Turns a double into a string written in scientific format\&. Code stolen from ht
.PP
\fBReturns\fP
.RS 4
-String
+std::string
.RE
.PP
.PP
-Definition at line \fB14\fP of file \fButils\&.cpp\fP\&.
+Definition at line \fB17\fP of file \fButils\&.cpp\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for Penning Trap Simulation from the source code\&.