24#ifndef DUMUX_MATERIAL_GEOMECHANICS_ELASTIC_FV_SPATIAL_PARAMS_HH
25#define DUMUX_MATERIAL_GEOMECHANICS_ELASTIC_FV_SPATIAL_PARAMS_HH
27#warning "This file is deprecated, use FVElasticSpatialParams from dumux/geomechanics/elastic/fvspatialparams.hh instead!"
31#include <dune/common/exceptions.hh>
41template<
class GlobalPosition>
42struct hasLameParamsAtPos
44 template<
class SpatialParams>
45 auto operator()(
const SpatialParams& a)
46 ->
decltype(a.lameParamsAtPos(std::declval<GlobalPosition>()))
57template<
class Scalar,
class Gr
idGeometry,
class Implementation>
59[[deprecated(
"Use FVElasticSpatialParams from dumux/geomechanics/elastic/fvspatialparams.hh instead. This class will be removed after 3.5.")]]
62 using FVElementGeometry =
typename GridGeometry::LocalView;
63 using SubControlVolume =
typename GridGeometry::SubControlVolume;
64 using GridView =
typename GridGeometry::GridView;
65 using Element =
typename GridView::template Codim<0>::Entity;
66 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
68 enum { dimWorld = GridView::dimensionworld };
73 : gridGeometry_(gridGeometry)
76 const bool enableGravity = getParam<bool>(
"Problem.EnableGravity");
78 gravity_[dimWorld-1] = -9.81;
91 const GlobalPosition&
gravity(
const GlobalPosition &pos)
const
104 template<
class Sol
idSystem,
class ElementSolution>
106 const SubControlVolume& scv,
107 const ElementSolution& elemSol,
110 static_assert(SolidSystem::isInert(),
"Elastic model can only be used with inert solid systems");
113 if (SolidSystem::numInertComponents == 1)
117 return asImp_().template inertVolumeFractionAtPos<SolidSystem>(scv.center(), compIdx);
128 template<
class Sol
idSystem>
130 { DUNE_THROW(Dune::InvalidStateException,
"The spatial parameters do not provide inertVolumeFractionAtPos() method."); }
145 template<
class ElemVolVars,
class FluxVarsCache>
147 const FVElementGeometry& fvGeometry,
148 const ElemVolVars& elemVolVars,
149 const FluxVarsCache& fluxVarsCache)
const
151 static_assert(
decltype(
isValid(Detail::hasLameParamsAtPos<GlobalPosition>())(this->asImp_()))::value,
" \n\n"
152 " Your spatial params class has to either implement\n\n"
153 " const LameParams& lameParamsAtPos(const GlobalPosition& globalPos) const\n\n"
154 " or overload this function\n\n"
155 " template<class ElementSolution>\n"
156 " const LameParams& lameParams(const Element& element,\n"
157 " const FVElementGeometry& fvGeometry,\n"
158 " const ElemVolVars& elemVolVars,\n"
159 " const FluxVarsCache& fluxVarsCache) const\n\n");
161 return asImp_().lameParamsAtPos(fluxVarsCache.ipGlobal());
166 {
return *gridGeometry_; }
170 {
return *
static_cast<Implementation*
>(
this); }
173 {
return *
static_cast<const Implementation*
>(
this); }
176 std::shared_ptr<const GridGeometry> gridGeometry_;
177 GlobalPosition gravity_;
A helper function for class member function introspection.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
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 linear elastic geomechanical problems.
Definition: fvelastic.hh:61
const Implementation & asImp_() const
Definition: fvelastic.hh:172
decltype(auto) lameParams(const Element &element, const FVElementGeometry &fvGeometry, const ElemVolVars &elemVolVars, const FluxVarsCache &fluxVarsCache) const
Define the Lame parameters.
Definition: fvelastic.hh:146
Scalar inertVolumeFractionAtPos(const GlobalPosition &globalPos, int compIdx) const
Function for defining the solid volume fraction. That is possibly solution dependent.
Definition: fvelastic.hh:129
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: fvelastic.hh:165
Scalar inertVolumeFraction(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol, int compIdx) const
Function for defining the solid volume fraction. That is possibly solution dependent.
Definition: fvelastic.hh:105
Implementation & asImp_()
Definition: fvelastic.hh:169
FVSpatialParamsElastic(std::shared_ptr< const GridGeometry > gridGeometry)
The constructor.
Definition: fvelastic.hh:72
const GlobalPosition & gravity(const GlobalPosition &pos) const
Returns the acceleration due to gravity .
Definition: fvelastic.hh:91