Commit 0b52e405 authored by Simon Scholz's avatar Simon Scholz
Browse files

[tpfa][cc] add static assert and cast for PermeabilityType+TODO for later

parent 04bdcfed
......@@ -271,7 +271,7 @@ class CCTpfaDarcysLaw<TypeTag, /*isNetwork*/ true>
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
using ElementFluxVarsCache = typename GET_PROP_TYPE(TypeTag, ElementFluxVariablesCache);
using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache);
using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
using Element = typename GridView::template Codim<0>::Entity;
using IndexType = typename GridView::IndexSet::IndexType;
......@@ -437,10 +437,18 @@ public:
// check if we evaluate the permeability in the volume (for discontinuous fields, default)
// or at the scvf center for analytical permeability fields (e.g. convergence studies)
auto getPermeability = [&problem](const VolumeVariables& volVars,
const GlobalPosition& scvfIpGlobal)
const GlobalPosition& scvfIpGlobal) -> typename SpatialParams::PermeabilityType
{
if (GET_PROP_VALUE(TypeTag, EvaluatePermeabilityAtScvfIP))
{
// TODO: Make PermeabilityType a property!!
// We do an implicit cast to permeability type in case EvaluatePermeabilityAtScvfIP is not true so that it compiles
// If it is true make sure that no cast is necessary and the correct return type is specified in the spatial params
static_assert(!GET_PROP_VALUE(TypeTag, EvaluatePermeabilityAtScvfIP)
|| std::is_same<std::decay_t<typename SpatialParams::PermeabilityType>, std::decay_t<decltype(problem.spatialParams().permeabilityAtPos(scvfIpGlobal))>>::value,
"permeabilityAtPos doesn't return PermeabilityType stated in the spatial params!");
return problem.spatialParams().permeabilityAtPos(scvfIpGlobal);
}
else
return volVars.permeability();
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment