Removed unused SimulatorState comparison.
This commit is contained in:
1 parent
df0d11b8de
commit
5ce1d84ac1
2 files changed
-54
No files matched your search
@@ -6,40 +6,6 @@
|
|||||||
|
|
||||||
using namespace Opm;
|
using namespace Opm;
|
||||||
|
|
||||||
bool
|
|
||||||
SimulatorState::equals (const SimulatorState& other,
|
|
||||||
double epsilon) const {
|
|
||||||
bool equal = (num_phases_ == other.num_phases_);
|
|
||||||
|
|
||||||
// if we use &=, then all the tests will be run regardless
|
|
||||||
equal = equal && vectorApproxEqual( pressure() , other.pressure() , epsilon);
|
|
||||||
equal = equal && vectorApproxEqual( temperature() , other.temperature() , epsilon);
|
|
||||||
equal = equal && vectorApproxEqual( facepressure() , other.facepressure() , epsilon);
|
|
||||||
equal = equal && vectorApproxEqual( faceflux() , other.faceflux() , epsilon);
|
|
||||||
equal = equal && vectorApproxEqual( saturation() , other.saturation() , epsilon);
|
|
||||||
|
|
||||||
return equal;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
SimulatorState::vectorApproxEqual(const std::vector<double>& v1,
|
|
||||||
const std::vector<double>& v2,
|
|
||||||
double epsilon) {
|
|
||||||
if (v1.size() != v2.size()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i = 0; i < v1.size(); i++) {
|
|
||||||
const double diff = std::abs(v1[i] - v2[i]);
|
|
||||||
const double scale = std::abs(v1[i]) + std::abs(v2[i]);
|
|
||||||
if (diff > epsilon * scale) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SimulatorState::init(int number_of_cells, int number_of_faces, int num_phases)
|
SimulatorState::init(int number_of_cells, int number_of_faces, int num_phases)
|
||||||
|
|||||||
@@ -47,13 +47,6 @@ namespace Opm
|
|||||||
const std::vector<double>& faceflux () const { return faceData_[ faceFluxId_ ]; }
|
const std::vector<double>& faceflux () const { return faceData_[ faceFluxId_ ]; }
|
||||||
const std::vector<double>& saturation () const { return cellData_[ saturationId_ ]; }
|
const std::vector<double>& saturation () const { return cellData_[ saturationId_ ]; }
|
||||||
|
|
||||||
/**
|
|
||||||
* Compare this state with another, to see if they are different
|
|
||||||
* only within a small margin.
|
|
||||||
*/
|
|
||||||
virtual bool equals(const SimulatorState& other,
|
|
||||||
double epsilon = 1e-8) const;
|
|
||||||
|
|
||||||
std::vector< std::vector<double> >& cellData() { return cellData_; }
|
std::vector< std::vector<double> >& cellData() { return cellData_; }
|
||||||
const std::vector< std::vector<double> >& cellData() const { return cellData_; }
|
const std::vector< std::vector<double> >& cellData() const { return cellData_; }
|
||||||
|
|
||||||
@@ -80,19 +73,6 @@ namespace Opm
|
|||||||
/// \brief names for the face data
|
/// \brief names for the face data
|
||||||
std::vector< std::string > faceDataNames_;
|
std::vector< std::string > faceDataNames_;
|
||||||
|
|
||||||
protected:
|
|
||||||
/**
|
|
||||||
* Check if two vectors are equal within a margin.
|
|
||||||
*
|
|
||||||
* @param epsilon Relative difference that is tolerated for the
|
|
||||||
* vectors to still be considered equal.
|
|
||||||
*
|
|
||||||
* @return True if every element is within the margin, false if
|
|
||||||
* there is at least one that is not.
|
|
||||||
*/
|
|
||||||
static bool vectorApproxEqual(const std::vector<double>& v1,
|
|
||||||
const std::vector<double>& v2,
|
|
||||||
double epsilon);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
|||||||
Reference in new issue
Block a user