本文整理汇总了C++中opm::DeckConstPtr::size方法的典型用法代码示例。如果您正苦于以下问题:C++ DeckConstPtr::size方法的具体用法?C++ DeckConstPtr::size怎么用?C++ DeckConstPtr::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类opm::DeckConstPtr
的用法示例。
在下文中一共展示了DeckConstPtr::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
TimeMap::TimeMap(Opm::DeckConstPtr deck) {
// The default start date is not specified in the Eclipse
// reference manual. We hence just assume it is same as for
// the START keyword for Eclipse R100, i.e., January 1st,
// 1983...
boost::posix_time::ptime startTime(boost::gregorian::date(1983, 1, 1));
// use the 'START' keyword to find out the start date (if the
// keyword was specified)
if (deck->hasKeyword("START")) {
Opm::DeckKeywordConstPtr keyword = deck->getKeyword("START");
startTime = timeFromEclipse(keyword->getRecord(/*index=*/0));
}
m_timeList.push_back( startTime );
// find all "TSTEP" and "DATES" keywords in the deck and deal
// with them one after another
size_t numKeywords = deck->size();
for (size_t keywordIdx = 0; keywordIdx < numKeywords; ++keywordIdx) {
Opm::DeckKeywordConstPtr keyword = deck->getKeyword(keywordIdx);
// We're only interested in "TSTEP" and "DATES" keywords,
// so we ignore everything else here...
if (keyword->name() != "TSTEP" &&
keyword->name() != "DATES")
{
continue;
}
if (keyword->name() == "TSTEP")
addFromTSTEPKeyword(keyword);
else if (keyword->name() == "DATES")
addFromDATESKeyword(keyword);
}
}