@@ -33,11 +33,12 @@
|
||||
|
||||
|
||||
struct keyword {
|
||||
keyword(const std::string& name, const std::string& filename, std::size_t line_number, std::size_t content_hash) :
|
||||
name(name),
|
||||
filename(filename),
|
||||
line_number(line_number),
|
||||
content_hash(content_hash)
|
||||
keyword(const std::string& name_arg, const std::string& filename_arg,
|
||||
std::size_t line_number_arg, std::size_t content_hash_arg) :
|
||||
name(name_arg),
|
||||
filename(filename_arg),
|
||||
line_number(line_number_arg),
|
||||
content_hash(content_hash_arg)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
msim::msim(const EclipseState& state) :
|
||||
state(state)
|
||||
msim::msim(const EclipseState& state_arg) :
|
||||
state(state_arg)
|
||||
{}
|
||||
|
||||
void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) {
|
||||
|
||||
@@ -54,9 +54,6 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
void setKeywordBox( const DeckRecord& deckRecord,
|
||||
BoxManager& boxManager);
|
||||
|
||||
class Eclipse3DProperties;
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
namespace Opm {
|
||||
struct InjectionControls {
|
||||
public:
|
||||
InjectionControls(int controls) :
|
||||
controls(controls)
|
||||
InjectionControls(int controls_arg) :
|
||||
controls(controls_arg)
|
||||
{}
|
||||
|
||||
double bhp_limit;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
namespace Opm {
|
||||
struct ProductionControls {
|
||||
public:
|
||||
ProductionControls(int controls) :
|
||||
controls(controls)
|
||||
ProductionControls(int controls_arg) :
|
||||
controls(controls_arg)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -870,8 +870,8 @@ captureDynamicWellData(const Schedule& sched,
|
||||
wellLoop(wells, [this, &smry]
|
||||
(const Well2& well, const std::size_t wellID) -> void
|
||||
{
|
||||
auto xw = this->xWell_[wellID];
|
||||
auto xwell = this->xWell_[wellID];
|
||||
|
||||
XWell::dynamicContrib(well, smry, xw);
|
||||
XWell::dynamicContrib(well, smry, xwell);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -303,9 +303,9 @@ namespace Opm {
|
||||
const std::string& gdfile_arg = gdfile_kw.getRecord(0).getItem("filename").get<std::string>(0);
|
||||
std::string filename = deck.makeDeckPath(gdfile_arg);
|
||||
|
||||
ecl_grid_type * grid_ptr = ecl_grid_load_case__( filename.c_str(), false);
|
||||
if (grid_ptr)
|
||||
this->m_grid.reset( grid_ptr );
|
||||
ecl_grid_type * grid_ptr_loc = ecl_grid_load_case__( filename.c_str(), false);
|
||||
if (grid_ptr_loc)
|
||||
this->m_grid.reset( grid_ptr_loc );
|
||||
else
|
||||
throw std::invalid_argument("Failed to load grid from: " + filename);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp>
|
||||
#include <opm/parser/eclipse/Utility/String.hpp>
|
||||
|
||||
#include "setKeywordBox.hpp"
|
||||
|
||||
namespace Opm {
|
||||
|
||||
/*
|
||||
|
||||
@@ -218,8 +218,8 @@ namespace {
|
||||
class Serializer {
|
||||
public:
|
||||
Serializer() = default;
|
||||
explicit Serializer(const std::vector<char>& buffer) :
|
||||
buffer(buffer)
|
||||
explicit Serializer(const std::vector<char>& buffer_arg) :
|
||||
buffer(buffer_arg)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ namespace Opm {
|
||||
|
||||
|
||||
|
||||
UDQASTNode::UDQASTNode(UDQTokenType type) :
|
||||
type(type),
|
||||
UDQASTNode::UDQASTNode(UDQTokenType type_arg) :
|
||||
type(type_arg),
|
||||
var_type(UDQVarType::NONE)
|
||||
{
|
||||
if (type == UDQTokenType::error)
|
||||
@@ -41,10 +41,10 @@ UDQASTNode::UDQASTNode(UDQTokenType type) :
|
||||
throw std::invalid_argument("The one argument constructor is only available for error and end");
|
||||
}
|
||||
|
||||
UDQASTNode::UDQASTNode(double scalar_value) :
|
||||
UDQASTNode::UDQASTNode(double scalar_value_arg) :
|
||||
type(UDQTokenType::number),
|
||||
var_type(UDQVarType::SCALAR),
|
||||
scalar_value(scalar_value)
|
||||
scalar_value(scalar_value_arg)
|
||||
{}
|
||||
|
||||
|
||||
@@ -82,12 +82,12 @@ UDQASTNode::UDQASTNode(UDQTokenType type_arg,
|
||||
|
||||
|
||||
UDQASTNode::UDQASTNode(UDQTokenType type_arg,
|
||||
const std::string& string_value,
|
||||
const std::vector<std::string>& selector) :
|
||||
const std::string& string_value_arg,
|
||||
const std::vector<std::string>& selector_arg) :
|
||||
type(type_arg),
|
||||
var_type(UDQ::targetType(string_value)),
|
||||
string_value(string_value),
|
||||
selector(selector)
|
||||
var_type(UDQ::targetType(string_value_arg)),
|
||||
string_value(string_value_arg),
|
||||
selector(selector_arg)
|
||||
{
|
||||
if (type_arg == UDQTokenType::number)
|
||||
this->scalar_value = std::stod(string_value);
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
UDQContext::UDQContext(const UDQParams& params, const UDQFunctionTable& udqft, const SummaryState& summary_state) :
|
||||
params(params),
|
||||
udqft(udqft),
|
||||
summary_state(summary_state)
|
||||
UDQContext::UDQContext(const UDQParams& params_arg, const UDQFunctionTable& udqft_arg, const SummaryState& summary_state_arg) :
|
||||
params(params_arg),
|
||||
udqft(udqft_arg),
|
||||
summary_state(summary_state_arg)
|
||||
{
|
||||
for (const auto& pair : TimeMap::eclipseMonthIndices())
|
||||
this->add(pair.first, pair.second);
|
||||
|
||||
@@ -62,28 +62,28 @@ std::vector<std::string> quote_split(const std::string& item) {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
UDQDefine::UDQDefine(const UDQParams& udq_params,
|
||||
UDQDefine::UDQDefine(const UDQParams& udq_params_arg,
|
||||
const std::string& keyword,
|
||||
const std::vector<std::string>& deck_data,
|
||||
const ParseContext& parseContext,
|
||||
T&& errors) :
|
||||
UDQDefine(udq_params, keyword, deck_data, parseContext, errors)
|
||||
UDQDefine(udq_params_arg, keyword, deck_data, parseContext, errors)
|
||||
{}
|
||||
|
||||
|
||||
UDQDefine::UDQDefine(const UDQParams& udq_params,
|
||||
UDQDefine::UDQDefine(const UDQParams& udq_params_arg,
|
||||
const std::string& keyword,
|
||||
const std::vector<std::string>& deck_data) :
|
||||
UDQDefine(udq_params, keyword, deck_data, ParseContext(), ErrorGuard())
|
||||
UDQDefine(udq_params_arg, keyword, deck_data, ParseContext(), ErrorGuard())
|
||||
{}
|
||||
|
||||
|
||||
UDQDefine::UDQDefine(const UDQParams& udq_params,
|
||||
UDQDefine::UDQDefine(const UDQParams& udq_params_arg,
|
||||
const std::string& keyword,
|
||||
const std::vector<std::string>& deck_data,
|
||||
const ParseContext& parseContext,
|
||||
ErrorGuard& errors) :
|
||||
udq_params(udq_params),
|
||||
udq_params(udq_params_arg),
|
||||
m_keyword(keyword),
|
||||
m_var_type(UDQ::varType(keyword))
|
||||
{
|
||||
|
||||
@@ -29,8 +29,8 @@ UDQFunctionTable::UDQFunctionTable() :
|
||||
UDQFunctionTable(UDQParams())
|
||||
{}
|
||||
|
||||
UDQFunctionTable::UDQFunctionTable(const UDQParams& params) :
|
||||
params(params)
|
||||
UDQFunctionTable::UDQFunctionTable(const UDQParams& params_arg) :
|
||||
params(params_arg)
|
||||
{
|
||||
// SCalar functions
|
||||
this->insert_function( std::make_shared<UDQScalarFunction>("SUM", UDQScalarFunction::SUM) );
|
||||
|
||||
@@ -35,10 +35,10 @@ class ParseContext;
|
||||
class ErrorGuard;
|
||||
|
||||
struct UDQParseNode {
|
||||
UDQParseNode(UDQTokenType type_arg, const std::string& value_arg, const std::vector<std::string>& selector) :
|
||||
UDQParseNode(UDQTokenType type_arg, const std::string& value_arg, const std::vector<std::string>& selector_arg) :
|
||||
type(type_arg),
|
||||
value(value_arg),
|
||||
selector(selector)
|
||||
selector(selector_arg)
|
||||
{
|
||||
if (type_arg == UDQTokenType::ecl_expr)
|
||||
this->var_type = UDQ::targetType(value_arg);
|
||||
@@ -66,10 +66,10 @@ public:
|
||||
static UDQASTNode parse(const UDQParams& udq_params, UDQVarType target_type, const std::string& target_var, const std::vector<std::string>& tokens, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
|
||||
private:
|
||||
UDQParser(const UDQParams& udq_params1, const std::vector<std::string>& tokens) :
|
||||
UDQParser(const UDQParams& udq_params1, const std::vector<std::string>& tokens1) :
|
||||
udq_params(udq_params1),
|
||||
udqft(UDQFunctionTable(udq_params)),
|
||||
tokens(tokens)
|
||||
tokens(tokens1)
|
||||
{}
|
||||
|
||||
UDQASTNode parse_cmp();
|
||||
|
||||
@@ -72,29 +72,29 @@ namespace {
|
||||
}
|
||||
|
||||
|
||||
Well2::Well2(const std::string& wname,
|
||||
Well2::Well2(const std::string& wname_arg,
|
||||
const std::string& gname,
|
||||
std::size_t init_step,
|
||||
std::size_t insert_index,
|
||||
int headI,
|
||||
int headJ,
|
||||
double ref_depth,
|
||||
Phase phase,
|
||||
std::size_t init_step_arg,
|
||||
std::size_t insert_index_arg,
|
||||
int headI_arg,
|
||||
int headJ_arg,
|
||||
double ref_depth_arg,
|
||||
Phase phase_arg,
|
||||
WellProducer::ControlModeEnum whistctl_cmode,
|
||||
WellCompletion::CompletionOrderEnum ordering,
|
||||
const UnitSystem& unit_system,
|
||||
double udq_undefined) :
|
||||
wname(wname),
|
||||
WellCompletion::CompletionOrderEnum ordering_arg,
|
||||
const UnitSystem& unit_system_arg,
|
||||
double udq_undefined_arg) :
|
||||
wname(wname_arg),
|
||||
group_name(gname),
|
||||
init_step(init_step),
|
||||
insert_index(insert_index),
|
||||
headI(headI),
|
||||
headJ(headJ),
|
||||
ref_depth(ref_depth),
|
||||
phase(phase),
|
||||
ordering(ordering),
|
||||
unit_system(unit_system),
|
||||
udq_undefined(udq_undefined),
|
||||
init_step(init_step_arg),
|
||||
insert_index(insert_index_arg),
|
||||
headI(headI_arg),
|
||||
headJ(headJ_arg),
|
||||
ref_depth(ref_depth_arg),
|
||||
phase(phase_arg),
|
||||
ordering(ordering_arg),
|
||||
unit_system(unit_system_arg),
|
||||
udq_undefined(udq_undefined_arg),
|
||||
status(WellCommon::SHUT),
|
||||
drainage_radius(ParserKeywords::WELSPECS::D_RADIUS::defaultValue),
|
||||
allow_cross_flow(DeckItem::to_bool(ParserKeywords::WELSPECS::CROSSFLOW::defaultValue)),
|
||||
@@ -383,15 +383,15 @@ bool Well2::isAvailableForGroupControl() const {
|
||||
|
||||
double Well2::getGuideRate() const {
|
||||
return this->guide_rate.guide_rate;
|
||||
};
|
||||
}
|
||||
|
||||
GuideRate::GuideRatePhaseEnum Well2::getGuideRatePhase() const {
|
||||
return this->guide_rate.guide_phase;
|
||||
};
|
||||
}
|
||||
|
||||
double Well2::getGuideRateScalingFactor() const {
|
||||
return this->guide_rate.scale_factor;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
double Well2::getEfficiencyFactor() const {
|
||||
|
||||
@@ -382,9 +382,9 @@ inline void keywordMISC( SummaryConfig::keyword_list& list,
|
||||
{
|
||||
// Modifies 'list' in place.
|
||||
auto makeNode = [&keyword, &list]
|
||||
(const std::string& well, const int segNumber)
|
||||
(const std::string& well_name, const int segNumber)
|
||||
{
|
||||
list.push_back(SummaryConfig::keyword_type( keyword.name(), well, segNumber ));
|
||||
list.push_back(SummaryConfig::keyword_type( keyword.name(), well_name, segNumber ));
|
||||
};
|
||||
|
||||
if (!well.isMultiSegment())
|
||||
|
||||
@@ -298,17 +298,17 @@ void ParserState::closeFile() {
|
||||
this->input_stack.pop();
|
||||
}
|
||||
|
||||
ParserState::ParserState(const ParseContext& __parseContext, ErrorGuard& errors) :
|
||||
ParserState::ParserState(const ParseContext& __parseContext, ErrorGuard& errors_arg) :
|
||||
parseContext( __parseContext ),
|
||||
errors( errors )
|
||||
errors( errors_arg )
|
||||
{}
|
||||
|
||||
ParserState::ParserState( const ParseContext& context,
|
||||
ErrorGuard& errors,
|
||||
ErrorGuard& errors_arg,
|
||||
boost::filesystem::path p ) :
|
||||
rootPath( boost::filesystem::canonical( p ).parent_path() ),
|
||||
parseContext( context ),
|
||||
errors( errors )
|
||||
errors( errors_arg )
|
||||
{
|
||||
openRootFile( p );
|
||||
}
|
||||
|
||||
@@ -147,31 +147,31 @@ void ECLRegressionTest::deviationsForNonFloatingPoints(T val1, T val2, const std
|
||||
|
||||
void ECLRegressionTest::deviationsForCell(double val1, double val2, const std::string& keyword, const std::string& reference, size_t kw_size, size_t cell, bool allowNegativeValues, bool useStrictTol)
|
||||
{
|
||||
double absTolerance = useStrictTol ? strictAbsTol : getAbsTolerance();
|
||||
double relTolerance = useStrictTol ? strictAbsTol : getRelTolerance();
|
||||
double absToleranceLoc = useStrictTol ? strictAbsTol : getAbsTolerance();
|
||||
double relToleranceLoc = useStrictTol ? strictAbsTol : getRelTolerance();
|
||||
|
||||
if (!allowNegativeValues) {
|
||||
if (val1 < 0) {
|
||||
if (std::abs(val1) > absTolerance) {
|
||||
if (std::abs(val1) > absToleranceLoc) {
|
||||
printValuesForCell(keyword, reference, kw_size, cell, grid1, val1, val2);
|
||||
HANDLE_ERROR(std::runtime_error, "Negative value in first file, "
|
||||
<< "which in absolute value exceeds the absolute tolerance of " << absTolerance << ".");
|
||||
<< "which in absolute value exceeds the absolute tolerance of " << absToleranceLoc << ".");
|
||||
}
|
||||
val1 = 0;
|
||||
}
|
||||
|
||||
if (val2 < 0) {
|
||||
if (std::abs(val2) > absTolerance) {
|
||||
if (std::abs(val2) > absToleranceLoc) {
|
||||
printValuesForCell(keyword, reference, kw_size, cell, grid1, val1, val2);
|
||||
HANDLE_ERROR(std::runtime_error, "Negative value in second file, "
|
||||
<< "which in absolute value exceeds the absolute tolerance of " << absTolerance << ".");
|
||||
<< "which in absolute value exceeds the absolute tolerance of " << absToleranceLoc << ".");
|
||||
}
|
||||
val2 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Deviation dev = calculateDeviations(val1, val2);
|
||||
if (dev.abs > absTolerance && (dev.rel > relTolerance || dev.rel == -1)) {
|
||||
if (dev.abs > absToleranceLoc && (dev.rel > relToleranceLoc || dev.rel == -1)) {
|
||||
if (analysis) {
|
||||
std::string keywref = keyword + ": " + reference;
|
||||
deviations[keywref].push_back(dev);
|
||||
@@ -183,8 +183,8 @@ void ECLRegressionTest::deviationsForCell(double val1, double val2, const std::s
|
||||
}
|
||||
|
||||
HANDLE_ERROR(std::runtime_error, "Deviations exceed tolerances."
|
||||
<< "\nThe absolute deviation is " << dev.abs << ", and the tolerance limit is " << absTolerance << "."
|
||||
<< "\nThe relative deviation is " << dev.rel << ", and the tolerance limit is " << relTolerance << ".");
|
||||
<< "\nThe absolute deviation is " << dev.abs << ", and the tolerance limit is " << absToleranceLoc << "."
|
||||
<< "\nThe relative deviation is " << dev.rel << ", and the tolerance limit is " << relToleranceLoc << ".");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,8 +46,9 @@ public:
|
||||
//! \param[in] absTolerance Tolerance for absolute deviation.
|
||||
//! \param[in] relTolerance Tolerance for relative deviation.
|
||||
//! \details This constructor only calls the constructor of the superclass, see the docs for ECLFilesComparator for more information.
|
||||
ECLRegressionTest(const std::string& basename1, const std::string& basename2, double absTolerance, double relTolerance):
|
||||
ECLFilesComparator(basename1, basename2, absTolerance, relTolerance) {}
|
||||
ECLRegressionTest(const std::string& basename1, const std::string& basename2,
|
||||
double absToleranceArg, double relToleranceArg):
|
||||
ECLFilesComparator(basename1, basename2, absToleranceArg, relToleranceArg) {}
|
||||
|
||||
~ECLRegressionTest();
|
||||
|
||||
|
||||
@@ -2018,19 +2018,21 @@ BOOST_AUTO_TEST_CASE( COMPDAT_multiple_wells ) {
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, eclipseProperties,runspec);
|
||||
|
||||
const auto& w1cs = schedule.getWell2( "W1", 1 ).getConnections();
|
||||
BOOST_CHECK_EQUAL( 1, w1cs.get( 0 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 2, w1cs.get( 1 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 3, w1cs.get( 2 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 4, w1cs.get( 3 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 5, w1cs.get( 4 ).complnum() );
|
||||
{
|
||||
const auto& w1cs = schedule.getWell2( "W1", 1 ).getConnections();
|
||||
BOOST_CHECK_EQUAL( 1, w1cs.get( 0 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 2, w1cs.get( 1 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 3, w1cs.get( 2 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 4, w1cs.get( 3 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 5, w1cs.get( 4 ).complnum() );
|
||||
|
||||
const auto& w2cs = schedule.getWell2( "W2", 1 ).getConnections();
|
||||
BOOST_CHECK_EQUAL( 1, w2cs.getFromIJK( 4, 4, 2 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 2, w2cs.getFromIJK( 4, 4, 0 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 3, w2cs.getFromIJK( 4, 4, 1 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 4, w2cs.getFromIJK( 4, 4, 3 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 5, w2cs.getFromIJK( 4, 4, 4 ).complnum() );
|
||||
const auto& w2cs = schedule.getWell2( "W2", 1 ).getConnections();
|
||||
BOOST_CHECK_EQUAL( 1, w2cs.getFromIJK( 4, 4, 2 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 2, w2cs.getFromIJK( 4, 4, 0 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 3, w2cs.getFromIJK( 4, 4, 1 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 4, w2cs.getFromIJK( 4, 4, 3 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 5, w2cs.getFromIJK( 4, 4, 4 ).complnum() );
|
||||
}
|
||||
|
||||
{
|
||||
const auto& w1cs = schedule.getWell2( "W1", 1 ).getConnections();
|
||||
|
||||
@@ -168,7 +168,6 @@ BOOST_AUTO_TEST_CASE(UDQ_DEFINETEST) {
|
||||
UDQFunctionTable udqft(udqp);
|
||||
{
|
||||
UDQDefine def(udqp, "WUBHP", {"WBHP"});
|
||||
UDQParams udqp;
|
||||
SummaryState st;
|
||||
UDQContext context(udqp, udqft, st);
|
||||
|
||||
@@ -626,15 +625,15 @@ BOOST_AUTO_TEST_CASE(CMP_FUNCTIONS) {
|
||||
}
|
||||
{
|
||||
const auto& func = dynamic_cast<const UDQBinaryFunction&>(udqft.get("^"));
|
||||
UDQSet arg1("NAME", 4);
|
||||
UDQSet arg2("NAME", 4);
|
||||
UDQSet arg1_local("NAME", 4);
|
||||
UDQSet arg2_local("NAME", 4);
|
||||
|
||||
for (std::size_t i=0; i < arg1.size(); i++) {
|
||||
arg1.assign(i, i + 1);
|
||||
arg2.assign(i, 2);
|
||||
for (std::size_t i=0; i < arg1_local.size(); i++) {
|
||||
arg1_local.assign(i, i + 1);
|
||||
arg2_local.assign(i, 2);
|
||||
}
|
||||
auto result = func.eval(arg1, arg2);
|
||||
for (std::size_t i=0; i < arg1.size(); i++)
|
||||
auto result = func.eval(arg1_local, arg2_local);
|
||||
for (std::size_t i=0; i < arg1_local.size(); i++)
|
||||
BOOST_CHECK_EQUAL( result[i].value(), (i+1)*(i+1));
|
||||
}
|
||||
{
|
||||
@@ -714,34 +713,34 @@ BOOST_AUTO_TEST_CASE(ELEMENTAL_UNARY_FUNCTIONS) {
|
||||
}
|
||||
{
|
||||
const auto& func = dynamic_cast<const UDQUnaryElementalFunction&>(udqft.get("LOG"));
|
||||
UDQSet arg("NAME", 3);
|
||||
arg.assign(0, 10);
|
||||
arg.assign(2,1000);
|
||||
UDQSet arg_local("NAME", 3);
|
||||
arg_local.assign(0, 10);
|
||||
arg_local.assign(2,1000);
|
||||
|
||||
auto result = func.eval(arg);
|
||||
auto result = func.eval(arg_local);
|
||||
BOOST_CHECK_EQUAL( result[0].value(), 1);
|
||||
BOOST_CHECK( !result[1] );
|
||||
BOOST_CHECK_EQUAL( result[2].value(), 3);
|
||||
}
|
||||
{
|
||||
const auto& func = dynamic_cast<const UDQUnaryElementalFunction&>(udqft.get("NINT"));
|
||||
UDQSet arg("NAME", 3);
|
||||
arg.assign(0, 0.75);
|
||||
arg.assign(2, 1.25);
|
||||
UDQSet arg_local("NAME", 3);
|
||||
arg_local.assign(0, 0.75);
|
||||
arg_local.assign(2, 1.25);
|
||||
|
||||
auto result = func.eval(arg);
|
||||
auto result = func.eval(arg_local);
|
||||
BOOST_CHECK_EQUAL( result[0].value(), 1);
|
||||
BOOST_CHECK( !result[1] );
|
||||
BOOST_CHECK_EQUAL( result[2].value(), 1);
|
||||
}
|
||||
{
|
||||
const auto& func = dynamic_cast<const UDQUnaryElementalFunction&>(udqft.get("RANDN"));
|
||||
UDQSet arg("NAME", 3);
|
||||
arg.assign(0, -1.0);
|
||||
arg.assign(2, -1.0);
|
||||
UDQSet arg_local("NAME", 3);
|
||||
arg_local.assign(0, -1.0);
|
||||
arg_local.assign(2, -1.0);
|
||||
|
||||
auto result1 = func.eval(arg);
|
||||
auto result2 = func.eval(arg);
|
||||
auto result1 = func.eval(arg_local);
|
||||
auto result2 = func.eval(arg_local);
|
||||
BOOST_CHECK( result1[0].value() != -1.0);
|
||||
BOOST_CHECK( !result1[1] );
|
||||
BOOST_CHECK( result1[2].value() != -1.0);
|
||||
|
||||
@@ -198,19 +198,23 @@ BOOST_AUTO_TEST_CASE(NewWellZeroCompletions) {
|
||||
BOOST_AUTO_TEST_CASE(isProducerCorrectlySet) {
|
||||
// HACK: This test checks correctly setting of isProducer/isInjector. This property depends on which of
|
||||
// WellProductionProperties/WellInjectionProperties is set last, independent of actual values.
|
||||
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
{
|
||||
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
/* 1: Well is created as producer */
|
||||
BOOST_CHECK_EQUAL( false , well.isInjector());
|
||||
BOOST_CHECK_EQUAL( true , well.isProducer());
|
||||
|
||||
/* Set a surface injection rate => Well becomes an Injector */
|
||||
auto injectionProps1 = std::make_shared<Opm::WellInjectionProperties>(well.getInjectionProperties());
|
||||
injectionProps1->surfaceInjectionRate.reset(100);
|
||||
well.updateInjection(injectionProps1);
|
||||
BOOST_CHECK_EQUAL( true , well.isInjector());
|
||||
BOOST_CHECK_EQUAL( false , well.isProducer());
|
||||
BOOST_CHECK_EQUAL( 100 , well.getInjectionProperties().surfaceInjectionRate.get<double>());
|
||||
/* 1: Well is created as producer */
|
||||
BOOST_CHECK_EQUAL( false , well.isInjector());
|
||||
BOOST_CHECK_EQUAL( true , well.isProducer());
|
||||
|
||||
/* Set a surface injection rate => Well becomes an Injector */
|
||||
auto injectionProps1 = std::make_shared<Opm::WellInjectionProperties>(well.getInjectionProperties());
|
||||
injectionProps1->surfaceInjectionRate.reset(100);
|
||||
well.updateInjection(injectionProps1);
|
||||
BOOST_CHECK_EQUAL( true , well.isInjector());
|
||||
BOOST_CHECK_EQUAL( false , well.isProducer());
|
||||
BOOST_CHECK_EQUAL( 100 , well.getInjectionProperties().surfaceInjectionRate.get<double>());
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
@@ -140,14 +140,14 @@ BOOST_AUTO_TEST_CASE(TestERft_1) {
|
||||
BOOST_CHECK_EQUAL(vect3.size(), 16);
|
||||
|
||||
// called with invalid argument, array not existing, wrong well name or wrong date
|
||||
BOOST_CHECK_THROW(std::vector<int> vect1=rft1.getRft<int>("CONIPOS","C-2H", Date{2016,5,31}),std::invalid_argument);
|
||||
BOOST_CHECK_THROW(std::vector<int> vect1=rft1.getRft<int>("CONIPOS","B-2H", Date{2016,5,30}),std::invalid_argument);
|
||||
BOOST_CHECK_THROW(std::vector<int> vect1=rft1.getRft<int>("XXXXXXX","B-2H", Date{2016,5,31}),std::invalid_argument);
|
||||
BOOST_CHECK_THROW(std::vector<int> vect11=rft1.getRft<int>("CONIPOS","C-2H", Date{2016,5,31}),std::invalid_argument);
|
||||
BOOST_CHECK_THROW(std::vector<int> vect11=rft1.getRft<int>("CONIPOS","B-2H", Date{2016,5,30}),std::invalid_argument);
|
||||
BOOST_CHECK_THROW(std::vector<int> vect11=rft1.getRft<int>("XXXXXXX","B-2H", Date{2016,5,31}),std::invalid_argument);
|
||||
|
||||
// called with wrong type
|
||||
BOOST_CHECK_THROW(std::vector<int> vect1=rft1.getRft<int>("SGAS","B-2H", Date{2016,5,31}),std::runtime_error);
|
||||
BOOST_CHECK_THROW(std::vector<float> vect1=rft1.getRft<float>("CONIPOS","B-2H", Date{2016,5,31}),std::runtime_error);
|
||||
BOOST_CHECK_THROW(std::vector<std::string> vect1=rft1.getRft<std::string>("CONIPOS","B-2H", Date{2016,5,31}), std::runtime_error);
|
||||
BOOST_CHECK_THROW(std::vector<int> vect11=rft1.getRft<int>("SGAS","B-2H", Date{2016,5,31}),std::runtime_error);
|
||||
BOOST_CHECK_THROW(std::vector<float> vect11=rft1.getRft<float>("CONIPOS","B-2H", Date{2016,5,31}),std::runtime_error);
|
||||
BOOST_CHECK_THROW(std::vector<std::string> vect11=rft1.getRft<std::string>("CONIPOS","B-2H", Date{2016,5,31}), std::runtime_error);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user