]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
A few small updates in Trilinos wrapper classes.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 16 Sep 2008 16:44:25 +0000 (16:44 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 16 Sep 2008 16:44:25 +0000 (16:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@16838 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/trilinos_sparse_matrix.h
deal.II/lac/source/trilinos_sparse_matrix.cc
deal.II/lac/source/trilinos_vector.cc

index cfe80656069a5353013b1a9f6228ad7ab23958db..2363ca35fdba8471a6f7f6f31cb6ea150aa68428 100755 (executable)
@@ -1649,7 +1649,7 @@ namespace TrilinosWrappers
   {
     int begin, end;
     begin = matrix->RowMap().MinMyGID();
-    end = matrix->RowMap().MaxMyGID();
+    end = matrix->RowMap().MaxMyGID()+1;
     
     return ((index >= static_cast<unsigned int>(begin)) &&
             (index < static_cast<unsigned int>(end)));
index 38988ac32b3bc01d6d6f83f98956e0f1b5fa2295..3d0c4cb17e6862954327bce757bf5da982d92ad1 100755 (executable)
@@ -393,10 +393,7 @@ namespace TrilinosWrappers
   {
                                  // flush buffers
     int ierr;
-    if (row_map.SameAs(col_map))
-      ierr = matrix->GlobalAssemble (true);
-    else
-      ierr = matrix->GlobalAssemble (col_map, row_map, true);
+    ierr = matrix->GlobalAssemble (col_map, row_map, true);
     
     AssertThrow (ierr == 0, ExcTrilinosError(ierr));
 
@@ -436,10 +433,7 @@ namespace TrilinosWrappers
     if (last_action == Add)
       {
        int ierr;
-       if (row_map.SameAs(col_map))
-         ierr = matrix->GlobalAssemble (false);
-       else
-         ierr = matrix->GlobalAssemble(col_map, row_map, false);
+       ierr = matrix->GlobalAssemble(col_map, row_map, false);
        
        AssertThrow (ierr == 0, ExcTrilinosError(ierr));
       }
@@ -478,10 +472,7 @@ namespace TrilinosWrappers
     if (last_action == Insert)
       {
        int ierr;
-       if (row_map.SameAs(col_map))
-         ierr = matrix->GlobalAssemble (false);
-       else
-         ierr = matrix->GlobalAssemble(col_map, row_map, false);
+       ierr = matrix->GlobalAssemble(col_map, row_map, false);
 
        AssertThrow (ierr == 0, ExcTrilinosError(ierr));
     }
@@ -494,8 +485,8 @@ namespace TrilinosWrappers
                                  // communication model (see the
                                  // comments in the documentation of
                                  // TrilinosWrappers::Vector), but we
-                                 // can save some work if the addend
-                                 // is zero
+                                 // can save some work if the addend is
+                                 // zero
     if (value == 0)
       return;
 
@@ -589,7 +580,7 @@ namespace TrilinosWrappers
                                      // already is transformed to
                                      // local indices.
        if (matrix->Filled() == false)
-         matrix->FillComplete(true);
+         matrix->FillComplete(col_map, row_map, true);
 
                                      // Prepare pointers for extraction
                                      // of a view of the row.
@@ -668,7 +659,7 @@ namespace TrilinosWrappers
                                      // already is transformed to
                                      // local indices.
       if (!matrix->Filled())
-       matrix->FillComplete(true);
+       matrix->FillComplete(col_map, row_map, true);
 
                                      // Prepare pointers for extraction
                                      // of a view of the row.
@@ -801,7 +792,7 @@ namespace TrilinosWrappers
   SparseMatrix::l1_norm () const
   {
     if (matrix->Filled() == false)
-      matrix->FillComplete();
+      matrix->FillComplete(col_map, row_map, true);
 
     TrilinosScalar result = matrix->NormOne();
 
@@ -814,7 +805,7 @@ namespace TrilinosWrappers
   SparseMatrix::linfty_norm () const
   {
     if (matrix->Filled() == false)
-      matrix->FillComplete();
+      matrix->FillComplete(col_map, row_map, true);
 
     TrilinosScalar result = matrix->NormInf();
 
@@ -827,7 +818,7 @@ namespace TrilinosWrappers
   SparseMatrix::frobenius_norm () const
   {
     if (matrix->Filled() == false)
-      matrix->FillComplete();
+      matrix->FillComplete(col_map, row_map, true);
 
     TrilinosScalar result = matrix->NormFrobenius();
 
@@ -874,7 +865,7 @@ namespace TrilinosWrappers
            ExcMessage ("Row map of matrix does not fit with vector map!"));
 
     if (matrix->Filled() == false)
-      matrix->FillComplete();
+      matrix->FillComplete(col_map, row_map, true);
 
     const int ierr = matrix->Multiply (false, *(src.vector), *(dst.vector));
     AssertThrow (ierr == 0, ExcTrilinosError(ierr));
@@ -894,7 +885,7 @@ namespace TrilinosWrappers
            ExcMessage ("Column map of matrix does not fit with vector map!"));
 
     if (matrix->Filled() == false)
-      matrix->FillComplete();
+      matrix->FillComplete(col_map, row_map, true);
 
     const int ierr = matrix->Multiply (true, *(src.vector), *(dst.vector));
     AssertThrow (ierr == 0, ExcTrilinosError(ierr));
index adfe635e7a34f2366225a0c9b6072dac103a9e70..29d2302c94f61bb7cafc6f6d824954bbeb871dcc 100755 (executable)
@@ -128,7 +128,10 @@ namespace TrilinosWrappers
                                        // already of the same size,
                                        // create an object for the data
                                        // exchange and then insert all
-                                       // the data.
+                                       // the data. The first assertion
+                                       // is basically there to check
+                                       // whether the user knows what
+                                       // she is doing.
       else
         {
          Assert (fast == false,

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.