mirror of
https://github.com/gwm17/catima.git
synced 2024-11-26 12:08:52 -05:00
commit
20d8a33d67
|
@ -35,9 +35,7 @@ const lest::test specification[] =
|
||||||
CASE("proton stopping power from srim"){
|
CASE("proton stopping power from srim"){
|
||||||
catima::Projectile p{1,1,1,1};
|
catima::Projectile p{1,1,1,1};
|
||||||
catima::Target he{4.002600,2};
|
catima::Target he{4.002600,2};
|
||||||
catima::Target carbon{12.0107,6};
|
catima::Target carbon{12.0107,6};
|
||||||
double dif,dif2;
|
|
||||||
|
|
||||||
|
|
||||||
EXPECT( catima::sezi_p_se(1,he) == approx(283,1));
|
EXPECT( catima::sezi_p_se(1,he) == approx(283,1));
|
||||||
p.T = 1;
|
p.T = 1;
|
||||||
|
@ -66,8 +64,6 @@ const lest::test specification[] =
|
||||||
CASE("dedx, low energy, from sezi"){
|
CASE("dedx, low energy, from sezi"){
|
||||||
catima::Projectile p{4,2,2,1};
|
catima::Projectile p{4,2,2,1};
|
||||||
catima::Target carbon{12.0107,6};
|
catima::Target carbon{12.0107,6};
|
||||||
double dif;
|
|
||||||
double exp;
|
|
||||||
|
|
||||||
// He projectile case
|
// He projectile case
|
||||||
p.T = 1;
|
p.T = 1;
|
||||||
|
@ -129,7 +125,6 @@ const lest::test specification[] =
|
||||||
{1.00794,1,2},
|
{1.00794,1,2},
|
||||||
{15.9994,8,1}
|
{15.9994,8,1}
|
||||||
});
|
});
|
||||||
double dif;
|
|
||||||
|
|
||||||
EXPECT( catima::dedx(p,1000, water) == approx(2.23).R(5e-3));
|
EXPECT( catima::dedx(p,1000, water) == approx(2.23).R(5e-3));
|
||||||
EXPECT( catima::dedx(p,500, water) == approx(2.76).R(5e-3));
|
EXPECT( catima::dedx(p,500, water) == approx(2.76).R(5e-3));
|
||||||
|
@ -141,7 +136,6 @@ const lest::test specification[] =
|
||||||
{12.011,6,1},
|
{12.011,6,1},
|
||||||
});
|
});
|
||||||
|
|
||||||
double dif;
|
|
||||||
auto res = catima::calculate(p(1000),graphite);
|
auto res = catima::calculate(p(1000),graphite);
|
||||||
EXPECT(catima::dedx(p,1000, graphite) == approx(res.dEdxi).R(0.001) );
|
EXPECT(catima::dedx(p,1000, graphite) == approx(res.dEdxi).R(0.001) );
|
||||||
|
|
||||||
|
@ -166,10 +160,8 @@ const lest::test specification[] =
|
||||||
graphite.add_element(12,6,1);
|
graphite.add_element(12,6,1);
|
||||||
graphite.density(2.0);
|
graphite.density(2.0);
|
||||||
graphite.thickness(0.5);
|
graphite.thickness(0.5);
|
||||||
double dif;
|
|
||||||
|
|
||||||
auto res = catima::calculate(p,graphite);
|
auto res = catima::calculate(p,graphite);
|
||||||
dif = res.Eout - 997.077;
|
|
||||||
EXPECT( res.Eout == approx(997.07,01));
|
EXPECT( res.Eout == approx(997.07,01));
|
||||||
},
|
},
|
||||||
CASE("TOF test"){
|
CASE("TOF test"){
|
||||||
|
|
|
@ -100,14 +100,14 @@ const lest::test specification[] =
|
||||||
catima::_storage.Reset();
|
catima::_storage.Reset();
|
||||||
EXPECT(catima::_storage.get_index()==0);
|
EXPECT(catima::_storage.get_index()==0);
|
||||||
for(int i=1;i<maxdata+1;i++){
|
for(int i=1;i<maxdata+1;i++){
|
||||||
catima::Projectile p1{2*i,i,i,1000};
|
catima::Projectile p1{2.0*i,(double)i,(double)i,1000};
|
||||||
catima::_storage.Add(p1,graphite);
|
catima::_storage.Add(p1,graphite);
|
||||||
EXPECT(catima::_storage.get_index()==i);
|
EXPECT(catima::_storage.get_index()==i);
|
||||||
EXPECT(catima::_storage.GetN()==maxdata);
|
EXPECT(catima::_storage.GetN()==maxdata);
|
||||||
}
|
}
|
||||||
EXPECT(catima::_storage.get_index()==maxdata);
|
EXPECT(catima::_storage.get_index()==maxdata);
|
||||||
for(int i=1;i<maxdata-1;i++){
|
for(int i=1;i<maxdata-1;i++){
|
||||||
catima::Projectile p1{2*i,i,i,1000};
|
catima::Projectile p1{2.0*i,(double)i,(double)i,1000};
|
||||||
catima::_storage.Add(p1,water);
|
catima::_storage.Add(p1,water);
|
||||||
EXPECT(catima::_storage.get_index()==i);
|
EXPECT(catima::_storage.get_index()==i);
|
||||||
EXPECT(catima::_storage.GetN()==maxdata);
|
EXPECT(catima::_storage.GetN()==maxdata);
|
||||||
|
@ -123,7 +123,6 @@ const lest::test specification[] =
|
||||||
EXPECT(catima::energy_table.values[catima::max_datapoints-1]==approx(exp(M_LN10*(catima::logEmax))).epsilon(1e-6));
|
EXPECT(catima::energy_table.values[catima::max_datapoints-1]==approx(exp(M_LN10*(catima::logEmax))).epsilon(1e-6));
|
||||||
},
|
},
|
||||||
CASE("indexing"){
|
CASE("indexing"){
|
||||||
double step = catima::energy_table.step;
|
|
||||||
double val, dif;
|
double val, dif;
|
||||||
|
|
||||||
EXPECT(EnergyTable_index(catima::energy_table, 0.0)==-1);
|
EXPECT(EnergyTable_index(catima::energy_table, 0.0)==-1);
|
||||||
|
|
|
@ -274,7 +274,7 @@ const lest::test specification[] =
|
||||||
EXPECT(mat.M()==approx(12.0,0.001));
|
EXPECT(mat.M()==approx(12.0,0.001));
|
||||||
EXPECT(mat.weight_fraction(0)==approx(1.0).R(1e-6));
|
EXPECT(mat.weight_fraction(0)==approx(1.0).R(1e-6));
|
||||||
|
|
||||||
EXPECT(air.M() == approx(28.97,0.1));
|
//EXPECT(air.M() == approx(28.97,0.1));
|
||||||
|
|
||||||
},
|
},
|
||||||
CASE("number density"){
|
CASE("number density"){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user