Commit 038a26cc authored by Kilian Weishaupt's avatar Kilian Weishaupt Committed by Timo Koch
Browse files

[staggeredGrid] Rename dofIndexSelf to dofIndex and dofIndexOpposite to dofIndexOpposingFace

parent 4a86b673
......@@ -93,7 +93,7 @@ public:
/*!
* \brief Returns the global dofIdx of the intersection itself
*/
int dofIdxSelf() const
int dofIndex() const
{
//TODO: use proper intersection mapper!
const auto inIdx = intersection_.indexInInside();
......@@ -103,7 +103,7 @@ public:
/*!
* \brief Returns the global dofIdx of the opposing intersection
*/
int dofIdxOpposite() const
int dofIndexOpposingFace() const
{
//TODO: use proper intersection mapper!
const auto inIdx = intersection_.indexInInside();
......
......@@ -98,8 +98,8 @@ public:
for (int i = 0; i < isGeometry.corners(); ++i)
corners_[i] = isGeometry.corner(i);
selfIdx_ = geometryHelper.dofIdxSelf();
oppositeIdx_ = geometryHelper.dofIdxOpposite();
dofIdx_ = geometryHelper.dofIndex();
oppositeIdx_ = geometryHelper.dofIndexOpposingFace();
selfToOppositeDistance_ = geometryHelper.selfToOppositeDistance();
pairData_ = geometryHelper.pairData();
......@@ -194,14 +194,14 @@ public:
return Geometry(geomType_, corners_);
}
//! The global index of this sub control volume face
IndexType dofIndexSelf() const
//! The global index of the dof living on this face
IndexType dofIndex() const
{
return selfIdx_;
return dofIdx_;
}
//! The global index of this sub control volume face
IndexType dofIndexOpposite() const
//! The global index of the dof living on the opposing face
IndexType dofIndexOpposingFace() const
{
return oppositeIdx_;
}
......@@ -256,7 +256,7 @@ private:
std::vector<IndexType> scvIndices_;
bool boundary_;
int selfIdx_;
int dofIdx_;
int oppositeIdx_;
Scalar selfToOppositeDistance_;
std::vector<StaggeredSubFace> subfaces_;
......
......@@ -102,7 +102,7 @@ public:
const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
const auto& insideVolVars = elemVolVars[insideScv];
const Scalar velocity = globalFaceVars.faceVars(scvf.dofIndexSelf()).velocity();
const Scalar velocity = globalFaceVars.faceVars(scvf.dofIndex()).velocity();
// if we are on an inflow/outflow boundary, use the volVars of the element itself
const auto& outsideVolVars = scvf.boundary() ? insideVolVars : elemVolVars[scvf.outsideScvIdx()];
......@@ -135,7 +135,7 @@ public:
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
{
stencil.push_back(scvf.dofIndexSelf());
stencil.push_back(scvf.dofIndex());
}
void computeFaceToCellCenterStencil(Stencil& stencil,
......@@ -163,8 +163,8 @@ public:
// the first entries are always the face dofIdx itself and the one of the opposing face
if(stencil.empty())
{
stencil.push_back(scvf.dofIndexSelf());
stencil.push_back(scvf.dofIndexOpposite());
stencil.push_back(scvf.dofIndex());
stencil.push_back(scvf.dofIndexOpposingFace());
}
for(const auto& data : scvf.pairData())
......@@ -193,8 +193,8 @@ public:
{
const auto insideScvIdx = scvf.insideScvIdx();
const auto& insideVolVars = elemVolVars[insideScvIdx];
const Scalar velocitySelf = globalFaceVars.faceVars(scvf.dofIndexSelf()).velocity() ;
const Scalar velocityOpposite = globalFaceVars.faceVars(scvf.dofIndexOpposite()).velocity();
const Scalar velocitySelf = globalFaceVars.faceVars(scvf.dofIndex()).velocity() ;
const Scalar velocityOpposite = globalFaceVars.faceVars(scvf.dofIndexOpposingFace()).velocity();
FacePrimaryVariables normalFlux(0.0);
if(navierStokes)
......@@ -285,7 +285,7 @@ private:
Scalar transportedVelocity(0.0);
if(innerElementIsUpstream)
transportedVelocity = velocity(scvf.dofIndexSelf());
transportedVelocity = velocity(scvf.dofIndex());
else
{
const int outerDofIdx = subFaceData.outerParallelFaceDofIdx;
......@@ -339,7 +339,7 @@ private:
tangentialDiffusiveFlux -= muAvg * normalDerivative;
// the parallel derivative
const Scalar innerParallelVelocity = velocity(scvf.dofIndexSelf());
const Scalar innerParallelVelocity = velocity(scvf.dofIndex());
const int outerParallelFaceDofIdx = subFaceData.outerParallelFaceDofIdx;
const Scalar outerParallelVelocity = outerParallelFaceDofIdx >= 0 ?
......
......@@ -176,7 +176,7 @@ public:
const GlobalFaceVars& globalFaceVars)
{
FacePrimaryVariables storage(0.0);
const Scalar velocity = globalFaceVars.faceVars(scvf.dofIndexSelf()).velocity();
const Scalar velocity = globalFaceVars.faceVars(scvf.dofIndex()).velocity();
storage[0] = volVars.density(0) * velocity;
return storage;
}
......@@ -285,7 +285,7 @@ protected:
// set a fixed value for the velocity
if(bcTypes.isDirichlet(momentumBalanceIdx))
{
const Scalar velocity = faceVars.faceVars(scvf.dofIndexSelf()).velocity();
const Scalar velocity = faceVars.faceVars(scvf.dofIndex()).velocity();
const Scalar dirichletValue = this->problem().dirichlet(scvf)[velocityIdx];
this->faceResiduals_[scvf.localFaceIdx()] = velocity - dirichletValue;
}
......
......@@ -150,7 +150,7 @@ public:
GlobalPosition velocityVector(0.0);
for (auto&& scvf : scvfs(fvGeometry))
{
auto& origFaceVars = this->curGlobalFaceVars().faceVars(scvf.dofIndexSelf());
auto& origFaceVars = this->curGlobalFaceVars().faceVars(scvf.dofIndex());
auto dirIdx = scvf.directionIndex();
velocityVector[dirIdx] += 0.5*origFaceVars.velocity();
......@@ -194,7 +194,7 @@ public:
{
for (auto&& scvf : scvfs(fvGeometry))
{
auto& origFaceVars = this->curGlobalFaceVars().faceVars(scvf.dofIndexSelf());
auto& origFaceVars = this->curGlobalFaceVars().faceVars(scvf.dofIndex());
auto dirIdx = scvf.directionIndex();
velocityVector[dirIdx] += 0.5*origFaceVars.velocity();
}
......
......@@ -103,7 +103,7 @@ public:
for (auto&& scvf : scvfs(fvGeometry))
{
auto& origFaceVars = problem_.model().curGlobalFaceVars().faceVars(scvf.dofIndexSelf());
auto& origFaceVars = problem_.model().curGlobalFaceVars().faceVars(scvf.dofIndex());
auto dirIdx = scvf.directionIndex();
velocity[dofIdxGlobal][dirIdx] += 0.5*origFaceVars.velocity();
}
......
......@@ -153,7 +153,7 @@ private:
// loop over sub control faces
for (auto&& scvf : scvfs(fvGeometry))
{
const auto globalI = scvf.dofIndexSelf();
const auto globalI = scvf.dofIndex();
for (auto&& globalJ : assemblyMap(faceIdx, cellCenterIdx, scvf.index()))
occupationPatternA21.add(globalI, globalJ);
for (auto&& globalJ : assemblyMap(faceIdx, faceIdx, scvf.index()))
......
......@@ -186,7 +186,7 @@ public:
faceResidualCache = 0.0;
for(auto&& scvf : scvfs(fvGeometry))
{
residual[faceIdx][scvf.dofIndexSelf()] += this->localResidual().faceResidual(scvf.localFaceIdx());
residual[faceIdx][scvf.dofIndex()] += this->localResidual().faceResidual(scvf.localFaceIdx());
faceResidualCache[scvf.localFaceIdx()] = this->localResidual().faceResidual(scvf.localFaceIdx());
}
......@@ -357,7 +357,7 @@ private:
for(auto&& scvf : scvfs(fvGeometry))
{
// set the actual dof index
const auto faceGlobalI = scvf.dofIndexSelf();
const auto faceGlobalI = scvf.dofIndex();
// build derivatives with for face dofs w.r.t. cell center dofs
for(const auto& globalJ : assemblyMap_(faceIdx, cellCenterIdx, scvf.index()))
......@@ -413,7 +413,7 @@ private:
for(auto&& scvf : scvfs(fvGeometry))
{
// set the actual dof index
const auto faceGlobalI = scvf.dofIndexSelf();
const auto faceGlobalI = scvf.dofIndex();
// build derivatives with for face dofs w.r.t. cell center dofs
for(const auto& globalJ : assemblyMap_(faceIdx, faceIdx, scvf.index()))
......
......@@ -264,7 +264,7 @@ public:
for(auto&& scvf : scvfs(fvGeometry))
{
auto initPriVars = this->problem_().initial(scvf)[faceIdx];
this->uCur_[faceIdx][scvf.dofIndexSelf()] = initPriVars;
this->uCur_[faceIdx][scvf.dofIndex()] = initPriVars;
}
}
}
......
......@@ -35,7 +35,7 @@
#include <dumux/implicit/staggered/properties.hh>
#include <dumux/discretization/staggered/globalfvgeometry.hh>
#include <dumux/discretization/staggered/fvelementgeometry.hh>
#include <dumux/discretization/staggered/subcontrolvolume.hh>
// #include <dumux/discretization/staggered/subcontrolvolume.hh>
#include <dumux/discretization/staggered/freeflow/subcontrolvolumeface.hh>
#include <dumux/freeflow/staggered/propertydefaults.hh>
......@@ -146,12 +146,12 @@ int main (int argc, char *argv[]) try
std::cout << std::fixed << std::left << std::setprecision(2)
<< "ip "<< scvf.ipGlobal()
<< "; face " << std::setw(3) << scvf.index()
<< "; self/oppo " << std::setw(3) << scvf.dofIndexSelf() << "/" << std::setw(3) <<scvf.dofIndexOpposite()
<< "; self/oppo " << std::setw(3) << scvf.dofIndex() << "/" << std::setw(3) <<scvf.dofIndexOpposingFace()
<< "; dist self/oppo " << std::setw(3) << scvf.selfToOppositeDistance()
<< ", norm1 in/out " << std::setw(3) << scvf.pairData(0).normalPair.first << "/" << std::setw(3) << scvf.pairData(0).normalPair.second
<< ", norm2 in/out " << std::setw(3) << scvf.pairData(1).normalPair.first << "/" << std::setw(3) << scvf.pairData(1).normalPair.second
<< ", par1 in/out " << std::setw(3) << scvf.dofIndexSelf() << "/" << std::setw(3) << scvf.pairData(0).outerParallelFaceDofIdx
<< ", par2 in/out " << std::setw(3) << scvf.dofIndexSelf() << "/" << std::setw(3) << scvf.pairData(1).outerParallelFaceDofIdx
<< ", par1 in/out " << std::setw(3) << scvf.dofIndex() << "/" << std::setw(3) << scvf.pairData(0).outerParallelFaceDofIdx
<< ", par2 in/out " << std::setw(3) << scvf.dofIndex() << "/" << std::setw(3) << scvf.pairData(1).outerParallelFaceDofIdx
<< ", normDist1 " << std::setw(3) << scvf.pairData(0).normalDistance
<< ", normDist2 " << std::setw(3) << scvf.pairData(1).normalDistance
<< ", parDist1 " << std::setw(3) << scvf.pairData(0).parallelDistance
......
......@@ -374,7 +374,7 @@ public:
// treat face dofs
for (auto&& scvf : scvfs(fvGeometry))
{
const int dofIdxFace = scvf.dofIndexSelf();
const int dofIdxFace = scvf.dofIndex();
const int dirIdx = scvf.directionIndex();
const auto analyticalSolutionFace = dirichletAtPos(scvf.center())[faceIdx][dirIdx];
const auto numericalSolutionFace = this->model().curSol()[faceIdx][dofIdxFace][momentumBalanceIdx];
......
......@@ -383,7 +383,7 @@ public:
// treat face dofs
for (auto&& scvf : scvfs(fvGeometry))
{
const int dofIdxFace = scvf.dofIndexSelf();
const int dofIdxFace = scvf.dofIndex();
const int dirIdx = scvf.directionIndex();
const auto analyticalSolutionFace = dirichletAtPos(scvf.center())[faceIdx][dirIdx];
const auto numericalSolutionFace = this->model().curSol()[faceIdx][dofIdxFace][momentumBalanceIdx];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment