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

Public Member Functions

 CPPUNIT_TEST_SUITE (ArrheniusRateLongDoubleTest)
 
 CPPUNIT_TEST (test_standard)
 
 CPPUNIT_TEST (test_reset_scalar_params)
 
 CPPUNIT_TEST (test_reset_vector_params2)
 
 CPPUNIT_TEST (test_reset_vector_params3)
 
 CPPUNIT_TEST_SUITE_END ()
 
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< long double > &reaction_rate, long doubletol)
 
void test_deriv (const Antioch::ArrheniusRate< long double > &reaction_rate, long doubletol)
 
void test_rate_and_deriv (const Antioch::ArrheniusRate< long double > &reaction_rate, long doubletol)
 

Protected Member Functions

virtual long double exact_rate (long doubleT)
 
virtual long double exact_deriv (long doubleT)
 
void reset_params (long doubleCf, long doubleEa)
 
void reset_params (long doubleCf, long doubleEa, long doubleR)
 
long double value (long doubleT)
 
long double deriv (long doubleT)
 

Protected Attributes

Antioch::ArrheniusRate< long
double > * 
_rate
 
long double _Cf
 
long double _Ea
 
long double _R
 

Detailed Description

Definition at line 174 of file arrhenius_rate_test.C.

Member Function Documentation

AntiochTesting::ArrheniusRateLongDoubleTest::CPPUNIT_TEST ( test_standard  )
AntiochTesting::ArrheniusRateLongDoubleTest::CPPUNIT_TEST ( test_reset_scalar_params  )
AntiochTesting::ArrheniusRateLongDoubleTest::CPPUNIT_TEST ( test_reset_vector_params2  )
AntiochTesting::ArrheniusRateLongDoubleTest::CPPUNIT_TEST ( test_reset_vector_params3  )
AntiochTesting::ArrheniusRateLongDoubleTest::CPPUNIT_TEST_SUITE ( ArrheniusRateLongDoubleTest  )
AntiochTesting::ArrheniusRateLongDoubleTest::CPPUNIT_TEST_SUITE_END ( )
long double AntiochTesting::ArrheniusRateTestHelper< long double >::deriv ( long double  T)
inlineprotectedinherited
virtual long double AntiochTesting::ArrheniusRateTest< long double >::exact_deriv ( long double  T)
inlineprotectedvirtualinherited
virtual long double AntiochTesting::ArrheniusRateTest< long double >::exact_rate ( long double  T)
inlineprotectedvirtualinherited
void AntiochTesting::ArrheniusRateTestHelper< long double >::reset_params ( long double  Cf,
long double  Ea 
)
inlineprotectedinherited
void AntiochTesting::ArrheniusRateTestHelper< long double >::reset_params ( long double  Cf,
long double  Ea,
long double  R 
)
inlineprotectedinherited
void AntiochTesting::ArrheniusRateTest< long double >::setUp ( )
inlineinherited

Definition at line 49 of file arrhenius_rate_test.C.

References AntiochTesting::ArrheniusRateTest< Scalar >::_rate, and AntiochTesting::ArrheniusRateTestHelper< Scalar >::reset_params().

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< long double > * _rate
void AntiochTesting::ArrheniusRateTest< long double >::tearDown ( )
inlineinherited

Definition at line 59 of file arrhenius_rate_test.C.

References AntiochTesting::ArrheniusRateTest< Scalar >::_rate.

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

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  }
_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< long double > , long double >::test_rate ( const Antioch::ArrheniusRate< long double > &  reaction_rate,
long double  tol 
)
inlineinherited

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

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  }
_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.
void AntiochTesting::ArrheniusRateTest< long double >::test_reset_scalar_params ( )
inlineinherited

Definition at line 73 of file arrhenius_rate_test.C.

References AntiochTesting::ArrheniusRateTest< Scalar >::_rate, Antioch::Units< T >::get_SI_factor(), AntiochTesting::ArrheniusRateTestHelper< Scalar >::reset_params(), Antioch::ArrheniusRate< CoeffType >::set_Cf(), Antioch::ArrheniusRate< CoeffType >::set_Ea(), Antioch::ArrheniusRate< CoeffType >::set_rscale(), AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar >, Scalar >::test_deriv(), AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar >, Scalar >::test_rate(), and AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar >, Scalar >::test_rate_and_deriv().

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< long double > &reaction_rate, long doubletol)
void set_Cf(const CoeffType Cf)
void test_rate_and_deriv(const Antioch::ArrheniusRate< long double > &reaction_rate, long doubletol)
Antioch::ArrheniusRate< long double > * _rate
T get_SI_factor() const
Multiplicative coefficient getter.
Definition: units.h:334
void test_deriv(const Antioch::ArrheniusRate< long double > &reaction_rate, long doubletol)
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)
void AntiochTesting::ArrheniusRateTest< long double >::test_reset_vector_params2 ( )
inlineinherited

Definition at line 92 of file arrhenius_rate_test.C.

References AntiochTesting::ArrheniusRateTest< Scalar >::_rate, Antioch::ArrheniusRate< CoeffType >::reset_coefs(), AntiochTesting::ArrheniusRateTestHelper< Scalar >::reset_params(), AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar >, Scalar >::test_deriv(), AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar >, Scalar >::test_rate(), and AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar >, Scalar >::test_rate_and_deriv().

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< long double > &reaction_rate, long doubletol)
void test_rate_and_deriv(const Antioch::ArrheniusRate< long double > &reaction_rate, long doubletol)
Antioch::ArrheniusRate< long double > * _rate
void test_deriv(const Antioch::ArrheniusRate< long double > &reaction_rate, long doubletol)
void reset_coefs(const VectorCoeffType &coefficients)
reset the coeffs
void AntiochTesting::ArrheniusRateTest< long double >::test_reset_vector_params3 ( )
inlineinherited

Definition at line 111 of file arrhenius_rate_test.C.

References AntiochTesting::ArrheniusRateTest< Scalar >::_rate, Antioch::ArrheniusRate< CoeffType >::reset_coefs(), AntiochTesting::ArrheniusRateTestHelper< Scalar >::reset_params(), AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar >, Scalar >::test_deriv(), AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar >, Scalar >::test_rate(), and AntiochTesting::ReactionRateTestBase< Antioch::ArrheniusRate< Scalar >, Scalar >::test_rate_and_deriv().

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< long double > &reaction_rate, long doubletol)
void test_rate_and_deriv(const Antioch::ArrheniusRate< long double > &reaction_rate, long doubletol)
Antioch::ArrheniusRate< long double > * _rate
void test_deriv(const Antioch::ArrheniusRate< long double > &reaction_rate, long doubletol)
void reset_coefs(const VectorCoeffType &coefficients)
reset the coeffs
void AntiochTesting::ArrheniusRateTest< long double >::test_standard ( )
inlineinherited
long double AntiochTesting::ArrheniusRateTestHelper< long double >::value ( long double  T)
inlineprotectedinherited

Member Data Documentation

long double AntiochTesting::ArrheniusRateTestHelper< long double >::_Cf
protectedinherited

Definition at line 44 of file arrhenius_rate_test_helper.h.

long double AntiochTesting::ArrheniusRateTestHelper< long double >::_Ea
protectedinherited

Definition at line 44 of file arrhenius_rate_test_helper.h.

long double AntiochTesting::ArrheniusRateTestHelper< long double >::_R
protectedinherited

Definition at line 44 of file arrhenius_rate_test_helper.h.

Antioch::ArrheniusRate<long double >* AntiochTesting::ArrheniusRateTest< long double >::_rate
protectedinherited

Definition at line 134 of file arrhenius_rate_test.C.


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