]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fixed an issue with boundary conditions.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 17 Oct 2008 07:55:53 +0000 (07:55 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 17 Oct 2008 07:55:53 +0000 (07:55 +0000)
git-svn-id: https://svn.dealii.org/trunk@17256 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/matrices.all_dimensions.cc
deal.II/lac/source/trilinos_sparse_matrix.cc

index 869ad7104fa1b795b0efcd41f186417bfc58b1a7..4366991f8e4b3f3c073c4a746130b5921124c420 100644 (file)
@@ -745,28 +745,33 @@ namespace TrilinosWrappers
           (dof->first < local_range.second))
         constrained_rows.push_back (dof->first);
 
-                                     // then eliminate these rows and set
-                                     // their diagonal entry to what we have
-                                     // determined above. if the value already
-                                     // is nonzero, it will be preserved, 
-                                     // in accordance with the basic 
+                                     // then eliminate these rows and
+                                     // set their diagonal entry to
+                                     // what we have determined
+                                     // above. if the value already is
+                                     // nonzero, it will be preserved,
+                                     // in accordance with the basic
                                      // matrix classes in deal.II.
     matrix.clear_rows (constrained_rows, average_nonzero_diagonal_entry);
 
-                                     // the next thing is to set right hand
-                                     // side to the wanted value. there's one
-                                     // drawback: if we write to individual
-                                     // vector elements, then we have to do
-                                     // that on all processors. however, some
+                                     // the next thing is to set right
+                                     // hand side to the wanted
+                                     // value. there's one drawback:
+                                     // if we write to individual
+                                     // vector elements, then we have
+                                     // to do that on all
+                                     // processors. however, some
                                      // processors may not need to set
-                                     // anything because their chunk of
-                                     // matrix/rhs do not contain any boundary
-                                     // nodes. therefore, rather than using
-                                     // individual calls, we use one call for
-                                     // all elements, thereby making sure that
-                                     // all processors call this function,
-                                     // even if some only have an empty set of
-                                     // elements to set
+                                     // anything because their chunk
+                                     // of matrix/rhs do not contain
+                                     // any boundary nodes. therefore,
+                                     // rather than using individual
+                                     // calls, we use one call for all
+                                     // elements, thereby making sure
+                                     // that all processors call this
+                                     // function, even if some only
+                                     // have an empty set of elements
+                                     // to set
     right_hand_side.compress ();
     solution.compress ();
 
@@ -784,10 +789,10 @@ namespace TrilinosWrappers
         }
     solution.set (indices, solution_values);
 
-                                     // now also set appropriate values for
-                                     // the rhs
+                                     // now also set appropriate
+                                     // values for the rhs
     for (unsigned int i=0; i<solution_values.size(); ++i)
-      solution_values[i] *= matrix.diag_element(i);
+      solution_values[i] *= matrix.diag_element(indices[i]);
 
     right_hand_side.set (indices, solution_values);
 
@@ -807,6 +812,8 @@ namespace TrilinosWrappers
                               TrilinosBlockVector &right_hand_side,
                               const bool          eliminate_columns)
   {
+    Assert (eliminate_columns == false, ExcNotImplemented());
+
     Assert (matrix.n() == right_hand_side.size(),
            ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
     Assert (matrix.n() == solution.size(),
index 3cebd986a2e4c01ae1d7ccd1d96c8b35f8af58f4..4953d8e3dbabdeac9388991b5d7e9694147f247f 100755 (executable)
@@ -560,14 +560,15 @@ namespace TrilinosWrappers
                ExcTrilinosError(ierr));
        
        int* diag_find = std::find(col_indices,col_indices+num_entries, 
-                                 local_row);
+                                  local_row);
        int diag_index = (int)(diag_find - col_indices);
 
        for (int j=0; j<num_entries; ++j)
          if (diag_index != j || new_diag_value == 0)
            values[j] = 0.;
 
-       if (diag_find && std::fabs(values[diag_index]) == 0 && new_diag_value!=0)
+       if (diag_find && std::fabs(values[diag_index]) == 0.0 && 
+           new_diag_value != 0.0)
          values[diag_index] = new_diag_value;
       }
   }

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.