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
11#include "cantera/kinetics/FalloffFactory.h"
12#include "cantera/kinetics/reaction_defs.h"
13
14 namespace Cantera
15{
16
17FalloffFactory* FalloffFactory::s_factory = 0;
18std::mutex FalloffFactory::falloff_mutex;
19
20 FalloffFactory::FalloffFactory()
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
29 Falloff* 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}
FalloffFactory.h
Parameterizations for reaction falloff functions.
Cantera::Factory< Falloff >::create
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
Cantera::Factory< Falloff >::addAlias
void addAlias(const std::string &original, const std::string &alias)
Add an alias for an existing registered type.
Definition: FactoryBase.h:86
Cantera::Factory< Falloff >::reg
void reg(const std::string &name, std::function< Falloff *(Args...)> f)
Register a new object construction function.
Definition: FactoryBase.h:81
Cantera::FalloffFactory::newFalloff
virtual Falloff * newFalloff(const std::string &type, const vector_fp &c)
Return a pointer to a new falloff function calculator.
Definition: FalloffFactory.cpp:29
Cantera::FalloffFactory::s_factory
static FalloffFactory * s_factory
Pointer to the single instance of the factory.
Definition: FalloffFactory.h:72
Cantera::FalloffFactory::falloff_mutex
static std::mutex falloff_mutex
Mutex for use when calling the factory.
Definition: FalloffFactory.h:78
Cantera::FalloffFactory::FalloffFactory
FalloffFactory()
default constructor, which is defined as private
Definition: FalloffFactory.cpp:20
Cantera::FalloffFactory::factory
static FalloffFactory * factory()
Return a pointer to the factory.
Definition: FalloffFactory.h:44
Cantera::FalloffRate
Base class for falloff rate calculators.
Definition: Falloff.h:79
Cantera::FalloffRate::init
void init(const vector_fp &c)
Initialize.
Definition: Falloff.cpp:85
Cantera::LindemannRate
The Lindemann falloff parameterization.
Definition: Falloff.h:276
Cantera::SriRate
The SRI falloff function.
Definition: Falloff.h:437
Cantera::TroeRate
The 3- or 4-parameter Troe falloff parameterization.
Definition: Falloff.h:335
Cantera::TsangRate
The 1- or 2-parameter Tsang falloff parameterization.
Definition: Falloff.h:547
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::newFalloff
shared_ptr< Falloff > newFalloff(const std::string &type, const vector_fp &c)
Return a pointer to a new falloff function calculator.
Definition: FalloffFactory.cpp:36
Cantera::vector_fp
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
reaction_defs.h
This file defines some constants used to specify reaction types.