mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2825 from blattms/dune-2.7-fixes
Fixes compilation with DUNE 2.7
This commit is contained in:
commit
1109aeecfc
@ -99,7 +99,6 @@
|
||||
#include <dune/common/version.hh>
|
||||
#include <dune/common/fvector.hh>
|
||||
#include <dune/common/fmatrix.hh>
|
||||
#include <dune/common/parallel/mpiguard.hh>
|
||||
|
||||
#include <opm/output/eclipse/EclipseIO.hpp>
|
||||
|
||||
@ -920,7 +919,28 @@ public:
|
||||
}
|
||||
|
||||
if (enableExperiments)
|
||||
checkDeckCompatibility_();
|
||||
{
|
||||
int success = 1;
|
||||
const auto& cc = simulator.vanguard().grid().comm();
|
||||
|
||||
try
|
||||
{
|
||||
checkDeckCompatibility_();
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
success = 0;
|
||||
success = cc.min(success);
|
||||
throw;
|
||||
}
|
||||
|
||||
success = cc.min(success);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
throw std::runtime_error("Checking deck compatibility failed");
|
||||
}
|
||||
}
|
||||
|
||||
// write the static output files (EGRID, INIT, SMSPEC, etc.)
|
||||
if (enableEclOutput_)
|
||||
@ -2125,7 +2145,6 @@ private:
|
||||
void checkDeckCompatibility_() const
|
||||
{
|
||||
const auto& comm = this->simulator().gridView().comm();
|
||||
Dune::MPIGuard guard;
|
||||
|
||||
if (comm.rank() == 0)
|
||||
{
|
||||
@ -2181,8 +2200,6 @@ private:
|
||||
throw std::runtime_error("The deck enables water, but this simulator cannot handle it.");
|
||||
// the opposite cases should be fine (albeit a bit slower than what's possible)
|
||||
}
|
||||
// throws an expeption on all processes if rank 0 had a problem
|
||||
guard.finalize();
|
||||
}
|
||||
|
||||
bool drsdtActive_() const
|
||||
|
@ -32,7 +32,7 @@ namespace Opm
|
||||
MultisegmentWellContribution::MultisegmentWellContribution(unsigned int dim_, unsigned int dim_wells_,
|
||||
unsigned int Nb_, unsigned int Mb_,
|
||||
unsigned int BnumBlocks_, std::vector<double> &Bvalues, std::vector<unsigned int> &BcolIndices, std::vector<unsigned int> &BrowPointers,
|
||||
unsigned int DnumBlocks_, double *Dvalues, int *DcolPointers, int *DrowIndices,
|
||||
unsigned int DnumBlocks_, double *Dvalues, UMFPackIndex *DcolPointers, UMFPackIndex *DrowIndices,
|
||||
std::vector<double> &Cvalues)
|
||||
:
|
||||
dim(dim_), // size of blockvectors in vectors x and y, equal to MultisegmentWell::numEq
|
||||
|
@ -26,6 +26,9 @@
|
||||
#include <cuda_runtime.h>
|
||||
#endif
|
||||
|
||||
#include <dune/istl/umfpack.hh>
|
||||
#include <dune/common/version.hh>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
@ -75,6 +78,13 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 7)
|
||||
using UMFPackIndex =
|
||||
typename Dune::UMFPack<Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1>>>::UMFPackMatrix::Index;
|
||||
#else
|
||||
using UMFPackIndex = int;
|
||||
#endif
|
||||
|
||||
#if HAVE_CUDA
|
||||
/// Set a cudaStream to be used
|
||||
/// \param[in] stream the cudaStream that is used
|
||||
@ -100,8 +110,8 @@ public:
|
||||
MultisegmentWellContribution(unsigned int dim, unsigned int dim_wells,
|
||||
unsigned int Nb, unsigned int Mb,
|
||||
unsigned int BnumBlocks, std::vector<double> &Bvalues, std::vector<unsigned int> &BcolIndices, std::vector<unsigned int> &BrowPointers,
|
||||
unsigned int DnumBlocks, double *Dvalues, int *DcolPointers, int *DrowIndices,
|
||||
std::vector<double> &Cvalues);
|
||||
unsigned int DnumBlocks, double *Dvalues, UMFPackIndex *DcolPointers,
|
||||
UMFPackIndex *DrowIndices, std::vector<double> &Cvalues);
|
||||
|
||||
/// Destroy a MultisegmentWellContribution, and free memory
|
||||
~MultisegmentWellContribution();
|
||||
|
@ -137,7 +137,7 @@ void WellContributions::alloc()
|
||||
void WellContributions::addMultisegmentWellContribution(unsigned int dim_, unsigned int dim_wells_,
|
||||
unsigned int Nb, unsigned int Mb,
|
||||
unsigned int BnumBlocks, std::vector<double> &Bvalues, std::vector<unsigned int> &BcolIndices, std::vector<unsigned int> &BrowPointers,
|
||||
unsigned int DnumBlocks, double *Dvalues, int *DcolPointers, int *DrowIndices,
|
||||
unsigned int DnumBlocks, double *Dvalues, UMFPackIndex *DcolPointers, UMFPackIndex *DrowIndices,
|
||||
std::vector<double> &Cvalues)
|
||||
{
|
||||
assert(dim==dim_);
|
||||
|
@ -31,7 +31,8 @@
|
||||
#include <vector>
|
||||
|
||||
#include <opm/simulators/linalg/bda/MultisegmentWellContribution.hpp>
|
||||
|
||||
#include <dune/istl/umfpack.hh>
|
||||
#include <dune/common/version.hh>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
@ -56,6 +57,12 @@ namespace Opm
|
||||
class WellContributions
|
||||
{
|
||||
public:
|
||||
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 7)
|
||||
using UMFPackIndex =
|
||||
typename Dune::UMFPack<Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1>>>::UMFPackMatrix::Index;
|
||||
#else
|
||||
using UMFPackIndex = int;
|
||||
#endif
|
||||
/// StandardWell has C, D and B matrices that need to be copied
|
||||
enum class MatrixType {
|
||||
C,
|
||||
@ -184,7 +191,8 @@ public:
|
||||
void addMultisegmentWellContribution(unsigned int dim, unsigned int dim_wells,
|
||||
unsigned int Nb, unsigned int Mb,
|
||||
unsigned int BnumBlocks, std::vector<double> &Bvalues, std::vector<unsigned int> &BcolIndices, std::vector<unsigned int> &BrowPointers,
|
||||
unsigned int DnumBlocks, double *Dvalues, int *DcolPointers, int *DrowIndices,
|
||||
unsigned int DnumBlocks, double *Dvalues,
|
||||
UMFPackIndex *DcolPointers, UMFPackIndex *DrowIndices,
|
||||
std::vector<double> &Cvalues);
|
||||
|
||||
/// If the rows of the matrix are reordered, the columnindices of the matrixdata are incorrect
|
||||
|
@ -677,8 +677,8 @@ namespace Opm
|
||||
// duneD
|
||||
Dune::UMFPack<DiagMatWell> umfpackMatrix(duneD_, 0);
|
||||
double *Dvals = umfpackMatrix.getInternalMatrix().getValues();
|
||||
int *Dcols = umfpackMatrix.getInternalMatrix().getColStart();
|
||||
int *Drows = umfpackMatrix.getInternalMatrix().getRowIndex();
|
||||
auto *Dcols = umfpackMatrix.getInternalMatrix().getColStart();
|
||||
auto *Drows = umfpackMatrix.getInternalMatrix().getRowIndex();
|
||||
|
||||
// duneB
|
||||
std::vector<unsigned int> Bcols;
|
||||
|
Loading…
Reference in New Issue
Block a user