From 83e7bbb140b20a05ad08310626d9d036b0234eb5 Mon Sep 17 00:00:00 2001 From: hnil Date: Mon, 19 Dec 2022 11:32:49 +0100 Subject: [PATCH] addressed review comments --- .../discretization/common/tpfalinearizer.hh | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/opm/models/discretization/common/tpfalinearizer.hh b/opm/models/discretization/common/tpfalinearizer.hh index d3b0e995d..55f7160c0 100644 --- a/opm/models/discretization/common/tpfalinearizer.hh +++ b/opm/models/discretization/common/tpfalinearizer.hh @@ -389,9 +389,9 @@ private: jacobian_->reserve(sparsityPattern); for (unsigned globI = 0; globI < numCells; globI++) { const auto& nbInfos = neighborInfo_[globI]; - diagMatAddress_[globI] = jacobian_->blockAddress(globI,globI); + diagMatAddress_[globI] = jacobian_->blockAddress(globI, globI); for (auto& nbInfo : nbInfos) { - nbInfo.matAddress = jacobian_->blockAddress(nbInfo.neighbor,globI); + nbInfo.matBlockAddress = jacobian_->blockAddress(nbInfo.neighbor, globI); } } } @@ -450,9 +450,9 @@ private: bMat = 0.0; adres = 0.0; const IntensiveQuantities* intQuantsExP = model_().cachedIntensiveQuantities(globJ, /*timeIdx*/ 0); - // if (intQuantsExP == nullptr) { - // throw std::logic_error("Missing updated intensive quantities for cell " + std::to_string(globJ) + " when assembling fluxes for cell " + std::to_string(globI)); - // } + if (intQuantsExP == nullptr) { + throw std::logic_error("Missing updated intensive quantities for cell " + std::to_string(globJ) + " when assembling fluxes for cell " + std::to_string(globI)); + } const IntensiveQuantities& intQuantsEx = *intQuantsExP; LocalResidual::computeFlux( adres, problem_(), globI, globJ, intQuantsIn, intQuantsEx, @@ -460,11 +460,11 @@ private: adres *= nbInfo.faceArea; setResAndJacobi(res, bMat, adres); residual_[globI] += res; - //jacobian_->addToBlock(globI, globI, bMat); + //SparseAdapter syntax: jacobian_->addToBlock(globI, globI, bMat); *diagMatAddress_[globI] += bMat; bMat *= -1.0; - //jacobian_->addToBlock(globJ, globI, bMat); - *nbInfo.matAddress += bMat; + //SparseAdapter syntax: jacobian_->addToBlock(globJ, globI, bMat); + *nbInfo.matBlockAddress += bMat; ++loc; } @@ -485,7 +485,7 @@ private: bMat *= storefac; // residual_[globI] -= model_().cachedStorage(globI, 1); //*storefac; residual_[globI] += res; - //jacobian_->addToBlock(globI, globI, bMat); + //SparseAdapter syntax: jacobian_->addToBlock(globI, globI, bMat); *diagMatAddress_[globI] += bMat; // wells sources for now (should be moved out) if (well_local) { @@ -496,7 +496,7 @@ private: adres *= -volume; setResAndJacobi(res, bMat, adres); residual_[globI] += res; - //jacobian_->addToBlock(globI, globI, bMat); + //SparseAdapter syntax: jacobian_->addToBlock(globI, globI, bMat); *diagMatAddress_[globI] += bMat; } } // end of loop for cell globI. @@ -558,7 +558,7 @@ private: double trans; double faceArea; FaceDir::DirEnum faceDirection; - MatrixBlock* matAddress; + MatrixBlock* matBlockAddress; }; SparseTable neighborInfo_; std::vector diagMatAddress_;