pass by reference

This commit is contained in:
Arne Morten Kvarving 2017-06-08 17:16:39 +02:00
parent bc3eac293f
commit 9fbda39404
3 changed files with 7 additions and 7 deletions

View File

@ -183,7 +183,7 @@ class RegressionTest: public ECLFilesComparator {
//! \brief Calculates deviations for a specific keyword.
//! \param[in] keyword Keyword which should be compared, if this keyword is absent in one of the cases, an exception will be thrown.
//! \details This function loops through every report step and every cell and compares the values for the given keyword from the two input cases. If the absolute or relative deviation between the two values for each step exceeds both the absolute tolerance and the relative tolerance (stored in ECLFilesComparator), an exception is thrown. In addition, some keywords are marked for "disallow negative values" -- these are SGAS, SWAT and PRESSURE. An exception is thrown if a value of one of these keywords is both negative and has an absolute value larger than the absolute tolerance. If no exceptions are thrown, resultsForKeyword() uses the private member funtion printResultsForKeyword to print the average and median deviations.
void resultsForKeyword(const std::string keyword);
void resultsForKeyword(const std::string& keyword);
};
@ -239,7 +239,7 @@ class IntegrationTest: public ECLFilesComparator {
* For all other occurrences \f$n\f$, the deviation value \f$\Delta\f$ is calculated the same way, but the total value \f$S\f$ is calculated relative to the initial occurrence total \f$S_0\f$:
* \f[ S = \sum_{i} |q_{n,i} - q_{0,i}| v_i. \f]
* The error ratio is \f$ E = \Delta/S\f$. */
void resultsForKeyword(const std::string keyword);
void resultsForKeyword(const std::string& keyword);
};
#endif

View File

@ -334,7 +334,7 @@ std::vector<int> serialize_IWEL( size_t step,
std::vector< int > serialize_OPM_IWEL( const data::Wells& wells,
const std::vector< const Well* > sched_wells ) {
const std::vector< const Well* >& sched_wells ) {
const auto getctrl = [&]( const Well* w ) {
const auto itr = wells.find( w->name() );
@ -348,7 +348,7 @@ std::vector< int > serialize_OPM_IWEL( const data::Wells& wells,
std::vector< double > serialize_OPM_XWEL( const data::Wells& wells,
int report_step,
const std::vector< const Well* > sched_wells,
const std::vector< const Well* >& sched_wells,
const Phases& phase_spec,
const EclipseGrid& grid ) {
@ -537,7 +537,7 @@ void writeWell(ecl_rst_file_type* rst_file, int report_step, const EclipseState&
void checkSaveArguments(const data::Solution& cells,
const EclipseGrid& grid,
const std::map<std::string, std::vector<double>> extra_data) {
const std::map<std::string, std::vector<double>>& extra_data) {
const std::set<std::string> reserved_keys = {"LOGIHEAD", "INTEHEAD" ,"DOUBHEAD", "IWEL", "XWEL","ICON", "XCON" , "OPM_IWEL" , "OPM_XWEL", "ZWEL"};

View File

@ -440,7 +440,7 @@ void RegressionTest::results() {
void RegressionTest::resultsForKeyword(const std::string keyword) {
void RegressionTest::resultsForKeyword(const std::string& keyword) {
keywordValidForComparing(keyword);
const unsigned int occurrences1 = ecl_file_get_num_named_kw(ecl_file1, keyword.c_str());
const unsigned int occurrences2 = ecl_file_get_num_named_kw(ecl_file2, keyword.c_str());
@ -651,7 +651,7 @@ void IntegrationTest::results() {
void IntegrationTest::resultsForKeyword(const std::string keyword) {
void IntegrationTest::resultsForKeyword(const std::string& keyword) {
std::cout << "Comparing " << keyword << "...";
keywordValidForComparing(keyword);
const unsigned int occurrences1 = ecl_file_get_num_named_kw(ecl_file1, keyword.c_str());