Change Particle

- Give Particle default values for mass and charge
- Modify PenningTrap to use the new Particle constructor
- Modify main.cpp to use the new Particle constructor
- Modify test_suite.cpp to use the new Particle constructor
This commit is contained in:
2023-10-23 09:54:13 +02:00
parent 8fc0bf8c13
commit 8f315a0955
5 changed files with 36 additions and 45 deletions

View File

@@ -15,15 +15,16 @@
#include <armadillo>
#include "typedefs.hpp"
#include "constants.hpp"
/** @brief A class that holds attributes of a particle
* */
class Particle {
private:
double q; ///< Charge
double m; ///< Mass
vec_3d r_vec; ///< position
vec_3d v_vec; ///< velocity
double q; ///< Charge
double m; ///< Mass
public:
/** @brief Initialize the particle.
@@ -36,7 +37,7 @@ public:
* @param r_vec The initial position of the particle
* @param v_vec The initial velocity of the particle
* */
Particle(double q, double m, vec_3d r_vec, vec_3d v_vec);
Particle(vec_3d r_vec, vec_3d v_vec, double q = CA_CHARGE, double m = CA_MASS);
/** @brief Make private attributes available for PenningTrap.
* */