]> https://gitweb.dealii.org/ - dealii.git/commitdiff
new BlockIndices functionality
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 15 Aug 2011 09:52:18 +0000 (09:52 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 15 Aug 2011 09:52:18 +0000 (09:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@24067 0785d39b-7218-0410-832d-ea1e28bc413d

tests/lac/block_indices.cc
tests/lac/block_indices/cmp/generic

index df70ba5460b1cf9a6f0c78a2284e421a25d49fbd..5b7958ca53e7ccee7bfd18851f6d66f8ea0aa655 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2007 by the deal.II authors
+//    Copyright (C) 2007, 2011 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
 void test (const BlockIndices& idx)
 {
   const unsigned int n = idx.size();
-  deallog << "blocks " << idx.size() << std::endl
-         << "elements " << idx.total_size() << std::endl
-         << "block sizes ";
+  deallog << "sizes: " << idx << std::endl;
+  deallog << "start:   ";
   for (unsigned i=0;i<n;++i)
-    deallog << '\t' << idx.block_size(i);
-  deallog << std::endl << "Block start ";
-  for (unsigned i=0;i<n;++i)
-    deallog << '\t' << idx.block_start(i);
+    deallog << ' ' << idx.block_start(i);
 
   deallog << std::endl;
   
@@ -60,10 +56,23 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   
+  BlockIndices bi0;
+  deallog << "empty: " << bi0 << std::endl;
+  bi0.push_back(3);
+  deallog << "push:  " << bi0 << std::endl;
+  bi0.push_back(2);
+  deallog << "push:  " << bi0 << std::endl;
+  
   BlockIndices bi1(3);
   test(bi1);
   bi1.reinit(3,4);
   test(bi1);
+  bi1.push_back(2);
+  deallog << "push: " << bi1 << std::endl;
+  bi1.push_back(5);
+  deallog << "push: " << bi1 << std::endl;
+  bi1.push_back(4);
+  test(bi1);
   
   std::vector<unsigned int> v(4);
   for (unsigned int i=0;i<v.size();++i)
index 6cab4b83502b01146641f526acd68d4ae5fb274c..d19ac5c6e36a136ad9fdc0d9977ced569c6d0103 100644 (file)
@@ -1,19 +1,22 @@
 
-DEAL::blocks 3
-DEAL::elements 0
-DEAL::block sizes      0       0       0
-DEAL::Block start      0       0       0
+DEAL::empty: 0:[]->0
+DEAL::push:  1:[3]->3
+DEAL::push:  2:[3 2]->5
+DEAL::sizes: 3:[0 0 0]->0
+DEAL::start:    0 0 0
 DEAL::
 DEAL::
-DEAL::blocks 3
-DEAL::elements 12
-DEAL::block sizes      4       4       4
-DEAL::Block start      0       4       8
+DEAL::sizes: 3:[4 4 4]->12
+DEAL::start:    0 4 8
 DEAL:: 0:0:0 1:0:1 2:0:2 3:0:3 4:1:0 5:1:1 6:1:2 7:1:3 8:2:0 9:2:1 10:2:2 11:2:3
 DEAL:: 0:0:0 1:0:1 2:0:2 3:0:3 4:1:0 5:1:1 6:1:2 7:1:3 8:2:0 9:2:1 10:2:2 11:2:3
-DEAL::blocks 4
-DEAL::elements 10
-DEAL::block sizes      4       3       2       1
-DEAL::Block start      0       4       7       9
+DEAL::push: 4:[4 4 4 2]->14
+DEAL::push: 5:[4 4 4 2 5]->19
+DEAL::sizes: 6:[4 4 4 2 5 4]->23
+DEAL::start:    0 4 8 12 14 19
+DEAL:: 0:0:0 1:0:1 2:0:2 3:0:3 4:1:0 5:1:1 6:1:2 7:1:3 8:2:0 9:2:1 10:2:2 11:2:3 12:3:0 13:3:1 14:4:0 15:4:1 16:4:2 17:4:3 18:4:4 19:5:0 20:5:1 21:5:2 22:5:3
+DEAL:: 0:0:0 1:0:1 2:0:2 3:0:3 4:1:0 5:1:1 6:1:2 7:1:3 8:2:0 9:2:1 10:2:2 11:2:3 12:3:0 13:3:1 14:4:0 15:4:1 16:4:2 17:4:3 18:4:4 19:5:0 20:5:1 21:5:2 22:5:3
+DEAL::sizes: 4:[4 3 2 1]->10
+DEAL::start:    0 4 7 9
 DEAL:: 0:0:0 1:0:1 2:0:2 3:0:3 4:1:0 5:1:1 6:1:2 7:2:0 8:2:1 9:3:0
 DEAL:: 0:0:0 1:0:1 2:0:2 3:0:3 4:1:0 5:1:1 6:1:2 7:2:0 8:2:1 9:3:0

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.