mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Transmissibility::computeHalfTrans_: use return value instead of out-param
and make it static
This commit is contained in:
parent
3695ea8b0b
commit
9ce9fe49f2
@ -251,11 +251,10 @@ protected:
|
||||
|
||||
void extractDispersion_();
|
||||
|
||||
void computeHalfTrans_(Scalar& halfTrans,
|
||||
const DimVector& areaNormal,
|
||||
static Scalar computeHalfTrans_(const DimVector& areaNormal,
|
||||
int faceIdx, // in the reference element that contains the intersection
|
||||
const DimVector& distance,
|
||||
const DimMatrix& perm) const;
|
||||
const DimMatrix& perm);
|
||||
|
||||
void computeHalfDiffusivity_(Scalar& halfDiff,
|
||||
const DimVector& areaNormal,
|
||||
|
@ -259,12 +259,10 @@ update(bool global, const TransUpdateQuantities update_quantities,
|
||||
auto faceAreaNormal = intersection.centerUnitOuterNormal();
|
||||
faceAreaNormal *= geometry.volume();
|
||||
|
||||
Scalar transBoundaryIs;
|
||||
computeHalfTrans_(transBoundaryIs,
|
||||
faceAreaNormal,
|
||||
Scalar transBoundaryIs =
|
||||
computeHalfTrans_(faceAreaNormal,
|
||||
intersection.indexInInside(),
|
||||
distanceVector_(faceCenterInside,
|
||||
elemIdx),
|
||||
distanceVector_(faceCenterInside, elemIdx),
|
||||
permeability_[elemIdx]);
|
||||
|
||||
// normally there would be two half-transmissibilities that would be
|
||||
@ -355,20 +353,15 @@ update(bool global, const TransUpdateQuantities update_quantities,
|
||||
faceAreaNormal,
|
||||
isCpGrid);
|
||||
|
||||
Scalar halfTrans1;
|
||||
Scalar halfTrans2;
|
||||
|
||||
computeHalfTrans_(halfTrans1,
|
||||
faceAreaNormal,
|
||||
Scalar halfTrans1 =
|
||||
computeHalfTrans_(faceAreaNormal,
|
||||
insideFaceIdx,
|
||||
distanceVector_(faceCenterInside,
|
||||
elemIdx),
|
||||
distanceVector_(faceCenterInside, elemIdx),
|
||||
permeability_[elemIdx]);
|
||||
computeHalfTrans_(halfTrans2,
|
||||
faceAreaNormal,
|
||||
Scalar halfTrans2 =
|
||||
computeHalfTrans_(faceAreaNormal,
|
||||
outsideFaceIdx,
|
||||
distanceVector_(faceCenterOutside,
|
||||
outsideElemIdx),
|
||||
distanceVector_(faceCenterOutside, outsideElemIdx),
|
||||
permeability_[outsideElemIdx]);
|
||||
|
||||
applyNtg_(halfTrans1, insideFaceIdx, elemIdx, ntg);
|
||||
@ -1321,19 +1314,21 @@ applyNncMultreg_(const std::unordered_map<std::size_t,int>& cartesianToCompresse
|
||||
}
|
||||
|
||||
template<class Grid, class GridView, class ElementMapper, class CartesianIndexMapper, class Scalar>
|
||||
void Transmissibility<Grid,GridView,ElementMapper,CartesianIndexMapper,Scalar>::
|
||||
computeHalfTrans_(Scalar& halfTrans,
|
||||
const DimVector& areaNormal,
|
||||
Scalar
|
||||
Transmissibility<Grid,GridView,ElementMapper,CartesianIndexMapper,Scalar>::
|
||||
computeHalfTrans_(const DimVector& areaNormal,
|
||||
int faceIdx, // in the reference element that contains the intersection
|
||||
const DimVector& distance,
|
||||
const DimMatrix& perm) const
|
||||
const DimMatrix& perm)
|
||||
{
|
||||
assert(faceIdx >= 0);
|
||||
unsigned dimIdx = faceIdx/2;
|
||||
unsigned dimIdx = faceIdx / 2;
|
||||
assert(dimIdx < dimWorld);
|
||||
halfTrans = perm[dimIdx][dimIdx];
|
||||
Scalar halfTrans = perm[dimIdx][dimIdx];
|
||||
halfTrans *= std::abs(Dune::dot(areaNormal, distance));
|
||||
halfTrans /= distance.two_norm2();
|
||||
|
||||
return halfTrans;
|
||||
}
|
||||
|
||||
template<class Grid, class GridView, class ElementMapper, class CartesianIndexMapper, class Scalar>
|
||||
|
Loading…
Reference in New Issue
Block a user