mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-16 20:24:48 -06:00
Don't use updated values for computing derivatives
We must not overwrite the current evaluation point until all the derivative values have been calculated. Otherwise, the derivatives will differ from that of the actual values.
This commit is contained in:
parent
72e2b1f5ca
commit
72d6d32095
@ -96,8 +96,8 @@ namespace AutoDiff {
|
||||
Forward&
|
||||
operator *=(const Forward& rhs)
|
||||
{
|
||||
x_ *= rhs.x_;
|
||||
dx_ *= dx_*rhs.x_ + x_*rhs.dx_;
|
||||
x_ *= rhs.x_;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@ -114,8 +114,8 @@ namespace AutoDiff {
|
||||
Forward&
|
||||
operator /=(const Forward& rhs)
|
||||
{
|
||||
x_ /= rhs.x_;
|
||||
dx_ = (dx_*rhs.x_ - x_*rhs.dx_) / (rhs.x_ * rhs.x_);
|
||||
x_ /= rhs.x_;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user