Commit 10d395e6 authored by Timo Koch's avatar Timo Koch Committed by Dennis Gläser
Browse files

[staggered] Adapt element solution to other discretizations

parent ef5f5b96
......@@ -340,7 +340,7 @@ protected:
const Scalar eps = numericEpsilon(priVars[pvIdx], cellCenterIdx, cellCenterIdx);
priVars[pvIdx] += eps;
auto elemSol = elementSolution<SolutionVector, FVGridGeometry>(std::move(priVars));
auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
curVolVars.update(elemSol, problem, elementJ, scvJ);
const auto deflectedResidual = localResidual.evalCellCenter(problem, element, fvGeometry, prevElemVolVars, curElemVolVars,
......@@ -467,7 +467,7 @@ protected:
const Scalar eps = numericEpsilon(priVars[pvIdx], faceIdx, cellCenterIdx);
priVars[pvIdx] += eps;
auto elemSol = elementSolution<SolutionVector, FVGridGeometry>(std::move(priVars));
auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
curVolVars.update(elemSol, problem, elementJ, scvJ);
const auto deflectedResidual = localResidual.evalFace(problem, element, fvGeometry, scvf,
......
......@@ -38,9 +38,9 @@ using StaggeredElementSolution = Dune::BlockVector<PrimaryVariables>;
* \brief Make an element solution for staggered schemes
* \note This is e.g. used to contruct an element solution at Dirichlet boundaries
*/
template<class SolutionVector, class FVGridGeometry, class PrimaryVariables>
template<class FVElementGeometry, class PrimaryVariables>
auto elementSolution(PrimaryVariables&& priVars)
-> std::enable_if_t<FVGridGeometry::discMethod == DiscretizationMethod::staggered,
-> std::enable_if_t<FVElementGeometry::FVGridGeometry::discMethod == DiscretizationMethod::staggered,
StaggeredElementSolution<PrimaryVariables>>
{
return StaggeredElementSolution<PrimaryVariables>({std::move(priVars)});
......
......@@ -161,7 +161,7 @@ public:
auto&& scvJ = fvGeometry.scv(globalJ);
CellCenterPrimaryVariables priVars(0.0);
priVars = sol[cellCenterIdx][globalJ];
auto elemSol = elementSolution<SolutionVector, FVGridGeometry>(std::move(priVars));
auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
volumeVariables_[localIdx].update(elemSol,
problem,
elementJ,
......@@ -197,7 +197,7 @@ public:
volumeVariables_.resize(localIdx+1);
volVarIndices_.resize(localIdx+1);
auto elemSol = elementSolution<SolutionVector, FVGridGeometry>(std::move(boundaryPriVars));
auto elemSol = elementSolution<FVElementGeometry>(std::move(boundaryPriVars));
volumeVariables_[localIdx].update(elemSol,
problem,
element,
......@@ -223,7 +223,7 @@ public:
auto&& scv = fvGeometry.scv(eIdx);
CellCenterPrimaryVariables priVars(0.0);
priVars = sol[cellCenterIdx][eIdx];
auto elemSol = elementSolution<SolutionVector, FVGridGeometry>(std::move(priVars));
auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
volumeVariables_[0].update(elemSol,
gridVolVars().problem(),
element,
......
......@@ -92,7 +92,7 @@ public:
{
CellCenterPrimaryVariables priVars(0.0);
priVars = sol[cellCenterIdx][scv.dofIndex()];
auto elemSol = elementSolution<SolutionVector, FVGridGeometry>(std::move(priVars));
auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
volumeVariables_[scv.dofIndex()].update(elemSol, problem(), element, scv);
}
......@@ -121,7 +121,7 @@ public:
if(eqIdx == Indices::pressureIdx)
DUNE_THROW(Dune::InvalidStateException, "Face at: " << scvf.center() << " has neither Dirichlet nor Neumann BC.");
}
auto elemSol = elementSolution<SolutionVector, FVGridGeometry>(std::move(boundaryPriVars));
auto elemSol = elementSolution<FVElementGeometry>(std::move(boundaryPriVars));
volumeVariables_[scvf.outsideScvIdx()].update(elemSol, problem(), element, insideScv);
}
}
......
......@@ -289,7 +289,7 @@ public:
{
const int dofIdx = scv.dofIndex();
CellCenterPrimaryVariables priVars(curSol[cellCenterIdx][dofIdx]);
auto elemSol = elementSolution<SolutionVector, FVGridGeometry>(std::move(priVars));
auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
VolumeVariables volVars;
volVars.update(elemSol, asImp_(), element, scv);
kinematicViscosity_[elementID] = volVars.viscosity() / volVars.density();
......
......@@ -121,7 +121,7 @@ public:
const int dofIdx = scv.dofIndex();
CellCenterPrimaryVariables priVars(curSol[cellCenterIdx][dofIdx]);
auto elemSol = elementSolution<SolutionVector, FVGridGeometry>(std::move(priVars));
auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
VolumeVariables volVars;
volVars.update(elemSol, asImp_(), 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