]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
document bug
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 16 Jun 2013 19:46:54 +0000 (19:46 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 16 Jun 2013 19:46:54 +0000 (19:46 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29823 0785d39b-7218-0410-832d-ea1e28bc413d

tests/lac/block_sparsity_pattern_03.cc [new file with mode: 0644]
tests/lac/block_sparsity_pattern_03/cmp/generic [new file with mode: 0644]

diff --git a/tests/lac/block_sparsity_pattern_03.cc b/tests/lac/block_sparsity_pattern_03.cc
new file mode 100644 (file)
index 0000000..49335ba
--- /dev/null
@@ -0,0 +1,60 @@
+//----------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2006, 2008, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//----------------------------------------------------------------------
+
+
+// BlockSparsityPattern::column_number is broken
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/block_sparsity_pattern.h>
+
+#include <iomanip>
+#include <fstream>
+
+int main()
+{
+  initlog(__FILE__);
+
+  std::vector<types::global_dof_index> row_blocks(2);
+  row_blocks[0] = 10;
+  row_blocks[1] = 5;
+
+  BlockCompressedSimpleSparsityPattern csp (row_blocks, row_blocks);
+
+      csp.reinit(2,2);
+    csp.block(0,0).reinit(10,10);
+    csp.block(0,1).reinit(10,5);
+    csp.block(1,0).reinit(5,10);
+    csp.block(1,1).reinit(5,5);
+    csp.collect_sizes();
+    csp.add(5,5);
+    csp.add(12,12);
+    csp.add(5,11);
+    csp.add(11,3);
+
+    csp.print(deallog.get_file_stream());
+
+
+    for (types::global_dof_index row=0; row<csp.n_rows(); ++row)
+      {
+        types::global_dof_index rlen = csp.row_length(row);
+
+        for (types::global_dof_index c=0; c<rlen; ++c)
+          {
+            types::global_dof_index column = csp.column_number(row, c);
+            deallog << row << "," << column << std::endl;
+          }
+      }
+  
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/lac/block_sparsity_pattern_03/cmp/generic b/tests/lac/block_sparsity_pattern_03/cmp/generic
new file mode 100644 (file)
index 0000000..0fd8fc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+DEAL::OK

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.