Added containsNaN() method to GridProperty
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user