GridProperty: Pass 'Defaulted' Flag to Post-Processor

This commit alters the post-processor API to accept a vector<bool>
of defaulted flags (true if defaulted, false if explicitly
assigned).  This, in turn, enables running the post-processor only
on defaulted (or assigned) property values.

Update existing post-processor implementation to honour the new
calling conventions.
This commit is contained in:
Bård Skaflestad
2019-06-27 19:17:27 +02:00
parent 430cc9d7b2
commit ceb9f01571
5 changed files with 17 additions and 12 deletions

View File

@@ -178,7 +178,7 @@ namespace Opm {
/// this method exists for (friend) Eclipse3DProperties to be allowed initializing PORV and ACTNUM keyword
void postAddKeyword(const std::string& name,
const T defaultValue,
std::function< void( std::vector< T >& ) > postProcessor,
std::function< void( const std::vector<bool>& defaulted, std::vector< T >& ) > postProcessor,
const std::string& dimString,
const bool defaultInitializable );

View File

@@ -45,7 +45,10 @@ class GridPropertySupportedKeywordInfo {
GridPropertySupportedKeywordInfo() = default;
using init = std::function< std::vector< T >( size_t ) >;
using post = std::function< void( std::vector< T >& ) >;
using post = std::function<
void(const std::vector<bool>& defaulted,
std::vector< T >&)
>;
GridPropertySupportedKeywordInfo(
const std::string& name,