changed: rename EvalFunc::derivative to EvalFunc::addDerivative

consistent with EvalFunction and more descriptive of what it does
This commit is contained in:
Arne Morten Kvarving 2023-09-23 18:13:09 +02:00
parent d1e222590b
commit 72f9748aa1
3 changed files with 3 additions and 3 deletions

View File

@ -146,7 +146,7 @@ void EvalFunc::cleanup ()
}
void EvalFunc::derivative (const std::string& function, const char* x)
void EvalFunc::addDerivative (const std::string& function, const char* x)
{
if (!gradient)
gradient = new EvalFunc(function.c_str(),x);

View File

@ -53,7 +53,7 @@ public:
virtual ~EvalFunc();
//! \brief Adds an expression function for a first derivative.
void derivative(const std::string& function, const char* x = "x");
void addDerivative(const std::string& function, const char* x = "x");
//! \brief Returns whether the function is time-independent or not.
virtual bool isConstant() const { return false; }

View File

@ -728,7 +728,7 @@ static const ScalarFunc* parseFunction (const char* type, char* cline, Real C)
if (sf && (cline = strtok(nullptr,":")))
{
IFEM::cout <<" (derivative: "<< cline <<")";
static_cast<EvalFunc*>(sf)->derivative(cline,"t");
static_cast<EvalFunc*>(sf)->addDerivative(cline,"t");
}
return sf;
}