diff --git a/opm/core/GridManager.cpp b/opm/core/GridManager.cpp index d286e504..528e2e12 100644 --- a/opm/core/GridManager.cpp +++ b/opm/core/GridManager.cpp @@ -97,6 +97,20 @@ namespace Opm + /// Construct a grid from an input file. + /// The file format used is currently undocumented, + /// and is therefore only suited for internal use. + GridManager::GridManager(const std::string& input_filename) + { + ug_ = read_grid(input_filename.c_str()); + if (!ug_) { + THROW("Failed to read grid from file " << input_filename); + } + } + + + + /// Destructor. GridManager::~GridManager() { diff --git a/opm/core/GridManager.hpp b/opm/core/GridManager.hpp index 26e335f2..36846f2c 100644 --- a/opm/core/GridManager.hpp +++ b/opm/core/GridManager.hpp @@ -20,6 +20,7 @@ #ifndef OPM_GRIDMANAGER_HEADER_INCLUDED #define OPM_GRIDMANAGER_HEADER_INCLUDED +#include struct UnstructuredGrid; @@ -53,6 +54,11 @@ namespace Opm GridManager(int nx, int ny, int nz, double dx, double dy, double dz); + /// Construct a grid from an input file. + /// The file format used is currently undocumented, + /// and is therefore only suited for internal use. + GridManager(const std::string& input_filename); + /// Destructor. ~GridManager();