Formatting
This commit is contained in:
@@ -52,8 +52,8 @@ vec_3d PenningTrap::v_func(unsigned int i, unsigned int j, double dt)
|
||||
return dt * this->k_v[2][j];
|
||||
case 3:
|
||||
return vec_3d((dt / 6.)
|
||||
* (this->k_v[0][j] + 2. * this->k_v[1][j] + 2. * this->k_v[2][j]
|
||||
+ this->k_v[3][j]));
|
||||
* (this->k_v[0][j] + 2. * this->k_v[1][j]
|
||||
+ 2. * this->k_v[2][j] + this->k_v[3][j]));
|
||||
default:
|
||||
std::cout << "Not valid!" << std::endl;
|
||||
abort();
|
||||
@@ -71,8 +71,8 @@ vec_3d PenningTrap::r_func(unsigned int i, unsigned int j, double dt)
|
||||
return dt * this->k_r[2][j];
|
||||
case 3:
|
||||
return vec_3d((dt / 6.)
|
||||
* (this->k_r[0][j] + 2. * this->k_r[1][j] + 2. * this->k_r[2][j]
|
||||
+ this->k_r[3][j]));
|
||||
* (this->k_r[0][j] + 2. * this->k_r[1][j]
|
||||
+ 2. * this->k_r[2][j] + this->k_r[3][j]));
|
||||
default:
|
||||
std::cout << "Not valid!" << std::endl;
|
||||
abort();
|
||||
@@ -116,8 +116,8 @@ vec_3d PenningTrap::total_force_external(unsigned int i)
|
||||
}
|
||||
|
||||
return vec_3d(p.q
|
||||
* (this->external_E_field(p.r_vec)
|
||||
+ arma::cross(p.v_vec, this->external_B_field(p.r_vec))));
|
||||
* (this->external_E_field(p.r_vec)
|
||||
+ arma::cross(p.v_vec, this->external_B_field(p.r_vec))));
|
||||
}
|
||||
|
||||
vec_3d PenningTrap::total_force_particles(unsigned int i)
|
||||
@@ -134,11 +134,10 @@ vec_3d PenningTrap::total_force_particles(unsigned int i)
|
||||
|
||||
vec_3d PenningTrap::total_force(unsigned int i)
|
||||
{
|
||||
if (arma::norm(this->particles[i].r_vec) > this->d) {
|
||||
return vec_3d{0., 0., 0.};
|
||||
}
|
||||
return vec_3d(this->total_force_external(i)
|
||||
- this->total_force_particles(i));
|
||||
return arma::norm(this->particles[i].r_vec) > this->d
|
||||
? vec_3d{0., 0., 0.}
|
||||
: vec_3d(this->total_force_external(i)
|
||||
- this->total_force_particles(i));
|
||||
}
|
||||
|
||||
void PenningTrap::evolve_RK4(double dt, bool particle_interaction)
|
||||
|
||||
Reference in New Issue
Block a user