Skip to content
Snippets Groups Projects
Commit 9378bea8 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

linear system petsc block uses sparsity data if available

parent 29cd27d2
No related branches found
No related tags found
No related merge requests found
...@@ -159,6 +159,11 @@ int linearSystemPETScBlockDouble::systemSolve() ...@@ -159,6 +159,11 @@ int linearSystemPETScBlockDouble::systemSolve()
KSPSolve(_ksp, _b, _x); KSPSolve(_ksp, _b, _x);
return 1; return 1;
} }
void linearSystemPETScBlockDouble::insertInSparsityPattern (int i, int j) {
i -= _localRowStart;
if (i<0 || i>= _localSize) return;
_sparsity.insertEntry (i,j);
}
void linearSystemPETScBlockDouble::preAllocateEntries() void linearSystemPETScBlockDouble::preAllocateEntries()
{ {
...@@ -220,7 +225,6 @@ linearSystemPETScBlockDouble::linearSystemPETScBlockDouble() ...@@ -220,7 +225,6 @@ linearSystemPETScBlockDouble::linearSystemPETScBlockDouble()
_entriesPreAllocated = false; _entriesPreAllocated = false;
_isAllocated = false; _isAllocated = false;
_kspAllocated = false; _kspAllocated = false;
printf("init\n");
} }
double linearSystemPETScBlockDouble::normInfRightHandSide() const double linearSystemPETScBlockDouble::normInfRightHandSide() const
......
...@@ -288,6 +288,7 @@ class linearSystemPETScBlockDouble : public linearSystem<fullMatrix<double> > { ...@@ -288,6 +288,7 @@ class linearSystemPETScBlockDouble : public linearSystem<fullMatrix<double> > {
void zeroMatrix(); void zeroMatrix();
void zeroRightHandSide(); void zeroRightHandSide();
double normInfRightHandSide() const; double normInfRightHandSide() const;
void insertInSparsityPattern (int i, int j);
linearSystemPETScBlockDouble(); linearSystemPETScBlockDouble();
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment