Added check to prevent segfaults for unsupported welltypes

This commit is contained in:
T.D. (Tongdong) Qiu 2020-03-19 16:06:49 +01:00
parent 947f419ef8
commit 7f3f03f63d

View File

@ -936,7 +936,11 @@ namespace Opm {
for(unsigned int i = 0; i < well_container_.size(); i++){
auto& well = well_container_[i];
std::shared_ptr<StandardWell<TypeTag> > derived = std::dynamic_pointer_cast<StandardWell<TypeTag> >(well);
derived->addWellContribution(wellContribs);
if (derived) {
derived->addWellContribution(wellContribs);
} else {
OpmLog::warning("Warning only StandardWell is supported by WellContributions for GPU");
}
}
}
#endif