addressed review comments

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

View File

@@ -391,7 +391,7 @@ private:
const auto& nbInfos = neighborInfo_[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> neighborInfo_;
std::vector<MatrixBlock*> diagMatAddress_;