Skip to content
Snippets Groups Projects
Commit 4c29620b authored by Kilian Weishaupt's avatar Kilian Weishaupt Committed by Ned Coltman
Browse files

[staggered][faceVars] Pass faceSolution instead of global solutionVector to update

* check if type is correct (Scalar)
parent 14d609ad
No related branches found
No related tags found
1 merge request!1877Reorder staggered matrix
......@@ -26,6 +26,7 @@
#include <array>
#include <vector>
#include <type_traits>
namespace Dumux {
......@@ -88,14 +89,17 @@ public:
* \param fvGeometry The finite-volume geometry
* \param scvf The sub-control volume face of interest
*/
template<class SolVector, class Problem, class Element,
template<class FaceSolution, class Problem, class Element,
class FVElementGeometry, class SubControlVolumeFace>
void update(const SolVector& faceSol,
void update(const FaceSolution& faceSol,
const Problem& problem,
const Element& element,
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
{
static_assert(std::decay_t<decltype(faceSol[0])>::dimension == 1,
"\n\n\nVelocity primary variable must be a scalar value. \n\n Make sure to use\n\n ffSol = partial(sol, ffFaceIdx, ffCellCenterIdx);\n\n");
inAxisVelocities_.self = faceSol[scvf.dofIndex()];
inAxisVelocities_.opposite = faceSol[scvf.dofIndexOpposingFace()];
......
......@@ -27,6 +27,7 @@
//! make the local view function available whenever we use this class
#include <dumux/discretization/localview.hh>
#include <dumux/discretization/staggered/elementfacevariables.hh>
#include <dumux/discretization/staggered/facesolution.hh>
namespace Dumux {
......@@ -82,18 +83,18 @@ public:
//! Update all face variables
template<class GridGeometry, class SolutionVector>
void update(const GridGeometry& gridGeometry, const SolutionVector& faceSol)
void update(const GridGeometry& gridGeometry, const SolutionVector& sol)
{
faceVariables_.resize(gridGeometry.numScvf());
for(auto&& element : elements(gridGeometry.gridView()))
for (auto&& element : elements(gridGeometry.gridView()))
{
auto fvGeometry = localView(gridGeometry);
fvGeometry.bindElement(element);
for(auto&& scvf : scvfs(fvGeometry))
for (auto&& scvf : scvfs(fvGeometry))
{
const auto faceSol = StaggeredFaceSolution(scvf, sol, gridGeometry);
faceVariables_[scvf.index()].update(faceSol, problem(), element, fvGeometry, scvf);
}
}
......
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