Skip to content
Snippets Groups Projects
Commit 84743515 authored by Kilian Weishaupt's avatar Kilian Weishaupt Committed by Timo Koch
Browse files

[staggeredGrid][model] Add velocity output function

parent 9da7120a
No related branches found
No related tags found
2 merge requests!617[WIP] Next,!370Feature/staggered grid
......@@ -170,6 +170,25 @@ public:
writer.attachDofData(*velocity, "velocity", isBox, dim);
}
auto velocity(const Element& element) const
{
GlobalPosition velocityVector(0.0);
// get the local fv geometry
auto fvGeometry = localView(this->globalFvGeometry());
fvGeometry.bindElement(element);
for (auto&& scv : scvs(fvGeometry))
{
for (auto&& scvf : scvfs(fvGeometry))
{
auto& origFaceVars = this->curGlobalFaceVars().faceVars(scvf.dofIndexSelf());
auto dirIdx = scvf.directionIndex();
velocityVector[dirIdx] += 0.5*origFaceVars.velocity();
}
}
return velocityVector;
}
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment