From: Wolfgang Bangerth Date: Wed, 13 May 1998 12:33:50 +0000 (+0000) Subject: Example update. X-Git-Tag: v8.0.0~22972 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70e68828afba5b6d134d40d189ae79a3de7bcb3d;p=dealii.git Example update. git-svn-id: https://svn.dealii.org/trunk@282 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/Attic/examples/error-estimation/Makefile b/deal.II/deal.II/Attic/examples/error-estimation/Makefile index 35cd1f7b8a..0cfca5ab45 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/Makefile +++ b/deal.II/deal.II/Attic/examples/error-estimation/Makefile @@ -23,9 +23,12 @@ run-parameters = ee.gauss.prm # To execute additional action apart from running the program, fill # in this list: -additional-run-action = $(target) ee.singular.prm ; \ - gnuplot make_ps ; \ - perl -pi -e 's/^\#.*$$\\${}n//g' data-*/*.inp +run-action=\ + $(target) ee.gauss.prm; \ + $(target) ee.singular.prm; \ + $(target) ee.kink.prm; \ + gnuplot make_ps; \ + perl -pi -e 's/^\#.*$$\\${}n//g' data-*/*.inp # To specify which files are to be deleted by "make clean" (apart from # the usual ones: object files, executables, backups, etc), fill in the @@ -89,11 +92,8 @@ $(target) : $(libraries) @echo ============================ Linking $@ @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs) -# rule how to run the program run: $(target) - $(target) $(run-parameters) - $(additional-run-action) - + $(run-action) # rule to make object files %.go : %.cc diff --git a/deal.II/deal.II/Attic/examples/error-estimation/ee.gauss.prm b/deal.II/deal.II/Attic/examples/error-estimation/ee.gauss.prm index cd8daeb2fd..2efdb4a724 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/ee.gauss.prm +++ b/deal.II/deal.II/Attic/examples/error-estimation/ee.gauss.prm @@ -2,6 +2,6 @@ set Test case = Gauss shape set Initial refinement = 2 set Refinement criterion = { global | true error | estimated error } set Refinement fraction = 0.3 -set Maximum cells = 3000 +set Maximum cells = 10000 set Output base filename = data-gauss/ set Output format = ucd diff --git a/deal.II/deal.II/Attic/examples/error-estimation/ee.kink.prm b/deal.II/deal.II/Attic/examples/error-estimation/ee.kink.prm index 5a3c5447d8..e8667dd510 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/ee.kink.prm +++ b/deal.II/deal.II/Attic/examples/error-estimation/ee.kink.prm @@ -2,6 +2,6 @@ set Test case = Kink set Initial refinement = 1 set Refinement criterion = { global | estimated error } set Refinement fraction = 0.1 -set Maximum cells = 30000 +set Maximum cells = 100000 set Output base filename = data-kink/ set Output format = ucd diff --git a/deal.II/deal.II/Attic/examples/error-estimation/ee.singular.prm b/deal.II/deal.II/Attic/examples/error-estimation/ee.singular.prm index 6b5861d006..61b6e7571a 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/ee.singular.prm +++ b/deal.II/deal.II/Attic/examples/error-estimation/ee.singular.prm @@ -2,6 +2,6 @@ set Test case = Singular set Initial refinement = 1 set Refinement criterion = { global | estimated error } set Refinement fraction = 0.1 -set Maximum cells = 10000 +set Maximum cells = 100000 set Output base filename = data-singular/ set Output format = ucd diff --git a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc index 6f055f91e2..d4b53f46c5 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc +++ b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc @@ -547,7 +547,29 @@ void PoissonProblem::run (ParameterHandler &prm) { cout << endl << endl; ++refine_step; }; + + String filename = prm.get ("Output base filename"); + switch (refine_mode) + { + case global: + filename += "global."; + break; + case true_error: + filename += "true_error."; + break; + case error_estimator: + filename += "estimated_error."; + break; + }; + + cout << endl; + filename += "finest_mesh.gnuplot"; + cout << " Wrinting finest grid to <" << filename << ">... " << endl; + ofstream finest_mesh (filename); + tria->print_gnuplot (finest_mesh); + finest_mesh.close(); + print_history (prm, refine_mode); cout << endl << endl << endl; diff --git a/deal.II/deal.II/Attic/examples/error-estimation/make_ps b/deal.II/deal.II/Attic/examples/error-estimation/make_ps index 06340e21a4..49b88af9ee 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/make_ps +++ b/deal.II/deal.II/Attic/examples/error-estimation/make_ps @@ -16,14 +16,13 @@ set output "data-gauss/history.true_error.eps" plot "data-gauss/history.true_error.gnuplot" using 1:2 title "L2 error","data-gauss/history.true_error.gnuplot" using 1:3 title "Linfty error","data-gauss/history.true_error.gnuplot" using 1:4 title "H1 error","data-gauss/history.true_error.gnuplot" using 1:5 title "Estimated H1 error" - set output "data-gauss/history.estimated_error.eps" plot "data-gauss/history.estimated_error.gnuplot" using 1:2 title "L2 error","data-gauss/history.estimated_error.gnuplot" using 1:3 title "Linfty error","data-gauss/history.estimated_error.gnuplot" using 1:4 title "H1 error","data-gauss/history.estimated_error.gnuplot" using 1:5 title "Estimated H1 error" set output "data-gauss/history.compare.eps" -plot "data-gauss/history.global.gnuplot" using 1:2 title "global refinement -- L2 error", "data-gauss/history.true_error.gnuplot" using 1:2 title "ref. by true error -- L2 error", "data-gauss/history.estimated_error.gnuplot" using 1:2 title "ref. by estimated error -- L2 error", "data-gauss/history.global.gnuplot" using 1:4 title "global refinement -- H1 error", "data-gauss/history.true_error.gnuplot" using 1:4 title "ref. by true error -- H1 error", "data-gauss/history.estimated_error.gnuplot" using 1:4 title "ref. by estimated error -- H1 error" +plot "data-gauss/history.global.gnuplot" using 1:2 title "global refinement -- L2 error", "data-gauss/history.true_error.gnuplot" using 1:2 title "ref. by true error -- L2 error", "data-gauss/history.estimated_error.gnuplot" using 1:2 title "ref. by estimated error -- L2 error", 0.1/sqrt(x) title "O(h)", "data-gauss/history.global.gnuplot" using 1:4 title "global refinement -- H1 error", "data-gauss/history.true_error.gnuplot" using 1:4 title "ref. by true error -- H1 error", "data-gauss/history.estimated_error.gnuplot" using 1:4 title "ref. by estimated error -- H1 error", 0.04/x title "O(h^2)" @@ -40,7 +39,7 @@ plot "data-singular/history.estimated_error.gnuplot" using 1:2 title "L2 error", set output "data-singular/history.compare.eps" -plot "data-singular/history.global.gnuplot" using 1:2 title "global refinement -- L2 error", "data-singular/history.estimated_error.gnuplot" using 1:2 title "ref. by estimated error -- L2 error", "data-singular/history.global.gnuplot" using 1:4 title "global refinement -- H1 error", "data-singular/history.estimated_error.gnuplot" using 1:4 title "ref. by estimated error -- H1 error" +plot "data-singular/history.global.gnuplot" using 1:2 title "global refinement -- L2 error", "data-singular/history.estimated_error.gnuplot" using 1:2 title "ref. by estimated error -- L2 error", 1.1/x**0.33 title "O(h^2/3)", 2./sqrt(x) title "O(h)", "data-singular/history.global.gnuplot" using 1:4 title "global refinement -- H1 error", "data-singular/history.estimated_error.gnuplot" using 1:4 title "ref. by estimated error -- H1 error", 0.2/x**0.4 title "O(h^0.8)", 4./x title "O(h^2)" @@ -59,4 +58,36 @@ plot "data-kink/history.estimated_error.gnuplot" using 1:2 title "L2 error","dat set output "data-kink/history.compare.eps" -plot "data-kink/history.global.gnuplot" using 1:2 title "global refinement -- L2 error", "data-kink/history.estimated_error.gnuplot" using 1:2 title "ref. by estimated error -- L2 error", "data-kink/history.global.gnuplot" using 1:4 title "global refinement -- H1 error", "data-kink/history.estimated_error.gnuplot" using 1:4 title "ref. by estimated error -- H1 error" +plot "data-kink/history.global.gnuplot" using 1:2 title "global refinement -- L2 error", "data-kink/history.estimated_error.gnuplot" using 1:2 title "ref. by estimated error -- L2 error", 5/x**0.25 title "O(h^1/2)", 20/x**0.5 title "O(h)", "data-kink/history.global.gnuplot" using 1:4 title "global refinement -- H1 error", "data-kink/history.estimated_error.gnuplot" using 1:4 title "ref. by estimated error -- H1 error", 1.5/sqrt(x) title "O(h)", 20/x**0.95 title "O(h^1.8)" + + + + +set parametric +set data style lines +set nologscale xy + +set output "data-gauss/finest_mesh.global.eps" +plot "data-gauss/global.finest_mesh.gnuplot" + +set output "data-gauss/finest_mesh.true_error.eps" +plot "data-gauss/true_error.finest_mesh.gnuplot" + +set output "data-gauss/finest_mesh.estimated_error.eps" +plot "data-gauss/estimated_error.finest_mesh.gnuplot" + + + +set output "data-singular/finest_mesh.global.eps" +plot "data-singular/global.finest_mesh.gnuplot" + +set output "data-singular/finest_mesh.estimated_error.eps" +plot "data-singular/estimated_error.finest_mesh.gnuplot" + + + +set output "data-kink/finest_mesh.global.eps" +plot "data-kink/global.finest_mesh.gnuplot" + +set output "data-kink/finest_mesh.estimated_error.eps" +plot "data-kink/estimated_error.finest_mesh.gnuplot" diff --git a/tests/big-tests/error-estimation/Makefile b/tests/big-tests/error-estimation/Makefile index 35cd1f7b8a..0cfca5ab45 100644 --- a/tests/big-tests/error-estimation/Makefile +++ b/tests/big-tests/error-estimation/Makefile @@ -23,9 +23,12 @@ run-parameters = ee.gauss.prm # To execute additional action apart from running the program, fill # in this list: -additional-run-action = $(target) ee.singular.prm ; \ - gnuplot make_ps ; \ - perl -pi -e 's/^\#.*$$\\${}n//g' data-*/*.inp +run-action=\ + $(target) ee.gauss.prm; \ + $(target) ee.singular.prm; \ + $(target) ee.kink.prm; \ + gnuplot make_ps; \ + perl -pi -e 's/^\#.*$$\\${}n//g' data-*/*.inp # To specify which files are to be deleted by "make clean" (apart from # the usual ones: object files, executables, backups, etc), fill in the @@ -89,11 +92,8 @@ $(target) : $(libraries) @echo ============================ Linking $@ @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs) -# rule how to run the program run: $(target) - $(target) $(run-parameters) - $(additional-run-action) - + $(run-action) # rule to make object files %.go : %.cc diff --git a/tests/big-tests/error-estimation/ee.gauss.prm b/tests/big-tests/error-estimation/ee.gauss.prm index cd8daeb2fd..2efdb4a724 100644 --- a/tests/big-tests/error-estimation/ee.gauss.prm +++ b/tests/big-tests/error-estimation/ee.gauss.prm @@ -2,6 +2,6 @@ set Test case = Gauss shape set Initial refinement = 2 set Refinement criterion = { global | true error | estimated error } set Refinement fraction = 0.3 -set Maximum cells = 3000 +set Maximum cells = 10000 set Output base filename = data-gauss/ set Output format = ucd diff --git a/tests/big-tests/error-estimation/ee.kink.prm b/tests/big-tests/error-estimation/ee.kink.prm index 5a3c5447d8..e8667dd510 100644 --- a/tests/big-tests/error-estimation/ee.kink.prm +++ b/tests/big-tests/error-estimation/ee.kink.prm @@ -2,6 +2,6 @@ set Test case = Kink set Initial refinement = 1 set Refinement criterion = { global | estimated error } set Refinement fraction = 0.1 -set Maximum cells = 30000 +set Maximum cells = 100000 set Output base filename = data-kink/ set Output format = ucd diff --git a/tests/big-tests/error-estimation/ee.singular.prm b/tests/big-tests/error-estimation/ee.singular.prm index 6b5861d006..61b6e7571a 100644 --- a/tests/big-tests/error-estimation/ee.singular.prm +++ b/tests/big-tests/error-estimation/ee.singular.prm @@ -2,6 +2,6 @@ set Test case = Singular set Initial refinement = 1 set Refinement criterion = { global | estimated error } set Refinement fraction = 0.1 -set Maximum cells = 10000 +set Maximum cells = 100000 set Output base filename = data-singular/ set Output format = ucd diff --git a/tests/big-tests/error-estimation/error-estimation.cc b/tests/big-tests/error-estimation/error-estimation.cc index 6f055f91e2..d4b53f46c5 100644 --- a/tests/big-tests/error-estimation/error-estimation.cc +++ b/tests/big-tests/error-estimation/error-estimation.cc @@ -547,7 +547,29 @@ void PoissonProblem::run (ParameterHandler &prm) { cout << endl << endl; ++refine_step; }; + + String filename = prm.get ("Output base filename"); + switch (refine_mode) + { + case global: + filename += "global."; + break; + case true_error: + filename += "true_error."; + break; + case error_estimator: + filename += "estimated_error."; + break; + }; + + cout << endl; + filename += "finest_mesh.gnuplot"; + cout << " Wrinting finest grid to <" << filename << ">... " << endl; + ofstream finest_mesh (filename); + tria->print_gnuplot (finest_mesh); + finest_mesh.close(); + print_history (prm, refine_mode); cout << endl << endl << endl; diff --git a/tests/big-tests/error-estimation/make_ps b/tests/big-tests/error-estimation/make_ps index 06340e21a4..49b88af9ee 100644 --- a/tests/big-tests/error-estimation/make_ps +++ b/tests/big-tests/error-estimation/make_ps @@ -16,14 +16,13 @@ set output "data-gauss/history.true_error.eps" plot "data-gauss/history.true_error.gnuplot" using 1:2 title "L2 error","data-gauss/history.true_error.gnuplot" using 1:3 title "Linfty error","data-gauss/history.true_error.gnuplot" using 1:4 title "H1 error","data-gauss/history.true_error.gnuplot" using 1:5 title "Estimated H1 error" - set output "data-gauss/history.estimated_error.eps" plot "data-gauss/history.estimated_error.gnuplot" using 1:2 title "L2 error","data-gauss/history.estimated_error.gnuplot" using 1:3 title "Linfty error","data-gauss/history.estimated_error.gnuplot" using 1:4 title "H1 error","data-gauss/history.estimated_error.gnuplot" using 1:5 title "Estimated H1 error" set output "data-gauss/history.compare.eps" -plot "data-gauss/history.global.gnuplot" using 1:2 title "global refinement -- L2 error", "data-gauss/history.true_error.gnuplot" using 1:2 title "ref. by true error -- L2 error", "data-gauss/history.estimated_error.gnuplot" using 1:2 title "ref. by estimated error -- L2 error", "data-gauss/history.global.gnuplot" using 1:4 title "global refinement -- H1 error", "data-gauss/history.true_error.gnuplot" using 1:4 title "ref. by true error -- H1 error", "data-gauss/history.estimated_error.gnuplot" using 1:4 title "ref. by estimated error -- H1 error" +plot "data-gauss/history.global.gnuplot" using 1:2 title "global refinement -- L2 error", "data-gauss/history.true_error.gnuplot" using 1:2 title "ref. by true error -- L2 error", "data-gauss/history.estimated_error.gnuplot" using 1:2 title "ref. by estimated error -- L2 error", 0.1/sqrt(x) title "O(h)", "data-gauss/history.global.gnuplot" using 1:4 title "global refinement -- H1 error", "data-gauss/history.true_error.gnuplot" using 1:4 title "ref. by true error -- H1 error", "data-gauss/history.estimated_error.gnuplot" using 1:4 title "ref. by estimated error -- H1 error", 0.04/x title "O(h^2)" @@ -40,7 +39,7 @@ plot "data-singular/history.estimated_error.gnuplot" using 1:2 title "L2 error", set output "data-singular/history.compare.eps" -plot "data-singular/history.global.gnuplot" using 1:2 title "global refinement -- L2 error", "data-singular/history.estimated_error.gnuplot" using 1:2 title "ref. by estimated error -- L2 error", "data-singular/history.global.gnuplot" using 1:4 title "global refinement -- H1 error", "data-singular/history.estimated_error.gnuplot" using 1:4 title "ref. by estimated error -- H1 error" +plot "data-singular/history.global.gnuplot" using 1:2 title "global refinement -- L2 error", "data-singular/history.estimated_error.gnuplot" using 1:2 title "ref. by estimated error -- L2 error", 1.1/x**0.33 title "O(h^2/3)", 2./sqrt(x) title "O(h)", "data-singular/history.global.gnuplot" using 1:4 title "global refinement -- H1 error", "data-singular/history.estimated_error.gnuplot" using 1:4 title "ref. by estimated error -- H1 error", 0.2/x**0.4 title "O(h^0.8)", 4./x title "O(h^2)" @@ -59,4 +58,36 @@ plot "data-kink/history.estimated_error.gnuplot" using 1:2 title "L2 error","dat set output "data-kink/history.compare.eps" -plot "data-kink/history.global.gnuplot" using 1:2 title "global refinement -- L2 error", "data-kink/history.estimated_error.gnuplot" using 1:2 title "ref. by estimated error -- L2 error", "data-kink/history.global.gnuplot" using 1:4 title "global refinement -- H1 error", "data-kink/history.estimated_error.gnuplot" using 1:4 title "ref. by estimated error -- H1 error" +plot "data-kink/history.global.gnuplot" using 1:2 title "global refinement -- L2 error", "data-kink/history.estimated_error.gnuplot" using 1:2 title "ref. by estimated error -- L2 error", 5/x**0.25 title "O(h^1/2)", 20/x**0.5 title "O(h)", "data-kink/history.global.gnuplot" using 1:4 title "global refinement -- H1 error", "data-kink/history.estimated_error.gnuplot" using 1:4 title "ref. by estimated error -- H1 error", 1.5/sqrt(x) title "O(h)", 20/x**0.95 title "O(h^1.8)" + + + + +set parametric +set data style lines +set nologscale xy + +set output "data-gauss/finest_mesh.global.eps" +plot "data-gauss/global.finest_mesh.gnuplot" + +set output "data-gauss/finest_mesh.true_error.eps" +plot "data-gauss/true_error.finest_mesh.gnuplot" + +set output "data-gauss/finest_mesh.estimated_error.eps" +plot "data-gauss/estimated_error.finest_mesh.gnuplot" + + + +set output "data-singular/finest_mesh.global.eps" +plot "data-singular/global.finest_mesh.gnuplot" + +set output "data-singular/finest_mesh.estimated_error.eps" +plot "data-singular/estimated_error.finest_mesh.gnuplot" + + + +set output "data-kink/finest_mesh.global.eps" +plot "data-kink/global.finest_mesh.gnuplot" + +set output "data-kink/finest_mesh.estimated_error.eps" +plot "data-kink/estimated_error.finest_mesh.gnuplot"