]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
make runs complete tests
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 8 Jul 1999 08:23:28 +0000 (08:23 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 8 Jul 1999 08:23:28 +0000 (08:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@1553 0785d39b-7218-0410-832d-ea1e28bc413d

tests/lac/Makefile
tests/lac/mg.cc
tests/lac/mg.checked [new file with mode: 0644]
tests/lac/mgbase.cc
tests/lac/mgbase.checked [new file with mode: 0644]
tests/lac/solver.cc
tests/lac/solver.checked [new file with mode: 0644]

index 138b42e782f03d949db081aa3c67777a26d45baa..cbdf8f2f578be8ce9024373ba1b69b9f03da61c6 100644 (file)
@@ -41,8 +41,9 @@ libraries = $(libs)
 flags     = $(CXXFLAGS.o) $(CXXFLAGS)
 endif
 
-all: solver mgbase mg benchmark
-
+all: solver.check mgbase.check mg.check
+exe: $(all:.check=.testcase) benchmark
+run: $(all:.check=.output)
 ############################################################
 # Typical block for building a running program
 #
@@ -64,7 +65,7 @@ else
 solver-o-files = $(solver-cc-files:.cc=.o)
 endif
 
-solver: $(solver-o-files) $(libraries)
+solver.testcase: $(solver-o-files) $(libraries)
        $(CXX) $(flags) -o $@ $^
 
 
@@ -79,7 +80,7 @@ else
 mgbase-o-files = $(mgbase-cc-files:.cc=.o)
 endif
 
-mgbase: $(mgbase-o-files) $(libraries)
+mgbase.testcase: $(mgbase-o-files) $(libraries)
        $(CXX) $(flags) -o $@ $^
 
 
@@ -95,7 +96,7 @@ else
 mg-o-files = $(mg-cc-files:.cc=.o)
 endif
 
-mg: $(mg-o-files) $(libraries)
+mg.testcase: $(mg-o-files) $(libraries)
        $(CXX) $(flags) -o $@ $^
 
 
@@ -113,7 +114,7 @@ else
 benchmark-o-files = $(benchmark-cc-files:.cc=.o)
 endif
 
-benchmark: $(benchmark-o-files) $(libraries)
+benchmark.testcase: $(benchmark-o-files) $(libraries)
        $(CXX) $(flags) -o $@ $^
 
 ############################################################
@@ -133,7 +134,17 @@ target1: $(target1-o-files) $(libraries)
        $(CXX) $(flags) -o $@ $^
 
 
+############################################################
+# Postprocessing
+############################################################
+
+%.output:%.testcase
+       $<
+       @perl -pi.bak -e 's/JobId.*//;s/value.*//;' $@
+       @rm $@.bak
 
+%.check:%.output
+       @-diff $< $(patsubst %.output,%.checked, $<)
 ############################################################
 # Cleanup targets
 ############################################################
index 0cba014f426d49b90c1062eb0b4f64cbf4dc5433..b49b2cee6042a509d87ce18ed4844effb58d98d7 100644 (file)
 #include <lac/precondition.h>
 #include <lac/mgbase.h>
 
-#define TYPE  long double
-#define ACCURACY 1.e-20
-
-template<class VECTOR>
-void print_vector(ostream& s, const VECTOR& v)
-{
-  const unsigned int n = (unsigned int)(sqrt(v.size())+.3);
-  unsigned int k=0;
+#define TYPE  double
+#define ACCURACY 1.e-5
+
+// template<class VECTOR>
+// void print_vector(ostream& s, const VECTOR& v)
+// {
+//   const unsigned int n = (unsigned int)(sqrt(v.size())+.3);
+//   unsigned int k=0;
   
-  for (unsigned int i=0;i<n;++i)
-    {
-      for (unsigned int j=0;j<n;++j)
-//     s << ((float)i)/n << '\t' << ((float)j)/n << '\t' << v(k++) << endl;
-       s << '\t' << v(k++);
-      s << endl;
-    }
-  s << endl;
-}
+//   for (unsigned int i=0;i<n;++i)
+//     {
+//       for (unsigned int j=0;j<n;++j)
+// //  s << ((float)i)/n << '\t' << ((float)j)/n << '\t' << v(k++) << endl;
+//     s << '\t' << v(k++);
+//       s << endl;
+//     }
+//   s << endl;
+// }
 
 class FDMG
   :
@@ -84,12 +84,13 @@ main()
 {
   ofstream logfile("mg.output");
   deallog.attach(logfile);
+  deallog.depth_console(0);
   
   PrimitiveVectorMemory<Vector<TYPE>  > mem;
   SolverControl control(10000, ACCURACY);
 
   const unsigned int base = 3;
-  const unsigned int maxlevel = 8;
+  const unsigned int maxlevel = 5;
   
   const unsigned int maxsize = base * (1 << maxlevel);
   
diff --git a/tests/lac/mg.checked b/tests/lac/mg.checked
new file mode 100644 (file)
index 0000000..4df0727
--- /dev/null
@@ -0,0 +1,13 @@
+
+DEAL::Level 0 size 3
+DEAL:cg::Convergence step 0 
+DEAL::Level 1 size 6
+DEAL:cg::Convergence step 4 
+DEAL::Level 2 size 12
+DEAL:cg::Convergence step 9 
+DEAL::Level 3 size 24
+DEAL:cg::Convergence step 18 
+DEAL::Level 4 size 48
+DEAL:cg::Convergence step 44 
+DEAL::Level 5 size 96
+DEAL:cg::Convergence step 87 
index 8a47cd22a02845be2f06e086f9156a14f6b86e87..ea131b4cde90a0d0dbbdbfa06297d82277f3b3da 100644 (file)
@@ -4,6 +4,9 @@
 // deal_II_libraries=-ldeal_II_2d
 
 #include <lac/mgbase.h>
+#include <base/logstream.h>
+
+#include <fstream>
 
 class TransferTest
   :
@@ -72,6 +75,10 @@ class MGTest
 
 main()
 {
+  ofstream logfile("mgbase.output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+
   TransferTest tr;
   SmoothTest s;
   MGCoarseGridTest c;
@@ -86,7 +93,7 @@ TransferTest::prolongate(unsigned l,
                         Vector<double>&,
                         const Vector<double>&) const
 {
-  cout << "Prolongating " << l-1 << " to " << l << endl;
+  deallog << "Prolongating " << l-1 << " to " << l << endl;
 }
 
 void
@@ -94,7 +101,7 @@ TransferTest::restrict(unsigned l,
                       Vector<double>&,
                       const Vector<double>&) const
 {
-  cout << "Restricting  " << l << " to " << l-1 << endl;
+  deallog << "Restricting  " << l << " to " << l-1 << endl;
 }
 
 void
@@ -102,7 +109,7 @@ SmoothTest::smooth (const unsigned int  level,
                    Vector<double>      &,
                    const Vector<double>&) const
 {
-  cout << "Smoothing on " << level << endl;
+  deallog << "Smoothing on " << level << endl;
 }
 
 void
@@ -111,7 +118,7 @@ MGTest::level_vmult(unsigned l,
                       const Vector<double>&,
                       const Vector<double>&)
 {
-  cout << "Residual on  " << l << endl;
+  deallog << "Residual on  " << l << endl;
 }
 
 void
@@ -119,5 +126,5 @@ MGCoarseGridTest::operator() (unsigned int level,
                              Vector<double>&,
                              const Vector<double>&) const
 {
-  cout << "Solving on   " << level << endl;
+  deallog << "Solving on   " << level << endl;
 }
diff --git a/tests/lac/mgbase.checked b/tests/lac/mgbase.checked
new file mode 100644 (file)
index 0000000..e4f121c
--- /dev/null
@@ -0,0 +1,32 @@
+
+DEAL::Smoothing on 9
+DEAL::Residual on  9
+DEAL::Restricting  9 to 8
+DEAL::Smoothing on 8
+DEAL::Residual on  8
+DEAL::Restricting  8 to 7
+DEAL::Smoothing on 7
+DEAL::Residual on  7
+DEAL::Restricting  7 to 6
+DEAL::Smoothing on 6
+DEAL::Residual on  6
+DEAL::Restricting  6 to 5
+DEAL::Smoothing on 5
+DEAL::Residual on  5
+DEAL::Restricting  5 to 4
+DEAL::Smoothing on 4
+DEAL::Residual on  4
+DEAL::Restricting  4 to 3
+DEAL::Solving on   3
+DEAL::Prolongating 3 to 4
+DEAL::Smoothing on 4
+DEAL::Prolongating 4 to 5
+DEAL::Smoothing on 5
+DEAL::Prolongating 5 to 6
+DEAL::Smoothing on 6
+DEAL::Prolongating 6 to 7
+DEAL::Smoothing on 7
+DEAL::Prolongating 7 to 8
+DEAL::Smoothing on 8
+DEAL::Prolongating 8 to 9
+DEAL::Smoothing on 9
index b4f7d9a096e75c178fae01d1bb9c7ad315a7bee2..6347d8e10ac1135ec4f423e4bf7244a882ad2db7 100644 (file)
@@ -31,9 +31,10 @@ main()
 {
   ofstream logfile("solver.output");
   deallog.attach(logfile);
+  deallog.depth_console(0);
   
   PrimitiveVectorMemory<Vector<double>  > mem;
-  SolverControl control(50, 1.e-5, true);
+  SolverControl control(50, 1.e-5);
   SolverCG<SparseMatrix<float> , Vector<double>  > cg(control, mem);
   SolverGMRES<SparseMatrix<float> , Vector<double>  > gmres(control, mem,20);
   SolverBicgstab<SparseMatrix<float> , Vector<double>  > bicgstab(control, mem);
diff --git a/tests/lac/solver.checked b/tests/lac/solver.checked
new file mode 100644 (file)
index 0000000..0971aa1
--- /dev/null
@@ -0,0 +1,49 @@
+
+DEAL::Size 4
+DEAL::SOR-diff:0
+DEAL:no:cg::Convergence step 2 
+DEAL:no:Bicgstab::Go!
+DEAL:no:Bicgstab::Convergence step 3 
+DEAL:no:GMRES::Convergence step 2 
+DEAL:ssor:Richardson::Convergence step 15 
+DEAL:ssor:cg::Convergence step 4 
+DEAL:ssor:Bicgstab::Go!
+DEAL:ssor:Bicgstab::Convergence step 3 
+DEAL:ssor:GMRES::Convergence step 3 
+DEAL:sor:Richardson::Convergence step 10 
+DEAL:sor:cg::Failure step 50 
+DEAL:sor:Bicgstab::Go!
+DEAL:sor:Bicgstab::Convergence step 5 
+DEAL:sor:GMRES::Convergence step 4 
+DEAL::Size 12
+DEAL::SOR-diff:0
+DEAL:no:cg::Convergence step 16 
+DEAL:no:Bicgstab::Go!
+DEAL:no:Bicgstab::Convergence step 13 
+DEAL:no:GMRES::Convergence step 16 
+DEAL:ssor:Richardson::Failure step 50 
+DEAL:ssor:cg::Convergence step 10 
+DEAL:ssor:Bicgstab::Go!
+DEAL:ssor:Bicgstab::Convergence step 6 
+DEAL:ssor:GMRES::Convergence step 9 
+DEAL:sor:Richardson::Failure step 50 
+DEAL:sor:cg::Failure step 50 
+DEAL:sor:Bicgstab::Go!
+DEAL:sor:Bicgstab::Convergence step 19 
+DEAL:sor:GMRES::Convergence step 24 
+DEAL::Size 36
+DEAL::SOR-diff:2.21867e-30
+DEAL:no:cg::Failure step 50 
+DEAL:no:Bicgstab::Go!
+DEAL:no:Bicgstab::Convergence step 44 
+DEAL:no:GMRES::Failure step 50 
+DEAL:ssor:Richardson::Failure step 50 
+DEAL:ssor:cg::Convergence step 26 
+DEAL:ssor:Bicgstab::Go!
+DEAL:ssor:Bicgstab::Convergence step 18 
+DEAL:ssor:GMRES::Convergence step 25 
+DEAL:sor:Richardson::Failure step 50 
+DEAL:sor:cg::Failure step 50 
+DEAL:sor:Bicgstab::Go!
+DEAL:sor:Bicgstab::Failure step 50 
+DEAL:sor:GMRES::Failure step 50 

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.