mirror of
https://github.com/OPM/opm-upscaling.git
synced 2025-02-25 18:45:23 -06:00
Fixed uint->size_t issues, added ignore for executables.
This commit is contained in:
parent
680d5fb32c
commit
e8c4755527
@ -32,4 +32,8 @@ missing
|
|||||||
|
|
||||||
# Ignoring executables
|
# Ignoring executables
|
||||||
*_test
|
*_test
|
||||||
cpchop
|
dune/upscaling/test/cpchop
|
||||||
|
examples/upscale_avg
|
||||||
|
examples/upscale_cond
|
||||||
|
examples/upscale_perm
|
||||||
|
examples/upscale_relperm
|
||||||
|
@ -239,9 +239,9 @@ int main(int varnum, char** vararg) {
|
|||||||
const std::vector<int>& ecl_idx = upscaler.grid().globalCell();
|
const std::vector<int>& ecl_idx = upscaler.grid().globalCell();
|
||||||
CpGrid::Codim<0>::LeafIterator c = upscaler.grid().leafbegin<0>();
|
CpGrid::Codim<0>::LeafIterator c = upscaler.grid().leafbegin<0>();
|
||||||
for (; c != upscaler.grid().leafend<0>(); ++c) {
|
for (; c != upscaler.grid().leafend<0>(); ++c) {
|
||||||
uint cell_idx = ecl_idx[c->index()];
|
size_t cell_idx = ecl_idx[c->index()];
|
||||||
|
|
||||||
//for (uint cell_idx = 0; cell_idx < num_eclipse_cells; ++cell_idx) {
|
//for (size_t cell_idx = 0; cell_idx < num_eclipse_cells; ++cell_idx) {
|
||||||
if (!use_actnum){
|
if (!use_actnum){
|
||||||
cellVolumes[cell_idx] = c->geometry().volume();
|
cellVolumes[cell_idx] = c->geometry().volume();
|
||||||
}
|
}
|
||||||
@ -270,7 +270,7 @@ int main(int varnum, char** vararg) {
|
|||||||
|
|
||||||
int zeroporocells = 0;
|
int zeroporocells = 0;
|
||||||
int negativeporocells = 0;
|
int negativeporocells = 0;
|
||||||
for (uint cell_idx = 0; cell_idx < (uint)num_eclipse_cells; ++cell_idx) {
|
for (size_t cell_idx = 0; cell_idx < (size_t)num_eclipse_cells; ++cell_idx) {
|
||||||
if (poros[cell_idx] == 0) {
|
if (poros[cell_idx] == 0) {
|
||||||
++zeroporocells;
|
++zeroporocells;
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ int main(int varnum, char** vararg) {
|
|||||||
if (doperm) {
|
if (doperm) {
|
||||||
int zeropermcells = 0;
|
int zeropermcells = 0;
|
||||||
int negativepermcells = 0;
|
int negativepermcells = 0;
|
||||||
for (uint cell_idx = 0; cell_idx < (uint)num_eclipse_cells; ++cell_idx) {
|
for (size_t cell_idx = 0; cell_idx < (size_t)num_eclipse_cells; ++cell_idx) {
|
||||||
if (cellVolumes[cell_idx] > emptycellvolumecutoff) {
|
if (cellVolumes[cell_idx] > emptycellvolumecutoff) {
|
||||||
permxsum += permxs[cell_idx];
|
permxsum += permxs[cell_idx];
|
||||||
volpermxsum += permxs[cell_idx] * cellVolumes[cell_idx];
|
volpermxsum += permxs[cell_idx] * cellVolumes[cell_idx];
|
||||||
@ -378,7 +378,7 @@ int main(int varnum, char** vararg) {
|
|||||||
int maxsatnumvalue = 0;
|
int maxsatnumvalue = 0;
|
||||||
// Check that SATNUM are set sensibly, that is > 0 and < 1000, and find number
|
// Check that SATNUM are set sensibly, that is > 0 and < 1000, and find number
|
||||||
// of unique satnums present ( = number of rocktypes)
|
// of unique satnums present ( = number of rocktypes)
|
||||||
for (uint i = 0; i < (uint)satnums.size(); ++i) {
|
for (size_t i = 0; i < (size_t)satnums.size(); ++i) {
|
||||||
if (satnums[i] > maxsatnumvalue) {
|
if (satnums[i] > maxsatnumvalue) {
|
||||||
maxsatnumvalue = satnums[i];
|
maxsatnumvalue = satnums[i];
|
||||||
}
|
}
|
||||||
@ -416,7 +416,7 @@ int main(int varnum, char** vararg) {
|
|||||||
activecellcount_rocktype.resize(maxsatnumvalue+1, 0);
|
activecellcount_rocktype.resize(maxsatnumvalue+1, 0);
|
||||||
|
|
||||||
// Now loop over cells to collect statistics pr. rocktype
|
// Now loop over cells to collect statistics pr. rocktype
|
||||||
for (uint cell_idx = 0; cell_idx < (uint)num_eclipse_cells; ++cell_idx) {
|
for (size_t cell_idx = 0; cell_idx < (size_t)num_eclipse_cells; ++cell_idx) {
|
||||||
++totalcellcount_rocktype[satnums[cell_idx]];
|
++totalcellcount_rocktype[satnums[cell_idx]];
|
||||||
if (cellVolumes[cell_idx] > emptycellvolumecutoff) {
|
if (cellVolumes[cell_idx] > emptycellvolumecutoff) {
|
||||||
++activecellcount_rocktype[satnums[cell_idx]];
|
++activecellcount_rocktype[satnums[cell_idx]];
|
||||||
@ -441,7 +441,7 @@ int main(int varnum, char** vararg) {
|
|||||||
phi_var = 1/V*sum(v_i*(phi_i-phi_avg)^2)
|
phi_var = 1/V*sum(v_i*(phi_i-phi_avg)^2)
|
||||||
*/
|
*/
|
||||||
if (doporosity) {
|
if (doporosity) {
|
||||||
for (uint cell_idx = 0; cell_idx < (uint)num_eclipse_cells; ++cell_idx) {
|
for (size_t cell_idx = 0; cell_idx < (size_t)num_eclipse_cells; ++cell_idx) {
|
||||||
if (cellVolumes[cell_idx] > emptycellvolumecutoff) {
|
if (cellVolumes[cell_idx] > emptycellvolumecutoff) {
|
||||||
porosityvariancesum_rocktype[satnums[cell_idx]] += cellVolumes[cell_idx]
|
porosityvariancesum_rocktype[satnums[cell_idx]] += cellVolumes[cell_idx]
|
||||||
* pow((poros[cell_idx]-porevolumesum_rocktype[satnums[cell_idx]]/volumesum_rocktype[satnums[cell_idx]]),2);
|
* pow((poros[cell_idx]-porevolumesum_rocktype[satnums[cell_idx]]/volumesum_rocktype[satnums[cell_idx]]),2);
|
||||||
|
@ -472,7 +472,7 @@ int main(int varnum, char** vararg)
|
|||||||
zero and less than minPerm.
|
zero and less than minPerm.
|
||||||
- Check maximum number of SATNUM values (can be number of rock types present)
|
- Check maximum number of SATNUM values (can be number of rock types present)
|
||||||
*/
|
*/
|
||||||
for (uint i = 0; i < satnums.size(); ++i) {
|
for (size_t i = 0; i < satnums.size(); ++i) {
|
||||||
if (satnums[i] < 0 || satnums[i] > 1000) {
|
if (satnums[i] < 0 || satnums[i] > 1000) {
|
||||||
if (isMaster) cerr << "satnums[" << i << "] = " << satnums[i] << ", not sane, quitting." << endl;
|
if (isMaster) cerr << "satnums[" << i << "] = " << satnums[i] << ", not sane, quitting." << endl;
|
||||||
usageandexit();
|
usageandexit();
|
||||||
@ -519,7 +519,7 @@ int main(int varnum, char** vararg)
|
|||||||
const std::vector<int>& ecl_idx = upscaler.grid().globalCell();
|
const std::vector<int>& ecl_idx = upscaler.grid().globalCell();
|
||||||
CpGrid::Codim<0>::LeafIterator c = upscaler.grid().leafbegin<0>();
|
CpGrid::Codim<0>::LeafIterator c = upscaler.grid().leafbegin<0>();
|
||||||
for (; c != upscaler.grid().leafend<0>(); ++c) {
|
for (; c != upscaler.grid().leafend<0>(); ++c) {
|
||||||
uint cell_idx = ecl_idx[c->index()];
|
size_t cell_idx = ecl_idx[c->index()];
|
||||||
if (satnums[cell_idx] > 0) { // Satnum zero is "no rock"
|
if (satnums[cell_idx] > 0) { // Satnum zero is "no rock"
|
||||||
cellVolumes[cell_idx] = c->geometry().volume();
|
cellVolumes[cell_idx] = c->geometry().volume();
|
||||||
cellPoreVolumes[cell_idx] = cellVolumes[cell_idx] * poros[cell_idx];
|
cellPoreVolumes[cell_idx] = cellVolumes[cell_idx] * poros[cell_idx];
|
||||||
@ -598,7 +598,7 @@ int main(int varnum, char** vararg)
|
|||||||
rock basis, the rock types that are not set explicitly, will be
|
rock basis, the rock types that are not set explicitly, will be
|
||||||
given the general value.
|
given the general value.
|
||||||
*/
|
*/
|
||||||
for (uint i = 1; i <= (uint)maxSatnum; ++i) {
|
for (size_t i = 1; i <= (size_t)maxSatnum; ++i) {
|
||||||
|
|
||||||
stringstream rocktypestring;
|
stringstream rocktypestring;
|
||||||
rocktypestring << i; // integer to string conversion.
|
rocktypestring << i; // integer to string conversion.
|
||||||
@ -703,8 +703,8 @@ int main(int varnum, char** vararg)
|
|||||||
double waterVolume = 0.0;
|
double waterVolume = 0.0;
|
||||||
CpGrid::Codim<0>::LeafIterator c = upscaler.grid().leafbegin<0>();
|
CpGrid::Codim<0>::LeafIterator c = upscaler.grid().leafbegin<0>();
|
||||||
for (; c != upscaler.grid().leafend<0>(); ++c) {
|
for (; c != upscaler.grid().leafend<0>(); ++c) {
|
||||||
uint cell_idx = ecl_idx[c->index()];
|
size_t cell_idx = ecl_idx[c->index()];
|
||||||
// for (uint cell_idx = 0; cell_idx < satnums.size(); ++cell_idx) {
|
// for (size_t cell_idx = 0; cell_idx < satnums.size(); ++cell_idx) {
|
||||||
//if (LFgrid.getCellIndex(cell_idx) != EMPTY) {
|
//if (LFgrid.getCellIndex(cell_idx) != EMPTY) {
|
||||||
double waterSaturationCell = 0.0;
|
double waterSaturationCell = 0.0;
|
||||||
if (satnums[cell_idx] > 0) { // handle "no rock" cells with satnum zero
|
if (satnums[cell_idx] > 0) { // handle "no rock" cells with satnum zero
|
||||||
@ -832,8 +832,8 @@ int main(int varnum, char** vararg)
|
|||||||
|
|
||||||
CpGrid::Codim<0>::LeafIterator c = upscaler.grid().leafbegin<0>();
|
CpGrid::Codim<0>::LeafIterator c = upscaler.grid().leafbegin<0>();
|
||||||
for (; c != upscaler.grid().leafend<0>(); ++c) {
|
for (; c != upscaler.grid().leafend<0>(); ++c) {
|
||||||
uint cell_idx = ecl_idx[c->index()];
|
size_t cell_idx = ecl_idx[c->index()];
|
||||||
// for (uint cell_idx = 0; cell_idx < satnums.size(); ++cell_idx) {
|
// for (size_t cell_idx = 0; cell_idx < satnums.size(); ++cell_idx) {
|
||||||
// if (LFgrid.getCellIndex(cell_idx) != EMPTY) {
|
// if (LFgrid.getCellIndex(cell_idx) != EMPTY) {
|
||||||
double resistivityCell = resistivityCutoff;
|
double resistivityCell = resistivityCutoff;
|
||||||
if (satnums[cell_idx] > 0) { // SATNUM index == 0 is legal, means "not rock"
|
if (satnums[cell_idx] > 0) { // SATNUM index == 0 is legal, means "not rock"
|
||||||
@ -1046,7 +1046,7 @@ int main(int varnum, char** vararg)
|
|||||||
outputtmp << "# cementationExponent: " << options["cementationExponent"] << endl;
|
outputtmp << "# cementationExponent: " << options["cementationExponent"] << endl;
|
||||||
outputtmp << "# saturationExponent: " << options["saturationExponent"] << endl;
|
outputtmp << "# saturationExponent: " << options["saturationExponent"] << endl;
|
||||||
outputtmp << "# Archie options pr. rocktype:" << endl;
|
outputtmp << "# Archie options pr. rocktype:" << endl;
|
||||||
for (uint i = 1; i <= (uint)maxSatnum; ++i) {
|
for (size_t i = 1; i <= (size_t)maxSatnum; ++i) {
|
||||||
stringstream rocktypestring;
|
stringstream rocktypestring;
|
||||||
rocktypestring << i; // integer to string conversion.
|
rocktypestring << i; // integer to string conversion.
|
||||||
double cemoptionvalue = atof(options["rock" + rocktypestring.str() + "cemexp"].c_str());
|
double cemoptionvalue = atof(options["rock" + rocktypestring.str() + "cemexp"].c_str());
|
||||||
@ -1111,7 +1111,7 @@ int main(int varnum, char** vararg)
|
|||||||
// Find min and max for saturation values
|
// Find min and max for saturation values
|
||||||
double xmin = DBL_MAX;
|
double xmin = DBL_MAX;
|
||||||
double xmax = -DBL_MAX;
|
double xmax = -DBL_MAX;
|
||||||
for (uint i = 0; i < Satvalues.size(); ++i) {
|
for (size_t i = 0; i < Satvalues.size(); ++i) {
|
||||||
if (Satvalues[i] < xmin) {
|
if (Satvalues[i] < xmin) {
|
||||||
xmin = Satvalues[i];
|
xmin = Satvalues[i];
|
||||||
}
|
}
|
||||||
@ -1148,7 +1148,7 @@ int main(int varnum, char** vararg)
|
|||||||
|
|
||||||
|
|
||||||
/* Output computed resistivity data */
|
/* Output computed resistivity data */
|
||||||
for (uint i=0; i < Satvalues.size(); ++i) {
|
for (size_t i=0; i < Satvalues.size(); ++i) {
|
||||||
// Note: The Interpolator-object's values contain the log10 of the real values.
|
// Note: The Interpolator-object's values contain the log10 of the real values.
|
||||||
outputtmp << std::showpoint << std::setw(14) << Pvalues[i];
|
outputtmp << std::showpoint << std::setw(14) << Pvalues[i];
|
||||||
outputtmp << std::showpoint << std::setw(14) << Satvalues[i];
|
outputtmp << std::showpoint << std::setw(14) << Satvalues[i];
|
||||||
|
0
examples/upscale_perm.cpp
Executable file → Normal file
0
examples/upscale_perm.cpp
Executable file → Normal file
0
examples/upscale_relperm.cpp
Executable file → Normal file
0
examples/upscale_relperm.cpp
Executable file → Normal file
Loading…
Reference in New Issue
Block a user