From a3d115ff22398be3cada56b3a3ebf85f33dfbcb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Tue, 16 Jun 2015 11:35:23 +0200 Subject: [PATCH] Add (disabled) parallel version. Disabled because the constructPreconditionerAndSolve() method does not have a way currently to construct a parallel preconditioner. --- .../NewtonIterationBlackoilInterleaved.cpp | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/opm/autodiff/NewtonIterationBlackoilInterleaved.cpp b/opm/autodiff/NewtonIterationBlackoilInterleaved.cpp index 0758c3cf1..6e3cc752f 100644 --- a/opm/autodiff/NewtonIterationBlackoilInterleaved.cpp +++ b/opm/autodiff/NewtonIterationBlackoilInterleaved.cpp @@ -1,5 +1,7 @@ /* Copyright 2015 SINTEF ICT, Applied Mathematics. + Copyright 2015 Dr. Blatt - HPC-Simulation-Software & Services + Copyright 2015 NTNU Copyright 2015 Statoil AS This file is part of the Open Porous Media project (OPM). @@ -25,6 +27,8 @@ #include #include #include +#include +#include #if HAVE_UMFPACK #include @@ -159,11 +163,30 @@ namespace Opm x = 0.0; Dune::InverseOperatorResult result; - // Construct operator, scalar product and vectors needed. - typedef Dune::MatrixAdapter Operator; - Operator opA(istlA); - Dune::Amg::SequentialInformation info; - constructPreconditionerAndSolve(opA, x, istlb, info, result); +// Parallel version is deactivated until we figure out how to do it properly. +#if 0 // HAVE_MPI + if (parallelInformation_.type() == typeid(ParallelISTLInformation)) + { + typedef Dune::OwnerOverlapCopyCommunication Comm; + const ParallelISTLInformation& info = + boost::any_cast( parallelInformation_); + Comm istlComm(info.communicator()); + info.copyValuesTo(istlComm.indexSet(), istlComm.remoteIndices(), + size, np); + // Construct operator, scalar product and vectors needed. + typedef Dune::OverlappingSchwarzOperator Operator; + Operator opA(istlA, istlComm); + constructPreconditionerAndSolve(opA, x, istlb, istlComm, result); + } + else +#endif + { + // Construct operator, scalar product and vectors needed. + typedef Dune::MatrixAdapter Operator; + Operator opA(istlA); + Dune::Amg::SequentialInformation info; + constructPreconditionerAndSolve(opA, x, istlb, info, result); + } // store number of iterations iterations_ = result.iterations;