Skip to content
Snippets Groups Projects
Commit 9da42db4 authored by Paul-Emile Bernard's avatar Paul-Emile Bernard
Browse files

bug using PETSC corrected...

parent 1ff8f483
No related branches found
No related tags found
No related merge requests found
...@@ -93,7 +93,7 @@ void linearSystemPETSc<scalar>::preAllocateEntries() ...@@ -93,7 +93,7 @@ void linearSystemPETSc<scalar>::preAllocateEntries()
int blockSize = _getBlockSizeFromParameters(); int blockSize = _getBlockSizeFromParameters();
std::vector<int> nByRowDiag (_localSize), nByRowOffDiag (_localSize); std::vector<int> nByRowDiag (_localSize), nByRowOffDiag (_localSize);
if (_sparsity.getNbRows() == 0) { if (_sparsity.getNbRows() == 0) {
PetscInt prealloc = 300; PetscInt prealloc = std::min(300,_localSize);
PetscBool set; PetscBool set;
PetscOptionsGetInt(PETSC_NULL, "-petsc_prealloc", &prealloc, &set); PetscOptionsGetInt(PETSC_NULL, "-petsc_prealloc", &prealloc, &set);
nByRowDiag.resize(0); nByRowDiag.resize(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment