diff --git a/dumux/discretization/cellcentered/globalvolumevariables.hh b/dumux/discretization/cellcentered/globalvolumevariables.hh index 8a0a4ef294d95ebc467f980de90d8d52c8ef0305..8f0b1603a76f62f8a6f99b9a234e945689938678 100644 --- a/dumux/discretization/cellcentered/globalvolumevariables.hh +++ b/dumux/discretization/cellcentered/globalvolumevariables.hh @@ -76,7 +76,7 @@ public: fvGeometry.bindElement(element); for (auto&& scv : scvs(fvGeometry)) - volumeVariables_[scv.index()].update(problem.model().elementSolution(element, sol), + volumeVariables_[scv.dofIndex()].update(problem.model().elementSolution(element, sol), problem, element, scv); diff --git a/dumux/discretization/cellcentered/mpfa/elementvolumevariables.hh b/dumux/discretization/cellcentered/mpfa/elementvolumevariables.hh index e0470acfc44d4a3044250574227aab05ccb9264d..7c7adbe759a0d4ca7cb250e0f9ac58bf7df79843 100644 --- a/dumux/discretization/cellcentered/mpfa/elementvolumevariables.hh +++ b/dumux/discretization/cellcentered/mpfa/elementvolumevariables.hh @@ -59,7 +59,7 @@ public: : globalVolVarsPtr_(&globalVolVars) {} const VolumeVariables& operator [](const SubControlVolume& scv) const - { return globalVolVars().volVars(scv.index()); } + { return globalVolVars().volVars(scv.dofIndex()); } // operator for the access with an index // needed for cc methods for the access to the boundary volume variables @@ -271,14 +271,14 @@ public: globalVolVars().problem_(), element, scv); - volVarIndices_[0] = scv.index(); + volVarIndices_[0] = scv.dofIndex(); } const VolumeVariables& operator [](const SubControlVolume& scv) const - { return volumeVariables_[getLocalIdx_(scv.index())]; } + { return volumeVariables_[getLocalIdx_(scv.dofIndex())]; } VolumeVariables& operator [](const SubControlVolume& scv) - { return volumeVariables_[getLocalIdx_(scv.index())]; } + { return volumeVariables_[getLocalIdx_(scv.dofIndex())]; } const VolumeVariables& operator [](IndexType scvIdx) const { return volumeVariables_[getLocalIdx_(scvIdx)]; } diff --git a/dumux/discretization/cellcentered/mpfa/globalvolumevariables.hh b/dumux/discretization/cellcentered/mpfa/globalvolumevariables.hh index 54ce225e4df8b0d9de67b144fc988800300b4fe5..617301cb09670cf1828a1f4c7ec8049d1dd348bb 100644 --- a/dumux/discretization/cellcentered/mpfa/globalvolumevariables.hh +++ b/dumux/discretization/cellcentered/mpfa/globalvolumevariables.hh @@ -77,7 +77,7 @@ public: fvGeometry.bindElement(element); for (auto&& scv : scvs(fvGeometry)) - volumeVariables_[scv.index()].update(problem.model().elementSolution(element, sol), + volumeVariables_[scv.dofIndex()].update(problem.model().elementSolution(element, sol), problem, element, scv); // handle the boundary volume variables diff --git a/dumux/discretization/cellcentered/subcontrolvolume.hh b/dumux/discretization/cellcentered/subcontrolvolume.hh index 01957c3483b1884000bb205be5fea3d17717e33a..711075fd728703edddebed9a2359e4ea05566594 100644 --- a/dumux/discretization/cellcentered/subcontrolvolume.hh +++ b/dumux/discretization/cellcentered/subcontrolvolume.hh @@ -99,13 +99,7 @@ public: return geometry_.value(); } - //! The global index of this scv - IndexType index() const - { - return elementIndex(); - } - - //! The index of the dof this scv is embedded in + //! The index of the dof this scv is embedded in (the global index of this scv) IndexType dofIndex() const { return elementIndex(); diff --git a/dumux/discretization/cellcentered/tpfa/elementvolumevariables.hh b/dumux/discretization/cellcentered/tpfa/elementvolumevariables.hh index 8a6c442dc82e6ed0399d00016705e62a1dd564b5..87819ed64508d3da617f68ee6efc1e5f9af32627 100644 --- a/dumux/discretization/cellcentered/tpfa/elementvolumevariables.hh +++ b/dumux/discretization/cellcentered/tpfa/elementvolumevariables.hh @@ -59,7 +59,7 @@ public: : globalVolVarsPtr_(&globalVolVars) {} const VolumeVariables& operator [](const SubControlVolume& scv) const - { return globalVolVars().volVars(scv.index()); } + { return globalVolVars().volVars(scv.dofIndex()); } // operator for the access with an index // needed for cc methods for the access to the boundary volume variables @@ -135,7 +135,7 @@ public: problem, element, scvI); - volVarIndices_[localIdx] = scvI.index(); + volVarIndices_[localIdx] = scvI.dofIndex(); ++localIdx; // Update the volume variables of the neighboring elements @@ -147,7 +147,7 @@ public: problem, elementJ, scvJ); - volVarIndices_[localIdx] = scvJ.index(); + volVarIndices_[localIdx] = scvJ.dofIndex(); ++localIdx; } @@ -191,7 +191,7 @@ public: problem, elementJ, scvJ); - volVarIndices_[localIdx] = scvJ.index(); + volVarIndices_[localIdx] = scvJ.dofIndex(); ++localIdx; } } @@ -215,14 +215,14 @@ public: globalVolVars().problem_(), element, scv); - volVarIndices_[0] = scv.index(); + volVarIndices_[0] = scv.dofIndex(); } const VolumeVariables& operator [](const SubControlVolume& scv) const - { return volumeVariables_[getLocalIdx_(scv.index())]; } + { return volumeVariables_[getLocalIdx_(scv.dofIndex())]; } VolumeVariables& operator [](const SubControlVolume& scv) - { return volumeVariables_[getLocalIdx_(scv.index())]; } + { return volumeVariables_[getLocalIdx_(scv.dofIndex())]; } const VolumeVariables& operator [](IndexType scvIdx) const { return volumeVariables_[getLocalIdx_(scvIdx)]; } diff --git a/dumux/discretization/staggered/elementvolumevariables.hh b/dumux/discretization/staggered/elementvolumevariables.hh index 0e8e8739974481a374a7c21bba6ceb2c0a783710..48bd0e8c9b69a25d6e9fef3f5f5b557cc11b5027 100644 --- a/dumux/discretization/staggered/elementvolumevariables.hh +++ b/dumux/discretization/staggered/elementvolumevariables.hh @@ -58,7 +58,7 @@ public: : globalVolVarsPtr_(&globalVolVars) {} const VolumeVariables& operator [](const SubControlVolume& scv) const - { return globalVolVars().volVars(scv.index()); } + { return globalVolVars().volVars(scv.dofIndex()); } // operator for the access with an index // needed for Staggered methods for the access to the boundary volume variables @@ -177,14 +177,14 @@ public: // update the volume variables of the element auto&& scv = fvGeometry.scv(eIdx); volumeVariables_[0].update(sol[eIdx], globalVolVars().problem_(), element, scv); - volVarIndices_[0] = scv.index(); + volVarIndices_[0] = scv.dofIndex(); } const VolumeVariables& operator [](const SubControlVolume& scv) const - { return volumeVariables_[getLocalIdx_(scv.index())]; } + { return volumeVariables_[getLocalIdx_(scv.dofIndex())]; } VolumeVariables& operator [](const SubControlVolume& scv) - { return volumeVariables_[getLocalIdx_(scv.index())]; } + { return volumeVariables_[getLocalIdx_(scv.dofIndex())]; } const VolumeVariables& operator [](IndexType scvIdx) const { return volumeVariables_[getLocalIdx_(scvIdx)]; } diff --git a/dumux/discretization/staggered/globalvolumevariables.hh b/dumux/discretization/staggered/globalvolumevariables.hh index 1510817e641270a7ccfeb791eea37bafdadd4866..55b206bc461e695f6676c6dd70f48d7e468a1a19 100644 --- a/dumux/discretization/staggered/globalvolumevariables.hh +++ b/dumux/discretization/staggered/globalvolumevariables.hh @@ -89,7 +89,7 @@ public: PrimaryVariables priVars(0.0); priVars[cellCenterIdx] = sol[cellCenterIdx][scv.dofIndex()]; ElementSolutionVector elemSol{std::move(priVars)}; - volumeVariables_[scv.index()].update(elemSol, problem, element, scv); + volumeVariables_[scv.dofIndex()].update(elemSol, problem, element, scv); } // handle the boundary volume variables diff --git a/dumux/implicit/cellcentered/localjacobian.hh b/dumux/implicit/cellcentered/localjacobian.hh index da7b6dd878e9fa39bd87415be4c49cdcf76a8595..414fc98d6707af7cc67b22ee76d9ddc10bcaa1ad 100644 --- a/dumux/implicit/cellcentered/localjacobian.hh +++ b/dumux/implicit/cellcentered/localjacobian.hh @@ -481,7 +481,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.index()); } + { return this->model_().nonConstCurGlobalVolVars().volVars(scv.dofIndex()); } //! When global volume variables caching is disabled, return the local volvar object template<class T = TypeTag> diff --git a/dumux/implicit/staggered/localjacobian.hh b/dumux/implicit/staggered/localjacobian.hh index dc53aa06c72e2031de38db0e33309fe5db38eef0..cf04d2e55112f153a870a34348be016eda2881a0 100644 --- a/dumux/implicit/staggered/localjacobian.hh +++ b/dumux/implicit/staggered/localjacobian.hh @@ -554,7 +554,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.index()); } + { return this->model_().nonConstCurGlobalVolVars().volVars(scv()); } //! When global volume variables caching is disabled, return the local volvar object template<class T = TypeTag> diff --git a/test/discretization/cellcentered/tpfa/test_tpfafvgeometry.cc b/test/discretization/cellcentered/tpfa/test_tpfafvgeometry.cc index c3ab1a1a1cb5c72cf5241d0fbd0fa277e35d0942..e6f5a1fa7beed65d0d9ac72fa34392c4c4f91b57 100644 --- a/test/discretization/cellcentered/tpfa/test_tpfafvgeometry.cc +++ b/test/discretization/cellcentered/tpfa/test_tpfafvgeometry.cc @@ -124,7 +124,7 @@ int main (int argc, char *argv[]) try for (auto&& scv : scvs(fvGeometry)) { - std::cout << "-- scv " << scv.index() << " center at: " << scv.center() << std::endl; + std::cout << "-- scv " << scv.dofIndex() << " center at: " << scv.center() << std::endl; } auto range2 = scvfs(fvGeometry); diff --git a/test/discretization/staggered/test_staggered.cc b/test/discretization/staggered/test_staggered.cc index d07d35e55d8b963c13a3e6d7e3c3d47ef116481f..6e26dcd3cb4a743117717528526d3fd8a8cff06b 100644 --- a/test/discretization/staggered/test_staggered.cc +++ b/test/discretization/staggered/test_staggered.cc @@ -132,7 +132,7 @@ int main (int argc, char *argv[]) try for (auto&& scv : scvs(fvGeometry)) { - std::cout << "-- scv " << scv.index() << " center at: " << scv.center() << std::endl; + std::cout << "-- scv " << scv.dofIndex() << " center at: " << scv.center() << std::endl; } auto range2 = scvfs(fvGeometry);