Cantera 2.6.0
FalloffFactory.cpp
Go to the documentation of this file.
1/**
2 * @file FalloffFactory.cpp
3 *
4 * @deprecated Deprecated in Cantera 2.6 and removed thereafter. Replaced by
5 * FalloffRate objects managed by MultiRate evaluators.
6 */
7
8// This file is part of Cantera. See License.txt in the top-level directory or
9// at https://cantera.org/license.txt for license and copyright information.
10
13
14namespace Cantera
15{
16
17FalloffFactory* FalloffFactory::s_factory = 0;
19
21{
22 reg("Lindemann", []() { return new Lindemann(); });
23 addAlias("Lindemann", "Simple");
24 reg("Troe", []() { return new Troe(); });
25 reg("SRI", []() { return new SRI(); });
26 reg("Tsang", []() { return new Tsang(); });
27}
28
29Falloff* FalloffFactory::newFalloff(const std::string& type, const vector_fp& c)
30{
31 Falloff* f = create(type);
32 f->init(c);
33 return f;
34}
35
36shared_ptr<Falloff> newFalloff(const std::string& type, const vector_fp& c)
37{
38 shared_ptr<Falloff> f(FalloffFactory::factory()->newFalloff(type, c));
39 return f;
40}
41
42}
Parameterizations for reaction falloff functions.
Falloff * create(const std::string &name, Args... args)
Create an object using the object construction function corresponding to "name" and the provided cons...
Definition: FactoryBase.h:76
void addAlias(const std::string &original, const std::string &alias)
Add an alias for an existing registered type.
Definition: FactoryBase.h:86
void reg(const std::string &name, std::function< Falloff *(Args...)> f)
Register a new object construction function.
Definition: FactoryBase.h:81
virtual Falloff * newFalloff(const std::string &type, const vector_fp &c)
Return a pointer to a new falloff function calculator.
static FalloffFactory * s_factory
Pointer to the single instance of the factory.
static std::mutex falloff_mutex
Mutex for use when calling the factory.
FalloffFactory()
default constructor, which is defined as private
static FalloffFactory * factory()
Return a pointer to the factory.
Base class for falloff rate calculators.
Definition: Falloff.h:79
void init(const vector_fp &c)
Initialize.
Definition: Falloff.cpp:85
The Lindemann falloff parameterization.
Definition: Falloff.h:276
The SRI falloff function.
Definition: Falloff.h:437
The 3- or 4-parameter Troe falloff parameterization.
Definition: Falloff.h:335
The 1- or 2-parameter Tsang falloff parameterization.
Definition: Falloff.h:547
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
shared_ptr< Falloff > newFalloff(const std::string &type, const vector_fp &c)
Return a pointer to a new falloff function calculator.
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:184
This file defines some constants used to specify reaction types.