Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FalloffFactory.cpp
Go to the documentation of this file.
1 /**
2  * @file FalloffFactory.cpp
3  */
4 // Copyright 2001 California Institute of Technology
5 
8 
9 namespace Cantera
10 {
11 
12 FalloffFactory* FalloffFactory::s_factory = 0;
14 
16 {
17  Falloff* f;
18  switch (type) {
19  case SIMPLE_FALLOFF:
20  f = new Falloff();
21  break;
22  case TROE_FALLOFF:
23  f = new Troe();
24  break;
25  case SRI_FALLOFF:
26  f = new SRI();
27  break;
28  default:
29  return 0;
30  }
31  f->init(c);
32  return f;
33 }
34 
35 shared_ptr<Falloff> newFalloff(int type, const vector_fp& c)
36 {
37  shared_ptr<Falloff> f(FalloffFactory::factory()->newFalloff(type, c));
38  return f;
39 }
40 
41 }
virtual Falloff * newFalloff(int type, const vector_fp &c)
Return a pointer to a new falloff function calculator.
shared_ptr< Falloff > newFalloff(int type, const vector_fp &c)
Return a pointer to a new falloff function calculator.
The SRI falloff function.
Definition: Falloff.h:191
The 3- or 4-parameter Troe falloff parameterization.
Definition: Falloff.h:118
Parameterizations for reaction falloff functions.
virtual void init(const vector_fp &c)
Initialize.
Definition: Falloff.cpp:13
static mutex_t falloff_mutex
Mutex for use when calling the factory.
static FalloffFactory * factory()
Return a pointer to the factory.
This file defines some constants used to specify reaction types.
static FalloffFactory * s_factory
Pointer to the single instance of the factory.
Base class for falloff function calculators.
Definition: Falloff.h:23
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:157