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
#
solver-o-files = $(solver-cc-files:.cc=.o)
endif
-solver: $(solver-o-files) $(libraries)
+solver.testcase: $(solver-o-files) $(libraries)
$(CXX) $(flags) -o $@ $^
mgbase-o-files = $(mgbase-cc-files:.cc=.o)
endif
-mgbase: $(mgbase-o-files) $(libraries)
+mgbase.testcase: $(mgbase-o-files) $(libraries)
$(CXX) $(flags) -o $@ $^
mg-o-files = $(mg-cc-files:.cc=.o)
endif
-mg: $(mg-o-files) $(libraries)
+mg.testcase: $(mg-o-files) $(libraries)
$(CXX) $(flags) -o $@ $^
benchmark-o-files = $(benchmark-cc-files:.cc=.o)
endif
-benchmark: $(benchmark-o-files) $(libraries)
+benchmark.testcase: $(benchmark-o-files) $(libraries)
$(CXX) $(flags) -o $@ $^
############################################################
$(CXX) $(flags) -o $@ $^
+############################################################
+# Postprocessing
+############################################################
+
+%.output:%.testcase
+ $<
+ @perl -pi.bak -e 's/JobId.*//;s/value.*//;' $@
+ @rm $@.bak
+%.check:%.output
+ @-diff $< $(patsubst %.output,%.checked, $<)
############################################################
# Cleanup targets
############################################################
#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
:
{
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);
--- /dev/null
+
+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
// deal_II_libraries=-ldeal_II_2d
#include <lac/mgbase.h>
+#include <base/logstream.h>
+
+#include <fstream>
class TransferTest
:
main()
{
+ ofstream logfile("mgbase.output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+
TransferTest tr;
SmoothTest s;
MGCoarseGridTest c;
Vector<double>&,
const Vector<double>&) const
{
- cout << "Prolongating " << l-1 << " to " << l << endl;
+ deallog << "Prolongating " << l-1 << " to " << l << endl;
}
void
Vector<double>&,
const Vector<double>&) const
{
- cout << "Restricting " << l << " to " << l-1 << endl;
+ deallog << "Restricting " << l << " to " << l-1 << endl;
}
void
Vector<double> &,
const Vector<double>&) const
{
- cout << "Smoothing on " << level << endl;
+ deallog << "Smoothing on " << level << endl;
}
void
const Vector<double>&,
const Vector<double>&)
{
- cout << "Residual on " << l << endl;
+ deallog << "Residual on " << l << endl;
}
void
Vector<double>&,
const Vector<double>&) const
{
- cout << "Solving on " << level << endl;
+ deallog << "Solving on " << level << endl;
}
--- /dev/null
+
+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
{
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);
--- /dev/null
+
+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