]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
new SparseMatrix storage
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 5 Dec 2003 10:13:31 +0000 (10:13 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 5 Dec 2003 10:13:31 +0000 (10:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@8233 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 91d9cb475d6a723ba2d3b4380da97bd2597ccafd..6e45e34ce31570f6e91e66faad2530e151664f13 100644 (file)
@@ -21,7 +21,7 @@
 #include <algorithm>
 
 
-
+//TODO:[WB] I don't think that the optimized storage of diagonals is needed (GK)
 template <typename number>
 void
 MatrixTools::apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
@@ -30,8 +30,8 @@ MatrixTools::apply_boundary_values (const std::map<unsigned int,double> &boundar
                                    Vector<number>   &right_hand_side,
                                    const bool        preserve_symmetry)
 {
-  Assert (matrix.n() == matrix.m(),
-         ExcDimensionMismatch(matrix.n(), matrix.m()));
+  Assert (matrix.get_sparsity_pattern().optimize_diagonal(),
+         typename SparsityPattern::ExcDiagonalNotOptimized());
   Assert (matrix.n() == right_hand_side.size(),
          ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
   Assert (matrix.n() == solution.size(),
@@ -195,8 +195,6 @@ MatrixTools::apply_boundary_values (const std::map<unsigned int,double> &boundar
 {
   const unsigned int blocks = matrix.n_block_rows();
   
-  Assert (matrix.n() == matrix.m(),
-         ExcDimensionMismatch(matrix.n(), matrix.m()));
   Assert (matrix.n() == right_hand_side.size(),
          ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
   Assert (matrix.n() == solution.size(),
@@ -212,7 +210,11 @@ MatrixTools::apply_boundary_values (const std::map<unsigned int,double> &boundar
   Assert (matrix.get_sparsity_pattern().get_row_indices() ==
          right_hand_side.get_block_indices (),
          ExcBlocksDontMatch ());
-  
+
+  for (unsigned int i=0;i<blocks;++i)
+    Assert (matrix.block(i,i).get_sparsity_pattern().optimize_diagonal(),
+           typename SparsityPattern::ExcDiagonalNotOptimized());
+
   
                                   // if no boundary values are to be applied
                                   // simply return

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.