Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8899 missing network summary data #8990

Merged
merged 4 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,14 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromEclipseTextAddress( const
//--------------------------------------------------------------------------------------------------
RifEclipseSummaryAddress::SummaryVarCategory RifEclipseSummaryAddress::identifyCategory( const std::string& vectorName )
{
// Try to an exact match on the vector name first in the vector table.
bool exactMatch = true;
auto exactCategory = RiuSummaryQuantityNameInfoProvider::instance()->categoryFromVectorName( vectorName, exactMatch );
if ( exactCategory != SUMMARY_INVALID ) return exactCategory;

if ( vectorName.size() < 3 || vectorName.size() > 8 ) return SUMMARY_INVALID;

// Try to match the base vector name with more heuristics
auto strippedQuantityName = baseVectorName( vectorName );

// First, try to lookup vector in vector table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ RiuSummaryQuantityNameInfoProvider* RiuSummaryQuantityNameInfoProvider::instance
///
//--------------------------------------------------------------------------------------------------
RifEclipseSummaryAddress::SummaryVarCategory
RiuSummaryQuantityNameInfoProvider::categoryFromVectorName( const std::string& vectorName ) const
RiuSummaryQuantityNameInfoProvider::categoryFromVectorName( const std::string& vectorName, bool exactMatch ) const
{
auto info = quantityInfo( vectorName );
auto info = quantityInfo( vectorName, exactMatch );

return info.category;
}
Expand All @@ -44,15 +44,17 @@ RifEclipseSummaryAddress::SummaryVarCategory
///
//--------------------------------------------------------------------------------------------------
RiuSummaryQuantityNameInfoProvider::RiuSummaryQuantityInfo
RiuSummaryQuantityNameInfoProvider::quantityInfo( const std::string& vectorName ) const
RiuSummaryQuantityNameInfoProvider::quantityInfo( const std::string& vectorName, bool exactMatch ) const
{
auto it = m_summaryToDescMap.find( vectorName );

if ( it != m_summaryToDescMap.end() )
{
return it->second;
}

// Stop searching if not found in lookup table and exact match was requested.
if ( exactMatch ) return RiuSummaryQuantityInfo();

if ( vectorName.size() > 1 && vectorName[1] == 'U' )
{
// User defined vector name
Expand All @@ -63,6 +65,7 @@ RiuSummaryQuantityNameInfoProvider::RiuSummaryQuantityInfo

return RiuSummaryQuantityInfo();
}

if ( vectorName.size() > 5 )
{
// Check for custom vector naming
Expand Down Expand Up @@ -2133,7 +2136,24 @@ std::unordered_map<std::string, RiuSummaryQuantityNameInfoProvider::RiuSummaryQu
info.insert( { "MONTH", { A::SUMMARY_MISC, "Month" } } );
info.insert( { "MSUMLINS", { A::SUMMARY_MISC, "Total number of linear iterations since the start of the run" } } );
info.insert( { "MSUMNEWT", { A::SUMMARY_MISC, "Total number of Newton iterations since the start of the run" } } );
info.insert( { "NBAKFL", { A::SUMMARY_MISC, "Number of calls to scalar fallback routines" } } );
info.insert( { "NBYTOT", { A::SUMMARY_MISC, "Peak usage of dynamically allocated memory" } } );
info.insert( { "NCPRLINS", { A::SUMMARY_MISC, "Average number of pressure iterations" } } );
info.insert( { "NEWTFL", { A::SUMMARY_MISC, "Cumulative average Newton iterations" } } );
info.insert( { "NEWTON", { A::SUMMARY_MISC, "Number of Newton iterations used for each timestep" } } );
info.insert( { "NLINEARP", { A::SUMMARY_MISC, "Average number of pressure iterations" } } );
info.insert( { "NLINEARS", { A::SUMMARY_MISC, "Average number of linear iterations" } } );
info.insert( { "NLINSMAX", { A::SUMMARY_MISC, "Actual maximum number of linear iterations" } } );
info.insert( { "NLINSMIN", { A::SUMMARY_MISC, "Actual minimum number of linear iterations" } } );
info.insert( { "NLRESMAX", { A::SUMMARY_MISC, "Maximum element of the non-linear residual" } } );
info.insert( { "NLRESSUM", { A::SUMMARY_MISC, "Sum of the non-linear residual" } } );
info.insert( { "NMESSAGE", { A::SUMMARY_MISC, "Requests a set of message data vectors for the run" } } );
info.insert( { "NNUMFL", { A::SUMMARY_MISC, "Total number of two phase flash calculations performed" } } );
info.insert( { "NNUMST", { A::SUMMARY_MISC, "Total number of stability tests performed" } } );
info.insert( { "NTS", { A::SUMMARY_MISC, "Number of timesteps taken" } } );
info.insert( { "NTSECL", { A::SUMMARY_MISC, "Number of energy density solution converged last" } } );
info.insert( { "NTSMCL", { A::SUMMARY_MISC, "Number of molar density solution converged last" } } );
info.insert( { "NTSPCL", { A::SUMMARY_MISC, "Number of pressure solution converged last" } } );
info.insert( { "STEPTYPE", { A::SUMMARY_MISC, "Step type" } } );
info.insert( { "TCPU", { A::SUMMARY_MISC, "TCPU" } } );
info.insert( { "TCPUDAY", { A::SUMMARY_MISC, "TCPUDAY" } } );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class RiuSummaryQuantityNameInfoProvider
public:
static RiuSummaryQuantityNameInfoProvider* instance();

RifEclipseSummaryAddress::SummaryVarCategory categoryFromVectorName( const std::string& vectorName ) const;
RifEclipseSummaryAddress::SummaryVarCategory categoryFromVectorName( const std::string& vectorName,
bool exactMatch = false ) const;
std::string longNameFromVectorName( const std::string& vectorName, bool returnVectorNameIfNotFound = false ) const;

private:
Expand All @@ -55,7 +56,7 @@ class RiuSummaryQuantityNameInfoProvider
private:
RiuSummaryQuantityNameInfoProvider();

RiuSummaryQuantityInfo quantityInfo( const std::string& vectorName ) const;
RiuSummaryQuantityInfo quantityInfo( const std::string& vectorName, bool exactMatch = false ) const;

static std::unordered_map<std::string, RiuSummaryQuantityInfo> createInfoForEclipseKeywords();
static std::unordered_map<std::string, RiuSummaryQuantityInfo> createInfoFor6xKeywords();
Expand Down
2 changes: 2 additions & 0 deletions ThirdParty/Ert/lib/ecl/ecl_smspec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,8 @@ static void ecl_smspec_install_special_keys( ecl_smspec_type * ecl_smspec , cons
break;
case(ECL_SMSPEC_AQUIFER_VAR):
break;
case(ECL_SMSPEC_NETWORK_VAR):
break;
default:
throw std::invalid_argument("Internal error - should not be here \n");
}
Expand Down
32 changes: 29 additions & 3 deletions ThirdParty/Ert/lib/ecl/smspec_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,26 @@
ecl_smspec_identify_special_var() and ecl_smspec_identify_var_type().
*/

static const char* special_vars[] = {"NEWTON",
"NAIMFRAC",
static const char* special_vars[] = {"NAIMFRAC",
"NBAKFL",
"NBYTOT",
"NCPRLINS",
"NEWTFL",
"NEWTON",
"NLINEARP",
"NLINEARS",
"NLINEARS",
"NLINSMIN",
"NLINSMAX",
"NLINSMIN",
"NLRESMAX",
"NLRESSUM",
"NMESSAGE",
"NNUMFL",
"NNUMST",
"NTS",
"NTSECL",
"NTSMCL",
"NTSPCL",
"ELAPSED",
"MAXDPR",
"MAXDSO",
Expand Down Expand Up @@ -592,6 +607,10 @@ void smspec_node::set_gen_keys( const char* key_join_string_) {
// KEYWORD
gen_key1 = keyword;
break;
case(ECL_SMSPEC_NETWORK_VAR):
// KEYWORD
gen_key1 = keyword;
break;
case(ECL_SMSPEC_GROUP_VAR):
// KEYWORD:WGNAME
gen_key1 = smspec_alloc_group_key( key_join_string_ , keyword , wgname);
Expand Down Expand Up @@ -718,6 +737,9 @@ ecl_smspec_var_type smspec_node::valid_type(const char * keyword, const char * w
return var_type;
}

if (var_type == ECL_SMSPEC_NETWORK_VAR)
return var_type;

return ECL_SMSPEC_INVALID_VAR;
}

Expand Down Expand Up @@ -907,6 +929,8 @@ smspec_node::smspec_node(int param_index,
case(ECL_SMSPEC_AQUIFER_VAR):
set_num( grid_dims , num );
break;
case(ECL_SMSPEC_NETWORK_VAR):
break;
default:
throw std::invalid_argument("Should not be here ... ");
break;
Expand Down Expand Up @@ -941,6 +965,8 @@ smspec_node::smspec_node( int param_index_,
switch (this->var_type) {
case(ECL_SMSPEC_LOCAL_WELL_VAR):
break;
case(ECL_SMSPEC_NETWORK_VAR):
break;
case(ECL_SMSPEC_LOCAL_BLOCK_VAR):
set_lgr_ijk( lgr_i, lgr_j , lgr_k );
break;
Expand Down