mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-14 08:33:33 -06:00
[refactor] Use DUNE's do product to hide code complexity.
this removes some explicit loops.
This commit is contained in:
parent
54d303ae5d
commit
f6a4d7b076
@ -1293,12 +1293,7 @@ computeHalfTrans_(Scalar& halfTrans,
|
|||||||
unsigned dimIdx = faceIdx/2;
|
unsigned dimIdx = faceIdx/2;
|
||||||
assert(dimIdx < dimWorld);
|
assert(dimIdx < dimWorld);
|
||||||
halfTrans = perm[dimIdx][dimIdx];
|
halfTrans = perm[dimIdx][dimIdx];
|
||||||
|
halfTrans *= std::abs(Dune::dot(areaNormal, distance));
|
||||||
Scalar val = 0;
|
|
||||||
for (unsigned i = 0; i < areaNormal.size(); ++i)
|
|
||||||
val += areaNormal[i]*distance[i];
|
|
||||||
|
|
||||||
halfTrans *= std::abs(val);
|
|
||||||
halfTrans /= distance.two_norm2();
|
halfTrans /= distance.two_norm2();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1310,11 +1305,7 @@ computeHalfDiffusivity_(Scalar& halfDiff,
|
|||||||
const Scalar& poro) const
|
const Scalar& poro) const
|
||||||
{
|
{
|
||||||
halfDiff = poro;
|
halfDiff = poro;
|
||||||
Scalar val = 0;
|
halfDiff *= std::abs(Dune::dot(areaNormal, distance));
|
||||||
for (unsigned i = 0; i < areaNormal.size(); ++i)
|
|
||||||
val += areaNormal[i]*distance[i];
|
|
||||||
|
|
||||||
halfDiff *= std::abs(val);
|
|
||||||
halfDiff /= distance.two_norm2();
|
halfDiff /= distance.two_norm2();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user