Commit 8b46f8c9 authored by Gabriele Seitz's avatar Gabriele Seitz
Browse files

[box] rename function scv.index() in scv.indexInElement()

parent 432332e8
......@@ -389,7 +389,7 @@ public:
for (auto&& scv : scvs(fvGeometry))
{
if (BoundingBoxTreeHelper<dimworld>::pointInGeometry(scv.geometry(), globalPos))
scvIndices.push_back(scv.index());
scvIndices.push_back(scv.indexInElement());
}
// for all scvs that where tested positiv add the point sources
// to the element/scv to point source map
......
......@@ -110,11 +110,11 @@ public:
const auto& volVars = elemVolVars[scv];
if (enableGravity)
rho += volVars.density(phaseIdx)*shapeValues[scv.index()][0];
rho += volVars.density(phaseIdx)*shapeValues[scv.indexInElement()][0];
// the global shape function gradient
DimVector gradN;
jacInvT.mv(shapeJacobian[scv.index()][0], gradN);
jacInvT.mv(shapeJacobian[scv.indexInElement()][0], gradN);
gradP.axpy(volVars.pressure(phaseIdx), gradN);
}
......
......@@ -65,7 +65,7 @@ public:
{ return globalVolVars().volVars(eIdx_, scvIdx); }
const VolumeVariables& operator [](const SubControlVolume& scv) const
{ return globalVolVars().volVars(eIdx_, scv.index()); }
{ return globalVolVars().volVars(eIdx_, scv.indexInElement()); }
// For compatibility reasons with the case of not storing the vol vars.
// function to be called before assembling an element, preparing the vol vars within the stencil
......@@ -137,7 +137,7 @@ public:
{
// TODO: INTERFACE SOLVER
// globalVolVars().problem_().model().boxInterfaceConditionSolver().updateScvVolVars(element, scv, sol);
volumeVariables_[scv.index()].update(elemSol, globalVolVars().problem_(), element, scv);
volumeVariables_[scv.indexInElement()].update(elemSol, globalVolVars().problem_(), element, scv);
}
}
......@@ -148,10 +148,10 @@ public:
{ return volumeVariables_[scvIdx]; }
const VolumeVariables& operator [](const SubControlVolume& scv) const
{ return volumeVariables_[scv.index()]; }
{ return volumeVariables_[scv.indexInElement()]; }
VolumeVariables& operator [](const SubControlVolume& scv)
{ return volumeVariables_[scv.index()]; }
{ return volumeVariables_[scv.indexInElement()]; }
//! The global volume variables object we are a restriction of
const GlobalVolumeVariables& globalVolVars() const
......
......@@ -115,12 +115,12 @@ public:
const auto& volVars = elemVolVars[scv];
// density interpolation
rho += useMoles ? volVars.molarDensity(phaseIdx)*shapeValues[scv.index()][0]
: volVars.density(phaseIdx)*shapeValues[scv.index()][0];
rho += useMoles ? volVars.molarDensity(phaseIdx)*shapeValues[scv.indexInElement()][0]
: volVars.density(phaseIdx)*shapeValues[scv.indexInElement()][0];
// the mole/mass fraction gradient
GlobalPosition gradI;
jacInvT.mv(shapeJacobian[scv.index()][0], gradI);
jacInvT.mv(shapeJacobian[scv.indexInElement()][0], gradI);
gradI *= useMoles ? volVars.moleFraction(phaseIdx, compIdx)
: volVars.massFraction(phaseIdx, compIdx);
gradX += gradI;
......
......@@ -112,7 +112,7 @@ public:
// the mole/mass fraction gradient
GlobalPosition gradI;
jacInvT.mv(shapeJacobian[scv.index()][0], gradI);
jacInvT.mv(shapeJacobian[scv.indexInElement()][0], gradI);
gradI *= volVars.temperature();
gradTemp += gradI;
}
......
......@@ -80,7 +80,7 @@ public:
volumeVariables_[eIdx].resize(fvGeometry.numScv());
for (auto&& scv : scvs(fvGeometry))
{
volumeVariables_[eIdx][scv.index()].update(elemSol,
volumeVariables_[eIdx][scv.indexInElement()].update(elemSol,
problem,
element,
scv);
......
......@@ -86,7 +86,7 @@ public:
}
//! The global index of this scv
IndexType index() const
IndexType indexInElement() const
{
return scvIdx_;
}
......
......@@ -91,7 +91,7 @@ public:
*/
static const PrimaryVariables& extractDofPriVars(const ElementSolutionVector& elemSol,
const SubControlVolume& scv)
{ return isBox ? elemSol[scv.index()] : elemSol[0]; }
{ return isBox ? elemSol[scv.indexInElement()] : elemSol[0]; }
/*!
* \brief Return the vector of primary variables
......
......@@ -91,7 +91,7 @@ public:
for (auto&& scv : scvs(fvGeometry))
{
int scvIdxLocal = scv.index();
int scvIdxLocal = scv.indexInElement();
(*this)[scvIdxLocal].reset();
if (problem.model().onBoundary(scv))
......
......@@ -146,7 +146,7 @@ public:
VolumeVariables origVolVars(curVolVars);
// add precalculated residual for this scv into the global container
residual[dofIdx] += this->residual_[scv.index()];
residual[dofIdx] += this->residual_[scv.indexInElement()];
// calculate derivatives w.r.t to the privars at the dof at hand
for (int pvIdx = 0; pvIdx < numEq; pvIdx++)
......@@ -166,7 +166,7 @@ public:
curVolVars = origVolVars;
// restore the original element solution
curElemSol[scv.index()][pvIdx] = this->model_().curSol()[scv.dofIndex()][pvIdx];
curElemSol[scv.indexInElement()][pvIdx] = this->model_().curSol()[scv.dofIndex()][pvIdx];
}
// TODO: what if we have an extended source stencil????
......@@ -242,7 +242,7 @@ protected:
// calculate f(x + \epsilon)
// deflect primary variables
curElemSol[scv.index()][pvIdx] += eps;
curElemSol[scv.indexInElement()][pvIdx] += eps;
delta += eps;
// update the volume variables connected to the dof
......@@ -268,7 +268,7 @@ protected:
// need to calculate f(x - \epsilon)
// deflect the primary variables
curElemSol[scv.index()][pvIdx] -= delta + eps;
curElemSol[scv.indexInElement()][pvIdx] -= delta + eps;
delta += eps;
// update the volume variables connected to the dof
......@@ -301,7 +301,7 @@ protected:
template<class T = TypeTag>
typename std::enable_if<GET_PROP_VALUE(T, EnableGlobalVolumeVariablesCache), VolumeVariables>::type&
getCurVolVars(ElementVolumeVariables& elemVolVars, const SubControlVolume& scv)
{ return this->model_().nonConstCurGlobalVolVars().volVars(scv.elementIndex(), scv.index()); }
{ return this->model_().nonConstCurGlobalVolVars().volVars(scv.elementIndex(), scv.indexInElement()); }
//! When global volume variables caching is disabled, return the local volvar object
template<class T = TypeTag>
......
......@@ -108,7 +108,7 @@ protected:
if (scvf.boundary())
{
auto&& scv = fvGeometry.scv(scvf.insideScvIdx());
this->asImp_().evalBoundaryFluxes_(element, fvGeometry, elemVolVars, scvf, scv, bcTypes[scv.index()], elemFluxVarsCache);
this->asImp_().evalBoundaryFluxes_(element, fvGeometry, elemVolVars, scvf, scv, bcTypes[scv.indexInElement()], elemFluxVarsCache);
}
}
}
......@@ -118,7 +118,7 @@ protected:
{
for (auto&& scv : scvs(fvGeometry))
{
auto scvBcTypes = bcTypes[scv.index()];
auto scvBcTypes = bcTypes[scv.indexInElement()];
if (scvBcTypes.hasDirichlet())
this->asImp_().evalDirichlet_(element, fvGeometry, elemVolVars, scv, scvBcTypes);
}
......@@ -149,7 +149,7 @@ protected:
// get the primary variables
const auto& priVars = elemVolVars[scv].priVars();
this->residual_[scv.index()][eqIdx] = priVars[pvIdx] - dirichletValues[pvIdx];
this->residual_[scv.indexInElement()][eqIdx] = priVars[pvIdx] - dirichletValues[pvIdx];
}
}
}
......
......@@ -313,7 +313,7 @@ protected:
// all sub control volumes
for (auto&& scv : scvs(fvGeometry))
{
auto localScvIdx = isBox ? scv.index() : 0;
auto localScvIdx = isBox ? scv.indexInElement() : 0;
const auto& volVars = curElemVolVars[scv];
storageTerm_[localScvIdx] = asImp_().computeStorage(scv, volVars);
storageTerm_[localScvIdx] *= scv.volume() * volVars.extrusionFactor();
......@@ -352,7 +352,7 @@ protected:
// evaluate the volume terms (storage + source terms)
for (auto&& scv : scvs(fvGeometry))
{
auto localScvIdx = isBox ? scv.index() : 0;
auto localScvIdx = isBox ? scv.indexInElement() : 0;
auto curExtrusionFactor = curElemVolVars[scv].extrusionFactor();
// subtract the source term from the local rate
......@@ -379,7 +379,7 @@ protected:
// evaluate the volume terms (storage + source terms)
for (auto&& scv : scvs(fvGeometry))
{
auto localScvIdx = isBox ? scv.index() : 0;
auto localScvIdx = isBox ? scv.indexInElement() : 0;
const auto& curVolVars = curElemVolVars[scv];
const auto& prevVolVars = prevElemVolVars[scv];
......
......@@ -981,7 +981,7 @@ public:
const SubControlVolume &scv) const
{
PrimaryVariables source(0);
auto scvIdx = isBox ? scv.index() : 0;
auto scvIdx = isBox ? scv.indexInElement() : 0;
auto key = std::make_pair(this->gridView().indexSet().index(element), scvIdx);
if (pointSourceMap_.count(key))
{
......
......@@ -150,7 +150,7 @@ public:
for (auto&& scv : scvs(fvGeometry))
{
if (BoundingBoxTreeHelper<dimworld>::pointInGeometry(scv.geometry(), globalPos))
scvIndices.push_back(scv.index());
scvIndices.push_back(scv.indexInElement());
}
// for all scvs that where tested positiv add the point sources
// to the element/scv to point source map
......
......@@ -257,7 +257,7 @@ protected:
VolumeVariables origVolVars(curVolVars);
// add precalculated residual for this scv into the global container
residual[dofIdx] += this->residual_[scv.index()];
residual[dofIdx] += this->residual_[scv.indexInElement()];
// calculate derivatives w.r.t to the privars at the dof at hand
for (int pvIdx = 0; pvIdx < numEq; pvIdx++)
......@@ -277,7 +277,7 @@ protected:
curVolVars = origVolVars;
// restore the original element solution
curElemSol[scv.index()][pvIdx] = this->problem_().model().curSol()[scv.dofIndex()][pvIdx];
curElemSol[scv.indexInElement()][pvIdx] = this->problem_().model().curSol()[scv.dofIndex()][pvIdx];
}
// TODO: what if we have an extended source stencil????
}
......@@ -506,7 +506,7 @@ protected:
// this->updateGlobalJacobian_(couplingMatrix, scv.dofIndex(), globalJ, pvIdx, partialDeriv[scv.dofIndex()]);
for (auto&& scv : scvs(fvGeometry))
this->updateGlobalJacobian_(couplingMatrix, scv.dofIndex(), globalJ, pvIdx, partialDeriv[scv.index()]);
this->updateGlobalJacobian_(couplingMatrix, scv.dofIndex(), globalJ, pvIdx, partialDeriv[scv.indexInElement()]);
}
}
}
......
......@@ -215,7 +215,7 @@ public:
if (priVarSwitch_().wasSwitched(dofIdxGlobal))
{
const auto elemSol = this->elementSolution(element, this->curSol());
this->nonConstCurGlobalVolVars().volVars(scv.index()).update(elemSol,
this->nonConstCurGlobalVolVars().volVars(scv()).update(elemSol,
this->problem_(),
element,
scv);
......
......@@ -233,7 +233,7 @@ public:
auto dofIdxGlobal = scv.dofIndex();
if (priVarSwitch_().wasSwitched(dofIdxGlobal))
{
this->nonConstCurGlobalVolVars().volVars(scv.index()).update(this->curSol()[dofIdxGlobal],
this->nonConstCurGlobalVolVars().volVars(scv()).update(this->curSol()[dofIdxGlobal],
this->problem_(),
element,
scv);
......
......@@ -233,7 +233,7 @@ public:
auto dofIdxGlobal = scv.dofIndex();
if (priVarSwitch_().wasSwitched(dofIdxGlobal))
{
this->nonConstCurGlobalVolVars().volVars(scv.index()).update(this->curSol()[dofIdxGlobal],
this->nonConstCurGlobalVolVars().volVars(scv()).update(this->curSol()[dofIdxGlobal],
this->problem_(),
element,
scv);
......
......@@ -126,7 +126,7 @@ public:
/////////////
// calculate the remaining quantities
/////////////
auto&& priVars = isBox ? elemSol[scv.index()] : elemSol[0];
auto&& priVars = isBox ? elemSol[scv.indexInElement()] : elemSol[0];
sumPrecipitates_ = 0.0;
for(int sPhaseIdx = 0; sPhaseIdx < numSPhases; ++sPhaseIdx)
......@@ -173,7 +173,7 @@ public:
fluidState.setTemperature(t);
auto phasePresence = problem.model().priVarSwitch().phasePresence(scv.dofIndex());
auto&& priVars = isBox ? elemSol[scv.index()] : elemSol[0];
auto&& priVars = isBox ? elemSol[scv.indexInElement()] : elemSol[0];
/////////////
// set the saturations
......
......@@ -212,7 +212,7 @@ public:
if (priVarSwitch_().wasSwitched(dofIdxGlobal))
{
this->nonConstCurGlobalVolVars().volVars(scv.index()).update(this->curSol()[dofIdxGlobal],
this->nonConstCurGlobalVolVars().volVars(scv()).update(this->curSol()[dofIdxGlobal],
this->problem_(),
element,
scv);
......
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