removed common_state.
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
#include "common_state.hpp"
|
||||
|
||||
|
||||
SunbeamState::SunbeamState(bool file_input, const std::string& deck_input, const Opm::ParseContext& context, const Opm::Parser& parser)
|
||||
: deck(file_input
|
||||
? parser.parseFile(deck_input, context, guard)
|
||||
: parser.parseString(deck_input, context, guard)),
|
||||
ecl_state(deck, context, guard),
|
||||
schedule(deck, ecl_state, context, guard),
|
||||
summary_config(deck, schedule, ecl_state.getTableManager(), context, guard)
|
||||
{
|
||||
guard.clear();
|
||||
}
|
||||
|
||||
|
||||
SunbeamState::SunbeamState(bool file_input, const std::string& deck_input) :
|
||||
SunbeamState(file_input, deck_input, Opm::ParseContext(), Opm::Parser())
|
||||
{}
|
||||
|
||||
|
||||
SunbeamState::SunbeamState(bool file_input, const std::string& deck_input, const Opm::ParseContext& context) :
|
||||
SunbeamState(file_input, deck_input, context, Opm::Parser())
|
||||
{}
|
||||
|
||||
|
||||
const Opm::EclipseState& SunbeamState::getEclipseState() const {
|
||||
return this->ecl_state;
|
||||
}
|
||||
|
||||
const Opm::Deck& SunbeamState::getDeck() const {
|
||||
return this->deck;
|
||||
}
|
||||
|
||||
const Opm::Schedule SunbeamState::getSchedule() const {
|
||||
return this->schedule;
|
||||
}
|
||||
|
||||
const Opm::SummaryConfig SunbeamState::getSummmaryConfig() const {
|
||||
return this->summary_config;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#include <opm/json/JsonObject.hpp>
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
|
||||
|
||||
|
||||
class SunbeamState {
|
||||
public:
|
||||
SunbeamState(bool file_input, const std::string& deck_input);
|
||||
SunbeamState(bool file_input, const std::string& deck_input, const Opm::ParseContext& context);
|
||||
SunbeamState(bool file_input, const std::string& deck_input, const Opm::ParseContext& context, const Opm::Parser& parser);
|
||||
|
||||
const Opm::EclipseState& getEclipseState() const;
|
||||
const Opm::Deck& getDeck() const;
|
||||
const Opm::Schedule getSchedule() const;
|
||||
const Opm::SummaryConfig getSummmaryConfig() const;
|
||||
|
||||
private:
|
||||
Opm::ErrorGuard guard;
|
||||
Opm::Deck deck;
|
||||
Opm::EclipseState ecl_state;
|
||||
Opm::Schedule schedule;
|
||||
Opm::SummaryConfig summary_config;
|
||||
};
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <pybind11/stl.h>
|
||||
|
||||
#include "common_state.hpp"
|
||||
#include "export.hpp"
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <pybind11/stl.h>
|
||||
|
||||
#include "common_state.hpp"
|
||||
#include "export.hpp"
|
||||
|
||||
|
||||
@@ -33,15 +32,6 @@ namespace {
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
SunbeamState * parse_file(const std::string& filename, const ParseContext& context, const Parser& parser) {
|
||||
return new SunbeamState(true, filename, context, parser);
|
||||
}
|
||||
|
||||
SunbeamState * parse_string(const std::string& filename, const ParseContext& context, const Parser& parser) {
|
||||
return new SunbeamState(false, filename, context, parser);
|
||||
}
|
||||
|
||||
void add_keyword(Parser* parser, const std::string& json_string) {
|
||||
const Json::JsonObject keyword(json_string);
|
||||
parser->addParserKeyword(keyword);
|
||||
@@ -51,8 +41,6 @@ namespace {
|
||||
|
||||
void python::common::export_Parser(py::module& module) {
|
||||
|
||||
module.def( "parse", parse_file );
|
||||
module.def( "parse_string", parse_string);
|
||||
module.def( "create_deck", &create_deck );
|
||||
module.def( "create_deck_string", &create_deck_string);
|
||||
|
||||
@@ -61,13 +49,6 @@ void python::common::export_Parser(py::module& module) {
|
||||
.def_property_readonly("name", &ParserKeyword::getName);
|
||||
|
||||
|
||||
py::class_<SunbeamState>(module, "SunbeamState")
|
||||
.def("_schedule", &SunbeamState::getSchedule, ref_internal)
|
||||
.def("_state", &SunbeamState::getEclipseState, ref_internal)
|
||||
.def("_deck", &SunbeamState::getDeck, ref_internal)
|
||||
.def("_summary_config", &SunbeamState::getSummmaryConfig, ref_internal);
|
||||
|
||||
|
||||
py::class_<Parser>(module, "Parser")
|
||||
.def(py::init<>())
|
||||
.def("parse", py::overload_cast<const std::string&>(&Parser::parseFile, py::const_))
|
||||
|
||||
@@ -42,7 +42,6 @@ ext_modules = [
|
||||
'cxx/parsecontext.cpp',
|
||||
'cxx/parser.cpp',
|
||||
'cxx/schedule.cpp',
|
||||
'cxx/common_state.cpp',
|
||||
'cxx/table_manager.cpp',
|
||||
'cxx/well.cpp',
|
||||
'cxx/export.cpp'
|
||||
|
||||
Reference in New Issue
Block a user