antioch-0.4.0
List of all members | Public Member Functions | Private Attributes | Friends
Antioch::KineticsType< CoeffType, VectorCoeffType > Class Template Referenceabstract

base class for kinetics models More...

#include <kinetics_type.h>

Inheritance diagram for Antioch::KineticsType< CoeffType, VectorCoeffType >:
Antioch::PhotochemicalRate< CoeffType, VectorCoeffType > Antioch::ArrheniusRate< double > Antioch::ArrheniusRate< float > Antioch::ArrheniusRate< long double > Antioch::ArrheniusRate< Scalar > Antioch::ArrheniusRate< typename Antioch::value_type< Eigen::Array< double, 2 *ANTIOCH_N_TUPLES, 1 > >::type > Antioch::ArrheniusRate< typename Antioch::value_type< Eigen::Array< float, 2 *ANTIOCH_N_TUPLES, 1 > >::type > Antioch::ArrheniusRate< typename Antioch::value_type< Eigen::Array< long double, 2 *ANTIOCH_N_TUPLES, 1 > >::type > Antioch::ArrheniusRate< typename Antioch::value_type< Eigen::Array< Scalar, 2 *ANTIOCH_N_TUPLES, 1 > >::type > Antioch::ArrheniusRate< typename Antioch::value_type< MetaPhysicL::NumberArray< 2 *ANTIOCH_N_TUPLES, float > >::type > Antioch::ArrheniusRate< typename Antioch::value_type< PairScalars >::type > Antioch::ArrheniusRate< typename Antioch::value_type< std::valarray< double > >::type > Antioch::ArrheniusRate< typename Antioch::value_type< std::valarray< float > >::type > Antioch::ArrheniusRate< typename Antioch::value_type< std::valarray< long double > >::type > Antioch::ArrheniusRate< typename Antioch::value_type< std::valarray< Scalar > >::type > Antioch::ArrheniusRate< typename Antioch::value_type< vex::vector< double > >::type > Antioch::ArrheniusRate< typename Antioch::value_type< vex::vector< float > >::type >

Public Member Functions

 KineticsType (const KineticsModel::KineticsModel type)
 
virtual ~KineticsType ()
 
KineticsModel::KineticsModel type () const
 
template<typename StateType , typename VectorStateType >
StateType operator() (const KineticsConditions< StateType, VectorStateType > &conditions) const
 
template<typename StateType >
StateType operator() (const StateType &temp) const
 
template<typename StateType , typename VectorStateType >
StateType derivative (const KineticsConditions< StateType, VectorStateType > &conditions) const
 
CoeffType get_parameter (KineticsModel::Parameters parameter) const
 get one parameter, characterized by enum More...
 
CoeffType get_parameter (KineticsModel::Parameters parameter, int l) const
 get one parameter, characterized by enum, for vectorized parameter More...
 
template<typename StateType >
StateType derivative (const StateType &conditions) const
 
template<typename StateType , typename VectorStateType >
void compute_rate_and_derivative (const KineticsConditions< StateType, VectorStateType > &conditions, StateType &rate, StateType &drate_dT) const
 
template<typename StateType >
void compute_rate_and_derivative (const StateType &temp, StateType &rate, StateType &drate_dT) const
 
void set_index (unsigned int nr)
 
virtual const std::string numeric () const =0
 
void print (std::ostream &os=std::cout) const
 Formatted print, by default to std::cout. More...
 

Private Attributes

KineticsModel::KineticsModel my_type
 
unsigned int my_index
 

Friends

std::ostream & operator<< (std::ostream &os, const KineticsType &rate)
 Formatted print. More...
 

Detailed Description

template<typename CoeffType, typename VectorCoeffType = std::vector<CoeffType>>
class Antioch::KineticsType< CoeffType, VectorCoeffType >

base class for kinetics models

Kinetics models are:

Definition at line 82 of file kinetics_type.h.

Constructor & Destructor Documentation

template<typename CoeffType , typename VectorCoeffType >
Antioch::KineticsType< CoeffType, VectorCoeffType >::KineticsType ( const KineticsModel::KineticsModel  type)
inline

Definition at line 151 of file kinetics_type.h.

151  :
152  my_type(type),
153  my_index(0)
154  {
155  return;
156  }
KineticsModel::KineticsModel type() const
KineticsModel::KineticsModel my_type
template<typename CoeffType , typename VectorCoeffType >
Antioch::KineticsType< CoeffType, VectorCoeffType >::~KineticsType ( )
inlinevirtual

Definition at line 167 of file kinetics_type.h.

168  {
169  return;
170  }

Member Function Documentation

template<typename CoeffType , typename VectorCoeffType >
template<typename StateType , typename VectorStateType >
void Antioch::KineticsType< CoeffType, VectorCoeffType >::compute_rate_and_derivative ( const KineticsConditions< StateType, VectorStateType > &  conditions,
StateType &  rate,
StateType &  drate_dT 
) const
inline

Definition at line 336 of file kinetics_type.h.

References antioch_error, Antioch::KineticsModel::ARRHENIUS, Antioch::KineticsModel::BERTHELOT, Antioch::KineticsModel::BHE, Antioch::KineticsModel::CONSTANT, Antioch::KineticsModel::HERCOURT_ESSEN, Antioch::KineticsModel::KOOIJ, Antioch::KineticsConditions< StateType, VectorStateType >::particle_flux(), Antioch::KineticsModel::PHOTOCHEM, and Antioch::KineticsModel::VANTHOFF.

Referenced by test_values().

338  {
339  switch (my_type)
340  {
342  {
343  (static_cast<const ConstantRate<CoeffType>*>(this))->rate_and_derivative(conditions,rate,drate_dT);
344  }
345  break;
346 
348  {
349  (static_cast<const HercourtEssenRate<CoeffType>*>(this))->rate_and_derivative(conditions,rate,drate_dT);
350  }
351  break;
352 
354  {
355  (static_cast<const BerthelotRate<CoeffType>*>(this))->rate_and_derivative(conditions,rate,drate_dT);
356  }
357  break;
358 
360  {
361  (static_cast<const ArrheniusRate<CoeffType>*>(this))->rate_and_derivative(conditions,rate,drate_dT);
362  }
363  break;
364 
365  case(KineticsModel::BHE):
366  {
367  (static_cast<const BerthelotHercourtEssenRate<CoeffType>*>(this))->rate_and_derivative(conditions,rate,drate_dT);
368  }
369  break;
370 
371  case(KineticsModel::KOOIJ):
372  {
373  (static_cast<const KooijRate<CoeffType>*>(this))->rate_and_derivative(conditions,rate,drate_dT);
374  }
375  break;
376 
378  {
379  (static_cast<const VantHoffRate<CoeffType>*>(this))->rate_and_derivative(conditions,rate,drate_dT);
380  }
381  break;
382 
384  {
385  (static_cast<const PhotochemicalRate<CoeffType,VectorCoeffType>*>(this))->rate_and_derivative(conditions.particle_flux(my_index),rate,drate_dT);
386  }
387  break;
388 
389  default:
390  {
391  antioch_error();
392  }
393 
394  } // switch(my_type)
395 
396  return;
397  }
#define antioch_error()
KineticsModel::KineticsModel my_type
template<typename CoeffType , typename VectorCoeffType >
template<typename StateType >
void Antioch::KineticsType< CoeffType, VectorCoeffType >::compute_rate_and_derivative ( const StateType &  temp,
StateType &  rate,
StateType &  drate_dT 
) const
inline

Definition at line 482 of file kinetics_type.h.

References antioch_deprecated.

484  {
487  (KineticsConditions<StateType> (temp), rate, drate_dT);
488  }
void compute_rate_and_derivative(const KineticsConditions< StateType, VectorStateType > &conditions, StateType &rate, StateType &drate_dT) const
#define antioch_deprecated()
template<typename CoeffType , typename VectorCoeffType >
template<typename StateType , typename VectorStateType >
StateType Antioch::KineticsType< CoeffType, VectorCoeffType >::derivative ( const KineticsConditions< StateType, VectorStateType > &  conditions) const
inline

Definition at line 259 of file kinetics_type.h.

References antioch_error, Antioch::KineticsModel::ARRHENIUS, Antioch::KineticsModel::BERTHELOT, Antioch::KineticsModel::BHE, Antioch::KineticsModel::CONSTANT, Antioch::KineticsModel::HERCOURT_ESSEN, Antioch::KineticsModel::KOOIJ, Antioch::KineticsConditions< StateType, VectorStateType >::particle_flux(), Antioch::KineticsModel::PHOTOCHEM, Antioch::KineticsConditions< StateType, VectorStateType >::T(), Antioch::KineticsModel::VANTHOFF, and Antioch::zero_clone().

Referenced by test_values().

260  {
261  switch(my_type)
262  {
264  {
265  return (static_cast<const ConstantRate<CoeffType>*>(this))->derivative(conditions);
266  }
267  break;
268 
270  {
271  return (static_cast<const HercourtEssenRate<CoeffType>*>(this))->derivative(conditions);
272  }
273  break;
274 
276  {
277  return (static_cast<const BerthelotRate<CoeffType>*>(this))->derivative(conditions);
278  }
279  break;
280 
282  {
283  return (static_cast<const ArrheniusRate<CoeffType>*>(this))->derivative(conditions);
284  }
285  break;
286 
287  case(KineticsModel::BHE):
288  {
289  return (static_cast<const BerthelotHercourtEssenRate<CoeffType>*>(this))->derivative(conditions);
290  }
291  break;
292 
293  case(KineticsModel::KOOIJ):
294  {
295  return (static_cast<const KooijRate<CoeffType>*>(this))->derivative(conditions);
296  }
297  break;
298 
300  {
301  return (static_cast<const VantHoffRate<CoeffType>*>(this))->derivative(conditions);
302  }
303  break;
304 
306  {
307  return (static_cast<const PhotochemicalRate<CoeffType,VectorCoeffType>*>(this))->derivative(conditions.particle_flux(my_index));
308  }
309  break;
310 
311  default:
312  {
313  antioch_error();
314  }
315 
316  } // switch(my_type)
317 
318  // Dummy
319  return zero_clone(conditions.T());
320  }
#define antioch_error()
KineticsModel::KineticsModel my_type
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > zero_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex)
Definition: eigen_utils.h:145
template<typename CoeffType , typename VectorCoeffType >
template<typename StateType >
StateType Antioch::KineticsType< CoeffType, VectorCoeffType >::derivative ( const StateType &  conditions) const
inline

Definition at line 326 of file kinetics_type.h.

References antioch_deprecated.

327  {
329  return derivative
330  ( KineticsConditions<StateType> (temp) );
331  }
StateType derivative(const KineticsConditions< StateType, VectorStateType > &conditions) const
#define antioch_deprecated()
template<typename CoeffType , typename VectorCoeffType >
CoeffType Antioch::KineticsType< CoeffType, VectorCoeffType >::get_parameter ( KineticsModel::Parameters  parameter) const

get one parameter, characterized by enum

Definition at line 400 of file kinetics_type.h.

References antioch_error, Antioch::KineticsModel::ARRHENIUS, Antioch::KineticsModel::BERTHELOT, Antioch::KineticsModel::BHE, Antioch::KineticsModel::CONSTANT, Antioch::KineticsModel::HERCOURT_ESSEN, Antioch::KineticsModel::KOOIJ, and Antioch::KineticsModel::VANTHOFF.

401  {
402  switch (my_type)
403  {
405  {
406  return (static_cast<const ConstantRate<CoeffType>*>(this))->get_parameter(parameter);
407  }
408  break;
409 
411  {
412  return (static_cast<const HercourtEssenRate<CoeffType>*>(this))->get_parameter(parameter);
413  }
414  break;
415 
417  {
418  return (static_cast<const BerthelotRate<CoeffType>*>(this))->get_parameter(parameter);
419  }
420  break;
421 
423  {
424  return (static_cast<const ArrheniusRate<CoeffType>*>(this))->get_parameter(parameter);
425  }
426  break;
427 
428  case(KineticsModel::BHE):
429  {
430  return (static_cast<const BerthelotHercourtEssenRate<CoeffType>*>(this))->get_parameter(parameter);
431  }
432  break;
433 
434  case(KineticsModel::KOOIJ):
435  {
436  return (static_cast<const KooijRate<CoeffType>*>(this))->get_parameter(parameter);
437  }
438  break;
439 
441  {
442  return (static_cast<const VantHoffRate<CoeffType>*>(this))->get_parameter(parameter);
443  }
444  break;
445 
446  default:
447  {
448  antioch_error();
449  }
450 
451  } // switch(my_type)
452 
453  return 0;
454  }
#define antioch_error()
KineticsModel::KineticsModel my_type
template<typename CoeffType , typename VectorCoeffType >
CoeffType Antioch::KineticsType< CoeffType, VectorCoeffType >::get_parameter ( KineticsModel::Parameters  parameter,
int  l 
) const

get one parameter, characterized by enum, for vectorized parameter

Definition at line 458 of file kinetics_type.h.

References antioch_error, and Antioch::KineticsModel::PHOTOCHEM.

459  {
460  switch(my_type)
461  {
463  {
464  return (static_cast<const PhotochemicalRate<CoeffType,VectorCoeffType>*>(this))->get_parameter(parameter,l);
465  }
466  break;
467 
468  default:
469  {
470  antioch_error();
471  }
472 
473  } // switch(my_type)
474 
475  return 0;
476  }
#define antioch_error()
KineticsModel::KineticsModel my_type
template<typename CoeffType, typename VectorCoeffType = std::vector<CoeffType>>
virtual const std::string Antioch::KineticsType< CoeffType, VectorCoeffType >::numeric ( ) const
pure virtual

Implemented in Antioch::VantHoffRate< CoeffType >, Antioch::KooijRate< CoeffType >, Antioch::ArrheniusRate< CoeffType >, Antioch::ArrheniusRate< typename Antioch::value_type< MetaPhysicL::NumberArray< 2 *ANTIOCH_N_TUPLES, float > >::type >, Antioch::ArrheniusRate< Scalar >, Antioch::ArrheniusRate< typename Antioch::value_type< std::valarray< Scalar > >::type >, Antioch::ArrheniusRate< double >, Antioch::ArrheniusRate< float >, Antioch::ArrheniusRate< typename Antioch::value_type< vex::vector< double > >::type >, Antioch::ArrheniusRate< typename Antioch::value_type< std::valarray< float > >::type >, Antioch::ArrheniusRate< typename Antioch::value_type< std::valarray< long double > >::type >, Antioch::ArrheniusRate< typename Antioch::value_type< Eigen::Array< long double, 2 *ANTIOCH_N_TUPLES, 1 > >::type >, Antioch::ArrheniusRate< typename Antioch::value_type< Eigen::Array< float, 2 *ANTIOCH_N_TUPLES, 1 > >::type >, Antioch::ArrheniusRate< typename Antioch::value_type< std::valarray< double > >::type >, Antioch::ArrheniusRate< typename Antioch::value_type< PairScalars >::type >, Antioch::ArrheniusRate< typename Antioch::value_type< vex::vector< float > >::type >, Antioch::ArrheniusRate< long double >, Antioch::ArrheniusRate< typename Antioch::value_type< Eigen::Array< double, 2 *ANTIOCH_N_TUPLES, 1 > >::type >, Antioch::ArrheniusRate< typename Antioch::value_type< Eigen::Array< Scalar, 2 *ANTIOCH_N_TUPLES, 1 > >::type >, Antioch::BerthelotHercourtEssenRate< CoeffType >, Antioch::HercourtEssenRate< CoeffType >, Antioch::BerthelotRate< CoeffType >, Antioch::ConstantRate< CoeffType >, and Antioch::PhotochemicalRate< CoeffType, VectorCoeffType >.

template<typename CoeffType , typename VectorCoeffType >
template<typename StateType , typename VectorStateType >
StateType Antioch::KineticsType< CoeffType, VectorCoeffType >::operator() ( const KineticsConditions< StateType, VectorStateType > &  conditions) const
inline

Definition at line 182 of file kinetics_type.h.

References antioch_error, Antioch::KineticsModel::ARRHENIUS, Antioch::KineticsModel::BERTHELOT, Antioch::KineticsModel::BHE, Antioch::KineticsModel::CONSTANT, Antioch::KineticsModel::HERCOURT_ESSEN, Antioch::KineticsModel::KOOIJ, Antioch::KineticsConditions< StateType, VectorStateType >::particle_flux(), Antioch::KineticsModel::PHOTOCHEM, Antioch::KineticsConditions< StateType, VectorStateType >::T(), Antioch::KineticsModel::VANTHOFF, and Antioch::zero_clone().

183  {
184  switch(my_type)
185  {
187  {
188  return (static_cast<const ConstantRate<CoeffType>*>(this))->rate(conditions);
189  }
190  break;
191 
193  {
194  return (static_cast<const HercourtEssenRate<CoeffType>*>(this))->rate(conditions);
195  }
196  break;
197 
199  {
200  return (static_cast<const BerthelotRate<CoeffType>*>(this))->rate(conditions);
201  }
202  break;
203 
205  {
206  return (static_cast<const ArrheniusRate<CoeffType>*>(this))->rate(conditions);
207  }
208  break;
209 
210  case(KineticsModel::BHE):
211  {
212  return (static_cast<const BerthelotHercourtEssenRate<CoeffType>*>(this))->rate(conditions);
213  }
214  break;
215 
216  case(KineticsModel::KOOIJ):
217  {
218  return (static_cast<const KooijRate<CoeffType>*>(this))->rate(conditions);
219  }
220  break;
221 
223  {
224  return (static_cast<const VantHoffRate<CoeffType>*>(this))->rate(conditions);
225  }
226  break;
227 
229  {
230  return (static_cast<const PhotochemicalRate<CoeffType,VectorCoeffType>*>(this))->rate(conditions.particle_flux(my_index));
231  }
232  break;
233 
234  default:
235  {
236  antioch_error();
237  }
238 
239  } // switch(my_type)
240 
241  // Dummy
242  return zero_clone(conditions.T());
243  }
#define antioch_error()
KineticsModel::KineticsModel my_type
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > zero_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex)
Definition: eigen_utils.h:145
template<typename CoeffType , typename VectorCoeffType >
template<typename StateType >
StateType Antioch::KineticsType< CoeffType, VectorCoeffType >::operator() ( const StateType &  temp) const
inline

Definition at line 249 of file kinetics_type.h.

References antioch_deprecated.

250  {
252  return operator()
253  (KineticsConditions<StateType>(temp) );
254  }
#define antioch_deprecated()
template<typename CoeffType , typename VectorCoeffType >
void Antioch::KineticsType< CoeffType, VectorCoeffType >::print ( std::ostream &  os = std::cout) const
inline

Formatted print, by default to std::cout.

Definition at line 144 of file kinetics_type.h.

145  {
146  os << numeric();
147  }
virtual const std::string numeric() const =0
template<typename CoeffType , typename VectorCoeffType >
void Antioch::KineticsType< CoeffType, VectorCoeffType >::set_index ( unsigned int  nr)
inline

Definition at line 174 of file kinetics_type.h.

175  {
176  my_index = nr;
177  }
template<typename CoeffType , typename VectorCoeffType >
KineticsModel::KineticsModel Antioch::KineticsType< CoeffType, VectorCoeffType >::type ( ) const
inline

Definition at line 160 of file kinetics_type.h.

Referenced by Antioch::reset_parameter_of_rate(), and Antioch::reset_rate().

161  {
162  return my_type;
163  }
KineticsModel::KineticsModel my_type

Friends And Related Function Documentation

template<typename CoeffType, typename VectorCoeffType = std::vector<CoeffType>>
std::ostream& operator<< ( std::ostream &  os,
const KineticsType< CoeffType, VectorCoeffType > &  rate 
)
friend

Formatted print.

Definition at line 130 of file kinetics_type.h.

131  {
132  rate.print(os);
133  return os;
134  }

Member Data Documentation

template<typename CoeffType, typename VectorCoeffType = std::vector<CoeffType>>
unsigned int Antioch::KineticsType< CoeffType, VectorCoeffType >::my_index
private

Definition at line 138 of file kinetics_type.h.

template<typename CoeffType, typename VectorCoeffType = std::vector<CoeffType>>
KineticsModel::KineticsModel Antioch::KineticsType< CoeffType, VectorCoeffType >::my_type
private

Definition at line 137 of file kinetics_type.h.


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

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