27 #ifndef ANTIOCH_REACTION_RATE_TEST_BASE_H
28 #define ANTIOCH_REACTION_RATE_TEST_BASE_H
30 #include "antioch_config.h"
32 #ifdef ANTIOCH_HAVE_CPPUNIT
34 #include <cppunit/extensions/HelperMacros.h>
35 #include <cppunit/TestCase.h>
39 template <
typename ReactionRate,
typename Scalar>
46 for(Scalar T = 300.1; T <= 2500.1; T += 10.)
49 Scalar rate = reaction_rate(T);
52 CPPUNIT_ASSERT_DOUBLES_EQUAL( rate,
59 Scalar rate = reaction_rate(cond);
62 CPPUNIT_ASSERT_DOUBLES_EQUAL( rate,
73 for(Scalar T = 300.1; T <= 2500.1; T += 10.)
76 Scalar deriv = reaction_rate.derivative(T);
79 CPPUNIT_ASSERT_DOUBLES_EQUAL( deriv,
86 Scalar deriv = reaction_rate.derivative(cond);
89 CPPUNIT_ASSERT_DOUBLES_EQUAL( deriv,
99 for(Scalar T = 300.1; T <= 2500.1; T += 10.)
106 reaction_rate.rate_and_derivative(cond,rate,deriv);
111 CPPUNIT_ASSERT_DOUBLES_EQUAL( rate,
115 CPPUNIT_ASSERT_DOUBLES_EQUAL( deriv,
131 #endif // ANTIOCH_HAVE_CPPUNIT
133 #endif // ANTIOCH_REACTION_RATE_TEST_BASE_H
void test_rate(const ReactionRate &reaction_rate, Scalar tol)
virtual Scalar exact_deriv(Scalar T)=0
void test_rate_and_deriv(const ReactionRate &reaction_rate, Scalar tol)
void test_deriv(const ReactionRate &reaction_rate, Scalar tol)
virtual Scalar exact_rate(Scalar T)=0
This class contains the conditions of the chemistry.