#7117 Fix stale data when reimporting elastic properties

This commit is contained in:
Kristian Bendiksen 2021-02-19 16:25:51 +01:00 committed by Magne Sjaastad
parent f12a3ed1ba
commit 8ce01c098a
3 changed files with 14 additions and 0 deletions

View File

@ -87,6 +87,11 @@ void RicElasticPropertiesImportTools::importElasticPropertiesFromFile( const QSt
RimElasticProperties* rimElasticProperties = stimPlanModelTemplate->elasticProperties();
if ( !rimElasticProperties ) rimElasticProperties = new RimElasticProperties;
// Clear the properties to avoid keeping data which has been deleted
// from the file since the last import.
rimElasticProperties->clearProperties();
for ( FaciesKey key : faciesKeys )
{
std::vector<RifElasticProperties> matchingFacies;

View File

@ -108,6 +108,14 @@ const RigElasticProperties& RimElasticProperties::propertiesForFacies( FaciesKey
return m_properties.find( key )->second;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimElasticProperties::clearProperties()
{
m_properties.clear();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -52,6 +52,7 @@ public:
void setPropertiesForFacies( FaciesKey& key, const RigElasticProperties& properties );
bool hasPropertiesForFacies( FaciesKey& key ) const;
const RigElasticProperties& propertiesForFacies( FaciesKey& key ) const;
void clearProperties();
void loadDataAndUpdate();