Rename to resdata

* Rename to resdata
* Remove development feature for storing grid import type in project file
* Clean up comments
This commit is contained in:
Magne Sjaastad
2024-04-22 19:56:10 +02:00
committed by GitHub
parent c17e5237ca
commit 98144078c8
31 changed files with 93 additions and 104 deletions

View File

@@ -65,10 +65,10 @@ void caf::AppEnum<RiaDefines::DepthUnitType>::setUp()
template <>
void caf::AppEnum<RiaDefines::GridModelReader>::setUp()
{
addItem( RiaDefines::GridModelReader::LIBECL, "LIBECL", "libecl" );
addItem( RiaDefines::GridModelReader::RESDATA, "RESDATA", "resdata", { "LIBECL" } );
addItem( RiaDefines::GridModelReader::OPM_COMMON, "OPM_COMMON", "opm-common (beta)" );
setDefault( RiaDefines::GridModelReader::LIBECL );
setDefault( RiaDefines::GridModelReader::RESDATA );
}
template <>

View File

@@ -172,7 +172,7 @@ enum class GridCaseAxis
enum class GridModelReader
{
LIBECL,
RESDATA,
OPM_COMMON
};

View File

@@ -57,7 +57,7 @@ void RiaPreferencesSummary::SummaryHistoryCurveStyleModeType::setUp()
template <>
void RiaPreferencesSummary::SummaryReaderModeType::setUp()
{
addItem( RiaPreferencesSummary::SummaryReaderMode::LIBECL, "LIBECL", "UNSMRY (libecl)" );
addItem( RiaPreferencesSummary::SummaryReaderMode::RESDATA, "RESDATA", "UNSMRY (resdata)", { "LIBECL" } );
addItem( RiaPreferencesSummary::SummaryReaderMode::HDF5_OPM_COMMON, "HDF5_OPM_COMMON", "h5 (HDF5)" );
addItem( RiaPreferencesSummary::SummaryReaderMode::OPM_COMMON, "OPM_COMMON", "ESMRY (opm-common)" );
setDefault( RiaPreferencesSummary::SummaryReaderMode::HDF5_OPM_COMMON );
@@ -471,7 +471,7 @@ QList<caf::PdmOptionItemInfo> RiaPreferencesSummary::calculateValueOptions( cons
#ifdef USE_HDF5
availableModes.push_back( SummaryReaderMode::HDF5_OPM_COMMON );
#endif // USE_HDF5
availableModes.push_back( SummaryReaderMode::LIBECL );
availableModes.push_back( SummaryReaderMode::RESDATA );
availableModes.push_back( SummaryReaderMode::OPM_COMMON );
for ( auto enumValue : availableModes )

View File

@@ -42,7 +42,7 @@ class RiaPreferencesSummary : public caf::PdmObject
public:
enum class SummaryReaderMode
{
LIBECL,
RESDATA,
OPM_COMMON,
HDF5_OPM_COMMON
};

View File

@@ -342,7 +342,7 @@ bool RifEclipseInputFileTools::exportGrid( const QString& fileName,
// Do not perform the transformation (applyMapaxes == false):
// The coordinates have been transformed to the map axes coordinate system already.
// However, send the map axes data in to libecl so that the coordinate system description is saved.
// However, send the map axes data in to resdata so that the coordinate system description is saved.
bool applyMapaxes = false;
ecl_grid_type* mainEclGrid =
ecl_grid_alloc_GRID_data( (int)ecl_coords.size(), ecl_nx, ecl_ny, ecl_nz, 5, &ecl_coords[0], &ecl_corners[0], applyMapaxes, mapAxes.data() );

View File

@@ -379,7 +379,7 @@ QStringList RifEclipseOutputFileTools::filterFileNamesOfType( const QStringList&
}
//-------------------------------------------------------------------------------------------------------
/// Check if libecl accepts the file name. libecl refuses to open files with mixed case in the file name.
/// Check if resdata accepts the file name. resdata refuses to open files with mixed case in the file name.
//-------------------------------------------------------------------------------------------------------
bool RifEclipseOutputFileTools::isValidEclipseFileName( const QString& fileName )
{

View File

@@ -160,7 +160,7 @@ std::vector<RifRestartFileInfo> RifEclipseSummaryTools::getRestartFiles( const Q
currFile.fileName = headerFileName;
while ( !currFile.fileName.isEmpty() )
{
// Due to a weakness in libecl regarding restart summary header file selection,
// Due to a weakness in resdata regarding restart summary header file selection,
// do some extra checking
{
QString formattedHeaderExtension = ".FSMSPEC";

View File

@@ -358,7 +358,7 @@ void RifOpmGridTools::transferCoordinatesCartesian( Opm::EclIO::EGrid& opmMainG
riActiveCells->setReservoirCellCount( riMainGrid->cellCount() );
// same mapping as libecl
// same mapping as resdata
const size_t cellMappingECLRi[8] = { 0, 1, 3, 2, 4, 5, 7, 6 };
#pragma omp parallel for

View File

@@ -68,7 +68,7 @@ void RifReaderEclipseRft::open()
if ( m_ecl_rft_file == nullptr )
{
RiaLogging::warning( QString( "Libecl could not find/open file '%1" ).arg( m_fileName ) );
RiaLogging::warning( QString( "resdata library could not find/open file '%1" ).arg( m_fileName ) );
return;
}

View File

@@ -68,7 +68,7 @@ bool RifReaderEclipseSummary::open( const QString& headerFileName, RiaThreadSafe
// - else
// - create ESMRY file if defined in preference
// - use ESMRY reader
// - if no reader has been created, fallback to libecl
// - if no reader has been created, fallback to resdata
//
// H5
// - if h5 file is present on disk
@@ -76,9 +76,9 @@ bool RifReaderEclipseSummary::open( const QString& headerFileName, RiaThreadSafe
// - else
// - create h5 file if defined in preference
// - use h5 reader
// - if no reader has been created, fallback to libecl
// - if no reader has been created, fallback to resdata
//
// For all import modes, use libecl to read data if no data is imported with ESMRY or h5
// For all import modes, use resdata to read data if no data is imported with ESMRY or h5
RiaPreferencesSummary* prefSummary = RiaPreferencesSummary::current();
@@ -136,7 +136,7 @@ bool RifReaderEclipseSummary::open( const QString& headerFileName, RiaThreadSafe
}
}
// If no summary reader has been created, always try to read data using libecl
// If no summary reader has been created, always try to read data using resdata
if ( !isValid )
{
auto libeclReader = std::make_unique<RifEclEclipseSummary>();

View File

@@ -55,7 +55,7 @@ std::pair<bool, std::vector<double>> RifSummaryReaderMultipleFiles::values( cons
// When a well is introduced, no data is present before the time step the well is introduced
// Add values of zero for this interval
//
// This issue was reported for libecl, but it is not relevant now as the low level file readers only handle
// This issue was reported for resdata, but it is not relevant now as the low level file readers only handle
// a single file.
// https://github.com/OPM/ResInsight/issues/7065

View File

@@ -81,14 +81,6 @@ RimEclipseResultCase::RimEclipseResultCase()
{
CAF_PDM_InitScriptableObject( "Eclipse Case", ":/Case48x48.png", "", "The Regular Eclipse Results Case" );
auto defaultReader = RiaPreferences::current()->gridModelReader();
CAF_PDM_InitField( &m_gridModelReader, "gridModelReader", caf::AppEnum<RiaDefines::GridModelReader>( defaultReader ), "Grid Model Reader" );
if ( !RiaApplication::enableDevelopmentFeatures() )
{
m_gridModelReader.xmlCapability()->disableIO();
m_gridModelReader.uiCapability()->setUiHidden( true );
}
CAF_PDM_InitFieldNoDefault( &m_unitSystem, "UnitSystem", "Unit System" );
m_unitSystem.registerGetMethod( RimProject::current(), &RimProject::commonUnitSystemForAllCases );
m_unitSystem.uiCapability()->setUiReadOnly( true );
@@ -145,7 +137,9 @@ bool RimEclipseResultCase::importGridAndResultMetaData( bool showTimeStepFilter
return false;
}
if ( m_gridModelReader == RiaDefines::GridModelReader::LIBECL )
auto defaultReader = RiaPreferences::current()->gridModelReader();
if ( defaultReader == RiaDefines::GridModelReader::RESDATA )
{
auto readerEclipseOutput = new RifReaderEclipseOutput();
@@ -620,7 +614,6 @@ bool RimEclipseResultCase::hasSourSimFile()
//--------------------------------------------------------------------------------------------------
void RimEclipseResultCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &m_gridModelReader );
uiOrdering.add( &m_caseUserDescription );
uiOrdering.add( &m_displayNameOption );
uiOrdering.add( &m_caseId );

View File

@@ -94,7 +94,6 @@ private:
cvf::ref<RifReaderEclipseRft> m_readerEclipseRft;
cvf::ref<RifReaderOpmRft> m_readerOpmRft;
caf::PdmField<caf::AppEnum<RiaDefines::GridModelReader>> m_gridModelReader;
caf::PdmProxyValueField<caf::AppEnum<RiaDefines::EclipseUnitSystem>> m_unitSystem;
caf::PdmChildArrayField<RimFlowDiagSolution*> m_flowDiagSolutions;
caf::PdmField<caf::FilePath> m_sourSimFileName;

View File

@@ -100,7 +100,7 @@ QString RimFileSummaryCase::caseName() const
void RimFileSummaryCase::createSummaryReaderInterfaceThreadSafe( RiaThreadSafeLogger* threadSafeLogger )
{
// RimFileSummaryCase::findRelatedFilesAndCreateReader is a performance bottleneck. The function
// RifEclipseSummaryTools::getRestartFile() should be refactored to use opm-common instead of libecl.
// RifEclipseSummaryTools::getRestartFile() should be refactored to use opm-common instead of resdata.
// It is not possible to use restart files in ESMRY file format, see see ESmry::make_esmry_file()
//
// https://github.com/OPM/ResInsight/issues/11342

View File

@@ -75,7 +75,7 @@ TEST( DISABLED_RifSummaryDataTest, LibEclAllData )
auto end = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> diff = end - start;
std::cout << "LibEcl : Open " << std::setw( 9 ) << diff.count() << " s\n";
std::cout << "resdata : Open " << std::setw( 9 ) << diff.count() << " s\n";
}
// for ( auto adr : reader.allResultAddresses() )
@@ -101,7 +101,7 @@ TEST( DISABLED_RifSummaryDataTest, LibEclAllData )
auto end = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> diff = end - start;
std::cout << "LibEcl read data" << std::setw( 9 ) << totalValuesRead << "totalValueCount" << diff.count() << " s\n";
std::cout << "resdata read data" << std::setw( 9 ) << totalValuesRead << "totalValueCount" << diff.count() << " s\n";
}
}
}