mirror of
https://github.com/OPM/opm-upscaling.git
synced 2025-02-25 18:45:23 -06:00
Merge pull request #267 from joakim-hove/error-guard
Remove ParseContext argument
This commit is contained in:
@@ -264,8 +264,7 @@ try
|
||||
Opm::Parser parser;
|
||||
stringstream gridstringstream(stringstream::in | stringstream::out);
|
||||
inflate (eclipseInput, sizeof (eclipseInput) / sizeof (eclipseInput[0]), gridstringstream);
|
||||
Opm::ParseContext mode;
|
||||
auto deck = parser.parseString(gridstringstream.str(), mode);
|
||||
auto deck = parser.parseString(gridstringstream.str());
|
||||
|
||||
finish = clock(); timeused = (double(finish)-double(start))/CLOCKS_PER_SEC;
|
||||
if (helper.isMaster) cout << " (" << timeused <<" secs)" << endl;
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
|
||||
@@ -132,10 +131,9 @@ try
|
||||
std::vector<double> permz;
|
||||
|
||||
|
||||
Opm::ParseContext parseMode;
|
||||
// Original x/y resolution in terms of coordinate values (not indices)
|
||||
Opm::Parser parser;
|
||||
auto deck = parser.parseFile(gridfilename , parseMode); // TODO: REFACTOR!!!! it is stupid to parse this again
|
||||
auto deck = parser.parseFile(gridfilename); // TODO: REFACTOR!!!! it is stupid to parse this again
|
||||
Opm::EclipseGridInspector gridinspector(deck);
|
||||
std::array<double, 6> gridlimits=gridinspector.getGridLimits();
|
||||
double finegridxresolution = (gridlimits[1]-gridlimits[0])/dims[0];
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
|
||||
#include <opm/common/utility/platform_dependent/disable_warnings.h>
|
||||
@@ -210,9 +209,7 @@ try
|
||||
|
||||
auto parser = std::make_shared<Opm::Parser>();
|
||||
|
||||
const Opm::Deck&
|
||||
deck(parser->parseFile(param.get<std::string>("filename"),
|
||||
Opm::ParseContext()));
|
||||
const Opm::Deck& deck(parser->parseFile(param.get<std::string>("filename")));
|
||||
|
||||
// Make a grid
|
||||
Dune::CpGrid grid;
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#endif
|
||||
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
|
||||
#include <opm/common/utility/platform_dependent/reenable_warnings.h>
|
||||
@@ -299,9 +298,8 @@ int run(Params& p)
|
||||
cellsize[2] = p.max[2] > -1?p.max[2]/cells[2]:1.0;
|
||||
grid.createCartesian(cells,cellsize);
|
||||
} else {
|
||||
Opm::ParseContext parseContext;
|
||||
Opm::Parser parser;
|
||||
auto deck = parser.parseFile(p.file , parseContext);
|
||||
auto deck = parser.parseFile(p.file);
|
||||
Opm::EclipseGrid inputGrid(deck);
|
||||
grid.processEclipseFormat(inputGrid, false);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#endif
|
||||
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
|
||||
namespace Opm {
|
||||
namespace Elasticity {
|
||||
@@ -605,8 +604,7 @@ IMPL_FUNC(void, loadMaterialsFromGrid(const std::string& file))
|
||||
Poiss.insert(Poiss.begin(),cells,0.38f);
|
||||
} else {
|
||||
Opm::Parser parser;
|
||||
Opm::ParseContext parseContext;
|
||||
auto deck = parser.parseFile(file , parseContext);
|
||||
auto deck = parser.parseFile(file);
|
||||
if (deck.hasKeyword("YOUNGMOD") && deck.hasKeyword("POISSONMOD")) {
|
||||
Emod = deck.getKeyword("YOUNGMOD").getRawDoubleData();
|
||||
Poiss = deck.getKeyword("POISSONMOD").getRawDoubleData();
|
||||
@@ -766,8 +764,7 @@ IMPL_FUNC(void, loadMaterialsFromRocklist(const std::string& file,
|
||||
}
|
||||
} else {
|
||||
Opm::Parser parser;
|
||||
Opm::ParseContext parseContext;
|
||||
auto deck = parser.parseFile(file , parseContext);
|
||||
auto deck = parser.parseFile(file);
|
||||
std::vector<int> satnum = deck.getKeyword("SATNUM").getIntData();
|
||||
std::vector<int> cells = gv.globalCell();
|
||||
for (size_t i=0;i<cells.size();++i) {
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include <opm/grid/CpGrid.hpp>
|
||||
#include <opm/porsol/common/ReservoirPropertyCapillary.hpp>
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
|
||||
#include <opm/common/utility/platform_dependent/disable_warnings.h>
|
||||
@@ -82,9 +81,8 @@ namespace Opm
|
||||
} else if (fileformat == "eclipse") {
|
||||
std::string ecl_file = param.get<std::string>("filename");
|
||||
|
||||
Opm::ParseContext parseContext;
|
||||
Opm::Parser parser;
|
||||
auto deck = parser.parseFile(ecl_file , parseContext);
|
||||
auto deck = parser.parseFile(ecl_file);
|
||||
if (param.has("z_tolerance")) {
|
||||
std::cerr << "****** Warning: z_tolerance parameter is obsolete, use PINCH in deck input instead\n";
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define OPM_CORNERPOINTCHOPPER_HEADER_INCLUDED
|
||||
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
@@ -41,7 +40,7 @@ namespace Opm
|
||||
{
|
||||
public:
|
||||
CornerPointChopper(const std::string& file) :
|
||||
deck_(Parser{}.parseFile(file, ParseContext{})),
|
||||
deck_(Parser{}.parseFile(file)),
|
||||
metricUnits_(Opm::UnitSystem::newMETRIC())
|
||||
{
|
||||
const auto& specgridRecord = deck_.getKeyword("SPECGRID").getRecord(0);
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#ifndef OPM_UPSCALING_RELPERM_UTILS_HPP
|
||||
#define OPM_UPSCALING_RELPERM_UTILS_HPP
|
||||
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
|
||||
@@ -194,7 +193,7 @@ namespace Opm {
|
||||
auto parser = Parser{};
|
||||
addNonStandardUpscalingKeywords(parser);
|
||||
|
||||
return parser.parseFile(eclipseFileName, ParseContext{});
|
||||
return parser.parseFile(eclipseFileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include <opm/common/ErrorMacros.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
|
||||
#include <opm/grid/CpGrid.hpp>
|
||||
@@ -60,8 +59,7 @@ void Opm::initCPGrid(Dune::CpGrid& grid, const Opm::ParameterGroup& param) {
|
||||
bool periodic_extension = param.getDefault<bool>("periodic_extension", false);
|
||||
bool turn_normals = param.getDefault<bool>("turn_normals", false);
|
||||
Opm::Parser parser;
|
||||
Opm::ParseContext parseContext;
|
||||
auto deck = parser.parseFile(filename, parseContext);
|
||||
auto deck = parser.parseFile(filename);
|
||||
Opm::EclipseGrid inputGrid(deck);
|
||||
grid.processEclipseFormat(inputGrid, periodic_extension , turn_normals );
|
||||
} else if (fileformat == "cartesian") {
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include <opm/upscaling/RelPermUtils.hpp>
|
||||
#undef UNITTEST_TRESPASS_PRIVATE_PROPERTY_DP
|
||||
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
|
||||
@@ -412,7 +411,7 @@ PORO
|
||||
Opm::RelPermUpscaleHelper helper{mpi_rank, options};
|
||||
{
|
||||
auto parse = Opm::Parser{};
|
||||
auto deck = parse.parseString(input, Opm::ParseContext{});
|
||||
auto deck = parse.parseString(input);
|
||||
|
||||
const auto minPerm = 0; // mD
|
||||
const auto maxPerm = 10.0e3; // mD
|
||||
|
||||
Reference in New Issue
Block a user