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

Public Member Functions

 CPPUNIT_TEST_SUITE (ArrheniusRateFloatTest)
 
 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< float > &reaction_rate, floattol)
 
void test_deriv (const Antioch::ArrheniusRate< float > &reaction_rate, floattol)
 
void test_rate_and_deriv (const Antioch::ArrheniusRate< float > &reaction_rate, floattol)
 

Protected Member Functions

virtual float exact_rate (floatT)
 
virtual float exact_deriv (floatT)
 
void reset_params (floatCf, floatEa)
 
void reset_params (floatCf, floatEa, floatR)
 
float value (floatT)
 
float deriv (floatT)
 

Protected Attributes

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

Detailed Description

Definition at line 148 of file arrhenius_rate_test.C.

Member Function Documentation

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

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

Definition at line 59 of file arrhenius_rate_test.C.

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

Definition at line 70 of file reaction_rate_test_base.h.

References AntiochTesting::ReactionRateTestBase< ReactionRate, Scalar >::exact_deriv().

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

Definition at line 43 of file reaction_rate_test_base.h.

References AntiochTesting::ReactionRateTestBase< ReactionRate, Scalar >::exact_rate().

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< float > , float >::test_rate_and_deriv ( const Antioch::ArrheniusRate< float > &  reaction_rate,
float  tol 
)
inlineinherited

Definition at line 96 of file reaction_rate_test_base.h.

References AntiochTesting::ReactionRateTestBase< ReactionRate, Scalar >::exact_deriv(), and AntiochTesting::ReactionRateTestBase< ReactionRate, Scalar >::exact_rate().

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< float >::test_reset_scalar_params ( )
inlineinherited

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

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

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

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< float > &reaction_rate, floattol)
void test_rate_and_deriv(const Antioch::ArrheniusRate< float > &reaction_rate, floattol)
Antioch::ArrheniusRate< float > * _rate
void test_deriv(const Antioch::ArrheniusRate< float > &reaction_rate, floattol)
float AntiochTesting::ArrheniusRateTestHelper< float >::value ( float  T)
inlineprotectedinherited

Member Data Documentation

float AntiochTesting::ArrheniusRateTestHelper< float >::_Cf
protectedinherited

Definition at line 44 of file arrhenius_rate_test_helper.h.

float AntiochTesting::ArrheniusRateTestHelper< float >::_Ea
protectedinherited

Definition at line 44 of file arrhenius_rate_test_helper.h.

float AntiochTesting::ArrheniusRateTestHelper< float >::_R
protectedinherited

Definition at line 44 of file arrhenius_rate_test_helper.h.

Antioch::ArrheniusRate<float >* AntiochTesting::ArrheniusRateTest< float >::_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