Merge pull request #4169 from blattms/dune-2.9-fix-deprecations

Dune 2.9 fix deprecations
This commit is contained in:
Atgeirr Flø Rasmussen 2022-10-17 15:17:29 +02:00 committed by GitHub
commit 1eec214c89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 10 deletions

View File

@ -64,15 +64,18 @@ public:
return codim == 0; return codim == 0;
} }
#if DUNE_VERSION_LT(DUNE_GRID, 2, 8)
bool fixedsize(int /* dim */, int /* codim */) const bool fixedsize(int /* dim */, int /* codim */) const
{ {
return true; return true;
} }
#else
bool fixedSize(int /* dim */, int /* codim */) const bool fixedSize(int /* dim */, int /* codim */) const
{ {
return true; return true;
} }
#endif
template<class EntityType> template<class EntityType>
std::size_t size(const EntityType /* entity */) const std::size_t size(const EntityType /* entity */) const
{ {

View File

@ -130,7 +130,12 @@
template<class T> template<class T>
std::tuple<T,int,int> PackUnpack(T& in) std::tuple<T,int,int> PackUnpack(T& in)
{ {
auto comm = Dune::MPIHelper::getCollectiveCommunication(); #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
const auto& comm = Dune::MPIHelper::getCommunication();
#else
const auto& comm = Dune::MPIHelper::getCollectiveCommunication();
#endif
Opm::EclMpiSerializer ser(comm); Opm::EclMpiSerializer ser(comm);
ser.pack(in); ser.pack(in);
size_t pos1 = ser.position(); size_t pos1 = ser.position();

View File

@ -75,7 +75,7 @@ void fillValues(int N, M& mat, int overlapStart, int overlapEnd, int start, int
template<class M, class G, class L, class C, int n> template<class M, class G, class L, class C, int n>
M setupAnisotropic2d(int N, Dune::ParallelIndexSet<G,L,n>& indices, M setupAnisotropic2d(int N, Dune::ParallelIndexSet<G,L,n>& indices,
const Dune::CollectiveCommunication<C>& p, int *nout, typename M::block_type::value_type eps=1.0); const C& p, int *nout, typename M::block_type::value_type eps=1.0);
template<class M, class G, class L, int s> template<class M, class G, class L, int s>
@ -218,7 +218,7 @@ void setBoundary(V& lhs, V& rhs, const G& N)
} }
template<class M, class G, class L, class C, int s> template<class M, class G, class L, class C, int s>
M setupAnisotropic2d(int N, Dune::ParallelIndexSet<G,L,s>& indices, const Dune::CollectiveCommunication<C>& p, int *nout, typename M::block_type::value_type eps) M setupAnisotropic2d(int N, Dune::ParallelIndexSet<G,L,s>& indices, const C& p, int *nout, typename M::block_type::value_type eps)
{ {
int procs=p.size(), rank=p.rank(); int procs=p.size(), rank=p.rank();
@ -278,7 +278,12 @@ void runBlackoilAmgLaplace()
typedef Dune::OverlappingSchwarzOperator<BCRSMat,Vector,Vector,Communication> Operator; typedef Dune::OverlappingSchwarzOperator<BCRSMat,Vector,Vector,Communication> Operator;
int argc; int argc;
char** argv; char** argv;
const auto& ccomm = Dune::MPIHelper::instance(argc, argv).getCollectiveCommunication();
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
const auto& ccomm = Dune::MPIHelper::getCommunication();
#else
const auto& ccomm = Dune::MPIHelper::getCollectiveCommunication();
#endif
Communication comm(ccomm); Communication comm(ccomm);
int n=0; int n=0;

View File

@ -58,7 +58,11 @@ init_unit_test_func()
BOOST_AUTO_TEST_CASE(BroadCast) BOOST_AUTO_TEST_CASE(BroadCast)
{ {
auto cc = Dune::MPIHelper::getCollectiveCommunication(); #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
const auto& cc = Dune::MPIHelper::getCommunication();
#else
const auto& cc = Dune::MPIHelper::getCollectiveCommunication();
#endif
std::vector<double> d(3); std::vector<double> d(3);
if (cc.rank() == 1) if (cc.rank() == 1)

View File

@ -81,8 +81,11 @@ void initLogger(std::ostringstream& log_stream) {
BOOST_AUTO_TEST_CASE(NoMessages) BOOST_AUTO_TEST_CASE(NoMessages)
{ {
auto cc = Dune::MPIHelper::getCollectiveCommunication(); #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
const auto& cc = Dune::MPIHelper::getCommunication();
#else
const auto& cc = Dune::MPIHelper::getCollectiveCommunication();
#endif
std::ostringstream log_stream; std::ostringstream log_stream;
initLogger(log_stream); initLogger(log_stream);
@ -104,7 +107,11 @@ BOOST_AUTO_TEST_CASE(NoMessages)
BOOST_AUTO_TEST_CASE(VariableNumberOfMessages) BOOST_AUTO_TEST_CASE(VariableNumberOfMessages)
{ {
const Opm::Parallel::Communication& cc = Dune::MPIHelper::getCollectiveCommunication(); #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
const auto& cc = Dune::MPIHelper::getCommunication();
#else
const auto& cc = Dune::MPIHelper::getCollectiveCommunication();
#endif
std::ostringstream log_stream; std::ostringstream log_stream;
initLogger(log_stream); initLogger(log_stream);
@ -142,7 +149,11 @@ BOOST_AUTO_TEST_CASE(VariableNumberOfMessages)
BOOST_AUTO_TEST_CASE(AllHaveOneMessage) BOOST_AUTO_TEST_CASE(AllHaveOneMessage)
{ {
const Opm::Parallel::Communication& cc = Dune::MPIHelper::getCollectiveCommunication(); #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
const auto& cc = Dune::MPIHelper::getCommunication();
#else
const auto& cc = Dune::MPIHelper::getCollectiveCommunication();
#endif
std::ostringstream log_stream; std::ostringstream log_stream;
initLogger(log_stream); initLogger(log_stream);

View File

@ -102,7 +102,11 @@ struct GlobalFixture {
Dune::MPIHelper::instance(argcDummy, argvDummy); Dune::MPIHelper::instance(argcDummy, argvDummy);
#endif #endif
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
Opm::FlowMainEbos<Opm::Properties::TTag::EclFlowProblem>::setupParameters_(argcDummy, argvDummy, Dune::MPIHelper::getCommunication());
#else
Opm::FlowMainEbos<Opm::Properties::TTag::EclFlowProblem>::setupParameters_(argcDummy, argvDummy, Dune::MPIHelper::getCollectiveCommunication()); Opm::FlowMainEbos<Opm::Properties::TTag::EclFlowProblem>::setupParameters_(argcDummy, argvDummy, Dune::MPIHelper::getCollectiveCommunication());
#endif
} }
}; };