mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-28 18:21:00 -06:00
Implement constant() and variable() in terms of function()
Specifically, - A constant is a function with zero derivative - A variable is a function with unit derivative with respect to itself.
This commit is contained in:
parent
70996fb195
commit
6ed2b129cb
@ -45,13 +45,15 @@ namespace AutoDiff {
|
||||
static Forward
|
||||
constant(const Scalar x)
|
||||
{
|
||||
return Forward(x, Scalar(0));
|
||||
// Constant is function with zero derivative.
|
||||
return function(x, Scalar(0));
|
||||
}
|
||||
|
||||
static Forward
|
||||
variable(const Scalar x)
|
||||
{
|
||||
return Forward(x, Scalar(1));
|
||||
// Variable is function with unit derivative (wrt. itself).
|
||||
return function(x, Scalar(1));
|
||||
}
|
||||
|
||||
static Forward
|
||||
|
Loading…
Reference in New Issue
Block a user