Cantera
2.1.2
|
Base class for 'functor' classes that evaluate a function of one variable. More...
#include <Func1.h>
Public Member Functions | |
Func1 (const Func1 &right) | |
Func1 & | operator= (const Func1 &right) |
virtual Func1 & | duplicate () const |
Duplicate the current function. More... | |
virtual int | ID () const |
doublereal | operator() (doublereal t) const |
Calls method eval to evaluate the function. More... | |
virtual doublereal | eval (doublereal t) const |
Evaluate the function. More... | |
virtual Func1 & | derivative () const |
Creates a derivative to the current function. More... | |
bool | isIdentical (Func1 &other) const |
Routine to determine if two functions are the same. More... | |
virtual doublereal | isProportional (TimesConstant1 &other) |
virtual doublereal | isProportional (Func1 &other) |
virtual std::string | write (const std::string &arg) const |
doublereal | c () const |
accessor function for the stored constant More... | |
void | setC (doublereal c) |
Function to set the stored constant. More... | |
Func1 & | func1 () const |
accessor function for m_f1 More... | |
Func1 & | func2 () const |
accessor function for m_f2 More... | |
virtual int | order () const |
Return the order of the function, if it makes sense. More... | |
Func1 & | func1_dup () const |
Func1 & | func2_dup () const |
Func1 * | parent () const |
void | setParent (Func1 *p) |
Protected Attributes | |
doublereal | m_c |
Func1 * | m_f1 |
Func1 * | m_f2 |
Func1 * | m_parent |
Base class for 'functor' classes that evaluate a function of one variable.
|
virtual |
Duplicate the current function.
This duplicates the current function, returning a reference to the new malloced function.
Reimplemented in Periodic1, Arrhenius1, Fourier1, Poly1, Gaussian, Composite1, Ratio1, PlusConstant1, TimesConstant1, Product1, Diff1, Sum1, Const1, Pow1, Exp1, Cos1, and Sin1.
Definition at line 44 of file Func1.cpp.
Referenced by Product1::derivative(), Ratio1::derivative(), Composite1::derivative(), Sum1::duplicate(), Diff1::duplicate(), Product1::duplicate(), TimesConstant1::duplicate(), PlusConstant1::duplicate(), Ratio1::duplicate(), and Composite1::duplicate().
doublereal operator() | ( | doublereal | t | ) | const |
Calls method eval to evaluate the function.
Definition at line 56 of file Func1.cpp.
References Func1::eval().
|
virtual |
Evaluate the function.
Reimplemented in Periodic1, Arrhenius1, Fourier1, Poly1, Gaussian, Composite1, Ratio1, PlusConstant1, TimesConstant1, Product1, Diff1, Sum1, Const1, Pow1, Exp1, Cos1, and Sin1.
Definition at line 62 of file Func1.cpp.
Referenced by OneDim::eval(), Sum1::eval(), Diff1::eval(), Product1::eval(), TimesConstant1::eval(), PlusConstant1::eval(), Ratio1::eval(), Composite1::eval(), Periodic1::eval(), Func1::operator()(), Wall::Q(), MassFlowController::updateMassFlowRate(), Valve::updateMassFlowRate(), and Wall::vdot().
|
virtual |
Creates a derivative to the current function.
This will malloc a derivative function and return a reference to the function.
Reimplemented in Composite1, Ratio1, PlusConstant1, TimesConstant1, Product1, Diff1, Sum1, Const1, Pow1, Exp1, Cos1, and Sin1.
Definition at line 67 of file Func1.cpp.
Referenced by Sum1::derivative(), Diff1::derivative(), Product1::derivative(), TimesConstant1::derivative(), PlusConstant1::derivative(), Ratio1::derivative(), and Composite1::derivative().
bool isIdentical | ( | Func1 & | other | ) | const |
Routine to determine if two functions are the same.
Two functions are the same if they are the same function. This means that the ID and stored constant is the same. This means that the m_f1 and m_f2 are identical if they are non-null.
Definition at line 74 of file Func1.cpp.
References Func1::isIdentical().
Referenced by Func1::isIdentical().
doublereal c | ( | ) | const |
accessor function for the stored constant
accessor function for the returned constant
Definition at line 99 of file Func1.cpp.
Referenced by Func1::setC().
void setC | ( | doublereal | c | ) |
Function to set the stored constant.
Definition at line 105 of file Func1.cpp.
References Func1::c().
|
virtual |
Return the order of the function, if it makes sense.
Reimplemented in Composite1, Ratio1, PlusConstant1, TimesConstant1, Product1, Diff1, and Sum1.