]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Parallel sparse matrices now also require the use of compress(VectorOperation) like...
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 25 Feb 2013 23:16:09 +0000 (23:16 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 25 Feb 2013 23:16:09 +0000 (23:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@28561 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/examples/step-32/step-32.cc
deal.II/examples/step-40/step-40.cc
deal.II/include/deal.II/lac/block_matrix_base.h
deal.II/include/deal.II/lac/petsc_matrix_base.h
deal.II/include/deal.II/lac/trilinos_sparse_matrix.h
deal.II/source/lac/petsc_matrix_base.cc

index 90e499d8f7c4d1803220973bd87cc66d8e1e7c79..866406c2b76b3c0753595ad6fcc24fbb7d0bf242 100644 (file)
@@ -163,6 +163,12 @@ never working correctly and it is not used.
 
 <ol>
 
+<li> Changed: parallel sparse matrices now also require the use of
+compress(VectorOperation) like vectors do. See the glossary for details.
+Old functions are now deprecated.
+<br>
+(Timo Heister, 2013/02/25)
+
 <li> New: step-49 demonstrates advanced techniques for mesh creation and
 manipulation.
 <br>
index e67bc9f1d82156d57b1e0041e5e9d9681e84724b..2430c9ea749353e22bdeec1576f997c7f64f7de2 100644 (file)
@@ -2235,7 +2235,7 @@ namespace Step32
          Assembly::CopyData::
          StokesPreconditioner<dim> (stokes_fe));
 
-    stokes_preconditioner_matrix.compress();
+    stokes_preconditioner_matrix.compress(VectorOperation::add);
   }
 
 
@@ -2432,7 +2432,7 @@ namespace Step32
          Assembly::CopyData::
          StokesSystem<dim> (stokes_fe));
 
-    stokes_matrix.compress();
+    stokes_matrix.compress(VectorOperation::add);
     stokes_rhs.compress(VectorOperation::add);
 
     rebuild_stokes_matrix = false;
@@ -2542,8 +2542,8 @@ namespace Step32
          Assembly::CopyData::
          TemperatureMatrix<dim> (temperature_fe));
 
-    temperature_mass_matrix.compress();
-    temperature_stiffness_matrix.compress();
+    temperature_mass_matrix.compress(VectorOperation::add);
+    temperature_stiffness_matrix.compress(VectorOperation::add);
 
     rebuild_temperature_matrices = false;
     rebuild_temperature_preconditioner = true;
@@ -2785,7 +2785,6 @@ namespace Step32
         temperature_matrix.copy_from (temperature_mass_matrix);
         temperature_matrix.add (time_step, temperature_stiffness_matrix);
       }
-    temperature_matrix.compress();
 
     if (rebuild_temperature_preconditioner == true)
       {
index 54e26fdc92a5a5eb9c9d2133e54b231476a6fc67..5c2ce3bbee61d076ce9cfad15b1c82090173bb66 100644 (file)
@@ -391,7 +391,7 @@ namespace Step40
                                                   system_rhs);
         }
 
-    system_matrix.compress ();
+    system_matrix.compress (VectorOperation::add);
     system_rhs.compress (VectorOperation::add);
   }
 
index c81fabf3ab2100fd55918eb3c99cfce88c5b1a21..62ef9d1bb3defee4890c0b06916c8518dd8622f9 100644 (file)
@@ -762,8 +762,12 @@ public:
   * distributed objects" for more
   * information.
    */
-  void compress (::dealii::VectorOperation::values operation
-                 =::dealii::VectorOperation::unknown);
+  void compress (::dealii::VectorOperation::values operation);
+
+  /**
+   * @deprecated: use compress() with VectorOperation instead.
+   */
+  void compress () DEAL_II_DEPRECATED;
 
   /**
    * Multiply the entire matrix by a
@@ -2359,6 +2363,14 @@ BlockMatrixBase<MatrixType>::compress (::dealii::VectorOperation::values operati
       block(r,c).compress (operation);
 }
 
+template <class MatrixType>
+inline
+void
+BlockMatrixBase<MatrixType>::compress ()
+{
+  compress(::dealii::VectorOperation::unknown);
+}
+
 
 
 template <class MatrixType>
index a62cec26002a2fbf00bb0e28eead6be9bb3dd368..9abcafd6d2c2f4b67c5e52eef607d9de1e2cd277 100644 (file)
@@ -672,8 +672,13 @@ namespace PETScWrappers
      * for more information.
      * more information.
      */
-    void compress (::dealii::VectorOperation::values operation
-                   =::dealii::VectorOperation::unknown);
+    void compress (::dealii::VectorOperation::values operation);
+
+    /**
+     * @deprecated: use compress() with VectorOperation instead.
+     */
+    void compress () DEAL_II_DEPRECATED;
+
     /**
      * Return the value of the entry
      * (<i>i,j</i>).  This may be an
index 688c21eae327694d9b57afa2822ce69379bcfe23..13cfcae00a7cc09caf8a8a5d06f672e94aa36c2f 100644 (file)
@@ -1375,8 +1375,12 @@ namespace TrilinosWrappers
      * See @ref GlossCompress "Compressing distributed objects"
      * for more information.
      */
-    void compress (::dealii::VectorOperation::values operation
-                   =::dealii::VectorOperation::unknown);
+    void compress (::dealii::VectorOperation::values operation);
+
+    /**
+     * @deprecated: use compress() with VectorOperation instead.
+     */
+    void compress () DEAL_II_DEPRECATED;
 
     /**
      * Set the element (<i>i,j</i>)
@@ -3047,12 +3051,21 @@ namespace TrilinosWrappers
 
 
 
+  inline
+  void
+  SparseMatrix::compress ()
+  {
+    compress(::dealii::VectorOperation::unknown);
+  }
+
+
+
   inline
   SparseMatrix &
   SparseMatrix::operator = (const double d)
   {
     Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
-    compress ();
+    compress (::dealii::VectorOperation::unknown); // TODO: why do we do this? Should we not check for is_compressed?
 
     const int ierr = matrix->PutScalar(d);
     AssertThrow (ierr == 0, ExcTrilinosError(ierr));
index f41fbd9f21bb49cf1893028799b2b137c1ef62e6..50962f17f480975c97a2ed8b69118636f8b8eb20 100644 (file)
@@ -263,6 +263,14 @@ namespace PETScWrappers
 
 
 
+  void
+  MatrixBase::compress ()
+  {
+    compress(::dealii::VectorOperation::unknown);
+  }
+
+
+
   unsigned int
   MatrixBase::m () const
   {

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.