3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
fv.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
25#ifndef DUMUX_FV_SPATIAL_PARAMS_HH
26#define DUMUX_FV_SPATIAL_PARAMS_HH
27
28#warning "This file is deprecated, use FVPorousMediumFlowSpatialParamsMP from dumux/porousmediumflow/fvspatialparamsmp.hh instead!"
29
30#include <dune/common/exceptions.hh>
32#include "fv1p.hh"
33
34namespace Dumux {
35
36#ifndef DOXYGEN
37namespace Detail {
38// helper struct detecting if the user-defined spatial params class
39// has a fluidMatrixInteractionAtPos function
40template<class GlobalPosition>
41struct hasFluidMatrixInteractionAtPos
42{
43 template<class SpatialParams>
44 auto operator()(const SpatialParams& a)
45 -> decltype(a.fluidMatrixInteractionAtPos(std::declval<GlobalPosition>()))
46 {}
47};
48} // end namespace Detail
49#endif
50
56template<class GridGeometry, class Scalar, class Implementation>
57class
58[[deprecated("Use FVPorousMediumFlowSpatialParamsMP from dumux/porousmediumflow/fvspatialparamsmp.hh instead. This class will be removed after 3.5.")]]
59FVSpatialParams : public FVSpatialParamsOneP<GridGeometry, Scalar, Implementation>
60{
61 using ParentType = FVSpatialParamsOneP<GridGeometry, Scalar, Implementation>;
62 using GridView = typename GridGeometry::GridView;
63 using FVElementGeometry = typename GridGeometry::LocalView;
64 using SubControlVolume = typename GridGeometry::SubControlVolume;
65 using Element = typename GridView::template Codim<0>::Entity;
66
67 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
68
69public:
70 FVSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
71 : ParentType(gridGeometry)
72 {}
73
81 template<class ElementSolution>
82 decltype(auto) fluidMatrixInteraction(const Element& element,
83 const SubControlVolume& scv,
84 const ElementSolution& elemSol) const
85 {
86 static_assert(decltype(isValid(Detail::hasFluidMatrixInteractionAtPos<GlobalPosition>())(this->asImp_()))::value," \n\n"
87 " Your spatial params class has to either implement\n\n"
88 " auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const\n\n"
89 " or overload this function\n\n"
90 " template<class ElementSolution>\n"
91 " auto fluidMatrixInteraction(const Element& element,\n"
92 " const SubControlVolume& scv,\n"
93 " const ElementSolution& elemSol) const\n\n");
94
95 return this->asImp_().fluidMatrixInteractionAtPos(scv.center());
96 }
97
106 template<class FluidSystem, class ElementSolution>
107 int wettingPhase(const Element& element,
108 const SubControlVolume& scv,
109 const ElementSolution& elemSol) const
110 {
111 return this->asImp_().template wettingPhaseAtPos<FluidSystem>(scv.center());
112 }
113
120 template<class FluidSystem>
121 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
122 {
123 DUNE_THROW(Dune::InvalidStateException,
124 "The spatial parameters do not provide "
125 "a wettingPhaseAtPos() method.");
126 }
127};
128
129} // namespace Dumux
130
131#endif
A helper function for class member function introspection.
The base class for spatial parameters of one-phase problems using a fully implicit discretization met...
Definition: adapt.hh:29
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
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:107
FVSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: fv.hh:70
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:82
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Function for defining which phase is to be considered as the wetting phase.
Definition: fv.hh:121
The base class for spatial parameters of one-phase problems using a fully implicit discretization met...
Definition: fv1p.hh:80