mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fix bug in -= operator.
This commit is contained in:
parent
5e4dff401c
commit
3bc57780aa
@ -198,7 +198,11 @@ namespace Opm
|
|||||||
AutoDiffBlock& operator-=(const AutoDiffBlock& rhs)
|
AutoDiffBlock& operator-=(const AutoDiffBlock& rhs)
|
||||||
{
|
{
|
||||||
if (jac_.empty()) {
|
if (jac_.empty()) {
|
||||||
jac_ = rhs.jac_;
|
const int num_blocks = rhs.numBlocks();
|
||||||
|
jac_.resize(num_blocks);
|
||||||
|
for (int block = 0; block < num_blocks; ++block) {
|
||||||
|
jac_[block] = -rhs.jac_[block];
|
||||||
|
}
|
||||||
} else if (!rhs.jac_.empty()) {
|
} else if (!rhs.jac_.empty()) {
|
||||||
assert (numBlocks() == rhs.numBlocks());
|
assert (numBlocks() == rhs.numBlocks());
|
||||||
assert (value().size() == rhs.value().size());
|
assert (value().size() == rhs.value().size());
|
||||||
|
Loading…
Reference in New Issue
Block a user