19 #ifndef OPM_PARSER_START_WRAPPER_HPP
20 #define OPM_PARSER_START_WRAPPER_HPP
24 #include <boost/date_time/gregorian/gregorian.hpp>
37 int day = keyword->getRecord(0)->getItem(0)->getInt(0);
38 std::string month = keyword->getRecord(0)->getItem(1)->getString(0);
39 int year = keyword->getRecord(0)->getItem(2)->getInt(0);
44 else if (month ==
"FEB")
46 else if (month ==
"MAR")
48 else if (month ==
"APR")
50 else if (month ==
"MAY")
52 else if (month ==
"JUN")
54 else if (month ==
"JUL")
56 else if (month ==
"AUG")
58 else if (month ==
"SEP")
60 else if (month ==
"OCT")
62 else if (month ==
"NOV")
64 else if (month ==
"DEC")
67 throw std::runtime_error(
"Invalid month specified for START keyword");
69 m_startDate = boost::gregorian::date(year, monthNum, day);
76 {
return m_startDate; }
79 boost::gregorian::date m_startDate;
83 #endif // OPM_PARSER_START_KEYWORD_HPP
std::shared_ptr< const DeckKeyword > DeckKeywordConstPtr
Definition: DeckKeyword.hpp:71
Definition: StartWrapper.hpp:29
const double day
Definition: ConversionFactors.hpp:101
const double year
Definition: ConversionFactors.hpp:102
const boost::gregorian::date & getStartDate() const
Return calendar date at which the simulation starts.
Definition: StartWrapper.hpp:75
StartWrapper(Opm::DeckKeywordConstPtr keyword)
A wrapper class to provide convenient access to the data exposed by the 'START' keyword.
Definition: StartWrapper.hpp:35