mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use old style traits class approach to check for face tag support.
Old version failed due to a gcc compiler bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77446 with error: "non-constant condition for static assertion"
This commit is contained in:
parent
7a42a82c55
commit
924bf5ed19
@ -44,10 +44,36 @@
|
||||
#include <opm/material/densead/Math.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <type_traits>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
template<class Grid>
|
||||
class SupportsFaceTag
|
||||
: public std::bool_constant<false>
|
||||
{};
|
||||
|
||||
|
||||
template<>
|
||||
class SupportsFaceTag<Dune::CpGrid>
|
||||
: public std::bool_constant<true>
|
||||
{};
|
||||
|
||||
|
||||
template<>
|
||||
class SupportsFaceTag<Dune::PolyhedralGrid<3, 3>>
|
||||
: public std::bool_constant<true>
|
||||
{};
|
||||
|
||||
#if HAVE_DUNE_ALUGRID
|
||||
template<>
|
||||
class SupportsFaceTag<Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>>
|
||||
: public std::bool_constant<true>
|
||||
{};
|
||||
#endif
|
||||
|
||||
|
||||
/// Class for handling the blackoil well model.
|
||||
template <typename TypeTag>
|
||||
class BlackoilAquiferModel
|
||||
@ -55,13 +81,6 @@ class BlackoilAquiferModel
|
||||
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
|
||||
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
||||
|
||||
constexpr bool supportsFaceTag(const Dune::CpGrid&){ return true;}
|
||||
constexpr bool supportsFaceTag(const Dune::PolyhedralGrid<3, 3>&){ return true;}
|
||||
#if HAVE_DUNE_ALUGRID
|
||||
constexpr bool supportsFaceTag(const Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>&){ return true;}
|
||||
#endif
|
||||
template<class G>
|
||||
constexpr bool supportsFaceTag(const G&){ return false;}
|
||||
|
||||
public:
|
||||
explicit BlackoilAquiferModel(Simulator& simulator);
|
||||
|
@ -26,7 +26,8 @@ BlackoilAquiferModel<TypeTag>::BlackoilAquiferModel(Simulator& simulator)
|
||||
: simulator_(simulator)
|
||||
{
|
||||
// Grid needs to support Facetag
|
||||
assert(supportsFaceTag(simulator.vanguard().grid()));
|
||||
using Grid = std::remove_const_t<std::remove_reference_t<decltype(simulator.vanguard().grid())>>;
|
||||
static_assert(SupportsFaceTag<Grid>::value, "Grid has to support assumptions about face tag.");
|
||||
|
||||
init();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user