Revert: Removed unused SimulatorState::setFirstSat

This commit is contained in:
Joakim Hove committed 2016-02-04 18:39:39 +01:00
1 parent 4e46bb3fa4
commit b241fde63c
2 files changed
+53

No files matched your search

+39
View File
@@ -63,3 +63,42 @@ SimulatorState::registerFaceData( const std::string& name, const int components,
return pos ;
}
template <typename Props> void
SimulatorState::setFirstSat(const std::vector<int>& cells,
const Props& props,
ExtremalSat es)
{
if (cells.empty()) {
return;
}
int n = cells.size();
std::vector<double> smin(num_phases_*n);
std::vector<double> smax(num_phases_*n);
props.satRange(n, &cells[0], &smin[0], &smax[0]);
std::vector< double >& sat = saturation();
const double* svals = (es == MinSat) ? &smin[0] : &smax[0];
for (int ci = 0; ci < n; ++ci) {
const int cell = cells[ci];
sat[num_phases_*cell] = svals[num_phases_*ci];
sat[num_phases_*cell + 1] = 1.0 - sat[num_phases_*cell];
}
}
// template instantiations for all known (to this library) subclasses
// of SimulatorState that will call this method. notice that there are
// no empty angle brackets after "template" -- that would have been
// specialization instead
#include <opm/core/props/BlackoilPropertiesInterface.hpp>
#include <opm/core/props/IncompPropertiesInterface.hpp>
template void
SimulatorState::setFirstSat <IncompPropertiesInterface> (
const std::vector<int> &cells,
const IncompPropertiesInterface &props,
ExtremalSat es);
template void
SimulatorState::setFirstSat <BlackoilPropertiesInterface> (
const std::vector<int> &cells,
const BlackoilPropertiesInterface &props,
ExtremalSat es);
+14
View File
@@ -17,6 +17,8 @@ namespace Opm
virtual void init(int number_of_cells, int number_of_faces, int num_phases);
enum ExtremalSat { MinSat, MaxSat };
protected:
/// \brief pressure per cell.
static const int pressureId_ = 0;
@@ -30,6 +32,18 @@ namespace Opm
/// \brief The fluxes at the faces.
static const int faceFluxId_ = 1;
/**
* Initialize the first saturation to maximum value. This method
* should be considered deprecated. Avoid to use it!
*
* \tparam Props Fluid and rock properties that pertain to this
* kind of simulation. Currently, only Blackoil-
* and IncompPropertiesInterface are supported.
*/
template <typename Props>
void setFirstSat(const std::vector<int>& cells,
const Props& props,
ExtremalSat es);
public:
int numPhases() const { return num_phases_; }
int numCells () const { return num_cells_; }