Revert "Activate paralle istl solvers if there is more than one process computing."

This reverts commit 9598a990df.
The commit slipped in by accident and should be part of a separate branch.
This commit is contained in:
Markus Blatt 2014-04-09 13:32:28 +02:00
parent 3329e48c57
commit 42fbe3b612
2 changed files with 2 additions and 47 deletions

View File

@ -24,8 +24,6 @@
#include <opm/autodiff/AutoDiffHelpers.hpp> #include <opm/autodiff/AutoDiffHelpers.hpp>
#include <opm/autodiff/BlackoilPropsAdInterface.hpp> #include <opm/autodiff/BlackoilPropsAdInterface.hpp>
#include <boost/any.hpp>
struct UnstructuredGrid; struct UnstructuredGrid;
struct Wells; struct Wells;
@ -62,8 +60,6 @@ namespace Opm {
/// \param[in] rock_comp_props if non-null, rock compressibility properties /// \param[in] rock_comp_props if non-null, rock compressibility properties
/// \param[in] wells well structure /// \param[in] wells well structure
/// \param[in] linsolver linear solver /// \param[in] linsolver linear solver
/// \param[in] anyComm A boost any parameter to use for passing information
/// about the parallelization to the linear solver.
FullyImplicitBlackoilSolver(const Grid& grid , FullyImplicitBlackoilSolver(const Grid& grid ,
const BlackoilPropsAdInterface& fluid, const BlackoilPropsAdInterface& fluid,
const DerivedGeology& geo , const DerivedGeology& geo ,

View File

@ -29,22 +29,16 @@
#include <opm/core/grid.h> #include <opm/core/grid.h>
#include <opm/core/linalg/LinearSolverInterface.hpp> #include <opm/core/linalg/LinearSolverInterface.hpp>
#include <opm/core/linalg/ParallelIstlInformation.hpp>
#include <opm/core/props/rock/RockCompressibility.hpp> #include <opm/core/props/rock/RockCompressibility.hpp>
#include <opm/core/simulator/BlackoilState.hpp> #include <opm/core/simulator/BlackoilState.hpp>
#include <opm/core/utility/ErrorMacros.hpp> #include <opm/core/utility/ErrorMacros.hpp>
#include <opm/core/utility/Exceptions.hpp> #include <opm/core/utility/Exceptions.hpp>
#include <opm/core/well_controls.h> #include <opm/core/well_controls.h>
#ifdef HAVE_DUNE_CORNERPOINT
#include <dune/grid/CpGrid.hpp>
#endif
#include <cassert> #include <cassert>
#include <cmath> #include <cmath>
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <type_traits>
//#include <fstream> //#include <fstream>
// A debugging utility. // A debugging utility.
@ -1176,39 +1170,7 @@ namespace {
} }
namespace
{
void resetAnyComm(boost::any&, const UnstructuredGrid&)
{}
struct NullDeleter
{
void operator()(void*)
{}
};
#ifdef HAVE_DUNE_CORNERPOINT
void resetAnyComm(boost::any& anyComm, const Dune::CpGrid& grid)
{
#if HAVE_MPI && DUNE_VERSION_NEWER(DUNE_GRID, 2, 3)
if(grid.comm().size()>1)
{
NullDeleter null_delete;
Dune::CpGrid mgrid=const_cast<Dune::CpGrid&>(grid);
Dune::CpGrid::ParallelIndexSet* idx=&(mgrid.getCellIndexSet());
Dune::CpGrid::RemoteIndices* ridx=&(mgrid.getCellRemoteIndices());
anyComm=boost::any(Opm::ParallelISTLInformation(std::shared_ptr<Dune::CpGrid::ParallelIndexSet>(idx, null_delete),
std::shared_ptr<Dune::CpGrid::RemoteIndices>(ridx, null_delete),
grid.comm()));
}
#else
(void*)(&anyComm);
(void*)(&grid);
#endif
}
#endif
}
template<class T> template<class T>
@ -1224,15 +1186,12 @@ void resetAnyComm(boost::any& anyComm, const Dune::CpGrid& grid)
// DUMP(total_residual); // DUMP(total_residual);
const Eigen::SparseMatrix<double, Eigen::RowMajor> matr = total_residual.derivative()[0]; const Eigen::SparseMatrix<double, Eigen::RowMajor> matr = total_residual.derivative()[0];
boost::any anyComm;
#if HAVE_MPI && DUNE_VERSION_NEWER(DUNE_GRID, 2, 3)
resetAnyComm(anyComm, grid_);
#endif
V dx(V::Zero(total_residual.size())); V dx(V::Zero(total_residual.size()));
Opm::LinearSolverInterface::LinearSolverReport rep Opm::LinearSolverInterface::LinearSolverReport rep
= linsolver_.solve(matr.rows(), matr.nonZeros(), = linsolver_.solve(matr.rows(), matr.nonZeros(),
matr.outerIndexPtr(), matr.innerIndexPtr(), matr.valuePtr(), matr.outerIndexPtr(), matr.innerIndexPtr(), matr.valuePtr(),
total_residual.value().data(), dx.data(), anyComm); total_residual.value().data(), dx.data());
/* /*
std::ofstream filestream("matrix.out"); std::ofstream filestream("matrix.out");
filestream << matr; filestream << matr;