mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
simplify updateStorageCache
use the elements() range generator. while at it, fix some cosmetics
This commit is contained in:
parent
2f80274100
commit
0d1c989a25
@ -394,15 +394,13 @@ protected:
|
||||
tr.concentrationInitial_ = tr.concentration_;
|
||||
|
||||
ElementContext elemCtx(simulator_);
|
||||
auto elemIt = simulator_.gridView().template begin</*codim=*/0>();
|
||||
auto elemEndIt = simulator_.gridView().template end</*codim=*/0>();
|
||||
for (; elemIt != elemEndIt; ++ elemIt) {
|
||||
elemCtx.updatePrimaryStencil(*elemIt);
|
||||
for (const auto& elem : elements(simulator_.gridView())) {
|
||||
elemCtx.updatePrimaryStencil(elem);
|
||||
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
||||
int globalDofIdx = elemCtx.globalSpaceIndex(0, /*timIdx=*/0);
|
||||
int globalDofIdx = elemCtx.globalSpaceIndex(0, /*timeIdx=*/0);
|
||||
Scalar fVolume;
|
||||
computeVolume_(fVolume, tr.phaseIdx_, elemCtx, 0, /*timIdx=*/0);
|
||||
for (int tIdx =0; tIdx < tr.numTracer(); ++tIdx) {
|
||||
computeVolume_(fVolume, tr.phaseIdx_, elemCtx, 0, /*timeIdx=*/0);
|
||||
for (int tIdx = 0; tIdx < tr.numTracer(); ++tIdx) {
|
||||
tr.storageOfTimeIndex1_[tIdx][globalDofIdx] = fVolume*tr.concentrationInitial_[tIdx][globalDofIdx];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user