Commit 35f04be1 authored by Roman Tolchenov's avatar Roman Tolchenov
Browse files

Re #16684. More Jacobian implementations fixed.

parent d9f9e49a
......@@ -44,6 +44,9 @@ public:
m_data[iY * m_np + iP] = value;
}
double get(size_t iY, size_t iP) override { return m_data[iY * m_np + iP]; }
void zero() override {
m_data.assign(m_data.size(), 0.0);
}
private:
size_t m_np;
......
......@@ -94,6 +94,7 @@ private:
public:
MOCK_METHOD3(set, void(size_t, size_t, double));
MOCK_METHOD2(get, double(size_t, size_t));
MOCK_METHOD0(zero, void());
};
// Mock domain to simulate a wrong domain type
......
......@@ -81,6 +81,7 @@ public:
off_diag += value;
}
double get(size_t, size_t) override { return 0.0; }
void zero() override {}
};
}
......
......@@ -158,6 +158,11 @@ public:
return m_jacobian[safeIndex(iY, iP)];
}
/// Implements API::Jacobian::zero
void zero() override {
m_jacobian.assign(m_jacobian.size(), 0.0);
}
/// Provides raw pointer access to the underlying std::vector. Required for
/// adept-interface.
double *rawValues() { return &m_jacobian[0]; }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment