mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fix output in case of LAPACK error.
Make copy of matrix before calling dgesv, since it will overwrite it.
This commit is contained in:
@@ -465,6 +465,7 @@ namespace Opm
|
|||||||
tof_coeff_ = &tof_coeff[0];
|
tof_coeff_ = &tof_coeff[0];
|
||||||
rhs_.resize(num_basis);
|
rhs_.resize(num_basis);
|
||||||
jac_.resize(num_basis*num_basis);
|
jac_.resize(num_basis*num_basis);
|
||||||
|
orig_jac_.resize(num_basis*num_basis);
|
||||||
basis_.resize(num_basis);
|
basis_.resize(num_basis);
|
||||||
basis_nb_.resize(num_basis);
|
basis_nb_.resize(num_basis);
|
||||||
grad_basis_.resize(num_basis*grid_.dimensions);
|
grad_basis_.resize(num_basis*grid_.dimensions);
|
||||||
@@ -617,6 +618,7 @@ namespace Opm
|
|||||||
std::vector<MAT_SIZE_T> piv(num_basis);
|
std::vector<MAT_SIZE_T> piv(num_basis);
|
||||||
MAT_SIZE_T ldb = num_basis;
|
MAT_SIZE_T ldb = num_basis;
|
||||||
MAT_SIZE_T info = 0;
|
MAT_SIZE_T info = 0;
|
||||||
|
orig_jac_ = jac_;
|
||||||
dgesv_(&n, &nrhs, &jac_[0], &lda, &piv[0], &rhs_[0], &ldb, &info);
|
dgesv_(&n, &nrhs, &jac_[0], &lda, &piv[0], &rhs_[0], &ldb, &info);
|
||||||
if (info != 0) {
|
if (info != 0) {
|
||||||
// Print the local matrix and rhs.
|
// Print the local matrix and rhs.
|
||||||
@@ -624,7 +626,7 @@ namespace Opm
|
|||||||
<< " with A = \n";
|
<< " with A = \n";
|
||||||
for (int row = 0; row < n; ++row) {
|
for (int row = 0; row < n; ++row) {
|
||||||
for (int col = 0; col < n; ++col) {
|
for (int col = 0; col < n; ++col) {
|
||||||
std::cerr << " " << jac_[row + n*col];
|
std::cerr << " " << orig_jac_[row + n*col];
|
||||||
}
|
}
|
||||||
std::cerr << '\n';
|
std::cerr << '\n';
|
||||||
}
|
}
|
||||||
|
@@ -91,6 +91,7 @@ namespace Opm
|
|||||||
double* tof_coeff_;
|
double* tof_coeff_;
|
||||||
std::vector<double> rhs_; // single-cell right-hand-side
|
std::vector<double> rhs_; // single-cell right-hand-side
|
||||||
std::vector<double> jac_; // single-cell jacobian
|
std::vector<double> jac_; // single-cell jacobian
|
||||||
|
std::vector<double> orig_jac_; // single-cell jacobian (copy)
|
||||||
// Below: storage for quantities needed by solveSingleCell().
|
// Below: storage for quantities needed by solveSingleCell().
|
||||||
std::vector<double> coord_;
|
std::vector<double> coord_;
|
||||||
std::vector<double> basis_;
|
std::vector<double> basis_;
|
||||||
|
Reference in New Issue
Block a user