mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Ensemble Surface improvements
* Performance : Improve surface import * Performance: Use opm when importing files * Surface : Use the triangle size as basis for the maximum search distance * Performance : Resample surfaces in parallell * Performance: Import file surfaces in parallell * Ensemble Surface : Create one ensemble per surface
This commit is contained in:
@@ -84,7 +84,7 @@ void RicCreateEnsembleSurfaceFeature::openDialogAndExecuteCommand()
|
||||
|
||||
if ( propertyDialog.exec() == QDialog::Accepted )
|
||||
{
|
||||
executeCommand( *ui, result.files.toStdList() );
|
||||
executeCommand( *ui, result.files.toVector().toStdVector() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,19 +92,32 @@ void RicCreateEnsembleSurfaceFeature::openDialogAndExecuteCommand()
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateEnsembleSurfaceFeature::executeCommand( const RicCreateEnsembleSurfaceUi& ui,
|
||||
const std::list<QString>& fileNames )
|
||||
const std::vector<QString>& fileNames )
|
||||
{
|
||||
std::vector layers = ui.layers();
|
||||
|
||||
caf::ProgressInfo progress( fileNames.size(), "Generating ensemble surface" );
|
||||
|
||||
QStringList allSurfaceFileNames;
|
||||
for ( auto fileName : fileNames )
|
||||
|
||||
auto fileCount = static_cast<int>( fileNames.size() );
|
||||
#pragma omp parallel for
|
||||
for ( int i = 0; i < fileCount; i++ )
|
||||
{
|
||||
auto task = progress.task( QString( "Extracting surfaces for %1" ).arg( fileName ) );
|
||||
auto [isOk, surfaceFileNames] = RimcCommandRouter_extractSurfaces::extractSurfaces( fileName, layers );
|
||||
if ( isOk ) allSurfaceFileNames << surfaceFileNames;
|
||||
auto fileName = fileNames[i];
|
||||
|
||||
// Not possible to use structured bindings here due to a bug in clang
|
||||
auto surfaceResult = RimcCommandRouter_extractSurfaces::extractSurfaces( fileName, layers );
|
||||
auto isOk = surfaceResult.first;
|
||||
auto surfaceFileNames = surfaceResult.second;
|
||||
|
||||
#pragma omp critical( RicCreateEnsembleSurfaceFeature )
|
||||
{
|
||||
auto task = progress.task( QString( "Extracting surfaces for %1" ).arg( fileName ) );
|
||||
if ( isOk ) allSurfaceFileNames << surfaceFileNames;
|
||||
}
|
||||
}
|
||||
progress.setProgress( fileNames.size() );
|
||||
|
||||
if ( ui.autoCreateEnsembleSurfaces() )
|
||||
RicImportEnsembleSurfaceFeature::importEnsembleSurfaceFromFiles( allSurfaceFileNames );
|
||||
|
||||
Reference in New Issue
Block a user