Merge pull request #867 from babrodtk/fix_warnings
Fixed several warnings
This commit is contained in:
commit
c17488888e
@ -43,8 +43,8 @@ public:
|
||||
typedef BaseRowType::size_type size_type;
|
||||
typedef int value_type;
|
||||
|
||||
IntRange(const int* start, const int* end)
|
||||
: BaseRowType(start, end)
|
||||
IntRange(const int* start_arg, const int* end_arg)
|
||||
: BaseRowType(start_arg, end_arg)
|
||||
{}
|
||||
};
|
||||
/// \brief The type of the roww.
|
||||
@ -55,8 +55,8 @@ public:
|
||||
/// \param offset The offsets of the rows. Row i starts
|
||||
/// at offset[i] and ends a offset[i+1]
|
||||
/// \param size The number of entries/rows of the table
|
||||
SparseTableView(int* data, int *offset, std::size_t size)
|
||||
: data_(data), offset_(offset), size_(size)
|
||||
SparseTableView(int* data, int *offset, std::size_t size_arg)
|
||||
: data_(data), offset_(offset), size_(size_arg)
|
||||
{}
|
||||
|
||||
/// \brief Get a row of the the table.
|
||||
|
@ -48,18 +48,18 @@ namespace Opm
|
||||
|
||||
// Copy data
|
||||
const std::vector<double>& press = pvdoTable.getPressureColumn();
|
||||
const std::vector<double>& b = pvdoTable.getFormationFactorColumn();
|
||||
const std::vector<double>& b_var = pvdoTable.getFormationFactorColumn();
|
||||
const std::vector<double>& visc = pvdoTable.getViscosityColumn();
|
||||
|
||||
const int sz = b.size();
|
||||
const int sz = b_var.size();
|
||||
std::vector<double> inverseB(sz);
|
||||
for (int i = 0; i < sz; ++i) {
|
||||
inverseB[i] = 1.0 / b[i];
|
||||
inverseB[i] = 1.0 / b_var[i];
|
||||
}
|
||||
|
||||
std::vector<double> inverseBmu(sz);
|
||||
for (int i = 0; i < sz; ++i) {
|
||||
inverseBmu[i] = 1.0 / (b[i] * visc[i]);
|
||||
inverseBmu[i] = 1.0 / (b_var[i] * visc[i]);
|
||||
}
|
||||
|
||||
b_[regionIdx] = NonuniformTableLinear<double>(press, inverseB);
|
||||
|
@ -54,12 +54,12 @@ namespace Opm
|
||||
|
||||
// Copy data
|
||||
const std::vector<double> &press = pvdoTable.getPressureColumn();
|
||||
const std::vector<double> &B = pvdoTable.getFormationFactorColumn();
|
||||
const std::vector<double> &B_var = pvdoTable.getFormationFactorColumn();
|
||||
const std::vector<double> &visc = pvdoTable.getViscosityColumn();
|
||||
|
||||
std::vector<double> B_inv(numRows);
|
||||
for (int i = 0; i < numRows; ++i) {
|
||||
B_inv[i] = 1.0 / B[i];
|
||||
B_inv[i] = 1.0 / B_var[i];
|
||||
}
|
||||
|
||||
buildUniformMonotoneTable(press, B_inv, numSamples, b_[regionIdx]);
|
||||
|
@ -110,15 +110,15 @@ namespace Opm
|
||||
undersat_oil_tables_[pvtTableIdx][i][0].push_back(pressure);
|
||||
double compr = (1.0/undersat_oil_tables_[pvtTableIdx][iNext][1][j]-1.0/undersat_oil_tables_[pvtTableIdx][iNext][1][j-1])
|
||||
/ (0.5*(1.0/undersat_oil_tables_[pvtTableIdx][iNext][1][j]+1.0/undersat_oil_tables_[pvtTableIdx][iNext][1][j-1]));
|
||||
double B = (1.0/undersat_oil_tables_[pvtTableIdx][i][1].back())*(1.0+0.5*compr)/(1.0-0.5*compr);
|
||||
undersat_oil_tables_[pvtTableIdx][i][1].push_back(1.0/B);
|
||||
double B_var = (1.0/undersat_oil_tables_[pvtTableIdx][i][1].back())*(1.0+0.5*compr)/(1.0-0.5*compr);
|
||||
undersat_oil_tables_[pvtTableIdx][i][1].push_back(1.0/B_var);
|
||||
double visc = (undersat_oil_tables_[pvtTableIdx][iNext][2][j]-undersat_oil_tables_[pvtTableIdx][iNext][2][j-1])
|
||||
/ (0.5*(undersat_oil_tables_[pvtTableIdx][iNext][2][j]+undersat_oil_tables_[pvtTableIdx][iNext][2][j-1]));
|
||||
double mu = (undersat_oil_tables_[pvtTableIdx][i][2].back())*(1.0+0.5*visc)/(1.0-0.5*visc);
|
||||
undersat_oil_tables_[pvtTableIdx][i][2].push_back(mu);
|
||||
double mu_var = (undersat_oil_tables_[pvtTableIdx][i][2].back())*(1.0+0.5*visc)/(1.0-0.5*visc);
|
||||
undersat_oil_tables_[pvtTableIdx][i][2].push_back(mu_var);
|
||||
|
||||
// A try to expolate the 1/BMu with the expolated mu and B
|
||||
double inverseBMu = 1.0 / (B*mu);
|
||||
double inverseBMu = 1.0 / (B_var*mu_var);
|
||||
undersat_oil_tables_[pvtTableIdx][i][3].push_back(inverseBMu);
|
||||
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ namespace Opm
|
||||
if (deck->hasKeyword("GASVISCT")) {
|
||||
gasvisctTables_ = &tables->getGasvisctTables();
|
||||
assert(int(gasvisctTables_->size()) == numRegions);
|
||||
static_cast<void>(numRegions); //Silence compiler warning
|
||||
|
||||
gasCompIdx_ = deck->getKeyword("GCOMPIDX")->getRecord(0)->getItem("GAS_COMPONENT_INDEX")->getInt(0) - 1;
|
||||
gasvisctColumnName_ = "Viscosity"+std::to_string(static_cast<long long>(gasCompIdx_));
|
||||
|
@ -411,24 +411,24 @@ namespace Opm
|
||||
rs_func_[r], rv_func_[r],
|
||||
props.phaseUsage());
|
||||
|
||||
PVec press = phasePressures(G, eqreg, cells, grav);
|
||||
PVec pressures = phasePressures(G, eqreg, cells, grav);
|
||||
const std::vector<double>& temp = temperature(G, eqreg, cells);
|
||||
|
||||
const PVec sat = phaseSaturations(G, eqreg, cells, props, swat_init_, press);
|
||||
const PVec sat = phaseSaturations(G, eqreg, cells, props, swat_init_, pressures);
|
||||
|
||||
const int np = props.numPhases();
|
||||
for (int p = 0; p < np; ++p) {
|
||||
copyFromRegion(press[p], cells, pp_[p]);
|
||||
copyFromRegion(pressures[p], cells, pp_[p]);
|
||||
copyFromRegion(sat[p], cells, sat_[p]);
|
||||
}
|
||||
if (props.phaseUsage().phase_used[BlackoilPhases::Liquid]
|
||||
&& props.phaseUsage().phase_used[BlackoilPhases::Vapour]) {
|
||||
const int oilpos = props.phaseUsage().phase_pos[BlackoilPhases::Liquid];
|
||||
const int gaspos = props.phaseUsage().phase_pos[BlackoilPhases::Vapour];
|
||||
const Vec rs = computeRs(G, cells, press[oilpos], temp, *(rs_func_[r]), sat[gaspos]);
|
||||
const Vec rv = computeRs(G, cells, press[gaspos], temp, *(rv_func_[r]), sat[oilpos]);
|
||||
copyFromRegion(rs, cells, rs_);
|
||||
copyFromRegion(rv, cells, rv_);
|
||||
const Vec rs_vals = computeRs(G, cells, pressures[oilpos], temp, *(rs_func_[r]), sat[gaspos]);
|
||||
const Vec rv_vals = computeRs(G, cells, pressures[gaspos], temp, *(rv_func_[r]), sat[oilpos]);
|
||||
copyFromRegion(rs_vals, cells, rs_);
|
||||
copyFromRegion(rv_vals, cells, rv_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -176,18 +176,18 @@ BOOST_AUTO_TEST_CASE(cellAreas)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(cellCenters)
|
||||
{
|
||||
double cellCenters[] = {
|
||||
double cellCenters_var[] = {
|
||||
-1./3., 0.0, /* cell 0 */
|
||||
1./2., 0.0, /* cell 1 */
|
||||
};
|
||||
BOOST_REQUIRE (sizeof(cellCenters)/sizeof(cellCenters[0]) ==
|
||||
BOOST_REQUIRE (sizeof(cellCenters_var)/sizeof(cellCenters_var[0]) ==
|
||||
g->number_of_cells * g->dimensions);
|
||||
for (int cell = 0; cell < g->number_of_cells; ++cell)
|
||||
{
|
||||
for (int dim = 0; dim < g->dimensions; ++dim)
|
||||
{
|
||||
BOOST_REQUIRE_CLOSE (g->cell_centroids[cell*g->dimensions+dim],
|
||||
cellCenters[cell*g->dimensions+dim], 0.001);
|
||||
cellCenters_var[cell*g->dimensions+dim], 0.001);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user