ESmry: use templated function rstep_vector()
This commit is contained in:
parent
f8e793a21a
commit
33ecf4215d
@ -88,6 +88,19 @@ private:
|
||||
std::string lookupKey(const SummaryNode&) const;
|
||||
|
||||
void write_block(std::ostream &, const std::vector<SummaryNode>&) const;
|
||||
|
||||
|
||||
template <typename T>
|
||||
std::vector<T> rstep_vector(const std::vector<T>& full_vector) const {
|
||||
std::vector<T> rstep_vector;
|
||||
rstep_vector.reserve(seqIndex.size());
|
||||
|
||||
for (const auto& ind : seqIndex){
|
||||
rstep_vector.push_back(full_vector[ind]);
|
||||
}
|
||||
|
||||
return rstep_vector;
|
||||
}
|
||||
};
|
||||
|
||||
}} // namespace Opm::EclIO
|
||||
|
@ -565,16 +565,7 @@ const std::vector<float>& ESmry::get(const std::string& name) const
|
||||
|
||||
std::vector<float> ESmry::get_at_rstep(const std::string& name) const
|
||||
{
|
||||
const std::vector<float> full_vector= this->get(name);
|
||||
|
||||
std::vector<float> rstep_vector;
|
||||
rstep_vector.reserve(seqIndex.size());
|
||||
|
||||
for (const auto& ind : seqIndex){
|
||||
rstep_vector.push_back(full_vector[ind]);
|
||||
}
|
||||
|
||||
return rstep_vector;
|
||||
return this->rstep_vector( this->get(name) );
|
||||
}
|
||||
|
||||
int ESmry::timestepIdxAtReportstepStart(const int reportStep) const
|
||||
|
Loading…
Reference in New Issue
Block a user