mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve fault reactivation file names (#11005)
Use model name in exported file name. Add model name to include file names.
This commit is contained in:
parent
544e6974e7
commit
daae1e6e05
@ -376,3 +376,22 @@ bool RiaFilePathTools::isFirstOlderThanSecond( const std::string& firstFileName,
|
||||
|
||||
return ( timeFirstFile < timeSecondFile );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RiaFilePathTools::makeSuitableAsFileName( const std::string candidateName )
|
||||
{
|
||||
if ( candidateName.empty() ) return "noname";
|
||||
|
||||
QString tmp = QString::fromStdString( candidateName );
|
||||
|
||||
tmp.replace( ' ', '_' );
|
||||
tmp.replace( '/', '_' );
|
||||
tmp.replace( '\\', '_' );
|
||||
tmp.replace( ':', '_' );
|
||||
tmp.replace( '&', '_' );
|
||||
tmp.replace( '|', '_' );
|
||||
|
||||
return tmp.toStdString();
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ public:
|
||||
static QString removeDuplicatePathSeparators( const QString& path );
|
||||
static QString rootSearchPathFromSearchFilter( const QString& searchFilter );
|
||||
static QString commonRootOfFileNames( const QStringList& filePaths );
|
||||
static std::string makeSuitableAsFileName( const std::string candidateName );
|
||||
|
||||
static QStringList splitPathIntoComponents( const QString& path, bool splitExtensionIntoSeparateEntry = false );
|
||||
|
||||
|
@ -48,13 +48,13 @@ void RicExportInpFileFeature::onActionTriggered( bool isChecked )
|
||||
auto faultReactivationModel = caf::SelectionManager::instance()->selectedItemOfType<RimFaultReactivationModel>();
|
||||
if ( faultReactivationModel )
|
||||
{
|
||||
QString exportFile = faultReactivationModel->baseDir() + "/faultreactivation.inp";
|
||||
auto [isOk, errorMessage] = RifFaultReactivationModelExporter::exportToFile( exportFile.toStdString(), *faultReactivationModel );
|
||||
auto [isOk, errorMessage] = RifFaultReactivationModelExporter::exportToFile( *faultReactivationModel );
|
||||
if ( !isOk )
|
||||
{
|
||||
const QString frmTitle( "Fault Reactivation Modeling" );
|
||||
QString outErrorText =
|
||||
QString( "Failed to export INP model to file %1.\n\n%2" ).arg( exportFile ).arg( QString::fromStdString( errorMessage ) );
|
||||
QString outErrorText = QString( "Failed to export INP model to file %1.\n\n%2" )
|
||||
.arg( QString::fromStdString( faultReactivationModel->inputFilename() ) )
|
||||
.arg( QString::fromStdString( errorMessage ) );
|
||||
QMessageBox::critical( nullptr, frmTitle, outErrorText );
|
||||
}
|
||||
}
|
||||
|
@ -62,13 +62,13 @@ void RicRunFaultReactModelingFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
runProgress.setProgressDescription( "Writing input files." );
|
||||
|
||||
QString exportFile = model->inputFilename();
|
||||
auto [result, errText] = RifFaultReactivationModelExporter::exportToFile( exportFile.toStdString(), *model );
|
||||
auto [result, errText] = RifFaultReactivationModelExporter::exportToFile( *model );
|
||||
|
||||
if ( !result )
|
||||
{
|
||||
QString outErrorText =
|
||||
QString( "Failed to export INP model to file %1.\n\n%2" ).arg( exportFile ).arg( QString::fromStdString( errText ) );
|
||||
QString outErrorText = QString( "Failed to export INP model to file %1.\n\n%2" )
|
||||
.arg( QString::fromStdString( model->inputFilename() ) )
|
||||
.arg( QString::fromStdString( errText ) );
|
||||
QMessageBox::critical( nullptr, frmTitle, outErrorText );
|
||||
return;
|
||||
}
|
||||
@ -107,7 +107,7 @@ void RicRunFaultReactModelingFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
for ( auto gCase : RimProject::current()->geoMechCases() )
|
||||
{
|
||||
if ( model->outputOdbFilename() == gCase->gridFileName() )
|
||||
if ( QString::fromStdString( model->outputOdbFilename() ) == gCase->gridFileName() )
|
||||
{
|
||||
gCase->reloadDataAndUpdate();
|
||||
auto& views = gCase->geoMechViews();
|
||||
@ -124,11 +124,11 @@ void RicRunFaultReactModelingFeature::onActionTriggered( bool isChecked )
|
||||
}
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
if ( !app->openOdbCaseFromFile( model->outputOdbFilename() ) )
|
||||
if ( !app->openOdbCaseFromFile( QString::fromStdString( model->outputOdbFilename() ) ) )
|
||||
{
|
||||
QMessageBox::critical( nullptr,
|
||||
frmTitle,
|
||||
"Failed to load modeling results from file \"" + model->outputOdbFilename() +
|
||||
"Failed to load modeling results from file \"" + QString::fromStdString( model->outputOdbFilename() ) +
|
||||
"\". Check log window for additional information." );
|
||||
}
|
||||
}
|
||||
|
@ -54,9 +54,9 @@ void RicShowFaultReactModelFeature::onActionTriggered( bool isChecked )
|
||||
if ( model == nullptr ) return;
|
||||
|
||||
const QString frmTitle( "Fault Reactivation Modeling" );
|
||||
const QString exportFile = model->inputFilename();
|
||||
|
||||
auto [result, errText] = RifFaultReactivationModelExporter::exportToFile( exportFile.toStdString(), *model );
|
||||
auto exportFile = QString::fromStdString( model->inputFilename() );
|
||||
auto [result, errText] = RifFaultReactivationModelExporter::exportToFile( *model );
|
||||
if ( !result )
|
||||
{
|
||||
QString outErrorText =
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaBaseDefs.h"
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaVersionInfo.h"
|
||||
#include "RiaWellLogUnitTools.h"
|
||||
|
||||
@ -41,9 +42,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream( std::ostream& stream,
|
||||
const std::string& exportDirectory,
|
||||
const RimFaultReactivationModel& rimModel )
|
||||
std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream( std::ostream& stream, const RimFaultReactivationModel& rimModel )
|
||||
{
|
||||
auto [modelOk, errorMsg] = rimModel.validateModel();
|
||||
if ( !modelOk ) return { false, errorMsg };
|
||||
@ -102,17 +101,18 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream(
|
||||
auto model = rimModel.model();
|
||||
CAF_ASSERT( !model.isNull() );
|
||||
|
||||
const std::string basePath = rimModel.baseFilePath();
|
||||
|
||||
std::vector<std::function<std::pair<bool, std::string>()>> methods = {
|
||||
[&]() { return printHeading( stream, applicationNameAndVersion ); },
|
||||
[&]() { return printParts( stream, *model, partNames, borders, faces, boundaries, materialNames ); },
|
||||
[&]() { return printAssembly( stream, *model, partNames, model->modelLocalNormalsXY() ); },
|
||||
[&]()
|
||||
{
|
||||
return printMaterials( stream, rimModel, materialNames, *dataAccess, exportDirectory, partNames, useGridDensity, useGridElasticProperties );
|
||||
[&]() {
|
||||
return printMaterials( stream, rimModel, materialNames, *dataAccess, basePath, partNames, useGridDensity, useGridElasticProperties );
|
||||
},
|
||||
[&]() { return printInteractionProperties( stream, faultFriction ); },
|
||||
[&]() { return printBoundaryConditions( stream, *model, partNames, boundaries ); },
|
||||
[&]() { return printPredefinedFields( stream, *model, *dataAccess, exportDirectory, partNames, useGridVoidRatio, useGridStress ); },
|
||||
[&]() { return printPredefinedFields( stream, *model, *dataAccess, basePath, partNames, useGridVoidRatio, useGridStress ); },
|
||||
[&]() { return printInteractions( stream, partNames, borders ); },
|
||||
[&]()
|
||||
{
|
||||
@ -121,7 +121,7 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream(
|
||||
*dataAccess,
|
||||
partNames,
|
||||
rimModel.selectedTimeSteps(),
|
||||
exportDirectory,
|
||||
basePath,
|
||||
useGridPorePressure,
|
||||
useGridTemperature,
|
||||
seaWaterLoad );
|
||||
@ -140,14 +140,10 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToFile( const std::string& filePath,
|
||||
const RimFaultReactivationModel& model )
|
||||
std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToFile( const RimFaultReactivationModel& model )
|
||||
{
|
||||
std::filesystem::path p( filePath );
|
||||
std::string exportDirectory = p.parent_path().generic_string();
|
||||
|
||||
std::ofstream stream( filePath );
|
||||
return exportToStream( stream, exportDirectory, model );
|
||||
std::ofstream stream( model.inputFilename() );
|
||||
return exportToStream( stream, model );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -311,7 +307,7 @@ std::pair<bool, std::string>
|
||||
const RimFaultReactivationModel& rimModel,
|
||||
const std::map<RimFaultReactivation::ElementSets, std::string>& materialNames,
|
||||
const RimFaultReactivationDataAccess& dataAccess,
|
||||
const std::string& exportDirectory,
|
||||
const std::string& exportBasePath,
|
||||
const std::map<RimFaultReactivation::GridPart, std::string>& partNames,
|
||||
bool densityFromGrid,
|
||||
bool elasticPropertiesFromGrid )
|
||||
@ -381,10 +377,9 @@ std::pair<bool, std::string>
|
||||
if ( densityFromGrid )
|
||||
{
|
||||
// Export the density to a separate inp file
|
||||
std::string tableName = "DENSITY";
|
||||
std::string fileName = tableName + ".inp";
|
||||
|
||||
std::string filePath = createFilePath( exportDirectory, fileName );
|
||||
std::string tableName = "DENSITY";
|
||||
std::string fullPath = exportBasePath + "_" + tableName + ".inp";
|
||||
auto [filePath, fileName] = RiaFilePathTools::toFolderAndFileName( QString::fromStdString( fullPath ) );
|
||||
|
||||
auto model = rimModel.model();
|
||||
bool isOk = writePropertiesToFile( *model,
|
||||
@ -392,21 +387,21 @@ std::pair<bool, std::string>
|
||||
{ RimFaultReactivation::Property::Density },
|
||||
{ "DENSITY" },
|
||||
0,
|
||||
filePath,
|
||||
fullPath,
|
||||
partNames,
|
||||
tableName,
|
||||
", 1." );
|
||||
if ( !isOk ) return { false, "Failed to create density file." };
|
||||
|
||||
RifInpExportTools::printHeading( stream, "INCLUDE, input=" + fileName );
|
||||
RifInpExportTools::printHeading( stream, "INCLUDE, input=" + fileName.toStdString() );
|
||||
}
|
||||
|
||||
if ( elasticPropertiesFromGrid )
|
||||
{
|
||||
// Export the elastic properties to a separate inp file
|
||||
std::string tableName = "ELASTICS";
|
||||
std::string fileName = tableName + ".inp";
|
||||
std::string filePath = createFilePath( exportDirectory, fileName );
|
||||
std::string tableName = "ELASTICS";
|
||||
std::string fullPath = exportBasePath + "_" + tableName + ".inp";
|
||||
auto [filePath, fileName] = RiaFilePathTools::toFolderAndFileName( QString::fromStdString( fullPath ) );
|
||||
|
||||
auto model = rimModel.model();
|
||||
bool isOk = writePropertiesToFile( *model,
|
||||
@ -414,13 +409,13 @@ std::pair<bool, std::string>
|
||||
{ RimFaultReactivation::Property::YoungsModulus, RimFaultReactivation::Property::PoissonsRatio },
|
||||
{ "MODULUS", "RATIO" },
|
||||
0,
|
||||
filePath,
|
||||
fullPath,
|
||||
partNames,
|
||||
tableName,
|
||||
", 2." );
|
||||
if ( !isOk ) return { false, "Failed to create elastic properties file." };
|
||||
|
||||
RifInpExportTools::printHeading( stream, "INCLUDE, input=" + fileName );
|
||||
RifInpExportTools::printHeading( stream, "INCLUDE, input=" + fileName.toStdString() );
|
||||
}
|
||||
|
||||
return { true, "" };
|
||||
@ -505,7 +500,7 @@ std::pair<bool, std::string>
|
||||
RifFaultReactivationModelExporter::printPredefinedFields( std::ostream& stream,
|
||||
const RigFaultReactivationModel& model,
|
||||
const RimFaultReactivationDataAccess& dataAccess,
|
||||
const std::string& exportDirectory,
|
||||
const std::string& exportBasePath,
|
||||
const std::map<RimFaultReactivation::GridPart, std::string>& partNames,
|
||||
bool voidRatioFromEclipse,
|
||||
bool stressFromGrid )
|
||||
@ -539,28 +534,26 @@ std::pair<bool, std::string>
|
||||
|
||||
if ( voidRatioFromEclipse )
|
||||
{
|
||||
std::string ratioName = "RATIO";
|
||||
|
||||
// Export the ratio to a separate inp file for each step
|
||||
std::string fileName = ratioName + ".inp";
|
||||
std::string filePath = createFilePath( exportDirectory, fileName );
|
||||
std::string ratioName = "RATIO";
|
||||
std::string fullPath = exportBasePath + "_" + ratioName + ".inp";
|
||||
auto [filePath, fileName] = RiaFilePathTools::toFolderAndFileName( QString::fromStdString( fullPath ) );
|
||||
|
||||
// Use void ratio from first time step
|
||||
size_t timeStep = 0;
|
||||
bool isOk = writePropertyToFile( model, dataAccess, RimFaultReactivation::Property::VoidRatio, timeStep, filePath, partNames, "" );
|
||||
bool isOk = writePropertyToFile( model, dataAccess, RimFaultReactivation::Property::VoidRatio, timeStep, fullPath, partNames, "" );
|
||||
if ( !isOk ) return { false, "Failed to create " + ratioName + " file." };
|
||||
|
||||
RifInpExportTools::printHeading( stream, "Initial Conditions, TYPE=" + ratioName );
|
||||
RifInpExportTools::printHeading( stream, "INCLUDE, input=" + fileName );
|
||||
RifInpExportTools::printHeading( stream, "INCLUDE, input=" + fileName.toStdString() );
|
||||
}
|
||||
|
||||
if ( stressFromGrid )
|
||||
{
|
||||
std::string stressName = "STRESS";
|
||||
|
||||
// Export the stress to a separate inp file
|
||||
std::string fileName = stressName + ".inp";
|
||||
std::string filePath = createFilePath( exportDirectory, fileName );
|
||||
std::string stressName = "STRESS";
|
||||
std::string fullPath = exportBasePath + "_" + stressName + ".inp";
|
||||
auto [filePath, fileName] = RiaFilePathTools::toFolderAndFileName( QString::fromStdString( fullPath ) );
|
||||
|
||||
// Use stress from first time step
|
||||
size_t timeStep = 0;
|
||||
@ -574,7 +567,7 @@ std::pair<bool, std::string>
|
||||
RimFaultReactivation::Property::LateralStressComponentY },
|
||||
{},
|
||||
timeStep,
|
||||
filePath,
|
||||
fullPath,
|
||||
partNames,
|
||||
"",
|
||||
"" );
|
||||
@ -582,7 +575,7 @@ std::pair<bool, std::string>
|
||||
if ( !isOk ) return { false, "Failed to create " + stressName + " file." };
|
||||
|
||||
RifInpExportTools::printHeading( stream, "Initial Conditions, TYPE=" + stressName );
|
||||
RifInpExportTools::printHeading( stream, "INCLUDE, input=" + fileName );
|
||||
RifInpExportTools::printHeading( stream, "INCLUDE, input=" + fileName.toStdString() );
|
||||
}
|
||||
|
||||
return { true, "" };
|
||||
@ -596,7 +589,7 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::printSteps( std:
|
||||
const RimFaultReactivationDataAccess& dataAccess,
|
||||
const std::map<RimFaultReactivation::GridPart, std::string>& partNames,
|
||||
const std::vector<QDateTime>& timeSteps,
|
||||
const std::string& exportDirectory,
|
||||
const std::string& exportBasePath,
|
||||
bool useGridPorePressure,
|
||||
bool useGridTemperature,
|
||||
double seaWaterLoad )
|
||||
@ -637,15 +630,16 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::printSteps( std:
|
||||
RifInpExportTools::printSectionComment( stream, "BOUNDARY CONDITIONS" );
|
||||
|
||||
// Export the pore pressure to a separate inp file for each step
|
||||
std::string fileName = createFileName( "PORE_PRESSURE", stepName );
|
||||
std::string filePath = createFilePath( exportDirectory, fileName );
|
||||
std::string postfix = createFilePostfix( "PORE_PRESSURE", stepName );
|
||||
std::string fullPath = exportBasePath + postfix;
|
||||
auto [filePath, fileName] = RiaFilePathTools::toFolderAndFileName( QString::fromStdString( fullPath ) );
|
||||
|
||||
bool isOk =
|
||||
writePropertyToFile( model, dataAccess, RimFaultReactivation::Property::PorePressure, i, filePath, partNames, "8, 8, " );
|
||||
writePropertyToFile( model, dataAccess, RimFaultReactivation::Property::PorePressure, i, fullPath, partNames, "8, 8, " );
|
||||
if ( !isOk ) return { false, "Failed to create pore pressure file." };
|
||||
|
||||
RifInpExportTools::printHeading( stream, "Boundary, type=displacement" );
|
||||
RifInpExportTools::printHeading( stream, "INCLUDE, input=" + fileName );
|
||||
RifInpExportTools::printHeading( stream, "INCLUDE, input=" + fileName.toStdString() );
|
||||
}
|
||||
|
||||
if ( useGridTemperature )
|
||||
@ -653,14 +647,15 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::printSteps( std:
|
||||
RifInpExportTools::printSectionComment( stream, "TEMPERATURE" );
|
||||
|
||||
// Export the temperature to a separate inp file for each step
|
||||
std::string fileName = createFileName( "TEMPERATURE", stepName );
|
||||
std::string filePath = createFilePath( exportDirectory, fileName );
|
||||
std::string postfix = createFilePostfix( "TEMPERATURE", stepName );
|
||||
std::string fullPath = exportBasePath + postfix;
|
||||
auto [filePath, fileName] = RiaFilePathTools::toFolderAndFileName( QString::fromStdString( fullPath ) );
|
||||
|
||||
bool isOk = writePropertyToFile( model, dataAccess, RimFaultReactivation::Property::Temperature, i, filePath, partNames, "" );
|
||||
bool isOk = writePropertyToFile( model, dataAccess, RimFaultReactivation::Property::Temperature, i, fullPath, partNames, "" );
|
||||
if ( !isOk ) return { false, "Failed to create temperature file." };
|
||||
|
||||
RifInpExportTools::printHeading( stream, "Temperature" );
|
||||
RifInpExportTools::printHeading( stream, "INCLUDE, input=" + fileName );
|
||||
RifInpExportTools::printHeading( stream, "INCLUDE, input=" + fileName.toStdString() );
|
||||
}
|
||||
|
||||
RifInpExportTools::printSectionComment( stream, "OUTPUT REQUESTS" );
|
||||
@ -804,17 +799,9 @@ std::pair<bool, std::string>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RifFaultReactivationModelExporter::createFileName( const std::string& title, const std::string& stepName )
|
||||
std::string RifFaultReactivationModelExporter::createFilePostfix( const std::string& title, const std::string& stepName )
|
||||
{
|
||||
return QString( "%1_%2.inp" ).arg( QString::fromStdString( title ) ).arg( QString::fromStdString( stepName ) ).toStdString();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RifFaultReactivationModelExporter::createFilePath( const std::string& dir, const std::string& fileName )
|
||||
{
|
||||
return dir + "/" + fileName;
|
||||
return QString( "_%1_%2.inp" ).arg( QString::fromStdString( title ) ).arg( QString::fromStdString( stepName ) ).toStdString();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -838,7 +825,7 @@ bool RifFaultReactivationModelExporter::exportModelSettings( const RimFaultReact
|
||||
faultNormal = faultNormal ^ cvf::Vec3d::Z_AXIS;
|
||||
|
||||
RimFaultReactivationTools::addSettingsToMap( settings, faultNormal, topPosition, bottomPosition );
|
||||
return ResInsightInternalJson::JsonWriter::encodeFile( rimModel.settingsFilename(), settings );
|
||||
return ResInsightInternalJson::JsonWriter::encodeFile( QString::fromStdString( rimModel.settingsFilename() ), settings );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -34,9 +34,8 @@
|
||||
class RifFaultReactivationModelExporter
|
||||
{
|
||||
public:
|
||||
static std::pair<bool, std::string>
|
||||
exportToStream( std::ostream& stream, const std::string& exportDirecotry, const RimFaultReactivationModel& model );
|
||||
static std::pair<bool, std::string> exportToFile( const std::string& filePath, const RimFaultReactivationModel& model );
|
||||
static std::pair<bool, std::string> exportToStream( std::ostream& stream, const RimFaultReactivationModel& model );
|
||||
static std::pair<bool, std::string> exportToFile( const RimFaultReactivationModel& model );
|
||||
|
||||
private:
|
||||
static std::pair<bool, std::string> printHeading( std::ostream& stream, const std::string& applicationNameAndVersion );
|
||||
@ -108,9 +107,7 @@ private:
|
||||
const std::string& tableName,
|
||||
const std::string& heading );
|
||||
|
||||
static std::string createFileName( const std::string& title, const std::string& stepName );
|
||||
|
||||
static std::string createFilePath( const std::string& dir, const std::string& fileName );
|
||||
static std::string createFilePostfix( const std::string& title, const std::string& stepName );
|
||||
|
||||
static bool exportModelSettings( const RimFaultReactivationModel& model );
|
||||
static std::shared_ptr<RimFaultReactivationDataAccess> extractAndExportModelData( const RimFaultReactivationModel& model );
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "RimFaultReactivationModel.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesGeoMech.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
@ -625,8 +626,8 @@ QStringList RimFaultReactivationModel::commandParameters() const
|
||||
QStringList retlist;
|
||||
|
||||
retlist << baseDir();
|
||||
retlist << inputFilename();
|
||||
retlist << outputOdbFilename();
|
||||
retlist << QString::fromStdString( inputFilename() );
|
||||
retlist << QString::fromStdString( outputOdbFilename() );
|
||||
|
||||
return retlist;
|
||||
}
|
||||
@ -634,45 +635,42 @@ QStringList RimFaultReactivationModel::commandParameters() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFaultReactivationModel::outputOdbFilename() const
|
||||
std::string RimFaultReactivationModel::outputOdbFilename() const
|
||||
{
|
||||
QDir directory( baseDir() );
|
||||
return directory.absoluteFilePath( baseFilename() + ".odb" );
|
||||
return baseFilePath() + ".odb";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFaultReactivationModel::inputFilename() const
|
||||
std::string RimFaultReactivationModel::inputFilename() const
|
||||
{
|
||||
QDir directory( baseDir() );
|
||||
return directory.absoluteFilePath( baseFilename() + ".inp" );
|
||||
return baseFilePath() + ".inp";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFaultReactivationModel::settingsFilename() const
|
||||
std::string RimFaultReactivationModel::settingsFilename() const
|
||||
{
|
||||
QDir directory( baseDir() );
|
||||
return directory.absoluteFilePath( baseFilename() + ".settings.json" );
|
||||
return baseFilePath() + ".settings.json";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFaultReactivationModel::baseFilename() const
|
||||
std::string RimFaultReactivationModel::baseFilename() const
|
||||
{
|
||||
QString tmp = m_userDescription();
|
||||
return RiaFilePathTools::makeSuitableAsFileName( m_userDescription().toStdString() );
|
||||
}
|
||||
|
||||
if ( tmp.isEmpty() ) return "faultReactivation";
|
||||
|
||||
tmp.replace( ' ', '_' );
|
||||
tmp.replace( '/', '_' );
|
||||
tmp.replace( '\\', '_' );
|
||||
tmp.replace( ':', '_' );
|
||||
|
||||
return tmp;
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimFaultReactivationModel::baseFilePath() const
|
||||
{
|
||||
QDir directory( baseDir() );
|
||||
return directory.absoluteFilePath( QString::fromStdString( baseFilename() ) ).toStdString();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -110,9 +110,10 @@ public:
|
||||
|
||||
QStringList commandParameters() const;
|
||||
|
||||
QString outputOdbFilename() const;
|
||||
QString inputFilename() const;
|
||||
QString settingsFilename() const;
|
||||
std::string outputOdbFilename() const;
|
||||
std::string inputFilename() const;
|
||||
std::string settingsFilename() const;
|
||||
std::string baseFilePath() const;
|
||||
|
||||
void updateTimeSteps();
|
||||
|
||||
@ -137,7 +138,7 @@ protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
||||
|
||||
QString baseFilename() const;
|
||||
std::string baseFilename() const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<RicPolylineTargetsPickEventHandler> m_pickTargetsEventHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user