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/version.hh>
|
||||||
#include <dune/common/fvector.hh>
|
#include <dune/common/fvector.hh>
|
||||||
#include <dune/common/fmatrix.hh>
|
#include <dune/common/fmatrix.hh>
|
||||||
#include <dune/common/parallel/mpiguard.hh>
|
|
||||||
|
|
||||||
#include <opm/output/eclipse/EclipseIO.hpp>
|
#include <opm/output/eclipse/EclipseIO.hpp>
|
||||||
|
|
||||||
@ -920,7 +919,28 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (enableExperiments)
|
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.)
|
// write the static output files (EGRID, INIT, SMSPEC, etc.)
|
||||||
if (enableEclOutput_)
|
if (enableEclOutput_)
|
||||||
@ -2125,7 +2145,6 @@ private:
|
|||||||
void checkDeckCompatibility_() const
|
void checkDeckCompatibility_() const
|
||||||
{
|
{
|
||||||
const auto& comm = this->simulator().gridView().comm();
|
const auto& comm = this->simulator().gridView().comm();
|
||||||
Dune::MPIGuard guard;
|
|
||||||
|
|
||||||
if (comm.rank() == 0)
|
if (comm.rank() == 0)
|
||||||
{
|
{
|
||||||
@ -2181,8 +2200,6 @@ private:
|
|||||||
throw std::runtime_error("The deck enables water, but this simulator cannot handle it.");
|
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)
|
// 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
|
bool drsdtActive_() const
|
||||||
|
@ -32,7 +32,7 @@ namespace Opm
|
|||||||
MultisegmentWellContribution::MultisegmentWellContribution(unsigned int dim_, unsigned int dim_wells_,
|
MultisegmentWellContribution::MultisegmentWellContribution(unsigned int dim_, unsigned int dim_wells_,
|
||||||
unsigned int Nb_, unsigned int Mb_,
|
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 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)
|
std::vector<double> &Cvalues)
|
||||||
:
|
:
|
||||||
dim(dim_), // size of blockvectors in vectors x and y, equal to MultisegmentWell::numEq
|
dim(dim_), // size of blockvectors in vectors x and y, equal to MultisegmentWell::numEq
|
||||||
|
@ -26,6 +26,9 @@
|
|||||||
#include <cuda_runtime.h>
|
#include <cuda_runtime.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <dune/istl/umfpack.hh>
|
||||||
|
#include <dune/common/version.hh>
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -75,6 +78,13 @@ private:
|
|||||||
|
|
||||||
public:
|
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
|
#if HAVE_CUDA
|
||||||
/// Set a cudaStream to be used
|
/// Set a cudaStream to be used
|
||||||
/// \param[in] stream the cudaStream that is used
|
/// \param[in] stream the cudaStream that is used
|
||||||
@ -100,8 +110,8 @@ public:
|
|||||||
MultisegmentWellContribution(unsigned int dim, unsigned int dim_wells,
|
MultisegmentWellContribution(unsigned int dim, unsigned int dim_wells,
|
||||||
unsigned int Nb, unsigned int Mb,
|
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 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,
|
||||||
std::vector<double> &Cvalues);
|
UMFPackIndex *DrowIndices, std::vector<double> &Cvalues);
|
||||||
|
|
||||||
/// Destroy a MultisegmentWellContribution, and free memory
|
/// Destroy a MultisegmentWellContribution, and free memory
|
||||||
~MultisegmentWellContribution();
|
~MultisegmentWellContribution();
|
||||||
|
@ -137,7 +137,7 @@ void WellContributions::alloc()
|
|||||||
void WellContributions::addMultisegmentWellContribution(unsigned int dim_, unsigned int dim_wells_,
|
void WellContributions::addMultisegmentWellContribution(unsigned int dim_, unsigned int dim_wells_,
|
||||||
unsigned int Nb, unsigned int Mb,
|
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 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)
|
std::vector<double> &Cvalues)
|
||||||
{
|
{
|
||||||
assert(dim==dim_);
|
assert(dim==dim_);
|
||||||
|
@ -31,7 +31,8 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <opm/simulators/linalg/bda/MultisegmentWellContribution.hpp>
|
#include <opm/simulators/linalg/bda/MultisegmentWellContribution.hpp>
|
||||||
|
#include <dune/istl/umfpack.hh>
|
||||||
|
#include <dune/common/version.hh>
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
@ -56,6 +57,12 @@ namespace Opm
|
|||||||
class WellContributions
|
class WellContributions
|
||||||
{
|
{
|
||||||
public:
|
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
|
/// StandardWell has C, D and B matrices that need to be copied
|
||||||
enum class MatrixType {
|
enum class MatrixType {
|
||||||
C,
|
C,
|
||||||
@ -184,7 +191,8 @@ public:
|
|||||||
void addMultisegmentWellContribution(unsigned int dim, unsigned int dim_wells,
|
void addMultisegmentWellContribution(unsigned int dim, unsigned int dim_wells,
|
||||||
unsigned int Nb, unsigned int Mb,
|
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 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);
|
std::vector<double> &Cvalues);
|
||||||
|
|
||||||
/// If the rows of the matrix are reordered, the columnindices of the matrixdata are incorrect
|
/// If the rows of the matrix are reordered, the columnindices of the matrixdata are incorrect
|
||||||
|
@ -677,8 +677,8 @@ namespace Opm
|
|||||||
// duneD
|
// duneD
|
||||||
Dune::UMFPack<DiagMatWell> umfpackMatrix(duneD_, 0);
|
Dune::UMFPack<DiagMatWell> umfpackMatrix(duneD_, 0);
|
||||||
double *Dvals = umfpackMatrix.getInternalMatrix().getValues();
|
double *Dvals = umfpackMatrix.getInternalMatrix().getValues();
|
||||||
int *Dcols = umfpackMatrix.getInternalMatrix().getColStart();
|
auto *Dcols = umfpackMatrix.getInternalMatrix().getColStart();
|
||||||
int *Drows = umfpackMatrix.getInternalMatrix().getRowIndex();
|
auto *Drows = umfpackMatrix.getInternalMatrix().getRowIndex();
|
||||||
|
|
||||||
// duneB
|
// duneB
|
||||||
std::vector<unsigned int> Bcols;
|
std::vector<unsigned int> Bcols;
|
||||||
|
Loading…
Reference in New Issue
Block a user