Commit 55c2639f authored by Timo Koch's avatar Timo Koch
Browse files

[shallowwater] Make flux class independent of TypeTag

parent 1cd534e3
......@@ -19,34 +19,14 @@
#include <dumux/common/math.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/properties.hh>
#include <dumux/flux/fluxvariablescaching.hh>
#include <dumux/flux/shallowwater/riemannproblem.hh>
namespace Dumux{
namespace Dumux {
template<class TypeTag>
template<class NumEqVector>
class ShallowWaterFlux
using Problem = GetPropType<TypeTag, Properties::Problem>;
using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
using GridView = GetPropType<TypeTag, Properties::GridView>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>;
using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>;
using Element = typename GridView::template Codim<0>::Entity;
using IndexType = typename GridView::IndexSet::IndexType;
using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>;
static const int dim = GridView::dimension;
static const int dimWorld = GridView::dimensionworld;
using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
......@@ -62,16 +42,16 @@ public:
* \todo The choice of the Riemann solver should be more flexible
template<class Problem, class FVElementGeometry, class ElementVolumeVariables>
static NumEqVector flux(const Problem& problem,
const Element& element,
const typename FVElementGeometry::FVGridGeometry::GridView::template Codim<0>::Entity& element,
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars,
const SubControlVolumeFace& scvf)
const typename FVElementGeometry::SubControlVolumeFace& scvf)
//Get the inside and outside volume variables
const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
const auto& insideVolVars = elemVolVars[insideScv];
const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
const auto& nxy = scvf.unitOuterNormal();
......@@ -187,7 +187,9 @@ template<class TypeTag>
struct IOFields<TypeTag, TTag::ShallowWater> {using type = ShallowWaterIOFields;};
template<class TypeTag>
struct AdvectionType<TypeTag, TTag::ShallowWater> {using type = ShallowWaterFlux<TypeTag>;};
struct AdvectionType<TypeTag, TTag::ShallowWater>
{ using type = ShallowWaterFlux< GetPropType<TypeTag, Properties::NumEqVector> >; };
//template<class TypeTag> struct DiffusionType<TypeTag, TTag::ShallowWater> {using type = ShallowWaterExactRiemannSolver<TypeTag>;};
} // end properties
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