mirror of
https://github.com/gwm17/catima.git
synced 2024-11-23 02:38:51 -05:00
added few tests
This commit is contained in:
parent
2f7703b942
commit
abd7aa3576
|
@ -139,7 +139,7 @@ const lest::test specification[] =
|
|||
p.T = 2794.4822;
|
||||
EXPECT( rcompare( f(), 1.768018, 0.02) );
|
||||
},
|
||||
CASE("dEdx for compunds"){
|
||||
CASE("dEdx for compounds"){
|
||||
catima::Projectile p{1,1,1,1000};
|
||||
catima::Material water({
|
||||
{1.00794,1,2},
|
||||
|
@ -327,6 +327,15 @@ const lest::test specification[] =
|
|||
EXPECT(res0.sigma_r == res.results[0].sigma_r);
|
||||
EXPECT(res0.tof == res.results[0].tof);
|
||||
|
||||
},
|
||||
CASE("default material calculations"){
|
||||
catima::Projectile p{12,6,6,350};
|
||||
auto air = catima::get_material(catima::material::AIR);
|
||||
air.thickness(0.500);
|
||||
auto res = catima::calculate(p(350),air);
|
||||
EXPECT(res.Eout == approx(345.6).epsilon(1e-2));
|
||||
EXPECT(res.sigma_a == approx(0.0013).epsilon(1e-2));
|
||||
EXPECT(res.sigma_E == approx(0.12).epsilon(1e-2));
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -181,6 +181,25 @@ const lest::test specification[] =
|
|||
mat5.add_element(12,6,1);
|
||||
EXPECT(mat5.ncomponents()==mat6.ncomponents()+1);
|
||||
|
||||
},
|
||||
CASE("int and double stn check"){
|
||||
catima::Projectile p{1,1,1,1000};
|
||||
catima::Material mat1({
|
||||
{12.01, 6, 1},
|
||||
{16.00, 8, 1}
|
||||
});
|
||||
catima::Material mat2({
|
||||
{12.01, 6, 0.5},
|
||||
{16.00, 8, 0.5}
|
||||
});
|
||||
mat1.thickness(1.0);
|
||||
mat2.thickness(1.0);
|
||||
auto res1 = catima::calculate(p(1000),mat1);
|
||||
auto res2 = catima::calculate(p(1000),mat2);
|
||||
EXPECT(res1.dEdxi == res2.dEdxi);
|
||||
EXPECT(res1.range == res2.range);
|
||||
EXPECT(res1.sigma_a == res2.sigma_a);
|
||||
EXPECT(res1.sigma_r == res2.sigma_r);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user