]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a bug with block vectors. Funny that it worked before.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 22 Nov 2001 16:11:07 +0000 (16:11 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 22 Nov 2001 16:11:07 +0000 (16:11 +0000)
git-svn-id: https://svn.dealii.org/branches/Branch-3-2@5244 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/filtered_matrix.templates.h

index f24a79bda17e6353ec88860d6cd234a3e374236c..be1e8701ed6ce5eff1838af36b4d7f2fbb5e38e9 100644 (file)
@@ -403,8 +403,12 @@ void
 FilteredMatrix<BlockSparseMatrix<double>,BlockVector<double> >::
 allocate_tmp_vector () 
 {
+  std::vector<unsigned int> block_sizes (matrix->n_block_rows());
+  for (unsigned int i=0; i<block_sizes.size(); ++i)
+    block_sizes[i] = matrix->block(i,i).n();
+  
   tmp_mutex.acquire ();
-  tmp_vector.reinit (matrix->n());
+  tmp_vector.reinit (block_sizes);
   tmp_mutex.release ();
 };
 
@@ -415,8 +419,12 @@ void
 FilteredMatrix<BlockSparseMatrix<float>,BlockVector<float> >::
 allocate_tmp_vector () 
 {
+  std::vector<unsigned int> block_sizes (matrix->n_block_rows());
+  for (unsigned int i=0; i<block_sizes.size(); ++i)
+    block_sizes[i] = matrix->block(i,i).n();
+  
   tmp_mutex.acquire ();
-  tmp_vector.reinit (matrix->n());
+  tmp_vector.reinit (block_sizes);
   tmp_mutex.release ();
 };
 

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.