Initial version of schedule handling more or less complete.
This commit is contained in:
parent
78e9a8f6fa
commit
174ab7cd6e
@ -446,6 +446,15 @@ void EclipseGridParser::readImpl(istream& is)
|
||||
special_field_by_epoch_.push_back(SpecialMap());
|
||||
++current_epoch_;
|
||||
ASSERT(int(special_field_by_epoch_.size()) == current_epoch_ + 1);
|
||||
// Add clones of all existing special fields to new map.
|
||||
SpecialMap& oldmap = special_field_by_epoch_[current_epoch_ - 1];
|
||||
SpecialMap& newmap = special_field_by_epoch_[current_epoch_];
|
||||
for (SpecialMap::iterator it = oldmap.begin(); it != oldmap.end(); ++it) {
|
||||
// if (it->first != "TSTEP") {
|
||||
newmap[it->first] = cloneSpecialField(it->first, it->second);
|
||||
//}
|
||||
}
|
||||
//ASSERT(newmap.count("TSTEP") == 0);
|
||||
}
|
||||
// Check if the keyword already exists. If so, append. Otherwise, create new.
|
||||
SpecialMap::iterator it = special_field_by_epoch_[current_epoch_].find(keyword);
|
||||
@ -703,6 +712,18 @@ EclipseGridParser::createSpecialField(std::istream& is,
|
||||
return spec_ptr;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
std::tr1::shared_ptr<SpecialBase>
|
||||
EclipseGridParser::cloneSpecialField(const std::string& fieldname,
|
||||
const std::tr1::shared_ptr<SpecialBase> original)
|
||||
//---------------------------------------------------------------------------
|
||||
{
|
||||
string ukey = upcase(fieldname);
|
||||
std::tr1::shared_ptr<SpecialBase> spec_ptr
|
||||
= Factory<SpecialBase>::cloneObject(fieldname, original);
|
||||
return spec_ptr;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
void EclipseGridParser::setIntegerField(const std::string& keyword,
|
||||
|
@ -193,6 +193,8 @@ public:
|
||||
|
||||
private:
|
||||
SpecialFieldPtr createSpecialField(std::istream& is, const std::string& fieldname);
|
||||
SpecialFieldPtr cloneSpecialField(const std::string& fieldname,
|
||||
const std::tr1::shared_ptr<SpecialBase> original);
|
||||
void readImpl(std::istream& is);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user