mirror of
https://github.com/gwm17/catima.git
synced 2025-02-17 01:48:50 -05:00
35 lines
880 B
C++
35 lines
880 B
C++
|
#include "lest.hpp"
|
||
|
#include <math.h>
|
||
|
#include "catima/catima.h"
|
||
|
#include "catima/reactions.h"
|
||
|
#include "testutils.h"
|
||
|
using namespace std;
|
||
|
using catima::approx;
|
||
|
using catima::reaction_rate;
|
||
|
using catima::nonreaction_rate;
|
||
|
const lest::test specification[] =
|
||
|
{
|
||
|
CASE("reaction"){
|
||
|
auto c = catima::get_material(6);
|
||
|
c.thickness(4.0);
|
||
|
double r = reaction_rate(1000,c.number_density_cm2());
|
||
|
std::cout<<r<<"\n";
|
||
|
|
||
|
EXPECT(reaction_rate(0,10.0) == 0.0);
|
||
|
EXPECT(reaction_rate(1000,0.0) == 0.0);
|
||
|
|
||
|
EXPECT(nonreaction_rate(0,10.0) == 1.0);
|
||
|
EXPECT(nonreaction_rate(1000,0.0) == 1.0);
|
||
|
|
||
|
auto fcc = [](double x){return 1000.0;};
|
||
|
r = reaction_rate(fcc, c.number_density_cm2());
|
||
|
std::cout<<r<<"\n";
|
||
|
}
|
||
|
};
|
||
|
|
||
|
int main( int argc, char * argv[] )
|
||
|
{
|
||
|
return lest::run( specification, argc, argv );
|
||
|
}
|
||
|
|