diff --git a/opm/autodiff/GridHelpers.hpp b/opm/autodiff/GridHelpers.hpp index 64d2c895b..00563edb5 100644 --- a/opm/autodiff/GridHelpers.hpp +++ b/opm/autodiff/GridHelpers.hpp @@ -35,6 +35,7 @@ #ifdef HAVE_DUNE_CORNERPOINT #include #include +#include #endif #include @@ -68,7 +69,7 @@ struct ADCell2FacesTraits /// \brief extracts the internal faces of a grid. /// \param[in] The grid whose internal faces we query. /// \param[out] internal_faces The internal faces. -/// \param[out] nbi +/// \param[out] nbi void extractInternalFaces(const UnstructuredGrid& grid, Eigen::Array& internal_faces, Eigen::Array& nbi); @@ -97,7 +98,7 @@ struct ADCell2FacesTraits /// \brief extracts the internal faces of a grid. /// \param[in] The grid whose internal faces we query. /// \param[out] internal_faces The internal faces. -/// \param[out] nbi +/// \param[out] nbi void extractInternalFaces(const Dune::CpGrid& grid, Eigen::Array& internal_faces, Eigen::Array& nbi); @@ -142,6 +143,16 @@ struct ADFaceCellTraits typedef Eigen::Array Type; }; +#ifdef HAVE_DUNE_CORNERPOINT +// specialization for PolyhedralGrid as a fallback to UnstructuredGrid +template< int dim, int dimworld > +struct ADFaceCellTraits< Dune::PolyhedralGrid< dim, dimworld > > + : public ADFaceCellTraits +{ +}; +#endif + + /// \brief Get the face to cell mapping of a grid. ADFaceCellTraits::Type faceCellsToEigen(const UnstructuredGrid& grid);