12#ifndef DUMUX_FREEFLOW_SPATIAL_PARAMS_HH 
   13#define DUMUX_FREEFLOW_SPATIAL_PARAMS_HH 
   20namespace Detail::BrinkmanSpatialParams {
 
   22template<
class GlobalPosition>
 
   23struct hasInversePermeabilityAtPos
 
   25    template<
class SpatialParams>
 
   26    auto operator()(
const SpatialParams& a)
 
   27    -> 
decltype(a.inversePermeabilityAtPos(std::declval<GlobalPosition>()))
 
   31template<
class GlobalPosition>
 
   32struct hasBrinkmanEpsilonAtPos
 
   34    template<
class SpatialParams>
 
   35    auto operator()(
const SpatialParams& a)
 
   36    -> 
decltype(a.brinkmanEpsilonAtPos(std::declval<GlobalPosition>()))
 
   47template<
class Gr
idGeometry, 
class Scalar, 
class Implementation>
 
   63template<
class Gr
idGeometry, 
class Scalar, 
class Implementation>
 
   68    using GridView = 
typename GridGeometry::GridView;
 
   69    using Element = 
typename GridView::template Codim<0>::Entity;
 
   70    using GlobalPosition = 
typename Element::Geometry::GlobalCoordinate;
 
   71    using FVElementGeometry = 
typename GridGeometry::LocalView;
 
   72    using SubControlVolume = 
typename GridGeometry::SubControlVolume;
 
   80                                       const FVElementGeometry& fvGeometry,
 
   81                                       const SubControlVolume& scv)
 const 
   83        static_assert(
decltype(
isValid(Detail::BrinkmanSpatialParams::hasInversePermeabilityAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n" 
   84        "   Your spatial params class has to either implement\n\n" 
   85        "         const PermeabilityType& inversePermeabilityAtPos(const GlobalPosition& globalPos) const\n\n" 
   86        "   or overload this function\n\n" 
   87        "         const PermeabilityType& inversePermeability(const Element& element,\n" 
   88        "                                                     const FVElementGeometry& fvGeometry,\n" 
   89        "                                                     const SubControlVolume& scv) const\n" 
   90        "    This can be done simply with the invert() function of the DimMatrix type (e.g. permeability.invert()). \n\n");
 
   91        return this->
asImp_().inversePermeabilityAtPos(scv.dofPosition());
 
 
   95                           const FVElementGeometry& fvGeometry,
 
   96                           const SubControlVolume& scv)
 const 
   98        static_assert(
decltype(
isValid(Detail::BrinkmanSpatialParams::hasBrinkmanEpsilonAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n" 
   99        "   Your spatial params class has to either implement\n\n" 
  100        "         const Scalar& brinkmanEpsilonAtPos(const GlobalPosition& globalPos) const\n\n" 
  101        "   or overload this function\n\n" 
  102        "         const Scalar& brinkmanEpsilon(const Element& element,\n" 
  103        "                                       const FVElementGeometry& fvGeometry,\n" 
  104        "                                       const SubControlVolume& scv) const\n\n");
 
  105        return this->
asImp_().brinkmanEpsilonAtPos(scv.dofPosition());
 
 
 
  114template<
class Gr
idGeometry, 
class Scalar>
 
  116: 
public FreeFlowSpatialParams<GridGeometry, Scalar, FreeFlowDefaultSpatialParams<GridGeometry, Scalar>>
 
  120    using ParentType::ParentType;
 
 
decltype(auto) inversePermeability(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv) const
Definition freeflow/spatialparams.hh:79
Scalar brinkmanEpsilon(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv) const
Definition freeflow/spatialparams.hh:94
BrinkmanSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition freeflow/spatialparams.hh:75
Implementation & asImp_()
Returns the implementation of the spatial parameters (static polymorphism)
Definition common/fvspatialparams.hh:135
FVSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition common/fvspatialparams.hh:45
const GridGeometry & gridGeometry() const
Definition common/fvspatialparams.hh:130
Definition of the spatial parameters for the freeflow problems.
Definition freeflow/spatialparams.hh:117
FreeFlowSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition freeflow/spatialparams.hh:54
Basic spatial parameters to be used with finite-volume schemes.
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