]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Patch by Fahad Alrashed: Add a possibly different PETSc Viewer object to PETScWrapper...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 2 Jan 2013 17:03:23 +0000 (17:03 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 2 Jan 2013 17:03:23 +0000 (17:03 +0000)
git-svn-id: https://svn.dealii.org/trunk@27898 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/include/deal.II/lac/petsc_matrix_base.h
deal.II/source/lac/petsc_matrix_base.cc

index 2c4dd85becb6b947ea59d8f1a83ac53286935225..17bae098481573d4d1e31c991d55a879b3886463 100644 (file)
@@ -127,7 +127,12 @@ DoFHandler, in particular removal of specializations.
 <h3>Specific improvements</h3>
 
 <ol>
-<li> New: The PETScWrappers::MPI::Vector::print function overloads the
+<li> New: The PETScWrappers::MatrixBase::write_ascii() now takes a
+(defaulted) argument allowing to select the PETSc Viewer style.
+<br>
+(Fahad Alrashed, 2013/1/2)
+
+<li> New: The PETScWrappers::MPI::Vector::print() function overloads the
 function of same name in the base class to ensure that the output
 generated by a parallel vector makes sense.
 <br>
index a4bfe4d4c5d98de402cbcf55f33411ed1b0221aa..a8f137b8460dc5be4f8dbdf8c7f16a59b1f7c7cf 100644 (file)
@@ -1137,12 +1137,14 @@ namespace PETScWrappers
     is_hermitian (const double tolerance = 1.e-12);
 
     /**
-     * Abstract PETSc object that helps view
-     * in ASCII other PETSc objects. Currently
-     * this function simply writes non-zero
-     * elements of a matrix to the terminal.
-     */
-    void write_ascii ();
+     * Prints the PETSc matrix object values
+     * using PETSc internal matrix viewer function
+     * <tt>MatView</tt>. The default format prints
+     * the non-zero matrix elements. For other valid
+     * view formats, consult
+     * http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatView.html
+     */
+    void write_ascii (const PetscViewerFormat format = PETSC_VIEWER_DEFAULT);
 
     /**
      *  Returns the number bytes consumed
index dca843a3cbf6d8291772b51cd8f21e1271986174..a49bc7cb436a65283cb99a3527e34bd1dc7ca0d5 100644 (file)
@@ -595,17 +595,17 @@ namespace PETScWrappers
   }
 
   void
-  MatrixBase::write_ascii ()
+  MatrixBase::write_ascii (const PetscViewerFormat format)
   {
     // First flush PETSc caches
     compress ();
 
     // Set options
     PetscViewerSetFormat (PETSC_VIEWER_STDOUT_WORLD,
-                          PETSC_VIEWER_DEFAULT);
+               format);
 
     // Write to screen
-    MatView (matrix,PETSC_VIEWER_STDOUT_WORLD);
+    MatView (matrix, PETSC_VIEWER_STDOUT_WORLD);
   }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.