rename all "newParserDeck" objects to "deck"

The "new" parser is now "the" parser...
This commit is contained in:
Andreas Lauser 2014-04-26 12:03:07 +02:00
parent f360562aee
commit 6a50afb219
19 changed files with 255 additions and 256 deletions

View File

@ -23,20 +23,20 @@
namespace Opm namespace Opm
{ {
BlackoilPropertiesFromDeck::BlackoilPropertiesFromDeck(Opm::DeckConstPtr newParserDeck, BlackoilPropertiesFromDeck::BlackoilPropertiesFromDeck(Opm::DeckConstPtr deck,
const UnstructuredGrid& grid, const UnstructuredGrid& grid,
bool init_rock) bool init_rock)
{ {
init(newParserDeck, grid.number_of_cells, grid.global_cell, grid.cartdims, init(deck, grid.number_of_cells, grid.global_cell, grid.cartdims,
grid.cell_centroids, grid.dimensions, init_rock); grid.cell_centroids, grid.dimensions, init_rock);
} }
BlackoilPropertiesFromDeck::BlackoilPropertiesFromDeck(Opm::DeckConstPtr newParserDeck, BlackoilPropertiesFromDeck::BlackoilPropertiesFromDeck(Opm::DeckConstPtr deck,
const UnstructuredGrid& grid, const UnstructuredGrid& grid,
const parameter::ParameterGroup& param, const parameter::ParameterGroup& param,
bool init_rock) bool init_rock)
{ {
init(newParserDeck, grid.number_of_cells, grid.global_cell, grid.cartdims, grid.cell_centroids, init(deck, grid.number_of_cells, grid.global_cell, grid.cartdims, grid.cell_centroids,
grid.dimensions, param, init_rock); grid.dimensions, param, init_rock);
} }

View File

@ -46,7 +46,7 @@ namespace Opm
/// \param[in] grid Grid to which property object applies, needed for the /// \param[in] grid Grid to which property object applies, needed for the
/// mapping from cell indices (typically from a processed grid) /// mapping from cell indices (typically from a processed grid)
/// to logical cartesian indices consistent with the deck. /// to logical cartesian indices consistent with the deck.
BlackoilPropertiesFromDeck(Opm::DeckConstPtr newParserDeck, BlackoilPropertiesFromDeck(Opm::DeckConstPtr deck,
const UnstructuredGrid& grid, bool init_rock=true ); const UnstructuredGrid& grid, bool init_rock=true );
/// Initialize from deck, grid and parameters. /// Initialize from deck, grid and parameters.
@ -60,14 +60,14 @@ namespace Opm
/// threephase_model("simple") three-phase relperm model (accepts "simple" and "stone2"). /// threephase_model("simple") three-phase relperm model (accepts "simple" and "stone2").
/// For both size parameters, a 0 or negative value indicates that no spline fitting is to /// For both size parameters, a 0 or negative value indicates that no spline fitting is to
/// be done, and the input fluid data used directly for linear interpolation. /// be done, and the input fluid data used directly for linear interpolation.
BlackoilPropertiesFromDeck(Opm::DeckConstPtr newParserDeck, BlackoilPropertiesFromDeck(Opm::DeckConstPtr deck,
const UnstructuredGrid& grid, const UnstructuredGrid& grid,
const parameter::ParameterGroup& param, const parameter::ParameterGroup& param,
bool init_rock=true); bool init_rock=true);
template<class CentroidIterator> template<class CentroidIterator>
BlackoilPropertiesFromDeck(Opm::DeckConstPtr newParserDeck, BlackoilPropertiesFromDeck(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell, const int* global_cell,
const int* cart_dims, const int* cart_dims,
@ -76,7 +76,7 @@ namespace Opm
bool init_rock=true); bool init_rock=true);
template<class CentroidIterator> template<class CentroidIterator>
BlackoilPropertiesFromDeck(Opm::DeckConstPtr newParserDeck, BlackoilPropertiesFromDeck(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell, const int* global_cell,
const int* cart_dims, const int* cart_dims,

View File

@ -26,12 +26,12 @@
namespace Opm namespace Opm
{ {
IncompPropertiesFromDeck::IncompPropertiesFromDeck(Opm::DeckConstPtr newParserDeck, IncompPropertiesFromDeck::IncompPropertiesFromDeck(Opm::DeckConstPtr deck,
const UnstructuredGrid& grid) const UnstructuredGrid& grid)
{ {
rock_.init(newParserDeck, grid.number_of_cells, grid.global_cell, grid.cartdims); rock_.init(deck, grid.number_of_cells, grid.global_cell, grid.cartdims);
pvt_.init(newParserDeck); pvt_.init(deck);
satprops_.init(newParserDeck, grid, 200); satprops_.init(deck, grid, 200);
if (pvt_.numPhases() != satprops_.numPhases()) { if (pvt_.numPhases() != satprops_.numPhases()) {
OPM_THROW(std::runtime_error, "IncompPropertiesFromDeck::IncompPropertiesFromDeck() - Inconsistent number of phases in pvt data (" OPM_THROW(std::runtime_error, "IncompPropertiesFromDeck::IncompPropertiesFromDeck() - Inconsistent number of phases in pvt data ("
<< pvt_.numPhases() << ") and saturation-dependent function data (" << satprops_.numPhases() << ")."); << pvt_.numPhases() << ") and saturation-dependent function data (" << satprops_.numPhases() << ").");

View File

@ -50,7 +50,7 @@ namespace Opm
/// \param grid Grid to which property object applies, needed for the /// \param grid Grid to which property object applies, needed for the
/// mapping from cell indices (typically from a processed grid) /// mapping from cell indices (typically from a processed grid)
/// to logical cartesian indices consistent with the deck. /// to logical cartesian indices consistent with the deck.
IncompPropertiesFromDeck(Opm::DeckConstPtr newParserDeck, IncompPropertiesFromDeck(Opm::DeckConstPtr deck,
const UnstructuredGrid& grid); const UnstructuredGrid& grid);
/// Destructor. /// Destructor.

View File

@ -69,19 +69,19 @@ namespace Opm
/// Looks at presence of WATER, OIL and GAS keywords in deck /// Looks at presence of WATER, OIL and GAS keywords in deck
/// to determine active phases. /// to determine active phases.
inline PhaseUsage phaseUsageFromDeck(Opm::DeckConstPtr newParserDeck) inline PhaseUsage phaseUsageFromDeck(Opm::DeckConstPtr deck)
{ {
PhaseUsage pu; PhaseUsage pu;
std::fill(pu.phase_used, pu.phase_used + BlackoilPhases::MaxNumPhases, 0); std::fill(pu.phase_used, pu.phase_used + BlackoilPhases::MaxNumPhases, 0);
// Discover phase usage. // Discover phase usage.
if (newParserDeck->hasKeyword("WATER")) { if (deck->hasKeyword("WATER")) {
pu.phase_used[BlackoilPhases::Aqua] = 1; pu.phase_used[BlackoilPhases::Aqua] = 1;
} }
if (newParserDeck->hasKeyword("OIL")) { if (deck->hasKeyword("OIL")) {
pu.phase_used[BlackoilPhases::Liquid] = 1; pu.phase_used[BlackoilPhases::Liquid] = 1;
} }
if (newParserDeck->hasKeyword("GAS")) { if (deck->hasKeyword("GAS")) {
pu.phase_used[BlackoilPhases::Vapour] = 1; pu.phase_used[BlackoilPhases::Vapour] = 1;
} }
pu.num_phases = 0; pu.num_phases = 0;

View File

@ -33,12 +33,12 @@ namespace Opm
{ {
} }
void PvtPropertiesIncompFromDeck::init(Opm::DeckConstPtr newParserDeck ) void PvtPropertiesIncompFromDeck::init(Opm::DeckConstPtr deck )
{ {
// If we need multiple regions, this class and the SinglePvt* classes must change. // If we need multiple regions, this class and the SinglePvt* classes must change.
int region_number = 0; int region_number = 0;
PhaseUsage phase_usage = phaseUsageFromDeck(newParserDeck); PhaseUsage phase_usage = phaseUsageFromDeck(deck);
if (phase_usage.phase_used[PhaseUsage::Vapour] || if (phase_usage.phase_used[PhaseUsage::Vapour] ||
!phase_usage.phase_used[PhaseUsage::Aqua] || !phase_usage.phase_used[PhaseUsage::Aqua] ||
!phase_usage.phase_used[PhaseUsage::Liquid]) { !phase_usage.phase_used[PhaseUsage::Liquid]) {
@ -46,8 +46,8 @@ namespace Opm
} }
// Surface densities. Accounting for different orders in eclipse and our code. // Surface densities. Accounting for different orders in eclipse and our code.
if (newParserDeck->hasKeyword("DENSITY")) { if (deck->hasKeyword("DENSITY")) {
Opm::DeckRecordConstPtr densityRecord = newParserDeck->getKeyword("DENSITY")->getRecord(region_number); Opm::DeckRecordConstPtr densityRecord = deck->getKeyword("DENSITY")->getRecord(region_number);
surface_density_[phase_usage.phase_pos[PhaseUsage::Aqua]] = densityRecord->getItem("OIL")->getSIDouble(0); surface_density_[phase_usage.phase_pos[PhaseUsage::Aqua]] = densityRecord->getItem("OIL")->getSIDouble(0);
surface_density_[phase_usage.phase_pos[PhaseUsage::Liquid]] = densityRecord->getItem("WATER")->getSIDouble(0); surface_density_[phase_usage.phase_pos[PhaseUsage::Liquid]] = densityRecord->getItem("WATER")->getSIDouble(0);
} else { } else {
@ -59,8 +59,8 @@ namespace Opm
reservoir_density_ = surface_density_; reservoir_density_ = surface_density_;
// Water viscosity. // Water viscosity.
if (newParserDeck->hasKeyword("PVTW")) { if (deck->hasKeyword("PVTW")) {
Opm::DeckRecordConstPtr pvtwRecord = newParserDeck->getKeyword("PVTW")->getRecord(region_number); Opm::DeckRecordConstPtr pvtwRecord = deck->getKeyword("PVTW")->getRecord(region_number);
if (pvtwRecord->getItem("WATER_COMPRESSIBILITY")->getSIDouble(0) != 0.0 || if (pvtwRecord->getItem("WATER_COMPRESSIBILITY")->getSIDouble(0) != 0.0 ||
pvtwRecord->getItem("WATER_VISCOSIBILITY")->getSIDouble(0) != 0.0) { pvtwRecord->getItem("WATER_VISCOSIBILITY")->getSIDouble(0) != 0.0) {
OPM_MESSAGE("Compressibility effects in PVTW are ignored."); OPM_MESSAGE("Compressibility effects in PVTW are ignored.");
@ -74,8 +74,8 @@ namespace Opm
} }
// Oil viscosity. // Oil viscosity.
if (newParserDeck->hasKeyword("PVCDO")) { if (deck->hasKeyword("PVCDO")) {
Opm::DeckRecordConstPtr pvcdoRecord = newParserDeck->getKeyword("PVCDO")->getRecord(region_number); Opm::DeckRecordConstPtr pvcdoRecord = deck->getKeyword("PVCDO")->getRecord(region_number);
if (pvcdoRecord->getItem("OIL_COMPRESSIBILITY")->getSIDouble(0) != 0.0 || if (pvcdoRecord->getItem("OIL_COMPRESSIBILITY")->getSIDouble(0) != 0.0 ||
pvcdoRecord->getItem("OIL_VISCOSIBILITY")->getSIDouble(0) != 0.0) { pvcdoRecord->getItem("OIL_VISCOSIBILITY")->getSIDouble(0) != 0.0) {

View File

@ -38,7 +38,7 @@ namespace Opm
PvtPropertiesIncompFromDeck(); PvtPropertiesIncompFromDeck();
/// Initialize from deck. /// Initialize from deck.
void init(Opm::DeckConstPtr newParserDeck); void init(Opm::DeckConstPtr deck);
/// Number of active phases. /// Number of active phases.
int numPhases() const; int numPhases() const;

View File

@ -40,19 +40,19 @@ namespace Opm
rock_comp_ = param.getDefault("rock_compressibility", 0.0)/unit::barsa; rock_comp_ = param.getDefault("rock_compressibility", 0.0)/unit::barsa;
} }
RockCompressibility::RockCompressibility(Opm::DeckConstPtr newParserDeck) RockCompressibility::RockCompressibility(Opm::DeckConstPtr deck)
: pref_(0.0), : pref_(0.0),
rock_comp_(0.0) rock_comp_(0.0)
{ {
if (newParserDeck->hasKeyword("ROCKTAB")) { if (deck->hasKeyword("ROCKTAB")) {
Opm::DeckKeywordConstPtr rtKeyword = newParserDeck->getKeyword("ROCKTAB"); Opm::DeckKeywordConstPtr rtKeyword = deck->getKeyword("ROCKTAB");
if (rtKeyword->size() != 1) if (rtKeyword->size() != 1)
OPM_THROW(std::runtime_error, "Can only handle a single region in ROCKTAB."); OPM_THROW(std::runtime_error, "Can only handle a single region in ROCKTAB.");
// the number of colums of the "ROCKTAB" keyword // the number of colums of the "ROCKTAB" keyword
// depends on the presence of the "RKTRMDIR" // depends on the presence of the "RKTRMDIR"
// keyword. Messy stuff... // keyword. Messy stuff...
bool isDirectional = newParserDeck->hasKeyword("RKTRMDIR"); bool isDirectional = deck->hasKeyword("RKTRMDIR");
if (isDirectional) if (isDirectional)
{ {
// well, okay. we don't support non-isotropic // well, okay. we don't support non-isotropic
@ -66,8 +66,8 @@ namespace Opm
p_ = rocktabTable.getPressureColumn(); p_ = rocktabTable.getPressureColumn();
poromult_ = rocktabTable.getPoreVolumeMultiplierColumn(); poromult_ = rocktabTable.getPoreVolumeMultiplierColumn();
transmult_ = rocktabTable.getTransmissibilityMultiplierColumn(); transmult_ = rocktabTable.getTransmissibilityMultiplierColumn();
} else if (newParserDeck->hasKeyword("ROCK")) { } else if (deck->hasKeyword("ROCK")) {
Opm::RockTable rockTable(newParserDeck->getKeyword("ROCK")); Opm::RockTable rockTable(deck->getKeyword("ROCK"));
if (rockTable.numRows() != 1) if (rockTable.numRows() != 1)
OPM_THROW(std::runtime_error, "Can only handle a single region in ROCK."); OPM_THROW(std::runtime_error, "Can only handle a single region in ROCK.");

View File

@ -34,7 +34,7 @@ namespace Opm
public: public:
/// Construct from input deck. /// Construct from input deck.
/// Looks for the keywords ROCK and ROCKTAB. /// Looks for the keywords ROCK and ROCKTAB.
RockCompressibility(Opm::DeckConstPtr newParserDeck); RockCompressibility(Opm::DeckConstPtr deck);
/// Construct from parameters. /// Construct from parameters.
/// Accepts the following parameters (with defaults). /// Accepts the following parameters (with defaults).

View File

@ -37,7 +37,7 @@ namespace Opm
void setScalarPermIfNeeded(std::array<int,9>& kmap, void setScalarPermIfNeeded(std::array<int,9>& kmap,
int i, int j, int k); int i, int j, int k);
PermeabilityKind fillTensor(Opm::DeckConstPtr newParserDeck, PermeabilityKind fillTensor(Opm::DeckConstPtr deck,
std::vector<const std::vector<double>*>& tensor, std::vector<const std::vector<double>*>& tensor,
std::array<int,9>& kmap); std::array<int,9>& kmap);
@ -53,23 +53,23 @@ namespace Opm
{ {
} }
void RockFromDeck::init(Opm::DeckConstPtr newParserDeck, void RockFromDeck::init(Opm::DeckConstPtr deck,
int number_of_cells, const int* global_cell, int number_of_cells, const int* global_cell,
const int* cart_dims) const int* cart_dims)
{ {
assignPorosity(newParserDeck, number_of_cells, global_cell); assignPorosity(deck, number_of_cells, global_cell);
permfield_valid_.assign(number_of_cells, false); permfield_valid_.assign(number_of_cells, false);
const double perm_threshold = 0.0; // Maybe turn into parameter? const double perm_threshold = 0.0; // Maybe turn into parameter?
assignPermeability(newParserDeck, number_of_cells, global_cell, cart_dims, assignPermeability(deck, number_of_cells, global_cell, cart_dims,
perm_threshold); perm_threshold);
} }
void RockFromDeck::assignPorosity(Opm::DeckConstPtr newParserDeck, void RockFromDeck::assignPorosity(Opm::DeckConstPtr deck,
int number_of_cells, const int* global_cell) int number_of_cells, const int* global_cell)
{ {
porosity_.assign(number_of_cells, 1.0); porosity_.assign(number_of_cells, 1.0);
if (newParserDeck->hasKeyword("PORO")) { if (deck->hasKeyword("PORO")) {
const std::vector<double>& poro = newParserDeck->getKeyword("PORO")->getSIDoubleData(); const std::vector<double>& poro = deck->getKeyword("PORO")->getSIDoubleData();
for (int c = 0; c < int(porosity_.size()); ++c) { for (int c = 0; c < int(porosity_.size()); ++c) {
const int deck_pos = (global_cell == NULL) ? c : global_cell[c]; const int deck_pos = (global_cell == NULL) ? c : global_cell[c];
assert(0 <= c && c < (int) porosity_.size()); assert(0 <= c && c < (int) porosity_.size());
@ -79,7 +79,7 @@ namespace Opm
} }
} }
void RockFromDeck::assignPermeability(Opm::DeckConstPtr newParserDeck, void RockFromDeck::assignPermeability(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell, const int* global_cell,
const int* cartdims, const int* cartdims,
@ -100,13 +100,13 @@ namespace Opm
tensor.push_back(&zero); tensor.push_back(&zero);
std::array<int,9> kmap; std::array<int,9> kmap;
PermeabilityKind pkind = fillTensor(newParserDeck, tensor, kmap); PermeabilityKind pkind = fillTensor(deck, tensor, kmap);
if (pkind == Invalid) { if (pkind == Invalid) {
OPM_THROW(std::runtime_error, "Invalid permeability field."); OPM_THROW(std::runtime_error, "Invalid permeability field.");
} }
// Assign permeability values only if such values are // Assign permeability values only if such values are
// given in the input deck represented by 'newParserDeck'. In // given in the input deck represented by 'deck'. In
// other words: Don't set any (arbitrary) default values. // other words: Don't set any (arbitrary) default values.
// It is infinitely better to experience a reproducible // It is infinitely better to experience a reproducible
// crash than subtle errors resulting from a (poorly // crash than subtle errors resulting from a (poorly
@ -143,7 +143,7 @@ namespace Opm
/// components such as @f$k_{xy}@f$ unless the /// components such as @f$k_{xy}@f$ unless the
/// corresponding diagonal components are known as well. /// corresponding diagonal components are known as well.
/// ///
/// @param newParserDeck [in] /// @param deck [in]
/// An Eclipse data parser capable of answering which /// An Eclipse data parser capable of answering which
/// permeability components are present in a given input /// permeability components are present in a given input
/// deck. /// deck.
@ -155,19 +155,19 @@ namespace Opm
/// TensorPerm at least one cross-component given. /// TensorPerm at least one cross-component given.
/// None no components given. /// None no components given.
/// Invalid invalid set of components given. /// Invalid invalid set of components given.
PermeabilityKind classifyPermeability(Opm::DeckConstPtr newParserDeck) PermeabilityKind classifyPermeability(Opm::DeckConstPtr deck)
{ {
const bool xx = newParserDeck->hasKeyword("PERMX" ); const bool xx = deck->hasKeyword("PERMX" );
const bool xy = newParserDeck->hasKeyword("PERMXY"); const bool xy = deck->hasKeyword("PERMXY");
const bool xz = newParserDeck->hasKeyword("PERMXZ"); const bool xz = deck->hasKeyword("PERMXZ");
const bool yx = newParserDeck->hasKeyword("PERMYX"); const bool yx = deck->hasKeyword("PERMYX");
const bool yy = newParserDeck->hasKeyword("PERMY" ); const bool yy = deck->hasKeyword("PERMY" );
const bool yz = newParserDeck->hasKeyword("PERMYZ"); const bool yz = deck->hasKeyword("PERMYZ");
const bool zx = newParserDeck->hasKeyword("PERMZX"); const bool zx = deck->hasKeyword("PERMZX");
const bool zy = newParserDeck->hasKeyword("PERMZY"); const bool zy = deck->hasKeyword("PERMZY");
const bool zz = newParserDeck->hasKeyword("PERMZ" ); const bool zz = deck->hasKeyword("PERMZ" );
int num_cross_comp = xy + xz + yx + yz + zx + zy; int num_cross_comp = xy + xz + yx + yz + zx + zy;
int num_comp = xx + yy + zz + num_cross_comp; int num_comp = xx + yy + zz + num_cross_comp;
@ -262,11 +262,11 @@ namespace Opm
/// ///
/// @param [out] tensor /// @param [out] tensor
/// @param [out] kmap /// @param [out] kmap
PermeabilityKind fillTensor(Opm::DeckConstPtr newParserDeck, PermeabilityKind fillTensor(Opm::DeckConstPtr deck,
std::vector<const std::vector<double>*>& tensor, std::vector<const std::vector<double>*>& tensor,
std::array<int,9>& kmap) std::array<int,9>& kmap)
{ {
PermeabilityKind kind = classifyPermeability(newParserDeck); PermeabilityKind kind = classifyPermeability(deck);
if (kind == Invalid) { if (kind == Invalid) {
OPM_THROW(std::runtime_error, "Invalid set of permeability fields given."); OPM_THROW(std::runtime_error, "Invalid set of permeability fields given.");
} }
@ -279,51 +279,51 @@ namespace Opm
// ----------------------------------------------------------- // -----------------------------------------------------------
// 1st row: [kxx, kxy, kxz] // 1st row: [kxx, kxy, kxz]
if (newParserDeck->hasKeyword("PERMX" )) { if (deck->hasKeyword("PERMX" )) {
kmap[xx] = tensor.size(); kmap[xx] = tensor.size();
tensor.push_back(&newParserDeck->getKeyword("PERMX")->getSIDoubleData()); tensor.push_back(&deck->getKeyword("PERMX")->getSIDoubleData());
setScalarPermIfNeeded(kmap, xx, yy, zz); setScalarPermIfNeeded(kmap, xx, yy, zz);
} }
if (newParserDeck->hasKeyword("PERMXY")) { if (deck->hasKeyword("PERMXY")) {
kmap[xy] = kmap[yx] = tensor.size(); // Enforce symmetry. kmap[xy] = kmap[yx] = tensor.size(); // Enforce symmetry.
tensor.push_back(&newParserDeck->getKeyword("PERMXY")->getSIDoubleData()); tensor.push_back(&deck->getKeyword("PERMXY")->getSIDoubleData());
} }
if (newParserDeck->hasKeyword("PERMXZ")) { if (deck->hasKeyword("PERMXZ")) {
kmap[xz] = kmap[zx] = tensor.size(); // Enforce symmetry. kmap[xz] = kmap[zx] = tensor.size(); // Enforce symmetry.
tensor.push_back(&newParserDeck->getKeyword("PERMXZ")->getSIDoubleData()); tensor.push_back(&deck->getKeyword("PERMXZ")->getSIDoubleData());
} }
// ----------------------------------------------------------- // -----------------------------------------------------------
// 2nd row: [kyx, kyy, kyz] // 2nd row: [kyx, kyy, kyz]
if (newParserDeck->hasKeyword("PERMYX")) { if (deck->hasKeyword("PERMYX")) {
kmap[yx] = kmap[xy] = tensor.size(); // Enforce symmetry. kmap[yx] = kmap[xy] = tensor.size(); // Enforce symmetry.
tensor.push_back(&newParserDeck->getKeyword("PERMYX")->getSIDoubleData()); tensor.push_back(&deck->getKeyword("PERMYX")->getSIDoubleData());
} }
if (newParserDeck->hasKeyword("PERMY" )) { if (deck->hasKeyword("PERMY" )) {
kmap[yy] = tensor.size(); kmap[yy] = tensor.size();
tensor.push_back(&newParserDeck->getKeyword("PERMY")->getSIDoubleData()); tensor.push_back(&deck->getKeyword("PERMY")->getSIDoubleData());
setScalarPermIfNeeded(kmap, yy, zz, xx); setScalarPermIfNeeded(kmap, yy, zz, xx);
} }
if (newParserDeck->hasKeyword("PERMYZ")) { if (deck->hasKeyword("PERMYZ")) {
kmap[yz] = kmap[zy] = tensor.size(); // Enforce symmetry. kmap[yz] = kmap[zy] = tensor.size(); // Enforce symmetry.
tensor.push_back(&newParserDeck->getKeyword("PERMYZ")->getSIDoubleData()); tensor.push_back(&deck->getKeyword("PERMYZ")->getSIDoubleData());
} }
// ----------------------------------------------------------- // -----------------------------------------------------------
// 3rd row: [kzx, kzy, kzz] // 3rd row: [kzx, kzy, kzz]
if (newParserDeck->hasKeyword("PERMZX")) { if (deck->hasKeyword("PERMZX")) {
kmap[zx] = kmap[xz] = tensor.size(); // Enforce symmetry. kmap[zx] = kmap[xz] = tensor.size(); // Enforce symmetry.
tensor.push_back(&newParserDeck->getKeyword("PERMZX")->getSIDoubleData()); tensor.push_back(&deck->getKeyword("PERMZX")->getSIDoubleData());
} }
if (newParserDeck->hasKeyword("PERMZY")) { if (deck->hasKeyword("PERMZY")) {
kmap[zy] = kmap[yz] = tensor.size(); // Enforce symmetry. kmap[zy] = kmap[yz] = tensor.size(); // Enforce symmetry.
tensor.push_back(&newParserDeck->getKeyword("PERMZY")->getSIDoubleData()); tensor.push_back(&deck->getKeyword("PERMZY")->getSIDoubleData());
} }
if (newParserDeck->hasKeyword("PERMZ" )) { if (deck->hasKeyword("PERMZ" )) {
kmap[zz] = tensor.size(); kmap[zz] = tensor.size();
tensor.push_back(&newParserDeck->getKeyword("PERMZ")->getSIDoubleData()); tensor.push_back(&deck->getKeyword("PERMZ")->getSIDoubleData());
setScalarPermIfNeeded(kmap, zz, xx, yy); setScalarPermIfNeeded(kmap, zz, xx, yy);
} }

View File

@ -36,12 +36,12 @@ namespace Opm
RockFromDeck(); RockFromDeck();
/// Initialize from deck and cell mapping. /// Initialize from deck and cell mapping.
/// \param newParserDeck Deck produced by the opm-parser code /// \param deck Deck produced by the opm-parser code
/// \param number_of_cells The number of cells in the grid. /// \param number_of_cells The number of cells in the grid.
/// \param global_cell The mapping fom local to global cell indices. /// \param global_cell The mapping fom local to global cell indices.
/// global_cell[i] is the corresponding global index of i. /// global_cell[i] is the corresponding global index of i.
/// \param cart_dims The size of the underlying cartesian grid. /// \param cart_dims The size of the underlying cartesian grid.
void init(Opm::DeckConstPtr newParserDeck, void init(Opm::DeckConstPtr deck,
int number_of_cells, const int* global_cell, int number_of_cells, const int* global_cell,
const int* cart_dims); const int* cart_dims);
@ -72,10 +72,10 @@ namespace Opm
} }
private: private:
void assignPorosity(Opm::DeckConstPtr newParserDeck, void assignPorosity(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell); const int* global_cell);
void assignPermeability(Opm::DeckConstPtr newParserDeck, void assignPermeability(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell, const int* global_cell,
const int* cart_dims, const int* cart_dims,

View File

@ -58,12 +58,12 @@ namespace Opm
/// to logical cartesian indices consistent with the deck. /// to logical cartesian indices consistent with the deck.
/// \param[in] samples Number of uniform sample points for saturation tables. /// \param[in] samples Number of uniform sample points for saturation tables.
/// NOTE: samples will only be used with the SatFuncSetUniform template argument. /// NOTE: samples will only be used with the SatFuncSetUniform template argument.
void init(Opm::DeckConstPtr newParserDeck, void init(Opm::DeckConstPtr deck,
const UnstructuredGrid& grid, const UnstructuredGrid& grid,
const int samples); const int samples);
/// Initialize from deck and grid. /// Initialize from deck and grid.
/// \param[in] newParserDeck Deck input parser /// \param[in] deck Deck input parser
/// \param[in] number_of_cells The number of cells of the grid to which property /// \param[in] number_of_cells The number of cells of the grid to which property
/// object applies, needed for the /// object applies, needed for the
/// mapping from cell indices (typically from a processed /// mapping from cell indices (typically from a processed
@ -76,7 +76,7 @@ namespace Opm
/// \param[in] samples Number of uniform sample points for saturation tables. /// \param[in] samples Number of uniform sample points for saturation tables.
/// NOTE: samples will only be used with the SatFuncSetUniform template argument. /// NOTE: samples will only be used with the SatFuncSetUniform template argument.
template<class T> template<class T>
void init(Opm::DeckConstPtr newParserDeck, void init(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell, const int* global_cell,
const T& begin_cell_centroids, const T& begin_cell_centroids,
@ -149,19 +149,19 @@ namespace Opm
const Funcs& funcForCell(const int cell) const; const Funcs& funcForCell(const int cell) const;
template<class T> template<class T>
void initEPS(Opm::DeckConstPtr newParserDeck, void initEPS(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell, const int* global_cell,
const T& begin_cell_centroids, const T& begin_cell_centroids,
int dimensions); int dimensions);
template<class T> template<class T>
void initEPSHyst(Opm::DeckConstPtr newParserDeck, void initEPSHyst(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell, const int* global_cell,
const T& begin_cell_centroids, const T& begin_cell_centroids,
int dimensions); int dimensions);
template<class T> template<class T>
void initEPSKey(Opm::DeckConstPtr newParserDeck, void initEPSKey(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell, const int* global_cell,
const T& begin_cell_centroids, const T& begin_cell_centroids,
@ -186,10 +186,10 @@ namespace Opm
const std::vector<double>& krsr, const std::vector<double>& krsr,
const std::vector<double>& krmax); const std::vector<double>& krmax);
bool columnIsMasked_(Opm::DeckConstPtr newParserDeck, bool columnIsMasked_(Opm::DeckConstPtr deck,
const std::string& keywordName, const std::string& keywordName,
int /* columnIdx */) int /* columnIdx */)
{ return newParserDeck->getKeyword(keywordName)->getRecord(0)->getItem(0)->getSIDouble(0) != -1.0; } { return deck->getKeyword(keywordName)->getRecord(0)->getItem(0)->getSIDouble(0) != -1.0; }
}; };

View File

@ -49,11 +49,11 @@ namespace Opm
/// Initialize from deck. /// Initialize from deck.
template <class SatFuncSet> template <class SatFuncSet>
void SaturationPropsFromDeck<SatFuncSet>::init(Opm::DeckConstPtr newParserDeck, void SaturationPropsFromDeck<SatFuncSet>::init(Opm::DeckConstPtr deck,
const UnstructuredGrid& grid, const UnstructuredGrid& grid,
const int samples) const int samples)
{ {
this->init(newParserDeck, grid.number_of_cells, this->init(deck, grid.number_of_cells,
grid.global_cell, grid.cell_centroids, grid.global_cell, grid.cell_centroids,
grid.dimensions, samples); grid.dimensions, samples);
} }
@ -61,14 +61,14 @@ namespace Opm
/// Initialize from deck. /// Initialize from deck.
template <class SatFuncSet> template <class SatFuncSet>
template<class T> template<class T>
void SaturationPropsFromDeck<SatFuncSet>::init(Opm::DeckConstPtr newParserDeck, void SaturationPropsFromDeck<SatFuncSet>::init(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell, const int* global_cell,
const T& begin_cell_centroids, const T& begin_cell_centroids,
int dimensions, int dimensions,
const int samples) const int samples)
{ {
phase_usage_ = phaseUsageFromDeck(newParserDeck); phase_usage_ = phaseUsageFromDeck(deck);
// Extract input data. // Extract input data.
// Oil phase should be active. // Oil phase should be active.
@ -78,8 +78,8 @@ namespace Opm
// Check SATOPTS status // Check SATOPTS status
bool hysteresis_switch = false; bool hysteresis_switch = false;
if (newParserDeck->hasKeyword("SATOPTS")) { if (deck->hasKeyword("SATOPTS")) {
const std::vector<std::string>& satopts = newParserDeck->getKeyword("SATOPTS")->getStringData(); const std::vector<std::string>& satopts = deck->getKeyword("SATOPTS")->getStringData();
for (size_t i = 0; i < satopts.size(); ++i) { for (size_t i = 0; i < satopts.size(); ++i) {
if (satopts[i] == std::string("HYSTER")) { if (satopts[i] == std::string("HYSTER")) {
hysteresis_switch = true; hysteresis_switch = true;
@ -92,15 +92,15 @@ namespace Opm
// Obtain SATNUM, if it exists, and create cell_to_func_. // Obtain SATNUM, if it exists, and create cell_to_func_.
// Otherwise, let the cell_to_func_ mapping be just empty. // Otherwise, let the cell_to_func_ mapping be just empty.
int satfuncs_expected = 1; int satfuncs_expected = 1;
if (newParserDeck->hasKeyword("SATNUM")) { if (deck->hasKeyword("SATNUM")) {
const std::vector<int>& satnum = newParserDeck->getKeyword("SATNUM")->getIntData(); const std::vector<int>& satnum = deck->getKeyword("SATNUM")->getIntData();
satfuncs_expected = *std::max_element(satnum.begin(), satnum.end()); satfuncs_expected = *std::max_element(satnum.begin(), satnum.end());
const int num_cells = number_of_cells; const int num_cells = number_of_cells;
cell_to_func_.resize(num_cells); cell_to_func_.resize(num_cells);
const int* gc = global_cell; const int* gc = global_cell;
for (int cell = 0; cell < num_cells; ++cell) { for (int cell = 0; cell < num_cells; ++cell) {
const int newParserDeck_pos = (gc == NULL) ? cell : gc[cell]; const int deck_pos = (gc == NULL) ? cell : gc[cell];
cell_to_func_[cell] = satnum[newParserDeck_pos] - 1; cell_to_func_[cell] = satnum[deck_pos] - 1;
} }
} }
@ -108,13 +108,13 @@ namespace Opm
enum { Uninitialized = -1 }; enum { Uninitialized = -1 };
int num_tables = Uninitialized; int num_tables = Uninitialized;
if (phase_usage_.phase_used[Aqua]) { if (phase_usage_.phase_used[Aqua]) {
num_tables = newParserDeck->getKeyword("SWOF")->size(); num_tables = deck->getKeyword("SWOF")->size();
if (num_tables < satfuncs_expected) { if (num_tables < satfuncs_expected) {
OPM_THROW(std::runtime_error, "Found " << num_tables << " SWOF tables, SATNUM specifies at least " << satfuncs_expected); OPM_THROW(std::runtime_error, "Found " << num_tables << " SWOF tables, SATNUM specifies at least " << satfuncs_expected);
} }
} }
if (phase_usage_.phase_used[Vapour]) { if (phase_usage_.phase_used[Vapour]) {
int num_sgof_tables = newParserDeck->getKeyword("SGOF")->size(); int num_sgof_tables = deck->getKeyword("SGOF")->size();
if (num_sgof_tables < satfuncs_expected) { if (num_sgof_tables < satfuncs_expected) {
OPM_THROW(std::runtime_error, "Found " << num_tables << " SGOF tables, SATNUM specifies at least " << satfuncs_expected); OPM_THROW(std::runtime_error, "Found " << num_tables << " SGOF tables, SATNUM specifies at least " << satfuncs_expected);
} }
@ -128,36 +128,36 @@ namespace Opm
// Initialize tables. // Initialize tables.
satfuncset_.resize(num_tables); satfuncset_.resize(num_tables);
for (int table = 0; table < num_tables; ++table) { for (int table = 0; table < num_tables; ++table) {
satfuncset_[table].init(newParserDeck, table, phase_usage_, samples); satfuncset_[table].init(deck, table, phase_usage_, samples);
} }
// Check EHYSTR status // Check EHYSTR status
do_hyst_ = false; do_hyst_ = false;
if (hysteresis_switch && newParserDeck->hasKeyword("EHYSTR")) { if (hysteresis_switch && deck->hasKeyword("EHYSTR")) {
const int& relative_perm_hyst = newParserDeck->getKeyword("EHYSTR")->getRecord(0)->getItem(1)->getInt(0); const int& relative_perm_hyst = deck->getKeyword("EHYSTR")->getRecord(0)->getItem(1)->getInt(0);
const std::string& limiting_hyst_flag = newParserDeck->getKeyword("EHYSTR")->getRecord(0)->getItem(4)->getString(0); const std::string& limiting_hyst_flag = deck->getKeyword("EHYSTR")->getRecord(0)->getItem(4)->getString(0);
if (relative_perm_hyst != int(0)) { if (relative_perm_hyst != int(0)) {
OPM_THROW(std::runtime_error, "Keyword EHYSTR, item 2: Flag '" << relative_perm_hyst << "' found, only '0' is supported. "); OPM_THROW(std::runtime_error, "Keyword EHYSTR, item 2: Flag '" << relative_perm_hyst << "' found, only '0' is supported. ");
} }
if (limiting_hyst_flag != std::string("KR")) { if (limiting_hyst_flag != std::string("KR")) {
OPM_THROW(std::runtime_error, "Keyword EHYSTR, item 5: Flag '" << limiting_hyst_flag << "' found, only 'KR' is supported. "); OPM_THROW(std::runtime_error, "Keyword EHYSTR, item 5: Flag '" << limiting_hyst_flag << "' found, only 'KR' is supported. ");
} }
if ( ! newParserDeck->hasKeyword("ENDSCALE")) { if ( ! deck->hasKeyword("ENDSCALE")) {
// TODO When use of IMBNUM is implemented, this constraint will be lifted. // TODO When use of IMBNUM is implemented, this constraint will be lifted.
OPM_THROW(std::runtime_error, "Currently hysteris effects is only available through endpoint scaling."); OPM_THROW(std::runtime_error, "Currently hysteris effects is only available through endpoint scaling.");
} }
do_hyst_ = true; do_hyst_ = true;
} else if (hysteresis_switch) { } else if (hysteresis_switch) {
OPM_THROW(std::runtime_error, "Switch HYSTER of keyword SATOPTS is active, but keyword EHYSTR not found."); OPM_THROW(std::runtime_error, "Switch HYSTER of keyword SATOPTS is active, but keyword EHYSTR not found.");
} else if (newParserDeck->hasKeyword("EHYSTR")) { } else if (deck->hasKeyword("EHYSTR")) {
OPM_THROW(std::runtime_error, "Found keyword EHYSTR, but switch HYSTER of keyword SATOPTS is not set."); OPM_THROW(std::runtime_error, "Found keyword EHYSTR, but switch HYSTER of keyword SATOPTS is not set.");
} }
// Saturation table scaling // Saturation table scaling
do_eps_ = false; do_eps_ = false;
do_3pt_ = false; do_3pt_ = false;
if (newParserDeck->hasKeyword("ENDSCALE")) { if (deck->hasKeyword("ENDSCALE")) {
Opm::EndscaleWrapper endscale(newParserDeck->getKeyword("ENDSCALE")); Opm::EndscaleWrapper endscale(deck->getKeyword("ENDSCALE"));
if (endscale.directionSwitch() != std::string("NODIR")) { if (endscale.directionSwitch() != std::string("NODIR")) {
OPM_THROW(std::runtime_error, OPM_THROW(std::runtime_error,
"SaturationPropsFromDeck::init() -- ENDSCALE: " "SaturationPropsFromDeck::init() -- ENDSCALE: "
@ -168,8 +168,8 @@ namespace Opm
"SaturationPropsFromDeck::init() -- ENDSCALE: " "SaturationPropsFromDeck::init() -- ENDSCALE: "
"Currently only 'REVERS' accepted."); "Currently only 'REVERS' accepted.");
} }
if (newParserDeck->hasKeyword("SCALECRS")) { if (deck->hasKeyword("SCALECRS")) {
Opm::ScalecrsWrapper scalecrs(newParserDeck->getKeyword("SCALECRS")); Opm::ScalecrsWrapper scalecrs(deck->getKeyword("SCALECRS"));
if (scalecrs.isEnabled()) { if (scalecrs.isEnabled()) {
do_3pt_ = true; do_3pt_ = true;
} }
@ -177,8 +177,8 @@ namespace Opm
do_eps_ = true; do_eps_ = true;
// Make a consistency check of ENDNUM: #regions = NTENDP (ENDSCALE::3, TABDIMS::8)... // Make a consistency check of ENDNUM: #regions = NTENDP (ENDSCALE::3, TABDIMS::8)...
if (newParserDeck->hasKeyword("ENDNUM")) { if (deck->hasKeyword("ENDNUM")) {
const std::vector<int>& endnum = newParserDeck->getKeyword("ENDNUM")->getIntData(); const std::vector<int>& endnum = deck->getKeyword("ENDNUM")->getIntData();
int endnum_regions = *std::max_element(endnum.begin(), endnum.end()); int endnum_regions = *std::max_element(endnum.begin(), endnum.end());
if (endnum_regions > endscale.numEndscaleTables()) { if (endnum_regions > endscale.numEndscaleTables()) {
OPM_THROW(std::runtime_error, OPM_THROW(std::runtime_error,
@ -190,30 +190,29 @@ namespace Opm
// TODO: ENPTVD/ENKRVD: Too few tables gives a cryptical message from parser, // TODO: ENPTVD/ENKRVD: Too few tables gives a cryptical message from parser,
// superfluous tables are ignored by the parser without any warning ... // superfluous tables are ignored by the parser without any warning ...
initEPS(newParserDeck, number_of_cells, global_cell, begin_cell_centroids, initEPS(deck, number_of_cells, global_cell, begin_cell_centroids,
dimensions); dimensions);
if (do_hyst_) { if (do_hyst_) {
if (newParserDeck->hasKeyword("KRW") if (deck->hasKeyword("KRW")
|| newParserDeck->hasKeyword("KRG") || deck->hasKeyword("KRG")
|| newParserDeck->hasKeyword("KRO") || deck->hasKeyword("KRO")
|| newParserDeck->hasKeyword("KRWR") || deck->hasKeyword("KRWR")
|| newParserDeck->hasKeyword("KRGR") || deck->hasKeyword("KRGR")
|| newParserDeck->hasKeyword("KRORW") || deck->hasKeyword("KRORW")
|| newParserDeck->hasKeyword("KRORG") || deck->hasKeyword("KRORG")
|| newParserDeck->hasKeyword("ENKRVD") || deck->hasKeyword("ENKRVD")
|| newParserDeck->hasKeyword("IKRW") || deck->hasKeyword("IKRG")
|| newParserDeck->hasKeyword("IKRG") || deck->hasKeyword("IKRO")
|| newParserDeck->hasKeyword("IKRO") || deck->hasKeyword("IKRWR")
|| newParserDeck->hasKeyword("IKRWR") || deck->hasKeyword("IKRGR")
|| newParserDeck->hasKeyword("IKRGR") || deck->hasKeyword("IKRORW")
|| newParserDeck->hasKeyword("IKRORW") || deck->hasKeyword("IKRORG") ) {
|| newParserDeck->hasKeyword("IKRORG") ) {
OPM_THROW(std::runtime_error,"Currently hysteresis and relperm value scaling cannot be combined."); OPM_THROW(std::runtime_error,"Currently hysteresis and relperm value scaling cannot be combined.");
} }
if (newParserDeck->hasKeyword("IMBNUM")) { if (deck->hasKeyword("IMBNUM")) {
const std::vector<int>& imbnum = newParserDeck->getKeyword("IMBNUM")->getIntData(); const std::vector<int>& imbnum = deck->getKeyword("IMBNUM")->getIntData();
int imbnum_regions = *std::max_element(imbnum.begin(), imbnum.end()); int imbnum_regions = *std::max_element(imbnum.begin(), imbnum.end());
if (imbnum_regions > num_tables) { if (imbnum_regions > num_tables) {
OPM_THROW(std::runtime_error, OPM_THROW(std::runtime_error,
@ -232,7 +231,7 @@ namespace Opm
// to be a scaled version of the drainage curve (confer Norne model). // to be a scaled version of the drainage curve (confer Norne model).
} }
initEPSHyst(newParserDeck, number_of_cells, global_cell, begin_cell_centroids, initEPSHyst(deck, number_of_cells, global_cell, begin_cell_centroids,
dimensions); dimensions);
} }
} }
@ -424,7 +423,7 @@ namespace Opm
// Initialize saturation scaling parameters // Initialize saturation scaling parameters
template <class SatFuncSet> template <class SatFuncSet>
template<class T> template<class T>
void SaturationPropsFromDeck<SatFuncSet>::initEPS(Opm::DeckConstPtr newParserDeck, void SaturationPropsFromDeck<SatFuncSet>::initEPS(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell, const int* global_cell,
const T& begin_cell_centroid, const T& begin_cell_centroid,
@ -433,35 +432,35 @@ namespace Opm
std::vector<double> swl, swcr, swu, sgl, sgcr, sgu, sowcr, sogcr; std::vector<double> swl, swcr, swu, sgl, sgcr, sgu, sowcr, sogcr;
std::vector<double> krw, krg, kro, krwr, krgr, krorw, krorg; std::vector<double> krw, krg, kro, krwr, krgr, krorw, krorg;
// Initialize saturation scaling parameter // Initialize saturation scaling parameter
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("SWL"), swl); std::string("SWL"), swl);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("SWU"), swu); std::string("SWU"), swu);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("SWCR"), swcr); std::string("SWCR"), swcr);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("SGL"), sgl); std::string("SGL"), sgl);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("SGU"), sgu); std::string("SGU"), sgu);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("SGCR"), sgcr); std::string("SGCR"), sgcr);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("SOWCR"), sowcr); std::string("SOWCR"), sowcr);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("SOGCR"), sogcr); std::string("SOGCR"), sogcr);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("KRW"), krw); std::string("KRW"), krw);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("KRG"), krg); std::string("KRG"), krg);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("KRO"), kro); std::string("KRO"), kro);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("KRWR"), krwr); std::string("KRWR"), krwr);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("KRGR"), krgr); std::string("KRGR"), krgr);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("KRORW"), krorw); std::string("KRORW"), krorw);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("KRORG"), krorg); std::string("KRORG"), krorg);
eps_transf_.resize(number_of_cells); eps_transf_.resize(number_of_cells);
@ -507,7 +506,7 @@ namespace Opm
// Initialize hysteresis saturation scaling parameters // Initialize hysteresis saturation scaling parameters
template <class SatFuncSet> template <class SatFuncSet>
template<class T> template<class T>
void SaturationPropsFromDeck<SatFuncSet>::initEPSHyst(Opm::DeckConstPtr newParserDeck, void SaturationPropsFromDeck<SatFuncSet>::initEPSHyst(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell, const int* global_cell,
const T& begin_cell_centroid, const T& begin_cell_centroid,
@ -516,35 +515,35 @@ namespace Opm
std::vector<double> iswl, iswcr, iswu, isgl, isgcr, isgu, isowcr, isogcr; std::vector<double> iswl, iswcr, iswu, isgl, isgcr, isgu, isowcr, isogcr;
std::vector<double> ikrw, ikrg, ikro, ikrwr, ikrgr, ikrorw, ikrorg; std::vector<double> ikrw, ikrg, ikro, ikrwr, ikrgr, ikrorw, ikrorg;
// Initialize hysteresis saturation scaling parameters // Initialize hysteresis saturation scaling parameters
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("ISWL"), iswl); std::string("ISWL"), iswl);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("ISWU"), iswu); std::string("ISWU"), iswu);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("ISWCR"), iswcr); std::string("ISWCR"), iswcr);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("ISGL"), isgl); std::string("ISGL"), isgl);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("ISGU"), isgu); std::string("ISGU"), isgu);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("ISGCR"), isgcr); std::string("ISGCR"), isgcr);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("ISOWCR"), isowcr); std::string("ISOWCR"), isowcr);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("ISOGCR"), isogcr); std::string("ISOGCR"), isogcr);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("IKRW"), ikrw); std::string("IKRW"), ikrw);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("IKRG"), ikrg); std::string("IKRG"), ikrg);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("IKRO"), ikro); std::string("IKRO"), ikro);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("IKRWR"), ikrwr); std::string("IKRWR"), ikrwr);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("IKRGR"), ikrgr); std::string("IKRGR"), ikrgr);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("IKRORW"), ikrorw); std::string("IKRORW"), ikrorw);
initEPSKey(newParserDeck, number_of_cells, global_cell, begin_cell_centroid, dimensions, initEPSKey(deck, number_of_cells, global_cell, begin_cell_centroid, dimensions,
std::string("IKRORG"), ikrorg); std::string("IKRORG"), ikrorg);
eps_transf_hyst_.resize(number_of_cells); eps_transf_hyst_.resize(number_of_cells);
@ -591,7 +590,7 @@ namespace Opm
// Initialize saturation scaling parameter // Initialize saturation scaling parameter
template <class SatFuncSet> template <class SatFuncSet>
template<class T> template<class T>
void SaturationPropsFromDeck<SatFuncSet>::initEPSKey(Opm::DeckConstPtr newParserDeck, void SaturationPropsFromDeck<SatFuncSet>::initEPSKey(Opm::DeckConstPtr deck,
int number_of_cells, int number_of_cells,
const int* global_cell, const int* global_cell,
const T& begin_cell_centroid, const T& begin_cell_centroid,
@ -602,9 +601,9 @@ namespace Opm
const bool useAqua = phase_usage_.phase_used[Aqua]; const bool useAqua = phase_usage_.phase_used[Aqua];
const bool useLiquid = phase_usage_.phase_used[Liquid]; const bool useLiquid = phase_usage_.phase_used[Liquid];
const bool useVapour = phase_usage_.phase_used[Vapour]; const bool useVapour = phase_usage_.phase_used[Vapour];
bool useKeyword = newParserDeck->hasKeyword(keyword); bool useKeyword = deck->hasKeyword(keyword);
bool hasENPTVD = newParserDeck->hasKeyword("ENPTVD"); bool hasENPTVD = deck->hasKeyword("ENPTVD");
bool hasENKRVD = newParserDeck->hasKeyword("ENKRVD"); bool hasENKRVD = deck->hasKeyword("ENKRVD");
int itab = 0; int itab = 0;
std::vector<std::vector<double> > param_col; std::vector<std::vector<double> > param_col;
std::vector<std::vector<double> > depth_col; std::vector<std::vector<double> > depth_col;
@ -615,56 +614,56 @@ namespace Opm
int phase_pos_vapour = phase_usage_.phase_pos[BlackoilPhases::Vapour]; int phase_pos_vapour = phase_usage_.phase_pos[BlackoilPhases::Vapour];
if ((keyword[0] == 'S' && (useKeyword || hasENPTVD)) || (keyword[1] == 'S' && useKeyword) ) { if ((keyword[0] == 'S' && (useKeyword || hasENPTVD)) || (keyword[1] == 'S' && useKeyword) ) {
if (keyword == std::string("SWL") || keyword == std::string("ISWL") ) { if (keyword == std::string("SWL") || keyword == std::string("ISWL") ) {
if (useAqua && (useKeyword || columnIsMasked_(newParserDeck, "ENPTVD", 0))) { if (useAqua && (useKeyword || columnIsMasked_(deck, "ENPTVD", 0))) {
itab = 1; itab = 1;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).smin_[phase_pos_aqua]; scaleparam[i] = funcForCell(i).smin_[phase_pos_aqua];
} }
} else if (keyword == std::string("SWCR") || keyword == std::string("ISWCR") ) { } else if (keyword == std::string("SWCR") || keyword == std::string("ISWCR") ) {
if (useAqua && (useKeyword || columnIsMasked_(newParserDeck, "ENPTVD", 1))) { if (useAqua && (useKeyword || columnIsMasked_(deck, "ENPTVD", 1))) {
itab = 2; itab = 2;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).swcr_; scaleparam[i] = funcForCell(i).swcr_;
} }
} else if (keyword == std::string("SWU") || keyword == std::string("ISWU") ) { } else if (keyword == std::string("SWU") || keyword == std::string("ISWU") ) {
if (useAqua && (useKeyword || columnIsMasked_(newParserDeck, "ENPTVD", 2))) { if (useAqua && (useKeyword || columnIsMasked_(deck, "ENPTVD", 2))) {
itab = 3; itab = 3;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).smax_[phase_pos_aqua]; scaleparam[i] = funcForCell(i).smax_[phase_pos_aqua];
} }
} else if (keyword == std::string("SGL") || keyword == std::string("ISGL") ) { } else if (keyword == std::string("SGL") || keyword == std::string("ISGL") ) {
if (useVapour && (useKeyword || columnIsMasked_(newParserDeck, "ENPTVD", 3))) { if (useVapour && (useKeyword || columnIsMasked_(deck, "ENPTVD", 3))) {
itab = 4; itab = 4;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).smin_[phase_pos_vapour]; scaleparam[i] = funcForCell(i).smin_[phase_pos_vapour];
} }
} else if (keyword == std::string("SGCR") || keyword == std::string("ISGCR") ) { } else if (keyword == std::string("SGCR") || keyword == std::string("ISGCR") ) {
if (useVapour && (useKeyword || columnIsMasked_(newParserDeck, "ENPTVD", 4))) { if (useVapour && (useKeyword || columnIsMasked_(deck, "ENPTVD", 4))) {
itab = 5; itab = 5;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).sgcr_; scaleparam[i] = funcForCell(i).sgcr_;
} }
} else if (keyword == std::string("SGU") || keyword == std::string("ISGU") ) { } else if (keyword == std::string("SGU") || keyword == std::string("ISGU") ) {
if (useVapour && (useKeyword || columnIsMasked_(newParserDeck, "ENPTVD", 5))) { if (useVapour && (useKeyword || columnIsMasked_(deck, "ENPTVD", 5))) {
itab = 6; itab = 6;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).smax_[phase_pos_vapour]; scaleparam[i] = funcForCell(i).smax_[phase_pos_vapour];
} }
} else if (keyword == std::string("SOWCR") || keyword == std::string("ISOWCR") ) { } else if (keyword == std::string("SOWCR") || keyword == std::string("ISOWCR") ) {
if (useAqua && (useKeyword || columnIsMasked_(newParserDeck, "ENPTVD", 6))) { if (useAqua && (useKeyword || columnIsMasked_(deck, "ENPTVD", 6))) {
itab = 7; itab = 7;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).sowcr_; scaleparam[i] = funcForCell(i).sowcr_;
} }
} else if (keyword == std::string("SOGCR") || keyword == std::string("ISOGCR") ) { } else if (keyword == std::string("SOGCR") || keyword == std::string("ISOGCR") ) {
if (useVapour && (useKeyword || columnIsMasked_(newParserDeck, "ENPTVD", 7))) { if (useVapour && (useKeyword || columnIsMasked_(deck, "ENPTVD", 7))) {
itab = 8; itab = 8;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
@ -674,61 +673,61 @@ namespace Opm
OPM_THROW(std::runtime_error, " -- unknown keyword: '" << keyword << "'"); OPM_THROW(std::runtime_error, " -- unknown keyword: '" << keyword << "'");
} }
if (!useKeyword && itab > 0) { if (!useKeyword && itab > 0) {
int num_tables = newParserDeck->getKeyword("ENPTVD")->size(); int num_tables = deck->getKeyword("ENPTVD")->size();
param_col.resize(num_tables); param_col.resize(num_tables);
depth_col.resize(num_tables); depth_col.resize(num_tables);
col_names.resize(9); col_names.resize(9);
for (int table_num=0; table_num<num_tables; ++table_num) { for (int table_num=0; table_num<num_tables; ++table_num) {
Opm::SingleRecordTable enptvd(newParserDeck->getKeyword("ENPTVD"), col_names, table_num); Opm::SingleRecordTable enptvd(deck->getKeyword("ENPTVD"), col_names, table_num);
depth_col[table_num] = enptvd.getColumn(0); // depth depth_col[table_num] = enptvd.getColumn(0); // depth
param_col[table_num] = enptvd.getColumn(itab); // itab=[1-8]: swl swcr swu sgl sgcr sgu sowcr sogcr param_col[table_num] = enptvd.getColumn(itab); // itab=[1-8]: swl swcr swu sgl sgcr sgu sowcr sogcr
} }
} }
} else if ((keyword[0] == 'K' && (useKeyword || hasENKRVD)) || (keyword[1] == 'K' && useKeyword) ) { } else if ((keyword[0] == 'K' && (useKeyword || hasENKRVD)) || (keyword[1] == 'K' && useKeyword) ) {
if (keyword == std::string("KRW") || keyword == std::string("IKRW") ) { if (keyword == std::string("KRW") || keyword == std::string("IKRW") ) {
if (useAqua && (useKeyword || columnIsMasked_(newParserDeck, "ENKRVD", 0))) { if (useAqua && (useKeyword || columnIsMasked_(deck, "ENKRVD", 0))) {
itab = 1; itab = 1;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).krwmax_; scaleparam[i] = funcForCell(i).krwmax_;
} }
} else if (keyword == std::string("KRG") || keyword == std::string("IKRG") ) { } else if (keyword == std::string("KRG") || keyword == std::string("IKRG") ) {
if (useVapour && (useKeyword || columnIsMasked_(newParserDeck, "ENKRVD", 1))) { if (useVapour && (useKeyword || columnIsMasked_(deck, "ENKRVD", 1))) {
itab = 2; itab = 2;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).krgmax_; scaleparam[i] = funcForCell(i).krgmax_;
} }
} else if (keyword == std::string("KRO") || keyword == std::string("IKRO") ) { } else if (keyword == std::string("KRO") || keyword == std::string("IKRO") ) {
if (useLiquid && (useKeyword || columnIsMasked_(newParserDeck, "ENKRVD", 2))) { if (useLiquid && (useKeyword || columnIsMasked_(deck, "ENKRVD", 2))) {
itab = 3; itab = 3;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).kromax_; scaleparam[i] = funcForCell(i).kromax_;
} }
} else if (keyword == std::string("KRWR") || keyword == std::string("IKRWR") ) { } else if (keyword == std::string("KRWR") || keyword == std::string("IKRWR") ) {
if (useAqua && (useKeyword || columnIsMasked_(newParserDeck, "ENKRVD", 3))) { if (useAqua && (useKeyword || columnIsMasked_(deck, "ENKRVD", 3))) {
itab = 4; itab = 4;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).krwr_; scaleparam[i] = funcForCell(i).krwr_;
} }
} else if (keyword == std::string("KRGR") || keyword == std::string("IKRGR") ) { } else if (keyword == std::string("KRGR") || keyword == std::string("IKRGR") ) {
if (useVapour && (useKeyword || columnIsMasked_(newParserDeck, "ENKRVD", 4))) { if (useVapour && (useKeyword || columnIsMasked_(deck, "ENKRVD", 4))) {
itab = 5; itab = 5;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).krgr_; scaleparam[i] = funcForCell(i).krgr_;
} }
} else if (keyword == std::string("KRORW") || keyword == std::string("IKRORW") ) { } else if (keyword == std::string("KRORW") || keyword == std::string("IKRORW") ) {
if (useAqua && (useKeyword || columnIsMasked_(newParserDeck, "ENKRVD", 5))) { if (useAqua && (useKeyword || columnIsMasked_(deck, "ENKRVD", 5))) {
itab = 6; itab = 6;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
scaleparam[i] = funcForCell(i).krorw_; scaleparam[i] = funcForCell(i).krorw_;
} }
} else if (keyword == std::string("KRORG") || keyword == std::string("IKRORG") ) { } else if (keyword == std::string("KRORG") || keyword == std::string("IKRORG") ) {
if (useVapour && (useKeyword || columnIsMasked_(newParserDeck, "ENKRVD", 6))) { if (useVapour && (useKeyword || columnIsMasked_(deck, "ENKRVD", 6))) {
itab = 7; itab = 7;
scaleparam.resize(number_of_cells); scaleparam.resize(number_of_cells);
for (int i=0; i<number_of_cells; ++i) for (int i=0; i<number_of_cells; ++i)
@ -738,12 +737,12 @@ namespace Opm
OPM_THROW(std::runtime_error, " -- unknown keyword: '" << keyword << "'"); OPM_THROW(std::runtime_error, " -- unknown keyword: '" << keyword << "'");
} }
if (!useKeyword && itab > 0) { if (!useKeyword && itab > 0) {
int num_tables = newParserDeck->getKeyword("ENKRVD")->size(); int num_tables = deck->getKeyword("ENKRVD")->size();
param_col.resize(num_tables); param_col.resize(num_tables);
depth_col.resize(num_tables); depth_col.resize(num_tables);
col_names.resize(8); col_names.resize(8);
for (int table_num=0; table_num<num_tables; ++table_num) { for (int table_num=0; table_num<num_tables; ++table_num) {
Opm::SingleRecordTable enkrvd(newParserDeck->getKeyword("ENKRVD"), col_names, table_num); Opm::SingleRecordTable enkrvd(deck->getKeyword("ENKRVD"), col_names, table_num);
depth_col[table_num] = enkrvd.getColumn(0); // depth depth_col[table_num] = enkrvd.getColumn(0); // depth
param_col[table_num] = enkrvd.getColumn(itab); // itab=[1-7]: krw krg kro krwr krgr krorw krorg param_col[table_num] = enkrvd.getColumn(itab); // itab=[1-7]: krw krg kro krwr krgr krorw krorg
} }
@ -756,7 +755,7 @@ namespace Opm
// Keyword values from deck // Keyword values from deck
std::cout << "--- Scaling parameter '" << keyword << "' assigned." << std::endl; std::cout << "--- Scaling parameter '" << keyword << "' assigned." << std::endl;
const int* gc = global_cell; const int* gc = global_cell;
const std::vector<double>& val = newParserDeck->getKeyword(keyword)->getSIDoubleData(); const std::vector<double>& val = deck->getKeyword(keyword)->getSIDoubleData();
for (int c = 0; c < int(scaleparam.size()); ++c) { for (int c = 0; c < int(scaleparam.size()); ++c) {
const int deck_pos = (gc == NULL) ? c : gc[c]; const int deck_pos = (gc == NULL) ? c : gc[c];
scaleparam[c] = val[deck_pos]; scaleparam[c] = val[deck_pos];
@ -764,9 +763,9 @@ namespace Opm
} else { } else {
const int dim = dimensions; const int dim = dimensions;
std::vector<int> endnum; std::vector<int> endnum;
if ( newParserDeck->hasKeyword("ENDNUM")) { if ( deck->hasKeyword("ENDNUM")) {
const std::vector<int>& e = const std::vector<int>& e =
newParserDeck->getKeyword("ENDNUM")->getIntData(); deck->getKeyword("ENDNUM")->getIntData();
endnum.resize(number_of_cells); endnum.resize(number_of_cells);
const int* gc = global_cell; const int* gc = global_cell;
for (int cell = 0; cell < number_of_cells; ++cell) { for (int cell = 0; cell < number_of_cells; ++cell) {

View File

@ -167,7 +167,7 @@ namespace Opm
template <class Props, class State> template <class Props, class State>
void initStateFromDeck(const UnstructuredGrid& grid, void initStateFromDeck(const UnstructuredGrid& grid,
const Props& props, const Props& props,
Opm::DeckConstPtr newParserDeck, Opm::DeckConstPtr deck,
const double gravity, const double gravity,
State& state); State& state);
@ -182,7 +182,7 @@ namespace Opm
template <class Props, class State> template <class Props, class State>
void initBlackoilStateFromDeck(const UnstructuredGrid& grid, void initBlackoilStateFromDeck(const UnstructuredGrid& grid,
const Props& props, const Props& props,
Opm::DeckConstPtr newParserDeck, Opm::DeckConstPtr deck,
const double gravity, const double gravity,
State& state); State& state);
/// Initialize a blackoil state from input deck. /// Initialize a blackoil state from input deck.
@ -195,7 +195,7 @@ namespace Opm
CCI begin_cell_centroids, CCI begin_cell_centroids,
int dimensions, int dimensions,
const Props& props, const Props& props,
Opm::DeckConstPtr newParserDeck, Opm::DeckConstPtr deck,
const double gravity, const double gravity,
State& state); State& state);
} // namespace Opm } // namespace Opm

View File

@ -61,7 +61,7 @@ namespace Opm
*/ */
void initStateEquil(const UnstructuredGrid& grid, void initStateEquil(const UnstructuredGrid& grid,
const BlackoilPropertiesInterface& props, const BlackoilPropertiesInterface& props,
const Opm::DeckConstPtr newParserDeck, const Opm::DeckConstPtr deck,
const double gravity, const double gravity,
BlackoilState& state); BlackoilState& state);
@ -182,11 +182,11 @@ namespace Opm
namespace DeckDependent { namespace DeckDependent {
inline inline
std::vector<EquilRecord> std::vector<EquilRecord>
getEquil(const Opm::DeckConstPtr newParserDeck) getEquil(const Opm::DeckConstPtr deck)
{ {
if (newParserDeck->hasKeyword("EQUIL")) { if (deck->hasKeyword("EQUIL")) {
Opm::EquilWrapper eql(newParserDeck->getKeyword("EQUIL")); Opm::EquilWrapper eql(deck->getKeyword("EQUIL"));
const int nrec = eql.numRegions(); const int nrec = eql.numRegions();
@ -228,14 +228,14 @@ namespace Opm
inline inline
std::vector<int> std::vector<int>
equilnum(const Opm::DeckConstPtr newParserDeck, equilnum(const Opm::DeckConstPtr deck,
const UnstructuredGrid& G ) const UnstructuredGrid& G )
{ {
std::vector<int> eqlnum; std::vector<int> eqlnum;
if (newParserDeck->hasKeyword("EQLNUM")) { if (deck->hasKeyword("EQLNUM")) {
eqlnum.resize(G.number_of_cells); eqlnum.resize(G.number_of_cells);
const std::vector<int>& e = const std::vector<int>& e =
newParserDeck->getKeyword("EQLNUM")->getIntData(); deck->getKeyword("EQLNUM")->getIntData();
const int* gc = G.global_cell; const int* gc = G.global_cell;
for (int cell = 0; cell < G.number_of_cells; ++cell) { for (int cell = 0; cell < G.number_of_cells; ++cell) {
const int deck_pos = (gc == NULL) ? cell : gc[cell]; const int deck_pos = (gc == NULL) ? cell : gc[cell];
@ -255,7 +255,7 @@ namespace Opm
class InitialStateComputer { class InitialStateComputer {
public: public:
InitialStateComputer(const BlackoilPropertiesInterface& props, InitialStateComputer(const BlackoilPropertiesInterface& props,
const Opm::DeckConstPtr newParserDeck, const Opm::DeckConstPtr deck,
const UnstructuredGrid& G , const UnstructuredGrid& G ,
const double grav = unit::gravity) const double grav = unit::gravity)
: pp_(props.numPhases(), : pp_(props.numPhases(),
@ -266,20 +266,20 @@ namespace Opm
rv_(G.number_of_cells) rv_(G.number_of_cells)
{ {
// Get the equilibration records. // Get the equilibration records.
const std::vector<EquilRecord> rec = getEquil(newParserDeck); const std::vector<EquilRecord> rec = getEquil(deck);
// Create (inverse) region mapping. // Create (inverse) region mapping.
const RegionMapping<> eqlmap(equilnum(newParserDeck, G)); const RegionMapping<> eqlmap(equilnum(deck, G));
// Create Rs functions. // Create Rs functions.
rs_func_.reserve(rec.size()); rs_func_.reserve(rec.size());
if (newParserDeck->hasKeyword("DISGAS")) { if (deck->hasKeyword("DISGAS")) {
for (size_t i = 0; i < rec.size(); ++i) { for (size_t i = 0; i < rec.size(); ++i) {
const int cell = *(eqlmap.cells(i).begin()); const int cell = *(eqlmap.cells(i).begin());
if (rec[i].live_oil_table_index > 0) { if (rec[i].live_oil_table_index > 0) {
if (newParserDeck->hasKeyword("RSVD") && if (deck->hasKeyword("RSVD") &&
size_t(rec[i].live_oil_table_index) <= newParserDeck->getKeyword("RSVD")->size()) { size_t(rec[i].live_oil_table_index) <= deck->getKeyword("RSVD")->size()) {
Opm::SingleRecordTable rsvd(newParserDeck->getKeyword("RSVD"),std::vector<std::string>{"vd", "rs"},rec[i].live_oil_table_index-1); Opm::SingleRecordTable rsvd(deck->getKeyword("RSVD"),std::vector<std::string>{"vd", "rs"},rec[i].live_oil_table_index-1);
std::vector<double> vd(rsvd.getColumn("vd")); std::vector<double> vd(rsvd.getColumn("vd"));
std::vector<double> rs(rsvd.getColumn("rs")); std::vector<double> rs(rsvd.getColumn("rs"));
rs_func_.push_back(std::make_shared<Miscibility::RsVD>(props, cell, vd, rs)); rs_func_.push_back(std::make_shared<Miscibility::RsVD>(props, cell, vd, rs));
@ -304,13 +304,13 @@ namespace Opm
} }
rv_func_.reserve(rec.size()); rv_func_.reserve(rec.size());
if (newParserDeck->hasKeyword("VAPOIL")) { if (deck->hasKeyword("VAPOIL")) {
for (size_t i = 0; i < rec.size(); ++i) { for (size_t i = 0; i < rec.size(); ++i) {
const int cell = *(eqlmap.cells(i).begin()); const int cell = *(eqlmap.cells(i).begin());
if (rec[i].wet_gas_table_index > 0) { if (rec[i].wet_gas_table_index > 0) {
if (newParserDeck->hasKeyword("RVVD") && if (deck->hasKeyword("RVVD") &&
size_t(rec[i].wet_gas_table_index) <= newParserDeck->getKeyword("RVVD")->size()) { size_t(rec[i].wet_gas_table_index) <= deck->getKeyword("RVVD")->size()) {
Opm::SingleRecordTable rvvd(newParserDeck->getKeyword("RVVD"),std::vector<std::string>{"vd", "rv"},rec[i].wet_gas_table_index-1); Opm::SingleRecordTable rvvd(deck->getKeyword("RVVD"),std::vector<std::string>{"vd", "rv"},rec[i].wet_gas_table_index-1);
std::vector<double> vd(rvvd.getColumn("vd")); std::vector<double> vd(rvvd.getColumn("vd"));
std::vector<double> rv(rvvd.getColumn("rv")); std::vector<double> rv(rvvd.getColumn("rv"));
rv_func_.push_back(std::make_shared<Miscibility::RvVD>(props, cell, vd, rv)); rv_func_.push_back(std::make_shared<Miscibility::RvVD>(props, cell, vd, rv));

View File

@ -737,12 +737,12 @@ namespace Opm
*/ */
void initStateEquil(const UnstructuredGrid& grid, void initStateEquil(const UnstructuredGrid& grid,
const BlackoilPropertiesInterface& props, const BlackoilPropertiesInterface& props,
const Opm::DeckConstPtr newParserDeck, const Opm::DeckConstPtr deck,
const double gravity, const double gravity,
BlackoilState& state) BlackoilState& state)
{ {
typedef Equil::DeckDependent::InitialStateComputer ISC; typedef Equil::DeckDependent::InitialStateComputer ISC;
ISC isc(props, newParserDeck, grid, gravity); ISC isc(props, deck, grid, gravity);
const auto pu = props.phaseUsage(); const auto pu = props.phaseUsage();
const int ref_phase = pu.phase_used[BlackoilPhases::Liquid] const int ref_phase = pu.phase_used[BlackoilPhases::Liquid]
? pu.phase_pos[BlackoilPhases::Liquid] ? pu.phase_pos[BlackoilPhases::Liquid]

View File

@ -552,14 +552,14 @@ namespace Opm
template <class Props, class State> template <class Props, class State>
void initStateFromDeck(const UnstructuredGrid& grid, void initStateFromDeck(const UnstructuredGrid& grid,
const Props& props, const Props& props,
Opm::DeckConstPtr newParserDeck, Opm::DeckConstPtr deck,
const double gravity, const double gravity,
State& state) State& state)
{ {
initStateFromDeck(grid.number_of_cells, grid.global_cell, initStateFromDeck(grid.number_of_cells, grid.global_cell,
grid.number_of_faces, UgGridHelpers::faceCells(grid), grid.number_of_faces, UgGridHelpers::faceCells(grid),
grid.face_centroids, grid.cell_centroids, grid.dimensions, grid.face_centroids, grid.cell_centroids, grid.dimensions,
props, newParserDeck, gravity, state); props, deck, gravity, state);
} }
/// Initialize a state from input deck. /// Initialize a state from input deck.
template <class FaceCells, class FCI, class CCI, class Props, class State> template <class FaceCells, class FCI, class CCI, class Props, class State>
@ -571,23 +571,23 @@ namespace Opm
CCI begin_cell_centroids, CCI begin_cell_centroids,
int dimensions, int dimensions,
const Props& props, const Props& props,
Opm::DeckConstPtr newParserDeck, Opm::DeckConstPtr deck,
const double gravity, const double gravity,
State& state) State& state)
{ {
const int num_phases = props.numPhases(); const int num_phases = props.numPhases();
const PhaseUsage pu = phaseUsageFromDeck(newParserDeck); const PhaseUsage pu = phaseUsageFromDeck(deck);
if (num_phases != pu.num_phases) { if (num_phases != pu.num_phases) {
OPM_THROW(std::runtime_error, "initStateFromDeck(): user specified property object with " << num_phases << " phases, " OPM_THROW(std::runtime_error, "initStateFromDeck(): user specified property object with " << num_phases << " phases, "
"found " << pu.num_phases << " phases in deck."); "found " << pu.num_phases << " phases in deck.");
} }
state.init(number_of_cells, number_of_faces, num_phases); state.init(number_of_cells, number_of_faces, num_phases);
if (newParserDeck->hasKeyword("EQUIL") && newParserDeck->hasKeyword("PRESSURE")) { if (deck->hasKeyword("EQUIL") && deck->hasKeyword("PRESSURE")) {
OPM_THROW(std::runtime_error, "initStateFromDeck(): The deck must either specify the initial " OPM_THROW(std::runtime_error, "initStateFromDeck(): The deck must either specify the initial "
"condition using the PRESSURE _or_ the EQUIL keyword (currently it has both)"); "condition using the PRESSURE _or_ the EQUIL keyword (currently it has both)");
} }
if (newParserDeck->hasKeyword("EQUIL")) { if (deck->hasKeyword("EQUIL")) {
if (num_phases != 2) { if (num_phases != 2) {
OPM_THROW(std::runtime_error, "initStateFromDeck(): EQUIL-based init currently handling only two-phase scenarios."); OPM_THROW(std::runtime_error, "initStateFromDeck(): EQUIL-based init currently handling only two-phase scenarios.");
} }
@ -595,7 +595,7 @@ namespace Opm
OPM_THROW(std::runtime_error, "initStateFromDeck(): EQUIL-based init currently handling only oil-water scenario (no gas)."); OPM_THROW(std::runtime_error, "initStateFromDeck(): EQUIL-based init currently handling only oil-water scenario (no gas).");
} }
// Set saturations depending on oil-water contact. // Set saturations depending on oil-water contact.
EquilWrapper equil(newParserDeck->getKeyword("EQUIL")); EquilWrapper equil(deck->getKeyword("EQUIL"));
if (equil.numRegions() != 1) { if (equil.numRegions() != 1) {
OPM_THROW(std::runtime_error, "initStateFromDeck(): No region support yet."); OPM_THROW(std::runtime_error, "initStateFromDeck(): No region support yet.");
} }
@ -607,19 +607,19 @@ namespace Opm
const double datum_p = equil.datumDepthPressure(0); const double datum_p = equil.datumDepthPressure(0);
initHydrostaticPressure(number_of_cells, begin_cell_centroids, dimensions, initHydrostaticPressure(number_of_cells, begin_cell_centroids, dimensions,
props, woc, gravity, datum_z, datum_p, state); props, woc, gravity, datum_z, datum_p, state);
} else if (newParserDeck->hasKeyword("PRESSURE")) { } else if (deck->hasKeyword("PRESSURE")) {
// Set saturations from SWAT/SGAS, pressure from PRESSURE. // Set saturations from SWAT/SGAS, pressure from PRESSURE.
std::vector<double>& s = state.saturation(); std::vector<double>& s = state.saturation();
std::vector<double>& p = state.pressure(); std::vector<double>& p = state.pressure();
const std::vector<double>& p_deck = newParserDeck->getKeyword("PRESSURE")->getSIDoubleData(); const std::vector<double>& p_deck = deck->getKeyword("PRESSURE")->getSIDoubleData();
const int num_cells = number_of_cells; const int num_cells = number_of_cells;
if (num_phases == 2) { if (num_phases == 2) {
if (!pu.phase_used[BlackoilPhases::Aqua]) { if (!pu.phase_used[BlackoilPhases::Aqua]) {
// oil-gas: we require SGAS // oil-gas: we require SGAS
if (!newParserDeck->hasKeyword("SGAS")) { if (!deck->hasKeyword("SGAS")) {
OPM_THROW(std::runtime_error, "initStateFromDeck(): missing SGAS keyword in 2-phase init"); OPM_THROW(std::runtime_error, "initStateFromDeck(): missing SGAS keyword in 2-phase init");
} }
const std::vector<double>& sg_deck = newParserDeck->getKeyword("SGAS")->getSIDoubleData(); const std::vector<double>& sg_deck = deck->getKeyword("SGAS")->getSIDoubleData();
const int gpos = pu.phase_pos[BlackoilPhases::Vapour]; const int gpos = pu.phase_pos[BlackoilPhases::Vapour];
const int opos = pu.phase_pos[BlackoilPhases::Liquid]; const int opos = pu.phase_pos[BlackoilPhases::Liquid];
for (int c = 0; c < num_cells; ++c) { for (int c = 0; c < num_cells; ++c) {
@ -630,10 +630,10 @@ namespace Opm
} }
} else { } else {
// water-oil or water-gas: we require SWAT // water-oil or water-gas: we require SWAT
if (!newParserDeck->hasKeyword("SWAT")) { if (!deck->hasKeyword("SWAT")) {
OPM_THROW(std::runtime_error, "initStateFromDeck(): missing SWAT keyword in 2-phase init"); OPM_THROW(std::runtime_error, "initStateFromDeck(): missing SWAT keyword in 2-phase init");
} }
const std::vector<double>& sw_deck = newParserDeck->getKeyword("SWAT")->getSIDoubleData(); const std::vector<double>& sw_deck = deck->getKeyword("SWAT")->getSIDoubleData();
const int wpos = pu.phase_pos[BlackoilPhases::Aqua]; const int wpos = pu.phase_pos[BlackoilPhases::Aqua];
const int nwpos = (wpos + 1) % 2; const int nwpos = (wpos + 1) % 2;
for (int c = 0; c < num_cells; ++c) { for (int c = 0; c < num_cells; ++c) {
@ -644,15 +644,15 @@ namespace Opm
} }
} }
} else if (num_phases == 3) { } else if (num_phases == 3) {
const bool has_swat_sgas = newParserDeck->hasKeyword("SWAT") && newParserDeck->hasKeyword("SGAS"); const bool has_swat_sgas = deck->hasKeyword("SWAT") && deck->hasKeyword("SGAS");
if (!has_swat_sgas) { if (!has_swat_sgas) {
OPM_THROW(std::runtime_error, "initStateFromDeck(): missing SGAS or SWAT keyword in 3-phase init."); OPM_THROW(std::runtime_error, "initStateFromDeck(): missing SGAS or SWAT keyword in 3-phase init.");
} }
const int wpos = pu.phase_pos[BlackoilPhases::Aqua]; const int wpos = pu.phase_pos[BlackoilPhases::Aqua];
const int gpos = pu.phase_pos[BlackoilPhases::Vapour]; const int gpos = pu.phase_pos[BlackoilPhases::Vapour];
const int opos = pu.phase_pos[BlackoilPhases::Liquid]; const int opos = pu.phase_pos[BlackoilPhases::Liquid];
const std::vector<double>& sw_deck = newParserDeck->getKeyword("SWAT")->getSIDoubleData(); const std::vector<double>& sw_deck = deck->getKeyword("SWAT")->getSIDoubleData();
const std::vector<double>& sg_deck = newParserDeck->getKeyword("SGAS")->getSIDoubleData(); const std::vector<double>& sg_deck = deck->getKeyword("SGAS")->getSIDoubleData();
for (int c = 0; c < num_cells; ++c) { for (int c = 0; c < num_cells; ++c) {
int c_deck = (global_cell == NULL) ? c : global_cell[c]; int c_deck = (global_cell == NULL) ? c : global_cell[c];
s[3*c + wpos] = sw_deck[c_deck]; s[3*c + wpos] = sw_deck[c_deck];
@ -855,14 +855,14 @@ namespace Opm
template <class Props, class State> template <class Props, class State>
void initBlackoilStateFromDeck(const UnstructuredGrid& grid, void initBlackoilStateFromDeck(const UnstructuredGrid& grid,
const Props& props, const Props& props,
Opm::DeckConstPtr newParserDeck, Opm::DeckConstPtr deck,
const double gravity, const double gravity,
State& state) State& state)
{ {
initBlackoilStateFromDeck(grid.number_of_cells, grid.global_cell, initBlackoilStateFromDeck(grid.number_of_cells, grid.global_cell,
grid.number_of_faces, UgGridHelpers::faceCells(grid), grid.number_of_faces, UgGridHelpers::faceCells(grid),
grid.face_centroids, grid.cell_centroids,grid.dimensions, grid.face_centroids, grid.cell_centroids,grid.dimensions,
props, newParserDeck, gravity, state); props, deck, gravity, state);
} }
/// Initialize a blackoil state from input deck. /// Initialize a blackoil state from input deck.
@ -875,15 +875,15 @@ namespace Opm
CCI begin_cell_centroids, CCI begin_cell_centroids,
int dimensions, int dimensions,
const Props& props, const Props& props,
Opm::DeckConstPtr newParserDeck, Opm::DeckConstPtr deck,
const double gravity, const double gravity,
State& state) State& state)
{ {
initStateFromDeck(number_of_cells, global_cell, number_of_faces, initStateFromDeck(number_of_cells, global_cell, number_of_faces,
face_cells, begin_face_centroids, begin_cell_centroids, face_cells, begin_face_centroids, begin_cell_centroids,
dimensions, props, newParserDeck, gravity, state); dimensions, props, deck, gravity, state);
if (newParserDeck->hasKeyword("RS")) { if (deck->hasKeyword("RS")) {
const std::vector<double>& rs_deck = newParserDeck->getKeyword("RS")->getSIDoubleData(); const std::vector<double>& rs_deck = deck->getKeyword("RS")->getSIDoubleData();
const int num_cells = number_of_cells; const int num_cells = number_of_cells;
for (int c = 0; c < num_cells; ++c) { for (int c = 0; c < num_cells; ++c) {
int c_deck = (global_cell == NULL) ? c : global_cell[c]; int c_deck = (global_cell == NULL) ? c : global_cell[c];
@ -891,8 +891,8 @@ namespace Opm
} }
initBlackoilSurfvolUsingRSorRV(number_of_cells, props, state); initBlackoilSurfvolUsingRSorRV(number_of_cells, props, state);
computeSaturation(props,state); computeSaturation(props,state);
} else if (newParserDeck->hasKeyword("RV")){ } else if (deck->hasKeyword("RV")){
const std::vector<double>& rv_deck = newParserDeck->getKeyword("RV")->getSIDoubleData(); const std::vector<double>& rv_deck = deck->getKeyword("RV")->getSIDoubleData();
const int num_cells = number_of_cells; const int num_cells = number_of_cells;
for (int c = 0; c < num_cells; ++c) { for (int c = 0; c < num_cells; ++c) {
int c_deck = (global_cell == NULL) ? c : global_cell[c]; int c_deck = (global_cell == NULL) ? c : global_cell[c];

View File

@ -32,12 +32,12 @@ BOOST_AUTO_TEST_CASE(EqualsDifferentDeckReturnFalse) {
const string filename1 = "testBlackoilState1.DATA"; const string filename1 = "testBlackoilState1.DATA";
const string filename2 = "testBlackoilState2.DATA"; const string filename2 = "testBlackoilState2.DATA";
Opm::ParserPtr parser(new Opm::Parser()); Opm::ParserPtr parser(new Opm::Parser());
Opm::DeckConstPtr newParserDeck1(parser->parseFile(filename1)); Opm::DeckConstPtr deck1(parser->parseFile(filename1));
Opm::DeckConstPtr newParserDeck2(parser->parseFile(filename2)); Opm::DeckConstPtr deck2(parser->parseFile(filename2));
GridManager gridManager1(newParserDeck1); GridManager gridManager1(deck1);
const UnstructuredGrid* grid1 = gridManager1.c_grid(); const UnstructuredGrid* grid1 = gridManager1.c_grid();
GridManager gridManager2(newParserDeck2); GridManager gridManager2(deck2);
const UnstructuredGrid* grid2 = gridManager2.c_grid(); const UnstructuredGrid* grid2 = gridManager2.c_grid();
BlackoilState state1; BlackoilState state1;
@ -55,9 +55,9 @@ BOOST_AUTO_TEST_CASE(EqualsDifferentNumPhasesReturnFalse) {
const string filename = "testBlackoilState1.DATA"; const string filename = "testBlackoilState1.DATA";
Opm::ParserPtr parser(new Opm::Parser()); Opm::ParserPtr parser(new Opm::Parser());
Opm::DeckConstPtr newParserDeck(parser->parseFile(filename)); Opm::DeckConstPtr deck(parser->parseFile(filename));
GridManager gridManager(newParserDeck); GridManager gridManager(deck);
const UnstructuredGrid* grid = gridManager.c_grid(); const UnstructuredGrid* grid = gridManager.c_grid();
BlackoilState state1; BlackoilState state1;
@ -75,9 +75,9 @@ BOOST_AUTO_TEST_CASE(EqualsNumericalDifferenceReturnFalse) {
const string filename = "testBlackoilState1.DATA"; const string filename = "testBlackoilState1.DATA";
Opm::ParserPtr parser(new Opm::Parser()); Opm::ParserPtr parser(new Opm::Parser());
Opm::DeckConstPtr newParserDeck(parser->parseFile(filename)); Opm::DeckConstPtr deck(parser->parseFile(filename));
GridManager gridManager(newParserDeck); GridManager gridManager(deck);
const UnstructuredGrid* grid = gridManager.c_grid(); const UnstructuredGrid* grid = gridManager.c_grid();
BlackoilState state1; BlackoilState state1;

View File

@ -176,10 +176,10 @@ BOOST_AUTO_TEST_CASE(New_Constructor_Works) {
const std::string filename = "wells_manager_data.data"; const std::string filename = "wells_manager_data.data";
Opm::ParserPtr parser(new Opm::Parser()); Opm::ParserPtr parser(new Opm::Parser());
Opm::DeckConstPtr newParserDeck(parser->parseFile(filename)); Opm::DeckConstPtr deck(parser->parseFile(filename));
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(newParserDeck)); Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck));
Opm::GridManager gridManager(newParserDeck); Opm::GridManager gridManager(deck);
{ {
Opm::WellsManager wellsManager(eclipseState, 0, *gridManager.c_grid(), NULL); Opm::WellsManager wellsManager(eclipseState, 0, *gridManager.c_grid(), NULL);
@ -199,10 +199,10 @@ BOOST_AUTO_TEST_CASE(New_Constructor_Works) {
BOOST_AUTO_TEST_CASE(WellsEqual) { BOOST_AUTO_TEST_CASE(WellsEqual) {
const std::string filename = "wells_manager_data.data"; const std::string filename = "wells_manager_data.data";
Opm::ParserPtr parser(new Opm::Parser()); Opm::ParserPtr parser(new Opm::Parser());
Opm::DeckConstPtr newParserDeck(parser->parseFile(filename)); Opm::DeckConstPtr deck(parser->parseFile(filename));
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(newParserDeck)); Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck));
Opm::GridManager gridManager(newParserDeck); Opm::GridManager gridManager(deck);
Opm::WellsManager wellsManager0(eclipseState , 0 , *gridManager.c_grid(), NULL); Opm::WellsManager wellsManager0(eclipseState , 0 , *gridManager.c_grid(), NULL);
Opm::WellsManager wellsManager1(eclipseState , 1 , *gridManager.c_grid(), NULL); Opm::WellsManager wellsManager1(eclipseState , 1 , *gridManager.c_grid(), NULL);
@ -215,10 +215,10 @@ BOOST_AUTO_TEST_CASE(WellsEqual) {
BOOST_AUTO_TEST_CASE(ControlsEqual) { BOOST_AUTO_TEST_CASE(ControlsEqual) {
const std::string filename = "wells_manager_data.data"; const std::string filename = "wells_manager_data.data";
Opm::ParserPtr parser(new Opm::Parser()); Opm::ParserPtr parser(new Opm::Parser());
Opm::DeckConstPtr newParserDeck(parser->parseFile(filename)); Opm::DeckConstPtr deck(parser->parseFile(filename));
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(newParserDeck)); Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck));
Opm::GridManager gridManager(newParserDeck); Opm::GridManager gridManager(deck);
Opm::WellsManager wellsManager0(eclipseState , 0 , *gridManager.c_grid(), NULL); Opm::WellsManager wellsManager0(eclipseState , 0 , *gridManager.c_grid(), NULL);
Opm::WellsManager wellsManager1(eclipseState , 1 , *gridManager.c_grid(), NULL); Opm::WellsManager wellsManager1(eclipseState , 1 , *gridManager.c_grid(), NULL);
@ -239,10 +239,10 @@ BOOST_AUTO_TEST_CASE(ControlsEqual) {
BOOST_AUTO_TEST_CASE(WellHasSTOP_ExceptionIsThrown) { BOOST_AUTO_TEST_CASE(WellHasSTOP_ExceptionIsThrown) {
const std::string filename = "wells_manager_data_wellSTOP.data"; const std::string filename = "wells_manager_data_wellSTOP.data";
Opm::ParserPtr parser(new Opm::Parser()); Opm::ParserPtr parser(new Opm::Parser());
Opm::DeckConstPtr newParserDeck(parser->parseFile(filename)); Opm::DeckConstPtr deck(parser->parseFile(filename));
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(newParserDeck)); Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck));
Opm::GridManager gridManager(newParserDeck); Opm::GridManager gridManager(deck);
BOOST_CHECK_THROW( new Opm::WellsManager(eclipseState, 0, *gridManager.c_grid(), NULL), std::runtime_error ); BOOST_CHECK_THROW( new Opm::WellsManager(eclipseState, 0, *gridManager.c_grid(), NULL), std::runtime_error );
} }