diff --git a/opm/autodiff/BlackoilAquiferModel.hpp b/opm/autodiff/BlackoilAquiferModel.hpp index c24a782b6..ac671ec67 100644 --- a/opm/autodiff/BlackoilAquiferModel.hpp +++ b/opm/autodiff/BlackoilAquiferModel.hpp @@ -44,50 +44,19 @@ namespace Opm { public: explicit BlackoilAquiferModel(Simulator& simulator); - void initialSolutionApplied() - { - for (auto aquifer = aquifers_.begin(); aquifer != aquifers_.end(); ++aquifer) { - aquifer->initialSolutionApplied(); - } - } - - void beginEpisode() - { } - - void beginTimeStep() - { - for (auto aquifer = aquifers_.begin(); aquifer != aquifers_.end(); ++aquifer) { - aquifer->beginTimeStep(); - } - } - - void beginIteration() - { } - + void initialSolutionApplied(); + void beginEpisode(); + void beginTimeStep(); + void beginIteration(); // add the water rate due to aquifers to the source term. template void addToSource(RateVector& rates, const Context& context, unsigned spaceIdx, - unsigned timeIdx) const - { - for (auto& aquifer: aquifers_) { - aquifer.addToSource(rates, context, spaceIdx, timeIdx); - } - } - - void endIteration() - { } - - void endTimeStep() - { - for (auto aquifer = aquifers_.begin(); aquifer != aquifers_.end(); ++aquifer) { - aquifer->endTimeStep(); - } - } - - void endEpisode() - { } + unsigned timeIdx) const; + void endIteration(); + void endTimeStep(); + void endEpisode(); protected: // --------- Types --------- diff --git a/opm/autodiff/BlackoilAquiferModel_impl.hpp b/opm/autodiff/BlackoilAquiferModel_impl.hpp index 3d9525c7d..2c5646746 100644 --- a/opm/autodiff/BlackoilAquiferModel_impl.hpp +++ b/opm/autodiff/BlackoilAquiferModel_impl.hpp @@ -9,6 +9,66 @@ namespace Opm { init(); } + template + void + BlackoilAquiferModel::initialSolutionApplied() + { + for (auto aquifer = aquifers_.begin(); aquifer != aquifers_.end(); ++aquifer) { + aquifer->initialSolutionApplied(); + } + } + + template + void + BlackoilAquiferModel::beginEpisode() + { } + + template + void + BlackoilAquiferModel::beginTimeStep() + { + for (auto aquifer = aquifers_.begin(); aquifer != aquifers_.end(); ++aquifer) { + aquifer->beginTimeStep(); + } + } + + template + void + BlackoilAquiferModel::beginIteration() + { } + + template + template + void + BlackoilAquiferModel::addToSource(RateVector& rates, + const Context& context, + unsigned spaceIdx, + unsigned timeIdx) const + { + for (auto& aquifer: aquifers_) { + aquifer.addToSource(rates, context, spaceIdx, timeIdx); + } + } + + template + void + BlackoilAquiferModel::endIteration() + { } + + template + void + BlackoilAquiferModel::endTimeStep() + { + for (auto aquifer = aquifers_.begin(); aquifer != aquifers_.end(); ++aquifer) { + aquifer->endTimeStep(); + } + } + + template + void + BlackoilAquiferModel::endEpisode() + { } + // Initialize the aquifers in the deck template void