warning fixed related to petsc

This commit is contained in:
Kai Bao 2016-11-14 18:09:20 +01:00
parent 0cf4021698
commit fda1016532
2 changed files with 5 additions and 3 deletions

View File

@ -23,7 +23,9 @@
#include <opm/core/linalg/LinearSolverPetsc.hpp>
#include <unordered_map>
#define PETSC_CLANGUAGE_CXX 1 //enable CHKERRXX macro.
#include <opm/common/utility/platform_dependent/disable_warnings.h>
#include <petsc.h>
#include <opm/common/utility/platform_dependent/reenable_warnings.h>
#include <opm/common/ErrorMacros.hpp>
namespace Opm
@ -180,11 +182,11 @@ namespace{
VecRestoreArray( v, &vec );
}
Mat to_petsc_mat( const int size, const int nonzeros,
Mat to_petsc_mat( const int size, const int /* nonzeros */,
const int* ia, const int* ja, const double* sa ) {
Mat A;
auto err = MatCreateSeqAIJWithArrays( PETSC_COMM_WORLD, size, size, (int*)ia, (int*)ja, (double*)sa, &A );
auto err = MatCreateSeqAIJWithArrays( PETSC_COMM_WORLD, size, size, const_cast<int*>(ia), const_cast<int*>(ja), (double*)sa, &A );
CHKERRXX( err );
return A;
}

View File

@ -61,7 +61,7 @@ struct MPIFixture {
};
BOOST_GLOBAL_FIXTURE(MPIFixture);
BOOST_GLOBAL_FIXTURE(MPIFixture)
struct MyMatrix
{