IAP GITLAB

Commit 0c125437 authored by Andre Schmidt's avatar Andre Schmidt

few updates

parent a3fc176b
Pipeline #2022 failed with stages
in 0 seconds
...@@ -242,15 +242,17 @@ namespace corsika::cascade { ...@@ -242,15 +242,17 @@ namespace corsika::cascade {
// Second Movement // Second Movement
position = position + directionAfter * min_distance / 2; position = position + directionAfter * min_distance / 2;
auto distance = position - vParticle.GetPosition(); auto distance = position - vParticle.GetPosition();
//distance.norm() != min_distance for distance_interact, distance_decay if q != 0 //distance.norm() != min_distance if q != 0
//small error can be neglected //small error can be neglected
if (distance.norm() != 0_m) {
velocity = distance.normalized() * velocity.norm(); velocity = distance.normalized() * velocity.norm();
} //no velocity update for very small steps
// here the particle is actually moved along the trajectory to new position: // here the particle is actually moved along the trajectory to new position:
// std::visit(setup::ParticleUpdate<Particle>{vParticle}, step); // std::visit(setup::ParticleUpdate<Particle>{vParticle}, step);
vParticle.SetMomentum(directionAfter.normalized() * vParticle.GetMomentum().GetNorm()); vParticle.SetMomentum(directionAfter.normalized() * vParticle.GetMomentum().norm());
geometry::Line line(vParticle.GetPosition(), velocity); geometry::Line line(vParticle.GetPosition(), velocity);
geometry::Trajectory<geometry::Line> stepNew(line, distance.norm() / velocity.GetNorm()); geometry::Trajectory<geometry::Line> stepNew(line, distance.norm() / velocity.norm());
vParticle.SetPosition(position); vParticle.SetPosition(position);
vParticle.SetTime(vParticle.GetTime() + distance.norm() / units::constants::c); vParticle.SetTime(vParticle.GetTime() + distance.norm() / units::constants::c);
std::cout << "New Position: " << vParticle.GetPosition().GetCoordinates() << std::endl; std::cout << "New Position: " << vParticle.GetPosition().GetCoordinates() << std::endl;
......
...@@ -124,6 +124,7 @@ namespace corsika::process { ...@@ -124,6 +124,7 @@ namespace corsika::process {
std::cout << "no intersection (1)!" << std::endl; std::cout << "no intersection (1)!" << std::endl;
// what to do when this happens? (very unlikely) // what to do when this happens? (very unlikely)
} }
delete [] solutions;
// First Movement // First Movement
// assuming magnetic field does not change during movement // assuming magnetic field does not change during movement
...@@ -187,6 +188,7 @@ namespace corsika::process { ...@@ -187,6 +188,7 @@ namespace corsika::process {
std::cout << "no intersection (2)!" << std::endl; std::cout << "no intersection (2)!" << std::endl;
// what to do when this happens? (very unlikely) // what to do when this happens? (very unlikely)
} }
delete [] solutions;
// First Movement // First Movement
// assuming magnetic field does not change during movement // assuming magnetic field does not change during movement
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment