Skip to content
Snippets Groups Projects
Commit 33292ef2 authored by Sebastien Blaise's avatar Sebastien Blaise
Browse files

Print system petsc

parent 72fdcae3
No related branches found
No related tags found
No related merge requests found
...@@ -177,6 +177,24 @@ void linearSystemPETScBlockDouble::clear() ...@@ -177,6 +177,24 @@ void linearSystemPETScBlockDouble::clear()
_isAllocated = false; _isAllocated = false;
} }
void linearSystemPETScBlockDouble::print()
{
_try(MatAssemblyBegin(_a, MAT_FINAL_ASSEMBLY));
_try(MatAssemblyEnd(_a, MAT_FINAL_ASSEMBLY));
_try(VecAssemblyBegin(_b));
_try(VecAssemblyEnd(_b));
if(Msg::GetCommRank()==0)
printf("a :\n");
MatView(_a, PETSC_VIEWER_STDOUT_WORLD);
if(Msg::GetCommRank()==0)
printf("b :\n");
VecView(_b, PETSC_VIEWER_STDOUT_WORLD);
if(Msg::GetCommRank()==0)
printf("x :\n");
VecView(_x, PETSC_VIEWER_STDOUT_WORLD);
}
int linearSystemPETScBlockDouble::systemSolve() int linearSystemPETScBlockDouble::systemSolve()
{ {
if (!_kspAllocated) if (!_kspAllocated)
......
...@@ -91,6 +91,7 @@ class linearSystemPETScBlockDouble : public linearSystem<fullMatrix<double> > { ...@@ -91,6 +91,7 @@ class linearSystemPETScBlockDouble : public linearSystem<fullMatrix<double> > {
bool _sequential; bool _sequential;
public: public:
void _kspCreate(); void _kspCreate();
void print();
virtual void addToMatrix(int row, int col, const fullMatrix<double> &val); virtual void addToMatrix(int row, int col, const fullMatrix<double> &val);
virtual void addToRightHandSide(int row, const fullMatrix<double> &val); virtual void addToRightHandSide(int row, const fullMatrix<double> &val);
virtual void addToSolution(int row, const fullMatrix<double> &val); virtual void addToSolution(int row, const fullMatrix<double> &val);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment