antioch-0.4.0
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
AntiochTesting::ArrheniusRateTest< Scalar > Class Template Reference
Inheritance diagram for AntiochTesting::ArrheniusRateTest< Scalar >:
AntiochTesting::ArrheniusRateTestHelper< Scalar > AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar >, Scalar >

Public Member Functions

void setUp ()
 
void tearDown ()
 
void test_standard ()
 
void test_reset_scalar_params ()
 
void test_reset_vector_params2 ()
 
void test_reset_vector_params3 ()
 
void test_rate (const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
 
void test_deriv (const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
 
void test_rate_and_deriv (const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
 

Protected Member Functions

virtual Scalar exact_rate (Scalar T)
 
virtual Scalar exact_deriv (Scalar T)
 
void reset_params (Scalar Cf, Scalar Ea)
 
void reset_params (Scalar Cf, Scalar Ea, Scalar R)
 
Scalar value (Scalar T)
 
Scalar deriv (Scalar T)
 

Protected Attributes

Antioch::ArrheniusRate< Scalar > * _rate
 
Scalar _Cf
 
Scalar _Ea
 
Scalar _R
 

Detailed Description

template<typename Scalar>
class AntiochTesting::ArrheniusRateTest< Scalar >

Definition at line 45 of file arrhenius_rate_test.C.

Member Function Documentation

template<typename Scalar>
Scalar AntiochTesting::ArrheniusRateTestHelper< Scalar >::deriv ( Scalar  T)
inlineprotectedinherited
template<typename Scalar>
virtual Scalar AntiochTesting::ArrheniusRateTest< Scalar >::exact_deriv ( Scalar  T)
inlineprotectedvirtual
template<typename Scalar>
virtual Scalar AntiochTesting::ArrheniusRateTest< Scalar >::exact_rate ( Scalar  T)
inlineprotectedvirtual
template<typename Scalar>
void AntiochTesting::ArrheniusRateTestHelper< Scalar >::reset_params ( Scalar  Cf,
Scalar  Ea 
)
inlineprotectedinherited
template<typename Scalar>
void AntiochTesting::ArrheniusRateTestHelper< Scalar >::reset_params ( Scalar  Cf,
Scalar  Ea,
Scalar  R 
)
inlineprotectedinherited
template<typename Scalar>
void AntiochTesting::ArrheniusRateTest< Scalar >::setUp ( )
inline

Definition at line 49 of file arrhenius_rate_test.C.

50  {
51  Scalar Cf = 1.4L;
52  Scalar Ea = 298.0L;
53  Scalar R = 1.0L; // Ea in K
54 
55  this->reset_params(Cf,Ea,R);
57  }
Antioch::ArrheniusRate< Scalar > * _rate
template<typename Scalar>
void AntiochTesting::ArrheniusRateTest< Scalar >::tearDown ( )
inline

Definition at line 59 of file arrhenius_rate_test.C.

60  {
61  delete _rate;
62  }
Antioch::ArrheniusRate< Scalar > * _rate
void AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar > , Scalar >::test_deriv ( const Antioch::ArrheniusRate< Scalar > &  reaction_rate,
Scalar  tol 
)
inlineinherited

Definition at line 70 of file reaction_rate_test_base.h.

Referenced by AntiochTesting::ArrheniusRateTest< long double >::test_reset_scalar_params(), AntiochTesting::ArrheniusRateTest< long double >::test_reset_vector_params2(), AntiochTesting::ArrheniusRateTest< long double >::test_reset_vector_params3(), and AntiochTesting::ArrheniusRateTest< long double >::test_standard().

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  }
_Cf VectorStateType VectorStateType derivative(const KineticsConditions< StateType, VectorStateType > &T) const ANTIOCH_AUTOFUNC(StateType
This class contains the conditions of the chemistry.
void AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar > , Scalar >::test_rate ( const Antioch::ArrheniusRate< Scalar > &  reaction_rate,
Scalar  tol 
)
inlineinherited

Definition at line 43 of file reaction_rate_test_base.h.

Referenced by AntiochTesting::ArrheniusRateTest< long double >::test_reset_scalar_params(), AntiochTesting::ArrheniusRateTest< long double >::test_reset_vector_params2(), AntiochTesting::ArrheniusRateTest< long double >::test_reset_vector_params3(), and AntiochTesting::ArrheniusRateTest< long double >::test_standard().

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  }
This class contains the conditions of the chemistry.
void AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar > , Scalar >::test_rate_and_deriv ( const Antioch::ArrheniusRate< Scalar > &  reaction_rate,
Scalar  tol 
)
inlineinherited

Definition at line 96 of file reaction_rate_test_base.h.

Referenced by AntiochTesting::ArrheniusRateTest< long double >::test_reset_scalar_params(), AntiochTesting::ArrheniusRateTest< long double >::test_reset_vector_params2(), AntiochTesting::ArrheniusRateTest< long double >::test_reset_vector_params3(), and AntiochTesting::ArrheniusRateTest< long double >::test_standard().

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  }
_Cf VectorStateType VectorStateType(*) VectorStateType voi rate_and_derivative)(const KineticsConditions< StateType, VectorStateType > &T, StateType &rate, StateType &drate_dT) const
This class contains the conditions of the chemistry.
template<typename Scalar>
void AntiochTesting::ArrheniusRateTest< Scalar >::test_reset_scalar_params ( )
inline

Definition at line 73 of file arrhenius_rate_test.C.

74  {
75  Scalar Cf = 1e-7L;
76  Scalar Ea = 36000.L;
77  Scalar R = Antioch::Constants::R_universal<Scalar>()*Antioch::Units<Scalar>("cal").get_SI_factor();
78 
79  this->reset_params( Cf, Ea, R );
80 
81  _rate->set_Cf(Cf);
82  _rate->set_Ea(Ea);
83  _rate->set_rscale(R);
84 
85  const Scalar tol = std::numeric_limits<Scalar>::epsilon() * 100;
86 
87  this->test_rate( *_rate, tol );
88  this->test_deriv( *_rate, tol );
89  this->test_rate_and_deriv( *_rate, tol );
90  }
void test_rate(const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
void set_Cf(const CoeffType Cf)
void test_rate_and_deriv(const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
Antioch::ArrheniusRate< Scalar > * _rate
T get_SI_factor() const
Multiplicative coefficient getter.
Definition: units.h:334
void test_deriv(const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
An advanced unit class.
Definition: units.h:111
void set_Ea(const CoeffType Ea)
set Ea, rescale the value, unit is known
void set_rscale(const CoeffType rscale)
template<typename Scalar>
void AntiochTesting::ArrheniusRateTest< Scalar >::test_reset_vector_params2 ( )
inline

Definition at line 92 of file arrhenius_rate_test.C.

93  {
94  Scalar Cf = 2.5e-7L;
95  Scalar Ea = 43000.L; //still in cal
96 
97  this->reset_params( Cf, Ea );
98 
99  std::vector<Scalar> values(2);
100  values[0] = Cf;
101  values[1] = Ea;
102  _rate->reset_coefs(values);
103 
104  const Scalar tol = std::numeric_limits<Scalar>::epsilon() * 100;
105 
106  this->test_rate( *_rate, tol );
107  this->test_deriv( *_rate, tol );
108  this->test_rate_and_deriv( *_rate, tol );
109  }
void test_rate(const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
void test_rate_and_deriv(const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
Antioch::ArrheniusRate< Scalar > * _rate
void test_deriv(const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
void reset_coefs(const VectorCoeffType &coefficients)
reset the coeffs
template<typename Scalar>
void AntiochTesting::ArrheniusRateTest< Scalar >::test_reset_vector_params3 ( )
inline

Definition at line 111 of file arrhenius_rate_test.C.

112  {
113  Scalar Cf = 2.1e-11L;
114  Scalar Ea = 100000.L;
115  Scalar R = Antioch::Constants::R_universal<Scalar>();
116 
117  this->reset_params( Cf, Ea, R );
118 
119  std::vector<Scalar> values(3);
120  values[0] = Cf;
121  values[1] = Ea;
122  values[2] = R;
123  _rate->reset_coefs(values);
124 
125  const Scalar tol = std::numeric_limits<Scalar>::epsilon() * 100;
126 
127  this->test_rate( *_rate, tol );
128  this->test_deriv( *_rate, tol );
129  this->test_rate_and_deriv( *_rate, tol );
130  }
void test_rate(const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
void test_rate_and_deriv(const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
Antioch::ArrheniusRate< Scalar > * _rate
void test_deriv(const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
void reset_coefs(const VectorCoeffType &coefficients)
reset the coeffs
template<typename Scalar>
void AntiochTesting::ArrheniusRateTest< Scalar >::test_standard ( )
inline

Definition at line 64 of file arrhenius_rate_test.C.

65  {
66  const Scalar tol = std::numeric_limits<Scalar>::epsilon() * 100;
67 
68  this->test_rate( *_rate, tol );
69  this->test_deriv( *_rate, tol );
70  this->test_rate_and_deriv( *_rate, tol );
71  }
void test_rate(const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
void test_rate_and_deriv(const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
Antioch::ArrheniusRate< Scalar > * _rate
void test_deriv(const Antioch::ArrheniusRate< Scalar > &reaction_rate, Scalar tol)
template<typename Scalar>
Scalar AntiochTesting::ArrheniusRateTestHelper< Scalar >::value ( Scalar  T)
inlineprotectedinherited

Member Data Documentation

template<typename Scalar>
Scalar AntiochTesting::ArrheniusRateTestHelper< Scalar >::_Cf
protectedinherited

Definition at line 44 of file arrhenius_rate_test_helper.h.

template<typename Scalar>
Scalar AntiochTesting::ArrheniusRateTestHelper< Scalar >::_Ea
protectedinherited

Definition at line 44 of file arrhenius_rate_test_helper.h.

template<typename Scalar>
Scalar AntiochTesting::ArrheniusRateTestHelper< Scalar >::_R
protectedinherited

Definition at line 44 of file arrhenius_rate_test_helper.h.

template<typename Scalar>
Antioch::ArrheniusRate<Scalar>* AntiochTesting::ArrheniusRateTest< Scalar >::_rate
protected

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

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