25#ifndef DUMUX_FV_SPATIAL_PARAMS_HH
26#define DUMUX_FV_SPATIAL_PARAMS_HH
28#include <dune/common/exceptions.hh>
38template<
class GlobalPosition>
39struct hasFluidMatrixInteractionAtPos
41 template<
class SpatialParams>
42 auto operator()(
const SpatialParams& a)
43 ->
decltype(a.fluidMatrixInteractionAtPos(std::declval<GlobalPosition>()))
54template<
class Gr
idGeometry,
class Scalar,
class Implementation>
58 using GridView =
typename GridGeometry::GridView;
59 using FVElementGeometry =
typename GridGeometry::LocalView;
60 using SubControlVolume =
typename GridGeometry::SubControlVolume;
61 using Element =
typename GridView::template Codim<0>::Entity;
63 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
77 template<
class ElementSolution>
79 const SubControlVolume& scv,
80 const ElementSolution& elemSol)
const
82 static_assert(
decltype(
isValid(Detail::hasFluidMatrixInteractionAtPos<GlobalPosition>())(this->
asImp_()))::value,
" \n\n"
83 " Your spatial params class has to either implement\n\n"
84 " auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const\n\n"
85 " or overload this function\n\n"
86 " template<class ElementSolution>\n"
87 " auto fluidMatrixInteraction(const Element& element,\n"
88 " const SubControlVolume& scv,\n"
89 " const ElementSolution& elemSol) const\n\n");
91 return this->
asImp_().fluidMatrixInteractionAtPos(scv.center());
102 template<
class Flu
idSystem,
class ElementSolution>
104 const SubControlVolume& scv,
105 const ElementSolution& elemSol)
const
107 return this->
asImp_().template wettingPhaseAtPos<FluidSystem>(scv.center());
116 template<
class Flu
idSystem>
119 DUNE_THROW(Dune::InvalidStateException,
120 "The spatial parameters do not provide "
121 "a wettingPhaseAtPos() method.");
A helper function for class member function introspection.
The base class for spatial parameters of one-phase problems using a fully implicit discretization met...
constexpr auto isValid(const Expression &t)
A function that creates a test functor to do class member introspection at compile time.
Definition: isvalid.hh:93
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
Definition: fv.hh:56
int wettingPhase(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining which phase is to be considered as the wetting phase.
Definition: fv.hh:103
FVSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: fv.hh:66
decltype(auto) fluidMatrixInteraction(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining the parameters needed by constitutive relationships (kr-sw, pc-sw,...
Definition: fv.hh:78
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Function for defining which phase is to be considered as the wetting phase.
Definition: fv.hh:117
The base class for spatial parameters of one-phase problems using a fully implicit discretization met...
Definition: fv1p.hh:77
Implementation & asImp_()
Definition: fv1p.hh:334
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: fv1p.hh:329