mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 23:46:00 -06:00
Enable starting FaultRA processing from 3d view (#7801)
This commit is contained in:
parent
0825fa10ac
commit
66b2b50a1d
@ -14,6 +14,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseTimeStepFilterFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewFaultReactAssessmentFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessmentFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessmentFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.h
|
||||
)
|
||||
|
||||
@ -31,7 +33,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseTimeStepFilterFeature.cpp
|
||||
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewFaultReactAssessmentFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessmentFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessmentFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.cpp
|
||||
)
|
||||
|
||||
|
@ -0,0 +1,46 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicRunAdvFaultReactAssessment3dFeature.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicRunAdvFaultReactAssessment3dFeature, "RicRunAdvFaultReactAssessment3dFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunAdvFaultReactAssessment3dFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
QVariant userData = this->userData();
|
||||
if ( userData.isNull() || userData.type() != QVariant::String ) return;
|
||||
|
||||
QString faultName = userData.toString();
|
||||
|
||||
int faultID = faultIDFromName( faultName );
|
||||
if ( faultID >= 0 ) runAdvancedProcessing( selectedFaultID() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunAdvFaultReactAssessment3dFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/fault_react_24x24.png" ) );
|
||||
actionToSetup->setText( "Run Advanced Processing" );
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RicRunBasicFaultReactAssessment3dFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicRunAdvFaultReactAssessment3dFeature : public RicRunBasicFaultReactAssessment3dFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
@ -18,38 +18,10 @@
|
||||
|
||||
#include "RicRunAdvFaultReactAssessmentFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaEclipseFileNameTools.h"
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
#include "RiaPreferencesGeoMech.h"
|
||||
#include "RiaResultNames.h"
|
||||
|
||||
#include "RifFaultRAJsonWriter.h"
|
||||
#include "RifFaultRAXmlWriter.h"
|
||||
|
||||
#include "RimEclipseInputCase.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFaultInView.h"
|
||||
#include "RimFaultInViewCollection.h"
|
||||
#include "RimFaultRAPreprocSettings.h"
|
||||
#include "RimFaultRASettings.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimProcess.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
#include "RiuFileDialogTools.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cafSelectionManagerTools.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QMessageBox>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicRunAdvFaultReactAssessmentFeature, "RicRunAdvFaultReactAssessmentFeature" );
|
||||
|
||||
@ -62,7 +34,7 @@ bool RicRunAdvFaultReactAssessmentFeature::isCommandEnabled()
|
||||
|
||||
if ( faultColl )
|
||||
{
|
||||
return ( faultColl->faultRAEnabled() && faultColl->faultRASettings()->geomechCase() != nullptr );
|
||||
return faultColl->faultRAAdvancedEnabled();
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -73,75 +45,7 @@ bool RicRunAdvFaultReactAssessmentFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunAdvFaultReactAssessmentFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimFaultInViewCollection* coll = faultCollection();
|
||||
if ( coll == nullptr ) return;
|
||||
|
||||
RimFaultRASettings* fraSettings = coll->faultRASettings();
|
||||
if ( fraSettings == nullptr ) return;
|
||||
|
||||
int faultID = selectedFaultID();
|
||||
caf::ProgressInfo runProgress( 3, "Running Advanced Fault RA processing, please wait..." );
|
||||
|
||||
runProgress.setProgressDescription( "Macris calibrate command." );
|
||||
QString paramfilename = fraSettings->basicParameterXMLFilename( faultID );
|
||||
|
||||
RifFaultRAXmlWriter xmlwriter( fraSettings );
|
||||
QString outErrorText;
|
||||
if ( !xmlwriter.writeCalculateFile( paramfilename, faultID, outErrorText ) )
|
||||
{
|
||||
QMessageBox::warning( nullptr,
|
||||
"Fault Reactivation Assessment Processing",
|
||||
"Unable to write parameter file! " + outErrorText );
|
||||
return;
|
||||
}
|
||||
|
||||
QString paramfilename2 = fraSettings->advancedParameterXMLFilename( faultID );
|
||||
if ( !xmlwriter.writeCalibrateFile( paramfilename2, faultID, outErrorText ) )
|
||||
{
|
||||
QMessageBox::warning( nullptr,
|
||||
"Fault Reactivation Assessment Processing",
|
||||
"Unable to write calibrate parameter file! " + outErrorText );
|
||||
return;
|
||||
}
|
||||
|
||||
addParameterFileForCleanUp( paramfilename );
|
||||
addParameterFileForCleanUp( paramfilename2 );
|
||||
|
||||
// remove any existing database file
|
||||
removeFile( fraSettings->advancedMacrisDatabase() );
|
||||
|
||||
// run the java macris program in calibrate mode
|
||||
QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand();
|
||||
QStringList parameters = fraSettings->advancedMacrisParameters( faultID );
|
||||
|
||||
RimProcess process;
|
||||
process.setCommand( command );
|
||||
process.setParameters( parameters );
|
||||
if ( !process.execute() )
|
||||
{
|
||||
QMessageBox::critical( nullptr,
|
||||
"Advanced Fault Reactivation Assessment Processing",
|
||||
"Failed to run Macris calibrate command. Check log window for additional information." );
|
||||
cleanUpParameterFiles();
|
||||
return;
|
||||
}
|
||||
|
||||
runProgress.incrementProgress();
|
||||
|
||||
runProgress.setProgressDescription( "Generating surface results." );
|
||||
|
||||
if ( runPostProcessing( faultID, fraSettings ) )
|
||||
{
|
||||
runProgress.incrementProgress();
|
||||
|
||||
runProgress.setProgressDescription( "Importing surface results." );
|
||||
|
||||
// reload output surfaces
|
||||
reloadSurfaces( fraSettings );
|
||||
}
|
||||
|
||||
// delete parameter files
|
||||
cleanUpParameterFiles();
|
||||
runAdvancedProcessing( selectedFaultID() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -0,0 +1,75 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicRunBasicFaultReactAssessment3dFeature.h"
|
||||
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFaultInViewCollection.h"
|
||||
#include "RimFaultRASettings.h"
|
||||
#include "RimGridView.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QVariant>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicRunBasicFaultReactAssessment3dFeature, "RicRunBasicFaultReactAssessment3dFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicRunBasicFaultReactAssessment3dFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunBasicFaultReactAssessment3dFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
QVariant userData = this->userData();
|
||||
if ( userData.isNull() || userData.type() != QVariant::String ) return;
|
||||
|
||||
QString faultName = userData.toString();
|
||||
|
||||
int faultID = faultIDFromName( faultName );
|
||||
if ( faultID >= 0 ) runBasicProcessing( faultID );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunBasicFaultReactAssessment3dFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/fault_react_24x24.png" ) );
|
||||
actionToSetup->setText( "Run Basic Processing" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFaultInViewCollection* RicRunBasicFaultReactAssessment3dFeature::faultCollection()
|
||||
{
|
||||
RimGridView* viewOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
|
||||
RimEclipseView* theView = dynamic_cast<RimEclipseView*>( viewOrComparisonView );
|
||||
|
||||
CAF_ASSERT( theView );
|
||||
|
||||
return theView->faultCollection();
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RicRunFaultReactAssessmentFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicRunBasicFaultReactAssessment3dFeature : public RicRunFaultReactAssessmentFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
RimFaultInViewCollection* faultCollection() override;
|
||||
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
@ -18,38 +18,10 @@
|
||||
|
||||
#include "RicRunBasicFaultReactAssessmentFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaEclipseFileNameTools.h"
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
#include "RiaPreferencesGeoMech.h"
|
||||
#include "RiaResultNames.h"
|
||||
|
||||
#include "RifFaultRAJsonWriter.h"
|
||||
#include "RifFaultRAXmlWriter.h"
|
||||
|
||||
#include "RimEclipseInputCase.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFaultInView.h"
|
||||
#include "RimFaultInViewCollection.h"
|
||||
#include "RimFaultRAPreprocSettings.h"
|
||||
#include "RimFaultRASettings.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimProcess.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
#include "RiuFileDialogTools.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cafSelectionManagerTools.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QMessageBox>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicRunBasicFaultReactAssessmentFeature, "RicRunBasicFaultReactAssessmentFeature" );
|
||||
|
||||
@ -72,67 +44,7 @@ bool RicRunBasicFaultReactAssessmentFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunBasicFaultReactAssessmentFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimFaultInViewCollection* coll = faultCollection();
|
||||
if ( coll == nullptr ) return;
|
||||
|
||||
RimFaultRASettings* fraSettings = coll->faultRASettings();
|
||||
if ( fraSettings == nullptr ) return;
|
||||
|
||||
int faultID = selectedFaultID();
|
||||
caf::ProgressInfo runProgress( 3, "Running Basic Fault RA processing, please wait..." );
|
||||
|
||||
{
|
||||
runProgress.setProgressDescription( "Macris calculate command." );
|
||||
QString paramfilename = fraSettings->basicParameterXMLFilename( faultID );
|
||||
|
||||
RifFaultRAXmlWriter xmlwriter( fraSettings );
|
||||
QString outErrorText;
|
||||
if ( !xmlwriter.writeCalculateFile( paramfilename, faultID, outErrorText ) )
|
||||
{
|
||||
QMessageBox::warning( nullptr,
|
||||
"Fault Reactivation Assessment Processing",
|
||||
"Unable to write parameter file! " + outErrorText );
|
||||
return;
|
||||
}
|
||||
|
||||
addParameterFileForCleanUp( paramfilename );
|
||||
|
||||
// remove any existing database file
|
||||
removeFile( fraSettings->basicMacrisDatabase() );
|
||||
|
||||
// run the java macris program in calculate mode
|
||||
QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand();
|
||||
QStringList parameters = fraSettings->basicMacrisParameters( faultID );
|
||||
|
||||
RimProcess process;
|
||||
process.setCommand( command );
|
||||
process.setParameters( parameters );
|
||||
if ( !process.execute() )
|
||||
{
|
||||
QMessageBox::critical( nullptr,
|
||||
"Basic Fault Reactivation Assessment Processing",
|
||||
"Failed to run Macris calculate command. Check log window for additional "
|
||||
"information." );
|
||||
cleanUpParameterFiles();
|
||||
return;
|
||||
}
|
||||
|
||||
runProgress.incrementProgress();
|
||||
}
|
||||
|
||||
runProgress.setProgressDescription( "Generating surface results." );
|
||||
|
||||
if ( runPostProcessing( faultID, fraSettings ) )
|
||||
{
|
||||
runProgress.incrementProgress();
|
||||
|
||||
runProgress.setProgressDescription( "Importing surface results." );
|
||||
|
||||
// reload output surfaces
|
||||
reloadSurfaces( fraSettings );
|
||||
}
|
||||
// delete parameter files
|
||||
cleanUpParameterFiles();
|
||||
runBasicProcessing( selectedFaultID() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "RiaResultNames.h"
|
||||
|
||||
#include "RifFaultRAJsonWriter.h"
|
||||
#include "RifFaultRAXmlWriter.h"
|
||||
|
||||
#include "RimEclipseInputCase.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
@ -83,6 +84,27 @@ RimFaultInViewCollection* RicRunFaultReactAssessmentFeature::faultCollection()
|
||||
return faultColl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RicRunFaultReactAssessmentFeature::faultIDFromName( QString faultName ) const
|
||||
{
|
||||
int retval = -1;
|
||||
|
||||
QString lookFor = RiaResultNames::faultReactAssessmentPrefix();
|
||||
QString name = faultName;
|
||||
if ( !name.startsWith( lookFor ) ) return retval;
|
||||
|
||||
name = name.mid( lookFor.length() );
|
||||
if ( name.size() == 0 ) return retval;
|
||||
|
||||
bool bOK;
|
||||
retval = name.toInt( &bOK );
|
||||
if ( !bOK ) retval = -1;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -92,16 +114,7 @@ int RicRunFaultReactAssessmentFeature::selectedFaultID()
|
||||
RimFaultInView* selObj = dynamic_cast<RimFaultInView*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( selObj )
|
||||
{
|
||||
QString lookFor = RiaResultNames::faultReactAssessmentPrefix();
|
||||
QString name = selObj->name();
|
||||
if ( !name.startsWith( lookFor ) ) return retval;
|
||||
|
||||
name = name.mid( lookFor.length() );
|
||||
if ( name.size() == 0 ) return retval;
|
||||
|
||||
bool bOK;
|
||||
retval = name.toInt( &bOK );
|
||||
if ( !bOK ) retval = -1;
|
||||
return faultIDFromName( selObj->name() );
|
||||
}
|
||||
|
||||
return retval;
|
||||
@ -234,3 +247,145 @@ void RicRunFaultReactAssessmentFeature::reloadSurfaces( RimFaultRASettings* sett
|
||||
// import the new surfaces
|
||||
surfColl->importSurfacesFromFiles( newFiles, showLegendInView );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunFaultReactAssessmentFeature::runBasicProcessing( int faultID )
|
||||
{
|
||||
RimFaultInViewCollection* coll = faultCollection();
|
||||
if ( coll == nullptr ) return;
|
||||
|
||||
RimFaultRASettings* fraSettings = coll->faultRASettings();
|
||||
if ( fraSettings == nullptr ) return;
|
||||
|
||||
caf::ProgressInfo runProgress( 3, "Running Basic Fault RA processing, please wait..." );
|
||||
|
||||
{
|
||||
runProgress.setProgressDescription( "Macris calculate command." );
|
||||
QString paramfilename = fraSettings->basicParameterXMLFilename( faultID );
|
||||
|
||||
RifFaultRAXmlWriter xmlwriter( fraSettings );
|
||||
QString outErrorText;
|
||||
if ( !xmlwriter.writeCalculateFile( paramfilename, faultID, outErrorText ) )
|
||||
{
|
||||
QMessageBox::warning( nullptr,
|
||||
"Fault Reactivation Assessment Processing",
|
||||
"Unable to write parameter file! " + outErrorText );
|
||||
return;
|
||||
}
|
||||
|
||||
addParameterFileForCleanUp( paramfilename );
|
||||
|
||||
// remove any existing database file
|
||||
removeFile( fraSettings->basicMacrisDatabase() );
|
||||
|
||||
// run the java macris program in calculate mode
|
||||
QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand();
|
||||
QStringList parameters = fraSettings->basicMacrisParameters( faultID );
|
||||
|
||||
RimProcess process;
|
||||
process.setCommand( command );
|
||||
process.setParameters( parameters );
|
||||
if ( !process.execute() )
|
||||
{
|
||||
QMessageBox::critical( nullptr,
|
||||
"Basic Fault Reactivation Assessment Processing",
|
||||
"Failed to run Macris calculate command. Check log window for additional "
|
||||
"information." );
|
||||
cleanUpParameterFiles();
|
||||
return;
|
||||
}
|
||||
|
||||
runProgress.incrementProgress();
|
||||
}
|
||||
|
||||
runProgress.setProgressDescription( "Generating surface results." );
|
||||
|
||||
if ( runPostProcessing( faultID, fraSettings ) )
|
||||
{
|
||||
runProgress.incrementProgress();
|
||||
|
||||
runProgress.setProgressDescription( "Importing surface results." );
|
||||
|
||||
// reload output surfaces
|
||||
reloadSurfaces( fraSettings );
|
||||
}
|
||||
// delete parameter files
|
||||
cleanUpParameterFiles();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunFaultReactAssessmentFeature::runAdvancedProcessing( int faultID )
|
||||
{
|
||||
RimFaultInViewCollection* coll = faultCollection();
|
||||
if ( coll == nullptr ) return;
|
||||
|
||||
RimFaultRASettings* fraSettings = coll->faultRASettings();
|
||||
if ( fraSettings == nullptr ) return;
|
||||
|
||||
caf::ProgressInfo runProgress( 3, "Running Advanced Fault RA processing, please wait..." );
|
||||
|
||||
runProgress.setProgressDescription( "Macris calibrate command." );
|
||||
QString paramfilename = fraSettings->basicParameterXMLFilename( faultID );
|
||||
|
||||
RifFaultRAXmlWriter xmlwriter( fraSettings );
|
||||
QString outErrorText;
|
||||
if ( !xmlwriter.writeCalculateFile( paramfilename, faultID, outErrorText ) )
|
||||
{
|
||||
QMessageBox::warning( nullptr,
|
||||
"Fault Reactivation Assessment Processing",
|
||||
"Unable to write parameter file! " + outErrorText );
|
||||
return;
|
||||
}
|
||||
|
||||
QString paramfilename2 = fraSettings->advancedParameterXMLFilename( faultID );
|
||||
if ( !xmlwriter.writeCalibrateFile( paramfilename2, faultID, outErrorText ) )
|
||||
{
|
||||
QMessageBox::warning( nullptr,
|
||||
"Fault Reactivation Assessment Processing",
|
||||
"Unable to write calibrate parameter file! " + outErrorText );
|
||||
return;
|
||||
}
|
||||
|
||||
addParameterFileForCleanUp( paramfilename );
|
||||
addParameterFileForCleanUp( paramfilename2 );
|
||||
|
||||
// remove any existing database file
|
||||
removeFile( fraSettings->advancedMacrisDatabase() );
|
||||
|
||||
// run the java macris program in calibrate mode
|
||||
QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand();
|
||||
QStringList parameters = fraSettings->advancedMacrisParameters( faultID );
|
||||
|
||||
RimProcess process;
|
||||
process.setCommand( command );
|
||||
process.setParameters( parameters );
|
||||
if ( !process.execute() )
|
||||
{
|
||||
QMessageBox::critical( nullptr,
|
||||
"Advanced Fault Reactivation Assessment Processing",
|
||||
"Failed to run Macris calibrate command. Check log window for additional information." );
|
||||
cleanUpParameterFiles();
|
||||
return;
|
||||
}
|
||||
|
||||
runProgress.incrementProgress();
|
||||
|
||||
runProgress.setProgressDescription( "Generating surface results." );
|
||||
|
||||
if ( runPostProcessing( faultID, fraSettings ) )
|
||||
{
|
||||
runProgress.incrementProgress();
|
||||
|
||||
runProgress.setProgressDescription( "Importing surface results." );
|
||||
|
||||
// reload output surfaces
|
||||
reloadSurfaces( fraSettings );
|
||||
}
|
||||
|
||||
// delete parameter files
|
||||
cleanUpParameterFiles();
|
||||
}
|
||||
|
@ -34,8 +34,10 @@ class RicRunFaultReactAssessmentFeature : public caf::CmdFeature
|
||||
protected:
|
||||
RicRunFaultReactAssessmentFeature();
|
||||
|
||||
RimFaultInViewCollection* faultCollection();
|
||||
int selectedFaultID();
|
||||
virtual RimFaultInViewCollection* faultCollection();
|
||||
|
||||
int selectedFaultID();
|
||||
int faultIDFromName( QString faultname ) const;
|
||||
|
||||
RimSurfaceCollection* surfaceCollection();
|
||||
|
||||
@ -47,6 +49,9 @@ protected:
|
||||
|
||||
void removeFile( QString filename );
|
||||
|
||||
void runBasicProcessing( int faultID );
|
||||
void runAdvancedProcessing( int faultID );
|
||||
|
||||
private:
|
||||
std::list<QString> m_parameterFilesToCleanUp;
|
||||
};
|
||||
|
@ -364,6 +364,14 @@ bool RimFaultInViewCollection::faultRAEnabled() const
|
||||
return m_enableFaultRA();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFaultInViewCollection::faultRAAdvancedEnabled() const
|
||||
{
|
||||
return m_enableFaultRA() && ( m_faultRASettings->geomechCase() != nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -64,6 +64,7 @@ public:
|
||||
|
||||
RimFaultRASettings* faultRASettings() const;
|
||||
bool faultRAEnabled() const;
|
||||
bool faultRAAdvancedEnabled() const;
|
||||
void enableFaultRA( bool enable );
|
||||
|
||||
caf::PdmField<bool> showFaultFaces;
|
||||
|
@ -429,15 +429,14 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( mainOrComparisonView );
|
||||
if ( eclipseView )
|
||||
{
|
||||
// Hide faults command
|
||||
// fault commands
|
||||
const RigFault* fault =
|
||||
eclipseView->mainGrid()->findFaultFromCellIndexAndCellFace( m_currentCellIndex, m_currentFaceIndex );
|
||||
if ( fault )
|
||||
{
|
||||
menuBuilder.addSeparator();
|
||||
|
||||
QString faultName = fault->name();
|
||||
|
||||
QString faultName = fault->name();
|
||||
QVariantList hideFaultList;
|
||||
qulonglong currentCellIndex = m_currentCellIndex;
|
||||
hideFaultList.push_back( currentCellIndex );
|
||||
@ -446,6 +445,22 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicEclipseHideFaultFeature",
|
||||
QString( "Hide " ) + faultName,
|
||||
hideFaultList );
|
||||
|
||||
if ( eclipseView->faultCollection() && eclipseView->faultCollection()->faultRAEnabled() )
|
||||
{
|
||||
menuBuilder.subMenuStart( "Reactivation Assessment" );
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicRunBasicFaultReactAssessment3dFeature",
|
||||
"Run Basic Processing",
|
||||
QVariant( fault->name() ) );
|
||||
if ( eclipseView->faultCollection()->faultRAAdvancedEnabled() )
|
||||
{
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicRunAdvFaultReactAssessment3dFeature",
|
||||
"Run Advanced Processing",
|
||||
QVariant( fault->name() ) );
|
||||
}
|
||||
menuBuilder.subMenuEnd();
|
||||
menuBuilder.addSeparator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user