addressed review comments

This commit is contained in:
hnil
2022-12-19 11:32:49 +01:00
parent d465ebdb78
commit 83e7bbb140

View File

@@ -389,9 +389,9 @@ private:
jacobian_->reserve(sparsityPattern); jacobian_->reserve(sparsityPattern);
for (unsigned globI = 0; globI < numCells; globI++) { for (unsigned globI = 0; globI < numCells; globI++) {
const auto& nbInfos = neighborInfo_[globI]; const auto& nbInfos = neighborInfo_[globI];
diagMatAddress_[globI] = jacobian_->blockAddress(globI,globI); diagMatAddress_[globI] = jacobian_->blockAddress(globI, globI);
for (auto& nbInfo : nbInfos) { 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; bMat = 0.0;
adres = 0.0; adres = 0.0;
const IntensiveQuantities* intQuantsExP = model_().cachedIntensiveQuantities(globJ, /*timeIdx*/ 0); const IntensiveQuantities* intQuantsExP = model_().cachedIntensiveQuantities(globJ, /*timeIdx*/ 0);
// if (intQuantsExP == nullptr) { 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)); 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; const IntensiveQuantities& intQuantsEx = *intQuantsExP;
LocalResidual::computeFlux( LocalResidual::computeFlux(
adres, problem_(), globI, globJ, intQuantsIn, intQuantsEx, adres, problem_(), globI, globJ, intQuantsIn, intQuantsEx,
@@ -460,11 +460,11 @@ private:
adres *= nbInfo.faceArea; adres *= nbInfo.faceArea;
setResAndJacobi(res, bMat, adres); setResAndJacobi(res, bMat, adres);
residual_[globI] += res; residual_[globI] += res;
//jacobian_->addToBlock(globI, globI, bMat); //SparseAdapter syntax: jacobian_->addToBlock(globI, globI, bMat);
*diagMatAddress_[globI] += bMat; *diagMatAddress_[globI] += bMat;
bMat *= -1.0; bMat *= -1.0;
//jacobian_->addToBlock(globJ, globI, bMat); //SparseAdapter syntax: jacobian_->addToBlock(globJ, globI, bMat);
*nbInfo.matAddress += bMat; *nbInfo.matBlockAddress += bMat;
++loc; ++loc;
} }
@@ -485,7 +485,7 @@ private:
bMat *= storefac; bMat *= storefac;
// residual_[globI] -= model_().cachedStorage(globI, 1); //*storefac; // residual_[globI] -= model_().cachedStorage(globI, 1); //*storefac;
residual_[globI] += res; residual_[globI] += res;
//jacobian_->addToBlock(globI, globI, bMat); //SparseAdapter syntax: jacobian_->addToBlock(globI, globI, bMat);
*diagMatAddress_[globI] += bMat; *diagMatAddress_[globI] += bMat;
// wells sources for now (should be moved out) // wells sources for now (should be moved out)
if (well_local) { if (well_local) {
@@ -496,7 +496,7 @@ private:
adres *= -volume; adres *= -volume;
setResAndJacobi(res, bMat, adres); setResAndJacobi(res, bMat, adres);
residual_[globI] += res; residual_[globI] += res;
//jacobian_->addToBlock(globI, globI, bMat); //SparseAdapter syntax: jacobian_->addToBlock(globI, globI, bMat);
*diagMatAddress_[globI] += bMat; *diagMatAddress_[globI] += bMat;
} }
} // end of loop for cell globI. } // end of loop for cell globI.
@@ -558,7 +558,7 @@ private:
double trans; double trans;
double faceArea; double faceArea;
FaceDir::DirEnum faceDirection; FaceDir::DirEnum faceDirection;
MatrixBlock* matAddress; MatrixBlock* matBlockAddress;
}; };
SparseTable<NeighborInfo> neighborInfo_; SparseTable<NeighborInfo> neighborInfo_;
std::vector<MatrixBlock*> diagMatAddress_; std::vector<MatrixBlock*> diagMatAddress_;