mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-02 04:26:55 -06:00
Merge pull request #310 from atgeirr/fix-warnings
Fix warnings and adapt to API changes
This commit is contained in:
commit
47d9b3438e
@ -315,7 +315,7 @@ void initEclipseTrans(TransGraph& eclipseTrans , const ecl_grid_type * ecl_grid
|
||||
|
||||
|
||||
|
||||
void dump_transGraph( DeckConstPtr deck , std::shared_ptr<const EclipseState> eclipseState , const ecl_grid_type * ecl_grid , const ecl_file_type * ecl_init , size_t verbosity) {
|
||||
void dump_transGraph( DeckConstPtr deck , std::shared_ptr<const EclipseState> eclipseState , const ecl_grid_type * ecl_grid , const ecl_file_type * ecl_init) {
|
||||
int nx = ecl_grid_get_nx( ecl_grid );
|
||||
int ny = ecl_grid_get_ny( ecl_grid );
|
||||
int nz = ecl_grid_get_nz( ecl_grid );
|
||||
@ -354,7 +354,7 @@ int main(int argc, char** argv) {
|
||||
std::cout << "Loading eclipse EGRID file ....: " << grid_file << std::endl;
|
||||
ecl_grid_type * ecl_grid = ecl_grid_alloc( grid_file.c_str() );
|
||||
|
||||
dump_transGraph( deck , state , ecl_grid , ecl_init , 3);
|
||||
dump_transGraph( deck , state , ecl_grid , ecl_init);
|
||||
|
||||
ecl_file_close( ecl_init );
|
||||
ecl_grid_free( ecl_grid );
|
||||
|
@ -80,8 +80,9 @@ namespace Opm {
|
||||
}
|
||||
|
||||
template <class T, unsigned long n>
|
||||
void resizeContainer( std::array<T, n>& a, size_t size )
|
||||
void resizeContainer( std::array<T, n>& /* a */, size_t size )
|
||||
{
|
||||
static_cast<void>(size);
|
||||
assert( int(size) == int(n) );
|
||||
}
|
||||
|
||||
@ -142,16 +143,16 @@ namespace Opm {
|
||||
BlackoilStateId = 2,
|
||||
WellStateFullyImplicitBackoilId = 3 };
|
||||
|
||||
inline int objectId( const SimulatorState& state ) {
|
||||
inline int objectId( const SimulatorState& /* state */) {
|
||||
return SimulatorStateId;
|
||||
}
|
||||
inline int objectId( const WellState& state ) {
|
||||
inline int objectId( const WellState& /* state */) {
|
||||
return WellStateId;
|
||||
}
|
||||
inline int objectId( const BlackoilState& state ) {
|
||||
inline int objectId( const BlackoilState& /* state */) {
|
||||
return BlackoilStateId;
|
||||
}
|
||||
inline int objectId( const WellStateFullyImplicitBlackoil& state ) {
|
||||
inline int objectId( const WellStateFullyImplicitBlackoil& /* state */) {
|
||||
return WellStateFullyImplicitBackoilId;
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,7 @@ namespace Opm
|
||||
const double* BlackoilPropsAd::surfaceDensity(int regionIdx) const
|
||||
{
|
||||
// this class only supports a single PVT region for now...
|
||||
static_cast<void>(regionIdx);
|
||||
assert(regionIdx == 0);
|
||||
return props_.surfaceDensity();
|
||||
}
|
||||
@ -433,7 +434,7 @@ namespace Opm
|
||||
/// \param[in] cells Array of n cell indices to be associated with the pressure values.
|
||||
/// \return Array of n formation volume factor values.
|
||||
V BlackoilPropsAd::bGas(const V& pg,
|
||||
const V& T,
|
||||
const V& /* T */,
|
||||
const Cells& cells) const
|
||||
{
|
||||
if (!pu_.phase_used[Gas]) {
|
||||
|
@ -71,10 +71,13 @@ namespace Opm
|
||||
BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(const BlackoilPropsAdFromDeck& props,
|
||||
const int number_of_cells)
|
||||
{
|
||||
if(number_of_cells>props.cellPvtRegionIdx_.size())
|
||||
const int original_size = props.cellPvtRegionIdx_.size();
|
||||
if (number_of_cells > original_size) {
|
||||
OPM_THROW(std::runtime_error, "The number of cells is larger than the one of the original grid!");
|
||||
if(number_of_cells<0)
|
||||
}
|
||||
if (number_of_cells < 0) {
|
||||
OPM_THROW(std::runtime_error, "The number of cells is has to be larger than 0.");
|
||||
}
|
||||
// Copy properties that do not depend on the postion within the grid.
|
||||
rock_ = props.rock_;
|
||||
satprops_ = props.satprops_;
|
||||
|
@ -77,14 +77,6 @@ namespace Opm
|
||||
/// \return solution to complete system.
|
||||
V recoverVariable(const ADB& equation, const V& partial_solution, const int n);
|
||||
|
||||
/// Determine diagonality of a sparse matrix.
|
||||
/// If there are off-diagonal elements in the sparse
|
||||
/// structure, this function returns true if they are all
|
||||
/// equal to zero.
|
||||
/// \param[in] matrix the matrix under consideration
|
||||
/// \return true if matrix is diagonal
|
||||
bool isDiagonal(const M& matrix);
|
||||
|
||||
/// Form an elliptic system of equations.
|
||||
/// \param[in] num_phases the number of fluid phases
|
||||
/// \param[in] eqs the equations
|
||||
@ -98,11 +90,6 @@ namespace Opm
|
||||
Eigen::SparseMatrix<double, Eigen::RowMajor>& A,
|
||||
V& b);
|
||||
|
||||
/// Create a dune-istl matrix from an Eigen matrix.
|
||||
/// \param[in] matrix input Eigen::SparseMatrix
|
||||
/// \return output Dune::BCRSMatrix
|
||||
Mat makeIstlMatrix(const Eigen::SparseMatrix<double, Eigen::RowMajor>& matrix);
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
@ -382,29 +369,6 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
|
||||
bool isDiagonal(const M& matr)
|
||||
{
|
||||
M matrix = matr;
|
||||
matrix.makeCompressed();
|
||||
for (int k = 0; k < matrix.outerSize(); ++k) {
|
||||
for (M::InnerIterator it(matrix, k); it; ++it) {
|
||||
if (it.col() != it.row()) {
|
||||
// Off-diagonal element.
|
||||
if (it.value() != 0.0) {
|
||||
// Nonzero off-diagonal element.
|
||||
// std::cout << "off-diag: " << it.row() << ' ' << it.col() << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// Form an elliptic system of equations.
|
||||
/// \param[in] num_phases the number of fluid phases
|
||||
/// \param[in] eqs the equations
|
||||
|
@ -89,15 +89,14 @@ public:
|
||||
{
|
||||
assert( T::codimension == 0);
|
||||
assert( size == 2 * recvState_.numPhases() +4+2*recvGrid_.numCellFaces(e.index()));
|
||||
(void) size;
|
||||
static_cast<void>(size);
|
||||
|
||||
double val;
|
||||
for ( int i=0; i<recvState_.numPhases(); ++i )
|
||||
{
|
||||
double val;
|
||||
buffer.read(val);
|
||||
recvState_.surfacevol()[e.index()]=val;
|
||||
}
|
||||
double val;
|
||||
buffer.read(val);
|
||||
recvState_.gasoilratio()[e.index()]=val;
|
||||
buffer.read(val);
|
||||
@ -111,13 +110,11 @@ public:
|
||||
|
||||
for ( int i=0; i<recvGrid_.numCellFaces(e.index()); ++i )
|
||||
{
|
||||
double val;
|
||||
buffer.read(val);
|
||||
recvState_.facepressure()[recvGrid_.cellFace(e.index(), i)]=val;
|
||||
}
|
||||
for ( int i=0; i<recvGrid_.numCellFaces(e.index()); ++i )
|
||||
{
|
||||
double val;
|
||||
buffer.read(val);
|
||||
recvState_.faceflux()[recvGrid_.cellFace(e.index(), i)]=val;
|
||||
}
|
||||
|
@ -127,7 +127,8 @@ namespace Opm
|
||||
{}
|
||||
|
||||
/** \copydoc Opm::OutputWriter::writeInit */
|
||||
void writeInit(const SimulatorTimerInterface &timer) {}
|
||||
void writeInit(const SimulatorTimerInterface& /* timer */)
|
||||
{}
|
||||
|
||||
/** \copydoc Opm::OutputWriter::writeTimeStep */
|
||||
void writeTimeStep(const SimulatorTimerInterface& timer,
|
||||
@ -155,7 +156,8 @@ namespace Opm
|
||||
{}
|
||||
|
||||
/** \copydoc Opm::OutputWriter::writeInit */
|
||||
void writeInit(const SimulatorTimerInterface &timer) {}
|
||||
void writeInit(const SimulatorTimerInterface& /* timer */)
|
||||
{}
|
||||
|
||||
/** \copydoc Opm::OutputWriter::writeTimeStep */
|
||||
void writeTimeStep(const SimulatorTimerInterface& timer,
|
||||
@ -200,7 +202,7 @@ namespace Opm
|
||||
const std::string& outputDirectory() const { return outputDir_; }
|
||||
|
||||
/** \brief return true if output is enabled */
|
||||
const bool output () const { return output_; }
|
||||
bool output () const { return output_; }
|
||||
|
||||
void restore(SimulatorTimerInterface& timer,
|
||||
BlackoilState& state,
|
||||
|
@ -248,7 +248,6 @@ namespace Opm
|
||||
Opm::UgGridHelpers::globalCell(grid_),
|
||||
Opm::UgGridHelpers::cartDims(grid_),
|
||||
Opm::UgGridHelpers::dimensions(grid_),
|
||||
Opm::UgGridHelpers::beginCellCentroids(grid_),
|
||||
Opm::UgGridHelpers::cell2Faces(grid_),
|
||||
Opm::UgGridHelpers::beginFaceCentroids(grid_),
|
||||
props_.permeability());
|
||||
|
Loading…
Reference in New Issue
Block a user