Commit 9f393fa4 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[navierstokes][fluxvars] Remove stencils methods

* adapt other headers accordingly
parent 0cad8ac8
......@@ -31,13 +31,20 @@
namespace Dumux
{
namespace Properties
{
NEW_PROP_TAG(StaggeredFluxStencils);
}
template<class TypeTag>
class StaggeredConnectivityMap
{
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry);
using SubControlVolumeFace = typename GET_PROP_TYPE(TypeTag, SubControlVolumeFace);
using Element = typename GridView::template Codim<0>::Entity;
using IndexType = typename GridView::IndexSet::IndexType;
using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices);
......@@ -53,6 +60,7 @@ class StaggeredConnectivityMap
using FaceToFaceMap = std::vector<std::vector<IndexType>>;
using Stencil = std::vector<IndexType>;
using FluxStencils = typename GET_PROP_TYPE(TypeTag, StaggeredFluxStencils);
public:
......@@ -76,7 +84,6 @@ public:
std::vector<Stencil> fullfaceToFaceStencils;
fullfaceToFaceStencils.resize(numDofsFace);
FluxVariables fluxVars;
for(auto&& element: elements(fvGridGeometry.gridView()))
{
// restrict the FvGeometry locally and bind to the element
......@@ -87,12 +94,12 @@ public:
for (auto&& scvf : scvfs(fvGeometry))
{
const auto dofIdxCellCenter = fvGridGeometry.elementMapper().index(element);
fluxVars.computeCellCenterToCellCenterStencil(cellCenterToCellCenterMap_[dofIdxCellCenter], element, fvGeometry, scvf);
fluxVars.computeCellCenterToFaceStencil(cellCenterToFaceMap_[dofIdxCellCenter], element, fvGeometry, scvf);
FluxStencils::computeCellCenterToCellCenterStencil(cellCenterToCellCenterMap_[dofIdxCellCenter], element, fvGeometry, scvf);
FluxStencils::computeCellCenterToFaceStencil(cellCenterToFaceMap_[dofIdxCellCenter], element, fvGeometry, scvf);
const auto scvfIdx = scvf.index();
fluxVars.computeFaceToCellCenterStencil(faceToCellCenterMap_[scvfIdx], fvGeometry, scvf);
fluxVars.computeFaceToFaceStencil(faceToFaceMap_[scvfIdx], fvGeometry, scvf);
FluxStencils::computeFaceToCellCenterStencil(faceToCellCenterMap_[scvfIdx], fvGeometry, scvf);
FluxStencils::computeFaceToFaceStencil(faceToFaceMap_[scvfIdx], fvGeometry, scvf);
}
}
}
......
......@@ -129,64 +129,6 @@ public:
return result;
}
void computeCellCenterToCellCenterStencil(Stencil& stencil,
const Element& element,
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
{
// the first entry is always the cc dofIdx itself
if(stencil.empty())
stencil.push_back(scvf.insideScvIdx());
if(!scvf.boundary())
stencil.push_back(scvf.outsideScvIdx());
}
void computeCellCenterToFaceStencil(Stencil& stencil,
const Element& element,
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
{
stencil.push_back(scvf.dofIndex());
}
void computeFaceToCellCenterStencil(Stencil& stencil,
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
{
const int eIdx = scvf.insideScvIdx();
stencil.push_back(scvf.insideScvIdx());
for(const auto& data : scvf.pairData())
{
auto& normalFace = fvGeometry.scvf(eIdx, data.localNormalFaceIdx);
const auto outerParallelElementDofIdx = normalFace.outsideScvIdx();
if(!normalFace.boundary())
stencil.push_back(outerParallelElementDofIdx);
}
}
void computeFaceToFaceStencil(Stencil& stencil,
const FVElementGeometry& fvGeometry,
const SubControlVolumeFace& scvf)
{
// the first entries are always the face dofIdx itself and the one of the opposing face
if(stencil.empty())
{
stencil.push_back(scvf.dofIndex());
stencil.push_back(scvf.dofIndexOpposingFace());
}
for(const auto& data : scvf.pairData())
{
stencil.push_back(data.normalPair.first);
const auto outerParallelFaceDofIdx = data.outerParallelFaceDofIdx;
if(outerParallelFaceDofIdx >= 0)
stencil.push_back(outerParallelFaceDofIdx);
if(!scvf.boundary())
stencil.push_back(data.normalPair.second);
}
}
/*!
* \brief Returns the normal part of the momentum flux
* \param scvf The sub control volume face
......
......@@ -38,34 +38,34 @@ namespace Dumux
{
//! Dummy flux variables class so that we can update the connectivity map
class MockFluxVariables
class MockFluxStencil
{
public:
template<class Map, class Element, class FvGeometry, class Scvf>
void computeCellCenterToCellCenterStencil(Map& map,
const Element& element,
const FvGeometry& fvGeometry,
const Scvf& scvf)
static void computeCellCenterToCellCenterStencil(Map& map,
const Element& element,
const FvGeometry& fvGeometry,
const Scvf& scvf)
{}
template<class Map, class Element, class FvGeometry, class Scvf>
void computeCellCenterToFaceStencil(Map& map,
const Element& element,
const FvGeometry& fvGeometry,
const Scvf& scvf)
static void computeCellCenterToFaceStencil(Map& map,
const Element& element,
const FvGeometry& fvGeometry,
const Scvf& scvf)
{}
template<class Map, class FvGeometry, class Scvf>
void computeFaceToCellCenterStencil(Map& map,
const FvGeometry& fvGeometry,
const Scvf& scvf)
static void computeFaceToCellCenterStencil(Map& map,
const FvGeometry& fvGeometry,
const Scvf& scvf)
{}
template<class Map, class FvGeometry, class Scvf>
void computeFaceToFaceStencil(Map& map,
const FvGeometry& fvGeometry,
const Scvf& scvf)
static void computeFaceToFaceStencil(Map& map,
const FvGeometry& fvGeometry,
const Scvf& scvf)
{}
};
......@@ -76,7 +76,7 @@ NEW_TYPE_TAG(TestFVGeometry, INHERITS_FROM(StaggeredModel));
SET_TYPE_PROP(TestFVGeometry, Grid, Dune::YaspGrid<2>);
SET_TYPE_PROP(TestFVGeometry, FluxVariables, MockFluxVariables);
SET_TYPE_PROP(TestFVGeometry, StaggeredFluxStencils, MockFluxStencil);
SET_BOOL_PROP(TestFVGeometry, EnableFVGridGeometryCache, true);
}
......
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