antioch-0.4.0
List of all members | Public Member Functions | Protected Member Functions
AntiochTesting::ReactionRateTestBase< ReactionRate, Scalar > Class Template Referenceabstract

#include <reaction_rate_test_base.h>

Inheritance diagram for AntiochTesting::ReactionRateTestBase< ReactionRate, Scalar >:

Public Member Functions

void test_rate (const ReactionRate &reaction_rate, Scalar tol)
 
void test_deriv (const ReactionRate &reaction_rate, Scalar tol)
 
void test_rate_and_deriv (const ReactionRate &reaction_rate, Scalar tol)
 

Protected Member Functions

virtual Scalar exact_rate (Scalar T)=0
 
virtual Scalar exact_deriv (Scalar T)=0
 

Detailed Description

template<typename ReactionRate, typename Scalar>
class AntiochTesting::ReactionRateTestBase< ReactionRate, Scalar >

Definition at line 40 of file reaction_rate_test_base.h.

Member Function Documentation

template<typename ReactionRate, typename Scalar>
virtual Scalar AntiochTesting::ReactionRateTestBase< ReactionRate, Scalar >::exact_deriv ( Scalar  T)
protectedpure virtual
template<typename ReactionRate, typename Scalar>
virtual Scalar AntiochTesting::ReactionRateTestBase< ReactionRate, Scalar >::exact_rate ( Scalar  T)
protectedpure virtual
template<typename ReactionRate, typename Scalar>
void AntiochTesting::ReactionRateTestBase< ReactionRate, Scalar >::test_deriv ( const ReactionRate &  reaction_rate,
Scalar  tol 
)
inline

Definition at line 70 of file reaction_rate_test_base.h.

72  {
73  for(Scalar T = 300.1; T <= 2500.1; T += 10.)
74  {
75  {
76  Scalar deriv = reaction_rate.derivative(T);
77  Scalar exact_deriv = this->exact_deriv(T);
78 
79  CPPUNIT_ASSERT_DOUBLES_EQUAL( deriv,
80  exact_deriv,
81  tol );
82  }
83 
84  {
86  Scalar deriv = reaction_rate.derivative(cond);
87  Scalar exact_deriv = this->exact_deriv(T);
88 
89  CPPUNIT_ASSERT_DOUBLES_EQUAL( deriv,
90  exact_deriv,
91  tol );
92  }
93  }
94  }
virtual Scalar exact_deriv(Scalar T)=0
This class contains the conditions of the chemistry.
template<typename ReactionRate, typename Scalar>
void AntiochTesting::ReactionRateTestBase< ReactionRate, Scalar >::test_rate ( const ReactionRate &  reaction_rate,
Scalar  tol 
)
inline

Definition at line 43 of file reaction_rate_test_base.h.

45  {
46  for(Scalar T = 300.1; T <= 2500.1; T += 10.)
47  {
48  {
49  Scalar rate = reaction_rate(T);
50  Scalar exact_rate = this->exact_rate(T);
51 
52  CPPUNIT_ASSERT_DOUBLES_EQUAL( rate,
53  exact_rate,
54  tol );
55  }
56 
57  {
59  Scalar rate = reaction_rate(cond);
60  Scalar exact_rate = this->exact_rate(T);
61 
62  CPPUNIT_ASSERT_DOUBLES_EQUAL( rate,
63  exact_rate,
64  tol );
65  }
66 
67  }
68  }
virtual Scalar exact_rate(Scalar T)=0
This class contains the conditions of the chemistry.
template<typename ReactionRate, typename Scalar>
void AntiochTesting::ReactionRateTestBase< ReactionRate, Scalar >::test_rate_and_deriv ( const ReactionRate &  reaction_rate,
Scalar  tol 
)
inline

Definition at line 96 of file reaction_rate_test_base.h.

98  {
99  for(Scalar T = 300.1; T <= 2500.1; T += 10.)
100  {
101  {
102  Scalar rate;
103  Scalar deriv;
105 
106  reaction_rate.rate_and_derivative(cond,rate,deriv);
107 
108  Scalar exact_rate = this->exact_rate(T);
109  Scalar exact_deriv = this->exact_deriv(T);
110 
111  CPPUNIT_ASSERT_DOUBLES_EQUAL( rate,
112  exact_rate,
113  tol );
114 
115  CPPUNIT_ASSERT_DOUBLES_EQUAL( deriv,
116  exact_deriv,
117  tol );
118  }
119  }
120  }
virtual Scalar exact_deriv(Scalar T)=0
virtual Scalar exact_rate(Scalar T)=0
This class contains the conditions of the chemistry.

The documentation for this class was generated from the following file:

Generated on Thu Jul 7 2016 11:09:52 for antioch-0.4.0 by  doxygen 1.8.8