33 template <
typename Scalar>
35 const Scalar & rate,
const Scalar & derive,
const Scalar & T)
37 const Scalar tol = std::numeric_limits<Scalar>::epsilon() * 2;
39 if( abs( (rate - rate_exact)/rate_exact ) > tol )
41 std::cout << std::scientific << std::setprecision(16)
42 <<
"Error: Mismatch in rate values." << std::endl
43 <<
"T = " << T <<
" K" << std::endl
44 <<
"rate(T) = " << rate << std::endl
45 <<
"rate_exact = " << rate_exact << std::endl
46 <<
"relative difference = " << abs( (rate - rate_exact)/rate_exact ) << std::endl
47 <<
"tolerance = " << tol << std::endl;
51 if( abs( (derive - derive_exact)/derive_exact ) > tol )
53 std::cout << std::scientific << std::setprecision(16)
54 <<
"Error: Mismatch in rate derivative values." << std::endl
55 <<
"T = " << T <<
" K" << std::endl
56 <<
"drate_dT(T) = " << derive << std::endl
57 <<
"derive_exact = " << derive_exact << std::endl
58 <<
"relative difference = " << abs( (derive - derive_exact)/derive_exact ) << std::endl
59 <<
"tolerance = " << tol << std::endl;
68 template <
typename Scalar>
72 for(Scalar T = 300.1; T <= 2500.1; T += 10.)
75 const Scalar rate_exact = Cf;
76 const Scalar derive_exact = 0.L;
80 Scalar rate = constant_rate(cond);
81 Scalar deriveRate = constant_rate.
derivative(cond);
90 rate = constant_rate(T);
103 template <
typename Scalar>
114 return_flag =
test_values(Cf,constant_rate) || return_flag;
118 return_flag =
test_values(Cf,constant_rate) || return_flag;
121 std::vector<Scalar> values(1,Cf);
123 return_flag =
test_values(Cf,constant_rate) || return_flag;
130 return (tester<double>() ||
131 tester<long double>() ||
int check_rate_and_derivative(const Scalar &rate_exact, const Scalar &derive_exact, const Scalar &rate, const Scalar &derive, const Scalar &T)
void set_Cf(const CoeffType Cf)
VectorStateType VectorStateType derivative(const KineticsConditions< StateType, VectorStateType > &cond) const ANTIOCH_AUTOFUNC(StateType
VectorStateType VectorStateType VectorStateType void rate_and_derivative(const KineticsConditions< StateType, VectorStateType > &cond, StateType &rate, StateType &drate_dT) const
void reset_coefs(const VectorCoeffType &coefficients)
reset the coeffs
int test_values(const Scalar &Cf, const Antioch::ConstantRate< Scalar > &constant_rate)
This class contains the conditions of the chemistry.