Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
0b52e405
Commit
0b52e405
authored
Nov 28, 2017
by
Simon Scholz
Browse files
[tpfa][cc] add static assert and cast for PermeabilityType+TODO for later
parent
04bdcfed
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/cellcentered/tpfa/darcyslaw.hh
View file @
0b52e405
...
...
@@ -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
();
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment