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
c78873f9
Commit
c78873f9
authored
Mar 09, 2021
by
Dennis Gläser
Browse files
[experimental][gridvars] add helper boolean
parent
6ed456c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/fvgridvariables.hh
View file @
c78873f9
...
...
@@ -173,7 +173,10 @@ private:
// Experimental implementation of new grid variables layout //
//////////////////////////////////////////////////////////////
#include <utility>
#include <dumux/common/typetraits/isvalid.hh>
#include <dumux/common/typetraits/problem.hh>
#include <dumux/discretization/localview.hh>
#include <dumux/discretization/gridvariables.hh>
...
...
@@ -374,6 +377,23 @@ private:
GridFluxVariablesCache
gridFluxVarsCache_
;
//!< the flux variables cache
};
namespace
Detail
{
struct
hasGridVolVars
{
template
<
class
GV
>
auto
operator
()(
const
GV
&
gv
)
->
decltype
(
gv
.
gridVolVars
())
{}
};
}
// end namespace Detail
// helper bool to check if a grid variables type fulfills the new experimental interface
// can be used in the transition period in places where both interfaces should be supported
// Note that this doesn't check if the provided type actually models grid variables. Instead,
// it is assumed that that is known, and it is only checked if the new or old behaviour can be
// expected from it.
template
<
class
GridVariables
>
inline
constexpr
bool
areExperimentalGridVars
=
decltype
(
isValid
(
Detail
::
hasGridVolVars
())(
std
::
declval
<
GridVariables
>
()))
::
value
;
}
// end namespace Dumux::Experimental
#endif
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