mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #960 from dr-robertk/PR/flow_ebos_polyhedral
Allow to run flow_ebos with PolyhedralGrid (UnstructuredGrid)
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include <opm/core/grid/GridManager.hpp>
|
||||
|
||||
#if HAVE_OPM_GRID
|
||||
#include <dune/grid/polyhedralgrid.hh>
|
||||
#include <dune/grid/CpGrid.hpp>
|
||||
#endif
|
||||
|
||||
@@ -68,6 +69,30 @@ namespace Opm
|
||||
|
||||
|
||||
#if HAVE_OPM_GRID
|
||||
/// Specialization for PolyhedralGrid.
|
||||
template < int dim, int dimworld >
|
||||
class GridInit< Dune::PolyhedralGrid< dim, dimworld > >
|
||||
{
|
||||
public:
|
||||
typedef Dune::PolyhedralGrid< dim, dimworld > Grid;
|
||||
/// Initialize from a deck and/or an eclipse state and (logical cartesian) specified pore volumes.
|
||||
GridInit(const EclipseState& eclipse_state, const std::vector<double>& porv)
|
||||
: grid_manager_(eclipse_state.getInputGrid(), porv),
|
||||
grid_( *grid_manager_.c_grid() )
|
||||
{
|
||||
}
|
||||
|
||||
/// Access the created grid.
|
||||
const Grid& grid()
|
||||
{
|
||||
return grid_;
|
||||
}
|
||||
private:
|
||||
GridManager grid_manager_;
|
||||
Grid grid_;
|
||||
};
|
||||
|
||||
|
||||
/// Specialization for CpGrid.
|
||||
template <>
|
||||
class GridInit<Dune::CpGrid>
|
||||
|
||||
@@ -105,8 +105,8 @@ namespace Opm
|
||||
virtual const WellStateFullyImplicitBlackoil& globalWellState() const { return *wellState_; }
|
||||
virtual bool isIORank () const { return true; }
|
||||
virtual bool isParallel () const { return false; }
|
||||
virtual int numCells() const { return grid_.number_of_cells; }
|
||||
virtual const int* globalCell() const { return grid_.global_cell; }
|
||||
virtual int numCells() const { return Opm::AutoDiffGrid::numCells(grid_); }
|
||||
virtual const int* globalCell() const { return Opm::AutoDiffGrid::globalCell(grid_); }
|
||||
};
|
||||
|
||||
#if HAVE_OPM_GRID
|
||||
|
||||
Reference in New Issue
Block a user