]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
new test directory for LAPACK functionality
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 5 Sep 2006 23:14:30 +0000 (23:14 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 5 Sep 2006 23:14:30 +0000 (23:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@13836 0785d39b-7218-0410-832d-ea1e28bc413d

tests/lapack/Makefile [new file with mode: 0644]
tests/lapack/tridiagonal_ev1.cc [new file with mode: 0644]
tests/lapack/tridiagonal_ev1/cmp/generic [new file with mode: 0644]

diff --git a/tests/lapack/Makefile b/tests/lapack/Makefile
new file mode 100644 (file)
index 0000000..3a72131
--- /dev/null
@@ -0,0 +1,39 @@
+############################################################
+# $Id$
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+############################################################
+
+############################################################
+# Include general settings for including DEAL libraries
+############################################################
+
+include ../Makefile.paths
+include $D/common/Make.global_options
+debug-mode = on
+
+libraries = $(lib-lac.g)  \
+            $(lib-base.g)
+libraries_o = $(lib-lac.o)  \
+            $(lib-base.o)
+
+default: run-tests 
+
+############################################################
+
+tests_x = tridiagonal_ev1
+
+
+# from above list of regular expressions, generate the real set of
+# tests
+expand = $(shell echo $(addsuffix .cc,$(1)) \
+           | $(PERL) -pi -e 's/\.cc//g;')
+tests = $(call expand,$(tests_x))
+
+############################################################
+
+
+include ../Makefile.rules
+include Makefile.depend
+include Makefile.tests
+
+.PHONY: default
\ No newline at end of file
diff --git a/tests/lapack/tridiagonal_ev1.cc b/tests/lapack/tridiagonal_ev1.cc
new file mode 100644 (file)
index 0000000..0072493
--- /dev/null
@@ -0,0 +1,50 @@
+//--------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2006 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.
+//
+//--------------------------------------------------------------------
+
+// Tests compute_eigenvalues() and eigenvalue() of TridiagonalMatrix
+
+#include "../tests.h"
+#include <base/logstream.h>
+#include <lac/tridiagonal_matrix.h>
+#include <lac/vector.h>
+
+#include <fstream>
+#include <iostream>
+
+
+template <typename number>
+void test_laplacian(unsigned int n)
+{
+  TridiagonalMatrix<number> M(n, true);
+  for (unsigned int i=0;i<n-1;++i)
+    {
+      M(i,i) = 2.;
+      M(i,i+1) = -1.;
+    }
+  M(n-1,n-1) = 2.;
+
+  M.compute_eigenvalues();
+  for (unsigned int i=0;i<n;++i)
+    deallog << i << '\t' << M.eigenvalue(i);
+}
+
+
+int main()
+{
+  std::ofstream logfile("tridiagonal_ev1/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test_laplacian<double>(50);
+}
diff --git a/tests/lapack/tridiagonal_ev1/cmp/generic b/tests/lapack/tridiagonal_ev1/cmp/generic
new file mode 100644 (file)
index 0000000..c8eede5
--- /dev/null
@@ -0,0 +1,10 @@
+
+DEAL:Rect::operator= (const FullMatrix<number>&) ok
+DEAL:Rect::vmult ok
+DEAL:Rect::vmult_add ok
+DEAL:Rect::Tvmult ok
+DEAL:Rect::Tvmult_add ok
+DEAL::Eigenvalues 5    0
+DEAL::Eigenvalues 1    0
+DEAL::Eigenvalues 5    0
+DEAL::Eigenvalues 5    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.