Added containsNaN() method to GridProperty

This commit is contained in:
Joakim Hove
2014-09-27 13:51:09 +02:00
parent b26475031c
commit e8c5176f1b
3 changed files with 39 additions and 0 deletions

View File

@@ -32,4 +32,25 @@ void GridProperty<double>::setDataPoint(size_t sourceIdx, size_t targetIdx, Opm:
m_data[targetIdx] = deckItem->getSIDouble(sourceIdx);
}
template<>
bool GridProperty<double>::containsNaN( ) {
bool return_value = false;
size_t size = m_data.size();
size_t index = 0;
while (true) {
if (std::isnan(m_data[index])) {
return_value = true;
break;
}
index++;
if (index == size)
break;
}
return return_value;
}
}