Commit 33ddaf51 authored by Kilian Weishaupt's avatar Kilian Weishaupt Committed by Timo Koch
Browse files

[navierstokes][localResidual] Correct source method for staggered

parent 86cd2150
......@@ -86,6 +86,8 @@ class NavierStokesResidualImpl<TypeTag, DiscretizationMethods::Staggered>
using CellCenterResidual = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
using FaceResidual = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables);
static constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter);
enum {
// grid and world dimension
dim = GridView::dimension,
......@@ -151,7 +153,16 @@ public:
const ElementFaceVariables& elemFaceVars,
const SubControlVolume &scv) const
return problem.sourceAtPos([cellCenterIdx];
CellCenterPrimaryVariables result(0.0);
// get the values from the problem
const auto sourceValues = problem.sourceAtPos(;
// copy the respective cell center related values to the result
for(int i = 0; i < numEqCellCenter; ++i)
result[i] = sourceValues[i];
return result;
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