mirror of
https://github.com/gwm17/catima.git
synced 2024-11-22 18:28:51 -05:00
Fix bug in integrator where occasionally step past 0 energy when stopping in material
This commit is contained in:
parent
629690a6f9
commit
671cda3c0f
|
@ -1,3 +1,8 @@
|
||||||
|
/*
|
||||||
|
* Simple energy loss integrators for forward and reverse cases.
|
||||||
|
*
|
||||||
|
* Dec 2022, Gordon McCann
|
||||||
|
*/
|
||||||
#include "catima/gwm_integrators.h"
|
#include "catima/gwm_integrators.h"
|
||||||
|
|
||||||
namespace catima {
|
namespace catima {
|
||||||
|
@ -34,6 +39,10 @@ namespace catima {
|
||||||
{
|
{
|
||||||
return e_in*proj.A;
|
return e_in*proj.A;
|
||||||
}
|
}
|
||||||
|
else if (e_final > 0.0)
|
||||||
|
{
|
||||||
|
return e_in * proj.A; //In case an integration step takes us below 0
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
e_step = dedx(proj, mat, c)*x_step*A_recip;
|
e_step = dedx(proj, mat, c)*x_step*A_recip;
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
/*
|
||||||
|
* Simple energy loss integrators for forward and reverse cases.
|
||||||
|
*
|
||||||
|
* Dec 2022, Gordon McCann
|
||||||
|
*/
|
||||||
#ifndef GWM_INTEGRATORS_H
|
#ifndef GWM_INTEGRATORS_H
|
||||||
#define GWM_INTEGRATORS_H
|
#define GWM_INTEGRATORS_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
/*
|
||||||
|
* Testing for gwm_integrators
|
||||||
|
*
|
||||||
|
* Dec 2022, Gordon McCann
|
||||||
|
*/
|
||||||
#include "catima/gwm_integrators.h"
|
#include "catima/gwm_integrators.h"
|
||||||
#include "catima/nucdata.h"
|
#include "catima/nucdata.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user