16 reg(
"functor", [](
const vector<double>& params) {
19 reg(
"sin", [](
const vector<double>& params) {
20 return new Sin1(params);
22 reg(
"cos", [](
const vector<double>& params) {
23 return new Cos1(params);
25 reg(
"exp", [](
const vector<double>& params) {
26 return new Exp1(params);
28 reg(
"log", [](
const vector<double>& params) {
29 return new Log1(params);
31 reg(
"pow", [](
const vector<double>& params) {
32 return new Pow1(params);
34 reg(
"constant", [](
const vector<double>& params) {
37 reg(
"polynomial", [](
const vector<double>& params) {
38 return new Poly1(params);
40 reg(
"Fourier", [](
const vector<double>& params) {
43 reg(
"Gaussian", [](
const vector<double>& params) {
46 reg(
"Arrhenius", [](
const vector<double>& params) {
49 reg(
"tabulated-linear", [](
const vector<double>& params) {
52 reg(
"tabulated-previous", [](
const vector<double>& params) {
54 fcn->setMethod(
"previous");
61 std::unique_lock<std::mutex> lock(
s_mutex);
70 std::unique_lock<std::mutex> lock(
s_mutex);
80 reg(
"sum", [](
const shared_ptr<Func1> f1,
const shared_ptr<Func1> f2) {
81 return new Sum1(f1, f2);
83 reg(
"diff", [](
const shared_ptr<Func1> f1,
const shared_ptr<Func1> f2) {
84 return new Diff1(f1, f2);
86 reg(
"product", [](
const shared_ptr<Func1> f1,
const shared_ptr<Func1> f2) {
89 reg(
"ratio", [](
const shared_ptr<Func1> f1,
const shared_ptr<Func1> f2) {
92 reg(
"composite", [](
const shared_ptr<Func1> f1,
const shared_ptr<Func1> f2) {
99 std::unique_lock<std::mutex> lock(
s_mutex);
108 std::unique_lock<std::mutex> lock(
s_mutex);
118 reg(
"times-constant", [](
const shared_ptr<Func1> f,
double c) {
121 reg(
"plus-constant", [](
const shared_ptr<Func1> f,
double c) {
124 reg(
"periodic", [](
const shared_ptr<Func1> f,
double c) {
131 std::unique_lock<std::mutex> lock(
s_mutex);
140 std::unique_lock<std::mutex> lock(
s_mutex);
145 shared_ptr<Func1>
newFunc1(
const string& func1Type,
double coeff)
147 return shared_ptr<Func1>(
151 shared_ptr<Func1>
newFunc1(
const string& func1Type,
const vector<double>& params)
153 return shared_ptr<Func1>(
157 shared_ptr<Func1>
newFunc1(
const string& func1Type,
const shared_ptr<Func1> f1,
158 const shared_ptr<Func1> f2)
160 return shared_ptr<Func1>(
164 shared_ptr<Func1>
newFunc1(
const string& func1Type,
165 const shared_ptr<Func1> f,
double coeff)
167 return shared_ptr<Func1>(
Implements a sum of Arrhenius terms.
Implements a composite function.
Implements the cos() function.
Implements the difference of two functions.
Implements the exp() (exponential) function.
void reg(const string &name, function< Func1 *(Args...)> f)
Register a new object construction function.
Implements a Fourier cosine/sine series.
Factory class to create Func1 objects.
static std::mutex s_mutex
Mutex for use when calling the factory.
static Func1Factory * s_factory
Pointer to the single instance of the factory.
void deleteFactory() override
Virtual abstract function that deletes the factory.
Func1Factory()
default constructor, which is defined as private
static Func1Factory * factory()
Return a pointer to the factory.
Base class for 'functor' classes that evaluate a function of one variable.
Implements a Gaussian function.
Implements the log() (natural logarithm) function.
Factory class to create Func1 compound objects - version A.
static Math1FactoryA * s_factory
Pointer to the single instance of the factory.
Math1FactoryA()
default constructor, which is defined as private
static std::mutex s_mutex
Mutex for use when calling the factory.
void deleteFactory() override
Virtual abstract function that deletes the factory.
static Math1FactoryA * factory()
Return a pointer to the factory.
Factory class to create Func1 compound objects - version B.
static std::mutex s_mutex
Mutex for use when calling the factory.
void deleteFactory() override
Virtual abstract function that deletes the factory.
Math1FactoryB()
default constructor, which is defined as private
static Math1FactoryB * factory()
Return a pointer to the factory.
static Math1FactoryB * s_factory
Pointer to the single instance of the factory.
Implements a periodic function.
Implements the sum of a function and a constant.
Implements a polynomial of degree n.
Implements the pow() (power) function.
Implements the product of two functions.
Implements the ratio of two functions.
Implements the sin() function.
Implements the sum of two functions.
Implements a tabulated function.
Implements the product of a function and a constant.
shared_ptr< Func1 > newFunc1(const string &func1Type, double coeff)
Create a new simple functor object (see Simple Functors).
Namespace for the Cantera kernel.