12#ifndef DUMUX_POROUS_MEDIUM_FLOW_FV_SPATIAL_PARAMS_HH 
   13#define DUMUX_POROUS_MEDIUM_FLOW_FV_SPATIAL_PARAMS_HH 
   15#include <dune/common/exceptions.hh> 
   16#include <dune/common/fmatrix.hh> 
   28template<
class GlobalPosition>
 
   29struct hasPermeabilityAtPos
 
   31    template<
class SpatialParams>
 
   32    auto operator()(
const SpatialParams& a)
 
   33    -> 
decltype(a.permeabilityAtPos(std::declval<GlobalPosition>()))
 
   43template<
class Gr
idGeometry, 
class Scalar, 
class Implementation>
 
   48    using GridView = 
typename GridGeometry::GridView;
 
   49    using FVElementGeometry = 
typename GridGeometry::LocalView;
 
   50    using SubControlVolume = 
typename GridGeometry::SubControlVolume;
 
   51    using SubControlVolumeFace = 
typename GridGeometry::SubControlVolumeFace;
 
   52    using Element = 
typename GridView::template Codim<0>::Entity;
 
   54    enum { dim = GridView::dimension };
 
   55    enum { dimWorld = GridView::dimensionworld };
 
   56    using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
 
   58    using GlobalPosition = 
typename Element::Geometry::GlobalCoordinate;
 
   82    template<
class ElementSolution>
 
   84                                const SubControlVolume& scv,
 
   85                                const ElementSolution& elemSol) 
const 
   87        static_assert(
decltype(
isValid(Detail::hasPermeabilityAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n" 
   88        "   Your spatial params class has to either implement\n\n" 
   89        "         const PermeabilityType& permeabilityAtPos(const GlobalPosition& globalPos) const\n\n" 
   90        "   or overload this function\n\n" 
   91        "         template<class ElementSolution>\n" 
   92        "         const PermeabilityType& permeability(const Element& element,\n" 
   93        "                                              const SubControlVolume& scv,\n" 
   94        "                                              const ElementSolution& elemSol) const\n\n");
 
   96        return this->
asImp_().permeabilityAtPos(scv.center());
 
 
  116        DUNE_THROW(Dune::InvalidStateException,
 
  117                   "The spatial parameters do not provide a beaversJosephCoeffAtPos() method.");
 
 
  128        return forchCoeffDefault_;
 
 
  132    Scalar forchCoeffDefault_;
 
 
decltype(auto) permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining the (intrinsic) permeability .
Definition porousmediumflow/fvspatialparams.hh:83
static constexpr bool evaluatePermeabilityAtScvfIP()
If the permeability should be evaluated directly at the scvf integration point (for convergence tests...
Definition porousmediumflow/fvspatialparams.hh:104
FVPorousMediumFlowSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition porousmediumflow/fvspatialparams.hh:61
Scalar beaversJosephCoeffAtPos(const GlobalPosition &globalPos) const
Function for defining the Beavers-Joseph coefficient for multidomain problems .
Definition porousmediumflow/fvspatialparams.hh:114
Scalar forchCoeff(const SubControlVolumeFace &scvf) const
Apply the Forchheimer coefficient for inertial forces calculation.
Definition porousmediumflow/fvspatialparams.hh:126
FVPorousMediumSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition fvporousmediumspatialparams.hh:60
Implementation & asImp_()
Returns the implementation of the spatial parameters (static polymorphism)
Definition common/fvspatialparams.hh:135
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition common/fvspatialparams.hh:130
The base class for spatial parameters in porous medium problems.
T getParam(Args &&... args)
A free function to get a parameter from the parameter tree singleton.
Definition parameters.hh:139
constexpr auto isValid(const Expression &t)
A function that creates a test functor to do class member introspection at compile time.
Definition isvalid.hh:81
A helper function for class member function introspection.
Define some often used mathematical functions.
Distance implementation details.
Definition cvfelocalresidual.hh:25
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.