GenericProblem: remove unnecessary Scalar template parameter

use the Scalar type from the FluidSystem
This commit is contained in:
Arne Morten Kvarving 2024-02-22 15:17:09 +01:00
parent 5972b3c88d
commit 958f33fbfc
5 changed files with 124 additions and 110 deletions

View File

@ -41,20 +41,17 @@
namespace Opm { namespace Opm {
template class FlowGenericProblem<Dune::GridView<Dune::DefaultLeafGridViewTraits<Dune::CpGrid>>, template class FlowGenericProblem<Dune::GridView<Dune::DefaultLeafGridViewTraits<Dune::CpGrid>>,
BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>, BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>>;
double>;
#if HAVE_DUNE_FEM #if HAVE_DUNE_FEM
template class FlowGenericProblem<Dune::GridView<Dune::Fem::GridPart2GridViewTraits<Dune::Fem::AdaptiveLeafGridPart<Dune::CpGrid, Dune::PartitionIteratorType(4), false>>>, template class FlowGenericProblem<Dune::GridView<Dune::Fem::GridPart2GridViewTraits<Dune::Fem::AdaptiveLeafGridPart<Dune::CpGrid, Dune::PartitionIteratorType(4), false>>>,
BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>, BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>>;
double>;
template class FlowGenericProblem<Dune::Fem::GridPart2GridViewImpl< template class FlowGenericProblem<Dune::Fem::GridPart2GridViewImpl<
Dune::Fem::AdaptiveLeafGridPart< Dune::Fem::AdaptiveLeafGridPart<
Dune::CpGrid, Dune::CpGrid,
Dune::PartitionIteratorType(4), Dune::PartitionIteratorType(4),
false> >, false> >,
BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>, BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>>;
double>;
#endif // HAVE_DUNE_FEM #endif // HAVE_DUNE_FEM
} // end namespace Opm } // end namespace Opm

View File

@ -65,10 +65,11 @@ int eclPositionalParameter(Dune::ParameterTree& tree,
* \brief This problem simulates an input file given in the data format used by the * \brief This problem simulates an input file given in the data format used by the
* commercial ECLiPSE simulator. * commercial ECLiPSE simulator.
*/ */
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
class FlowGenericProblem class FlowGenericProblem
{ {
public: public:
using Scalar = typename FluidSystem::Scalar;
using TabulatedTwoDFunction = UniformXTabulated2DFunction<Scalar>; using TabulatedTwoDFunction = UniformXTabulated2DFunction<Scalar>;
using TabulatedFunction = Tabulated1DFunction<Scalar>; using TabulatedFunction = Tabulated1DFunction<Scalar>;

View File

@ -78,8 +78,8 @@ int eclPositionalParameter(Dune::ParameterTree& tree,
return 1; return 1;
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
FlowGenericProblem<GridView,FluidSystem,Scalar>:: FlowGenericProblem<GridView,FluidSystem>::
FlowGenericProblem(const EclipseState& eclState, FlowGenericProblem(const EclipseState& eclState,
const Schedule& schedule, const Schedule& schedule,
const GridView& gridView) const GridView& gridView)
@ -91,9 +91,9 @@ FlowGenericProblem(const EclipseState& eclState,
{ {
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
FlowGenericProblem<GridView,FluidSystem,Scalar> FlowGenericProblem<GridView,FluidSystem>
FlowGenericProblem<GridView,FluidSystem,Scalar>:: FlowGenericProblem<GridView,FluidSystem>::
serializationTestObject(const EclipseState& eclState, serializationTestObject(const EclipseState& eclState,
const Schedule& schedule, const Schedule& schedule,
const GridView& gridView) const GridView& gridView)
@ -112,9 +112,9 @@ serializationTestObject(const EclipseState& eclState,
return result; return result;
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
std::string std::string
FlowGenericProblem<GridView,FluidSystem,Scalar>:: FlowGenericProblem<GridView,FluidSystem>::
helpPreamble(int, helpPreamble(int,
const char **argv) const char **argv)
{ {
@ -127,16 +127,16 @@ helpPreamble(int,
+ desc; + desc;
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
std::string std::string
FlowGenericProblem<GridView,FluidSystem,Scalar>:: FlowGenericProblem<GridView,FluidSystem>::
briefDescription() briefDescription()
{ {
return briefDescription_; return briefDescription_;
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
void FlowGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem>::
readRockParameters_(const std::vector<Scalar>& cellCenterDepths, readRockParameters_(const std::vector<Scalar>& cellCenterDepths,
std::function<std::array<int,3>(const unsigned)> ijkIndex) std::function<std::array<int,3>(const unsigned)> ijkIndex)
{ {
@ -210,8 +210,8 @@ readRockParameters_(const std::vector<Scalar>& cellCenterDepths,
} }
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
void FlowGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem>::
readRockCompactionParameters_() readRockCompactionParameters_()
{ {
const auto& rock_config = eclState_.getSimulationConfig().rock_config(); const auto& rock_config = eclState_.getSimulationConfig().rock_config();
@ -303,8 +303,9 @@ readRockCompactionParameters_()
} }
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
rockCompressibility(unsigned globalSpaceIdx) const rockCompressibility(unsigned globalSpaceIdx) const
{ {
if (this->rockParams_.empty()) if (this->rockParams_.empty())
@ -317,8 +318,9 @@ rockCompressibility(unsigned globalSpaceIdx) const
return this->rockParams_[tableIdx].compressibility; return this->rockParams_[tableIdx].compressibility;
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
rockReferencePressure(unsigned globalSpaceIdx) const rockReferencePressure(unsigned globalSpaceIdx) const
{ {
if (this->rockParams_.empty()) if (this->rockParams_.empty())
@ -331,15 +333,17 @@ rockReferencePressure(unsigned globalSpaceIdx) const
return this->rockParams_[tableIdx].referencePressure; return this->rockParams_[tableIdx].referencePressure;
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
porosity(unsigned globalSpaceIdx, unsigned timeIdx) const porosity(unsigned globalSpaceIdx, unsigned timeIdx) const
{ {
return this->referencePorosity_[timeIdx][globalSpaceIdx]; return this->referencePorosity_[timeIdx][globalSpaceIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
rockFraction(unsigned elementIdx, unsigned timeIdx) const rockFraction(unsigned elementIdx, unsigned timeIdx) const
{ {
// the reference porosity is defined as the accumulated pore volume divided by the // the reference porosity is defined as the accumulated pore volume divided by the
@ -350,9 +354,9 @@ rockFraction(unsigned elementIdx, unsigned timeIdx) const
return referencePorosity(elementIdx, timeIdx) / porosity * (1 - porosity); return referencePorosity(elementIdx, timeIdx) / porosity * (1 - porosity);
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
template<class T> template<class T>
void FlowGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem>::
updateNum(const std::string& name, std::vector<T>& numbers, std::size_t num_regions) updateNum(const std::string& name, std::vector<T>& numbers, std::size_t num_regions)
{ {
if (!eclState_.fieldProps().has_int(name)) if (!eclState_.fieldProps().has_int(name))
@ -372,40 +376,40 @@ updateNum(const std::string& name, std::vector<T>& numbers, std::size_t num_regi
true /*needsTranslation*/, valueCheck); true /*needsTranslation*/, valueCheck);
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
void FlowGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem>::
updatePvtnum_() updatePvtnum_()
{ {
const auto num_regions = eclState_.getTableManager().getTabdims().getNumPVTTables(); const auto num_regions = eclState_.getTableManager().getTabdims().getNumPVTTables();
updateNum("PVTNUM", pvtnum_, num_regions); updateNum("PVTNUM", pvtnum_, num_regions);
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
void FlowGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem>::
updateSatnum_() updateSatnum_()
{ {
const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables(); const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables();
updateNum("SATNUM", satnum_, num_regions); updateNum("SATNUM", satnum_, num_regions);
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
void FlowGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem>::
updateMiscnum_() updateMiscnum_()
{ {
const auto num_regions = 1; // we only support single region const auto num_regions = 1; // we only support single region
updateNum("MISCNUM", miscnum_, num_regions); updateNum("MISCNUM", miscnum_, num_regions);
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
void FlowGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem>::
updatePlmixnum_() updatePlmixnum_()
{ {
const auto num_regions = 1; // we only support single region const auto num_regions = 1; // we only support single region
updateNum("PLMIXNUM", plmixnum_, num_regions); updateNum("PLMIXNUM", plmixnum_, num_regions);
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
void FlowGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem>::
updateKrnum_() updateKrnum_()
{ {
const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables(); const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables();
@ -414,8 +418,8 @@ updateKrnum_()
updateNum("KRNUMZ", krnumz_, num_regions); updateNum("KRNUMZ", krnumz_, num_regions);
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
void FlowGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem>::
updateImbnum_() updateImbnum_()
{ {
const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables(); const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables();
@ -424,16 +428,16 @@ updateImbnum_()
updateNum("IMBNUMZ", imbnumz_, num_regions); updateNum("IMBNUMZ", imbnumz_, num_regions);
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
bool FlowGenericProblem<GridView,FluidSystem,Scalar>:: bool FlowGenericProblem<GridView,FluidSystem>::
vapparsActive(int episodeIdx) const vapparsActive(int episodeIdx) const
{ {
const auto& oilVaporizationControl = schedule_[episodeIdx].oilvap(); const auto& oilVaporizationControl = schedule_[episodeIdx].oilvap();
return (oilVaporizationControl.getType() == OilVaporizationProperties::OilVaporization::VAPPARS); return (oilVaporizationControl.getType() == OilVaporizationProperties::OilVaporization::VAPPARS);
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
bool FlowGenericProblem<GridView,FluidSystem,Scalar>:: bool FlowGenericProblem<GridView,FluidSystem>::
beginEpisode_(bool enableExperiments, beginEpisode_(bool enableExperiments,
int episodeIdx) int episodeIdx)
{ {
@ -469,8 +473,8 @@ beginEpisode_(bool enableExperiments,
return false; return false;
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
void FlowGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem>::
beginTimeStep_(bool enableExperiments, beginTimeStep_(bool enableExperiments,
int episodeIdx, int episodeIdx,
int timeStepIndex, int timeStepIndex,
@ -496,15 +500,15 @@ beginTimeStep_(bool enableExperiments,
this->mixControls_.updateExplicitQuantities(episodeIdx, timeStepSize); this->mixControls_.updateExplicitQuantities(episodeIdx, timeStepSize);
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
void FlowGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem>::
initFluidSystem_() initFluidSystem_()
{ {
FluidSystem::initFromState(eclState_, schedule_); FluidSystem::initFromState(eclState_, schedule_);
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
void FlowGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem>::
readBlackoilExtentionsInitialConditions_(std::size_t numDof, readBlackoilExtentionsInitialConditions_(std::size_t numDof,
bool enableSolvent, bool enableSolvent,
bool enablePolymer, bool enablePolymer,
@ -568,8 +572,9 @@ readBlackoilExtentionsInitialConditions_(std::size_t numDof,
} }
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
maxWaterSaturation(unsigned globalDofIdx) const maxWaterSaturation(unsigned globalDofIdx) const
{ {
if (maxWaterSaturation_.empty()) if (maxWaterSaturation_.empty())
@ -578,8 +583,9 @@ maxWaterSaturation(unsigned globalDofIdx) const
return maxWaterSaturation_[globalDofIdx]; return maxWaterSaturation_[globalDofIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
minOilPressure(unsigned globalDofIdx) const minOilPressure(unsigned globalDofIdx) const
{ {
if (minRefPressure_.empty()) if (minRefPressure_.empty())
@ -588,8 +594,9 @@ minOilPressure(unsigned globalDofIdx) const
return minRefPressure_[globalDofIdx]; return minRefPressure_[globalDofIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
overburdenPressure(unsigned elementIdx) const overburdenPressure(unsigned elementIdx) const
{ {
if (overburdenPressure_.empty()) if (overburdenPressure_.empty())
@ -598,8 +605,9 @@ overburdenPressure(unsigned elementIdx) const
return overburdenPressure_[elementIdx]; return overburdenPressure_[elementIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
solventSaturation(unsigned elemIdx) const solventSaturation(unsigned elemIdx) const
{ {
if (solventSaturation_.empty()) if (solventSaturation_.empty())
@ -608,8 +616,9 @@ solventSaturation(unsigned elemIdx) const
return solventSaturation_[elemIdx]; return solventSaturation_[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
solventRsw(unsigned elemIdx) const solventRsw(unsigned elemIdx) const
{ {
if (solventRsw_.empty()) if (solventRsw_.empty())
@ -618,16 +627,18 @@ solventRsw(unsigned elemIdx) const
return solventRsw_[elemIdx]; return solventRsw_[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
drsdtcon(unsigned elemIdx, int episodeIdx) const drsdtcon(unsigned elemIdx, int episodeIdx) const
{ {
return this->mixControls_.drsdtcon(elemIdx, episodeIdx, return this->mixControls_.drsdtcon(elemIdx, episodeIdx,
this->pvtRegionIndex(elemIdx)); this->pvtRegionIndex(elemIdx));
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
polymerConcentration(unsigned elemIdx) const polymerConcentration(unsigned elemIdx) const
{ {
if (polymer_.concentration.empty()) { if (polymer_.concentration.empty()) {
@ -637,8 +648,9 @@ polymerConcentration(unsigned elemIdx) const
return polymer_.concentration[elemIdx]; return polymer_.concentration[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
polymerMolecularWeight(const unsigned elemIdx) const polymerMolecularWeight(const unsigned elemIdx) const
{ {
if (polymer_.moleWeight.empty()) { if (polymer_.moleWeight.empty()) {
@ -648,8 +660,9 @@ polymerMolecularWeight(const unsigned elemIdx) const
return polymer_.moleWeight[elemIdx]; return polymer_.moleWeight[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
microbialConcentration(unsigned elemIdx) const microbialConcentration(unsigned elemIdx) const
{ {
if (micp_.microbialConcentration.empty()) { if (micp_.microbialConcentration.empty()) {
@ -659,8 +672,9 @@ microbialConcentration(unsigned elemIdx) const
return micp_.microbialConcentration[elemIdx]; return micp_.microbialConcentration[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
oxygenConcentration(unsigned elemIdx) const oxygenConcentration(unsigned elemIdx) const
{ {
if (micp_.oxygenConcentration.empty()) { if (micp_.oxygenConcentration.empty()) {
@ -670,8 +684,9 @@ oxygenConcentration(unsigned elemIdx) const
return micp_.oxygenConcentration[elemIdx]; return micp_.oxygenConcentration[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
ureaConcentration(unsigned elemIdx) const ureaConcentration(unsigned elemIdx) const
{ {
if (micp_.ureaConcentration.empty()) { if (micp_.ureaConcentration.empty()) {
@ -681,8 +696,9 @@ ureaConcentration(unsigned elemIdx) const
return micp_.ureaConcentration[elemIdx]; return micp_.ureaConcentration[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
biofilmConcentration(unsigned elemIdx) const biofilmConcentration(unsigned elemIdx) const
{ {
if (micp_.biofilmConcentration.empty()) { if (micp_.biofilmConcentration.empty()) {
@ -692,8 +708,9 @@ biofilmConcentration(unsigned elemIdx) const
return micp_.biofilmConcentration[elemIdx]; return micp_.biofilmConcentration[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
calciteConcentration(unsigned elemIdx) const calciteConcentration(unsigned elemIdx) const
{ {
if (micp_.calciteConcentration.empty()) { if (micp_.calciteConcentration.empty()) {
@ -703,8 +720,8 @@ calciteConcentration(unsigned elemIdx) const
return micp_.calciteConcentration[elemIdx]; return micp_.calciteConcentration[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
unsigned FlowGenericProblem<GridView,FluidSystem,Scalar>:: unsigned FlowGenericProblem<GridView,FluidSystem>::
pvtRegionIndex(unsigned elemIdx) const pvtRegionIndex(unsigned elemIdx) const
{ {
if (pvtnum_.empty()) if (pvtnum_.empty())
@ -713,8 +730,8 @@ pvtRegionIndex(unsigned elemIdx) const
return pvtnum_[elemIdx]; return pvtnum_[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
unsigned FlowGenericProblem<GridView,FluidSystem,Scalar>:: unsigned FlowGenericProblem<GridView,FluidSystem>::
satnumRegionIndex(unsigned elemIdx) const satnumRegionIndex(unsigned elemIdx) const
{ {
if (satnum_.empty()) if (satnum_.empty())
@ -723,8 +740,8 @@ satnumRegionIndex(unsigned elemIdx) const
return satnum_[elemIdx]; return satnum_[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
unsigned FlowGenericProblem<GridView,FluidSystem,Scalar>:: unsigned FlowGenericProblem<GridView,FluidSystem>::
miscnumRegionIndex(unsigned elemIdx) const miscnumRegionIndex(unsigned elemIdx) const
{ {
if (miscnum_.empty()) if (miscnum_.empty())
@ -733,8 +750,8 @@ miscnumRegionIndex(unsigned elemIdx) const
return miscnum_[elemIdx]; return miscnum_[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
unsigned FlowGenericProblem<GridView,FluidSystem,Scalar>:: unsigned FlowGenericProblem<GridView,FluidSystem>::
plmixnumRegionIndex(unsigned elemIdx) const plmixnumRegionIndex(unsigned elemIdx) const
{ {
if (plmixnum_.empty()) if (plmixnum_.empty())
@ -743,8 +760,9 @@ plmixnumRegionIndex(unsigned elemIdx) const
return plmixnum_[elemIdx]; return plmixnum_[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>:: typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
maxPolymerAdsorption(unsigned elemIdx) const maxPolymerAdsorption(unsigned elemIdx) const
{ {
if (polymer_.maxAdsorption.empty()) { if (polymer_.maxAdsorption.empty()) {
@ -754,8 +772,8 @@ maxPolymerAdsorption(unsigned elemIdx) const
return polymer_.maxAdsorption[elemIdx]; return polymer_.maxAdsorption[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem>
bool FlowGenericProblem<GridView,FluidSystem,Scalar>:: bool FlowGenericProblem<GridView,FluidSystem>::
operator==(const FlowGenericProblem& rhs) const operator==(const FlowGenericProblem& rhs) const
{ {
return this->maxWaterSaturation_ == rhs.maxWaterSaturation_ && return this->maxWaterSaturation_ == rhs.maxWaterSaturation_ &&

View File

@ -108,12 +108,10 @@ namespace Opm {
template <class TypeTag> template <class TypeTag>
class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem> class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
, public FlowGenericProblem<GetPropType<TypeTag, Properties::GridView>, , public FlowGenericProblem<GetPropType<TypeTag, Properties::GridView>,
GetPropType<TypeTag, Properties::FluidSystem>, GetPropType<TypeTag, Properties::FluidSystem>>
GetPropType<TypeTag, Properties::Scalar>>
{ {
using BaseType = FlowGenericProblem<GetPropType<TypeTag, Properties::GridView>, using BaseType = FlowGenericProblem<GetPropType<TypeTag, Properties::GridView>,
GetPropType<TypeTag, Properties::FluidSystem>, GetPropType<TypeTag, Properties::FluidSystem>>;
GetPropType<TypeTag, Properties::Scalar>>;
using ParentType = GetPropType<TypeTag, Properties::BaseProblem>; using ParentType = GetPropType<TypeTag, Properties::BaseProblem>;
using Implementation = GetPropType<TypeTag, Properties::Problem>; using Implementation = GetPropType<TypeTag, Properties::Problem>;
@ -197,13 +195,13 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
using DirectionalMobilityPtr = Utility::CopyablePtr<DirectionalMobility<TypeTag, Evaluation>>; using DirectionalMobilityPtr = Utility::CopyablePtr<DirectionalMobility<TypeTag, Evaluation>>;
public: public:
using FlowGenericProblem<GridView,FluidSystem,Scalar>::briefDescription; using BaseType::briefDescription;
using FlowGenericProblem<GridView,FluidSystem,Scalar>::helpPreamble; using BaseType::helpPreamble;
using FlowGenericProblem<GridView,FluidSystem,Scalar>::shouldWriteOutput; using BaseType::shouldWriteOutput;
using FlowGenericProblem<GridView,FluidSystem,Scalar>::shouldWriteRestartFile; using BaseType::shouldWriteRestartFile;
using FlowGenericProblem<GridView,FluidSystem,Scalar>::rockCompressibility; using BaseType::rockCompressibility;
using FlowGenericProblem<GridView,FluidSystem,Scalar>::rockReferencePressure; using BaseType::rockReferencePressure;
using FlowGenericProblem<GridView,FluidSystem,Scalar>::porosity; using BaseType::porosity;
/*! /*!
* \copydoc FvBaseProblem::registerParameters * \copydoc FvBaseProblem::registerParameters
@ -270,9 +268,9 @@ public:
*/ */
FlowProblem(Simulator& simulator) FlowProblem(Simulator& simulator)
: ParentType(simulator) : ParentType(simulator)
, FlowGenericProblem<GridView,FluidSystem,Scalar>(simulator.vanguard().eclState(), , BaseType(simulator.vanguard().eclState(),
simulator.vanguard().schedule(), simulator.vanguard().schedule(),
simulator.vanguard().gridView()) simulator.vanguard().gridView())
, transmissibilities_(simulator.vanguard().eclState(), , transmissibilities_(simulator.vanguard().eclState(),
simulator.vanguard().gridView(), simulator.vanguard().gridView(),
simulator.vanguard().cartesianIndexMapper(), simulator.vanguard().cartesianIndexMapper(),
@ -1077,7 +1075,7 @@ public:
std::shared_ptr<EclMaterialLawManager> materialLawManager() std::shared_ptr<EclMaterialLawManager> materialLawManager()
{ return materialLawManager_; } { return materialLawManager_; }
using FlowGenericProblem<GridView,FluidSystem,Scalar>::pvtRegionIndex; using BaseType::pvtRegionIndex;
/*! /*!
* \brief Returns the index of the relevant region for thermodynmic properties * \brief Returns the index of the relevant region for thermodynmic properties
*/ */
@ -1085,7 +1083,7 @@ public:
unsigned pvtRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const unsigned pvtRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
{ return pvtRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); } { return pvtRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); }
using FlowGenericProblem<GridView,FluidSystem,Scalar>::satnumRegionIndex; using BaseType::satnumRegionIndex;
/*! /*!
* \brief Returns the index of the relevant region for thermodynmic properties * \brief Returns the index of the relevant region for thermodynmic properties
*/ */
@ -1093,7 +1091,7 @@ public:
unsigned satnumRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const unsigned satnumRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
{ return this->satnumRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); } { return this->satnumRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); }
using FlowGenericProblem<GridView,FluidSystem,Scalar>::miscnumRegionIndex; using BaseType::miscnumRegionIndex;
/*! /*!
* \brief Returns the index of the relevant region for thermodynmic properties * \brief Returns the index of the relevant region for thermodynmic properties
*/ */
@ -1101,7 +1099,7 @@ public:
unsigned miscnumRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const unsigned miscnumRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
{ return this->miscnumRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); } { return this->miscnumRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); }
using FlowGenericProblem<GridView,FluidSystem,Scalar>::plmixnumRegionIndex; using BaseType::plmixnumRegionIndex;
/*! /*!
* \brief Returns the index of the relevant region for thermodynmic properties * \brief Returns the index of the relevant region for thermodynmic properties
*/ */
@ -1109,7 +1107,7 @@ public:
unsigned plmixnumRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const unsigned plmixnumRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
{ return this->plmixnumRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); } { return this->plmixnumRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); }
using FlowGenericProblem<GridView,FluidSystem,Scalar>::maxPolymerAdsorption; using BaseType::maxPolymerAdsorption;
/*! /*!
* \brief Returns the max polymer adsorption value * \brief Returns the max polymer adsorption value
*/ */

View File

@ -239,7 +239,7 @@ BOOST_AUTO_TEST_CASE(EclGenericProblem)
auto gridView = grid.leafGridView(); auto gridView = grid.leafGridView();
#endif // HAVE_DUNE_FEM #endif // HAVE_DUNE_FEM
auto data_out auto data_out
= Opm::FlowGenericProblem<GridView, Opm::BlackOilFluidSystem<double, Opm::BlackOilDefaultIndexTraits>, double>:: = Opm::FlowGenericProblem<GridView, Opm::BlackOilFluidSystem<double, Opm::BlackOilDefaultIndexTraits>>::
serializationTestObject(eclState, schedule, gridView); serializationTestObject(eclState, schedule, gridView);
Opm::Serialization::MemPacker packer; Opm::Serialization::MemPacker packer;
Opm::Serializer ser(packer); Opm::Serializer ser(packer);