]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
When generating an empty matrix, call FillComplete() in case that empty matrix is...
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 28 Sep 2008 19:42:14 +0000 (19:42 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 28 Sep 2008 19:42:14 +0000 (19:42 +0000)
git-svn-id: https://svn.dealii.org/trunk@17033 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/trilinos_sparse_matrix.cc

index eeabeb3c0dea6b12b5cd69c1d58eb7aecbaf8838..3cebd986a2e4c01ae1d7ccd1d96c8b35f8af58f4 100755 (executable)
@@ -88,7 +88,9 @@ namespace TrilinosWrappers
                  compressed (true),
                  matrix (std::auto_ptr<Epetra_FECrsMatrix>
                                (new Epetra_FECrsMatrix(View, row_map, 0)))
-  {}
+  {
+    matrix->FillComplete();
+  }
 
   SparseMatrix::SparseMatrix (const Epetra_Map  &InputMap,
                              const unsigned int n_max_entries_per_row)
@@ -288,7 +290,7 @@ namespace TrilinosWrappers
                                  // In the end, the matrix needs to
                                  // be compressed in order to be
                                  // really ready.
-    compress();    
+    compress();
   }
 
 
@@ -407,6 +409,8 @@ namespace TrilinosWrappers
     matrix = std::auto_ptr<Epetra_FECrsMatrix> 
              (new Epetra_FECrsMatrix(View, row_map, 0));
 
+    matrix->FillComplete();
+
     compressed = true;
   }
 
@@ -884,15 +888,15 @@ namespace TrilinosWrappers
                       const VectorBase &src) const
   {
     Assert (&src != &dst, ExcSourceEqualsDestination());
-    
-    Assert (col_map.SameAs(src.vector->Map()) == true,
-           ExcMessage ("Column map of matrix does not fit with vector map!"));
-    Assert (row_map.SameAs(dst.vector->Map()) == true,
-           ExcMessage ("Row map of matrix does not fit with vector map!"));
 
     if (matrix->Filled() == false)
       matrix->FillComplete(col_map, row_map, true);
 
+    Assert (src.vector->Map().SameAs(matrix->DomainMap()) == true,
+           ExcMessage ("Column map of matrix does not fit with vector map!"));
+    Assert (dst.vector->Map().SameAs(matrix->RangeMap()) == true,
+           ExcMessage ("Row map of matrix does not fit with vector map!"));
+
     const int ierr = matrix->Multiply (false, *(src.vector), *(dst.vector));
     AssertThrow (ierr == 0, ExcTrilinosError(ierr));
   }
@@ -905,14 +909,14 @@ namespace TrilinosWrappers
   {
     Assert (&src != &dst, ExcSourceEqualsDestination());
 
-    Assert (row_map.SameAs(src.vector->Map()) == true,
-           ExcMessage ("Row map of matrix does not fit with vector map!"));
-    Assert (col_map.SameAs(dst.vector->Map()) == true,
-           ExcMessage ("Column map of matrix does not fit with vector map!"));
-
     if (matrix->Filled() == false)
       matrix->FillComplete(col_map, row_map, true);
 
+    Assert (src.vector->Map().SameAs(matrix->DomainMap()) == true,
+           ExcMessage ("Column map of matrix does not fit with vector map!"));
+    Assert (dst.vector->Map().SameAs(matrix->RangeMap()) == true,
+           ExcMessage ("Row map of matrix does not fit with vector map!"));
+
     const int ierr = matrix->Multiply (true, *(src.vector), *(dst.vector));
     AssertThrow (ierr == 0, ExcTrilinosError(ierr));
   }

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.