remove parsecontext in generic vanguard

not used
This commit is contained in:
Arne Morten Kvarving 2022-06-14 10:51:13 +02:00
parent 4087fbff5b
commit 36ffb65525
2 changed files with 0 additions and 77 deletions

View File

@ -36,7 +36,6 @@
#include <opm/input/eclipse/Schedule/SummaryState.hpp> #include <opm/input/eclipse/Schedule/SummaryState.hpp>
#include <opm/input/eclipse/Schedule/UDQ/UDQState.hpp> #include <opm/input/eclipse/Schedule/UDQ/UDQState.hpp>
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp> #include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Python/Python.hpp> #include <opm/input/eclipse/Python/Python.hpp>
#include <dune/common/version.hh> #include <dune/common/version.hh>
@ -53,7 +52,6 @@ namespace Opm {
double EclGenericVanguard::setupTime_ = 0.0; double EclGenericVanguard::setupTime_ = 0.0;
std::shared_ptr<Deck> EclGenericVanguard::deck_; std::shared_ptr<Deck> EclGenericVanguard::deck_;
std::unique_ptr<ParseContext> EclGenericVanguard::externalParseContext_;
std::shared_ptr<EclipseState> EclGenericVanguard::eclState_; std::shared_ptr<EclipseState> EclGenericVanguard::eclState_;
std::shared_ptr<Schedule> EclGenericVanguard::eclSchedule_; std::shared_ptr<Schedule> EclGenericVanguard::eclSchedule_;
std::shared_ptr<SummaryConfig> EclGenericVanguard::eclSummaryConfig_; std::shared_ptr<SummaryConfig> EclGenericVanguard::eclSummaryConfig_;
@ -69,11 +67,6 @@ EclGenericVanguard::EclGenericVanguard()
EclGenericVanguard::~EclGenericVanguard() = default; EclGenericVanguard::~EclGenericVanguard() = default;
void EclGenericVanguard::setExternalParseContext(std::unique_ptr<ParseContext> parseContext)
{
externalParseContext_ = std::move(parseContext);
}
void EclGenericVanguard::setSchedule(std::shared_ptr<Schedule> schedule) void EclGenericVanguard::setSchedule(std::shared_ptr<Schedule> schedule)
{ {
eclSchedule_ = std::move(schedule); eclSchedule_ = std::move(schedule);
@ -156,40 +149,6 @@ std::string EclGenericVanguard::canonicalDeckPath(const std::string& caseName)
throw std::invalid_argument("Cannot find input case '"+caseName+"'"); throw std::invalid_argument("Cannot find input case '"+caseName+"'");
} }
std::unique_ptr<ParseContext> EclGenericVanguard::createParseContext(const std::string& ignoredKeywords,
bool eclStrictParsing)
{
typedef std::pair<std::string, InputError::Action> ParseModePair;
typedef std::vector<ParseModePair> ParseModePairs;
ParseModePairs tmp;
tmp.emplace_back(ParseContext::PARSE_RANDOM_SLASH, InputError::IGNORE);
tmp.emplace_back(ParseContext::PARSE_MISSING_DIMS_KEYWORD, InputError::WARN);
tmp.emplace_back(ParseContext::SUMMARY_UNKNOWN_WELL, InputError::WARN);
tmp.emplace_back(ParseContext::SUMMARY_UNKNOWN_GROUP, InputError::WARN);
tmp.emplace_back(ParseContext::PARSE_EXTRA_RECORDS, InputError::WARN);
auto parseContext = std::make_unique<ParseContext>(tmp);
if (!ignoredKeywords.empty()) {
size_t pos;
size_t offset = 0;
while (true) {
pos = ignoredKeywords.find(':', offset);
if (pos == std::string::npos) {
parseContext->ignoreKeyword(ignoredKeywords.substr(offset));
break;
}
parseContext->ignoreKeyword(ignoredKeywords.substr(offset, pos - offset));
offset = pos + 1;
}
}
if (eclStrictParsing)
parseContext->update(InputError::DELAYED_EXIT1);
return parseContext;
}
void EclGenericVanguard::updateOutputDir_(std::string outputDir, void EclGenericVanguard::updateOutputDir_(std::string outputDir,
bool enableEclCompatFile) bool enableEclCompatFile)
{ {
@ -251,29 +210,6 @@ void EclGenericVanguard::init()
std::transform(caseName_.begin(), caseName_.end(), caseName_.begin(), ::toupper); std::transform(caseName_.begin(), caseName_.end(), caseName_.begin(), ::toupper);
} }
// Check that we are in one of the known configurations for external variables
// and move them to internal
if (true)
{
if (externalParseContext_ )
{
parseContext_ = std::move(externalParseContext_);
}
else
{
OPM_THROW(std::logic_error, "Either parse context and error guard or ECL state, schedule, and summary config need to be"
<< " set externally.");
}
}
else if (externalParseContext_)
{
parseContext_ = std::move(externalParseContext_);
}
else
{
parseContext_ = createParseContext(ignoredKeywords_, eclStrictParsing_);
}
if (EclGenericVanguard::externalUDQState_) if (EclGenericVanguard::externalUDQState_)
this->udqState_ = std::move(EclGenericVanguard::externalUDQState_); this->udqState_ = std::move(EclGenericVanguard::externalUDQState_);
else else

View File

@ -87,12 +87,6 @@ public:
*/ */
static std::string canonicalDeckPath(const std::string& caseName); static std::string canonicalDeckPath(const std::string& caseName);
/*!
* \brief Creates an Opm::parseContext object assuming that the parameters are ready.
*/
static std::unique_ptr<ParseContext> createParseContext(const std::string& ignoredKeywords,
bool eclStrictParsing);
/*! /*!
* \brief Set the wall time which was spend externally to set up the external data structures * \brief Set the wall time which was spend externally to set up the external data structures
* *
@ -107,11 +101,6 @@ public:
static double setupTime() static double setupTime()
{ return setupTime_; } { return setupTime_; }
/*!
* \brief Set the Opm::ParseContext object which ought to be used for parsing the deck and creating the Opm::EclipseState object.
*/
static void setExternalParseContext(std::unique_ptr<ParseContext> parseContext);
/*! /*!
* \brief Set the Opm::Deck object which ought to be used when the simulator vanguard * \brief Set the Opm::Deck object which ought to be used when the simulator vanguard
* is instantiated. * is instantiated.
@ -300,7 +289,6 @@ protected:
void init(); void init();
static double setupTime_; static double setupTime_;
static std::unique_ptr<ParseContext> externalParseContext_;
// These variables may be owned by both Python and the simulator // These variables may be owned by both Python and the simulator
static std::unique_ptr<UDQState> externalUDQState_; static std::unique_ptr<UDQState> externalUDQState_;
@ -338,7 +326,6 @@ protected:
// these attributes point either to the internal or to the external version of the // these attributes point either to the internal or to the external version of the
// parser objects. // parser objects.
std::unique_ptr<ParseContext> parseContext_;
std::shared_ptr<Python> python; std::shared_ptr<Python> python;
// These variables may be owned by both Python and the simulator // These variables may be owned by both Python and the simulator
static std::shared_ptr<Deck> deck_; static std::shared_ptr<Deck> deck_;