Beispiel #1
0
    void IOConfig::handleSolutionSection(TimeMapConstPtr timemap, std::shared_ptr<const SOLUTIONSection> solutionSection) {
        if (solutionSection->hasKeyword("RPTRST")) {
            const auto& rptrstkeyword        = solutionSection->getKeyword("RPTRST");
            const auto& record = rptrstkeyword.getRecord(0);
            const auto& item     = record.getItem(0);

            bool handleRptrstBasic = false;
            size_t basic = 0;
            size_t freq  = 0;

            for (size_t index = 0; index < item.size(); ++index) {
                if (item.hasValue(index)) {
                    std::string mnemonics = item.get< std::string >(index);
                    std::size_t found_basic = mnemonics.find("BASIC=");
                    if (found_basic != std::string::npos) {
                        std::string basic_no = mnemonics.substr(found_basic+6, found_basic+7);
                        basic = atoi(basic_no.c_str());
                        handleRptrstBasic = true;
                    }

                    std::size_t found_freq = mnemonics.find("FREQ=");
                    if (found_freq != std::string::npos) {
                        std::string freq_no = mnemonics.substr(found_freq+5, found_freq+6);
                        freq = atoi(freq_no.c_str());
                    }
                }
            }

            if (handleRptrstBasic) {
                size_t currentStep = 0;
                handleRPTRSTBasic(timemap, currentStep, basic, freq, true);
            }


            setWriteInitialRestartFile(true); // Guessing on eclipse rules for write of initial RESTART file (at time 0):
                                              // Write of initial restart file is (due to the eclipse reference manual)
                                              // governed by RPTSOL RESTART in solution section,
                                              // if RPTSOL RESTART > 1 initial restart file is written.
                                              // but - due to initial restart file written from Eclipse
                                              // for data where RPTSOL RESTART not set - guessing that
                                              // when RPTRST is set in SOLUTION (no basic though...) -> write inital restart.

        } //RPTRST


        if (solutionSection->hasKeyword("RPTSOL") && (timemap->size() > 0)) {
            handleRPTSOL(solutionSection->getKeyword("RPTSOL"));
        } //RPTSOL
    }
Beispiel #2
0
    void RestartConfig::handleSolutionSection(const SOLUTIONSection& solutionSection) {
        if (solutionSection.hasKeyword("RPTRST")) {
            const auto& rptrstkeyword        = solutionSection.getKeyword("RPTRST");

            const auto rptrst = RPTRST( rptrstkeyword, {}, 0 );
            this->restart_keywords.updateInitial( rptrst.first );
            this->restart_schedule.updateInitial( rptrst.second );
            setWriteInitialRestartFile(true); // Guessing on eclipse rules for write of initial RESTART file (at time 0):
                                              // Write of initial restart file is (due to the eclipse reference manual)
                                              // governed by RPTSOL RESTART in solution section,
                                              // if RPTSOL RESTART > 1 initial restart file is written.
                                              // but - due to initial restart file written from Eclipse
                                              // for data where RPTSOL RESTART not set - guessing that
                                              // when RPTRST is set in SOLUTION (no basic though...) -> write inital restart.
        } //RPTRST


        if (solutionSection.hasKeyword("RPTSOL") && (m_timemap->size() > 0)) {
            handleRPTSOL(solutionSection.getKeyword("RPTSOL"));
        } //RPTSOL
    }