add check for gridType

This commit is contained in:
Tor Harald Sandve 2020-12-11 15:33:25 +01:00
parent 6cf91e7f19
commit 7a42a82c55
2 changed files with 17 additions and 0 deletions

View File

@ -35,6 +35,12 @@
#include <opm/simulators/aquifers/AquiferCarterTracy.hpp>
#include <opm/simulators/aquifers/AquiferFetkovich.hpp>
#include <opm/grid/CpGrid.hpp>
#include <opm/grid/polyhedralgrid.hh>
#if HAVE_DUNE_ALUGRID
#include <dune/alugrid/grid.hh>
#endif
#include <opm/material/densead/Math.hpp>
#include <vector>
@ -49,6 +55,14 @@ 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);

View File

@ -25,6 +25,9 @@ template <typename TypeTag>
BlackoilAquiferModel<TypeTag>::BlackoilAquiferModel(Simulator& simulator)
: simulator_(simulator)
{
// Grid needs to support Facetag
assert(supportsFaceTag(simulator.vanguard().grid()));
init();
}