From: Wolfgang Bangerth Date: Mon, 27 Jul 1998 22:13:57 +0000 (+0000) Subject: Add the criss-cross element to the convergence testcase. X-Git-Tag: v8.0.0~22794 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d933dbf72af3d6ee9bfd35640b010c2394386ed;p=dealii.git Add the criss-cross element to the convergence testcase. git-svn-id: https://svn.dealii.org/trunk@460 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/Attic/examples/convergence/Makefile b/deal.II/deal.II/Attic/examples/convergence/Makefile index d3c0974d42..4c40024109 100644 --- a/deal.II/deal.II/Attic/examples/convergence/Makefile +++ b/deal.II/deal.II/Attic/examples/convergence/Makefile @@ -28,7 +28,7 @@ additional-run-action = gnuplot make_ps # To specify which files are to be deleted by "make clean" (apart from # the usual ones: object files, executables, backups, etc), fill in the # following list -delete-files = gnuplot* *.eps +delete-files = *gnuplot *.eps *ucd *history diff --git a/deal.II/deal.II/Attic/examples/convergence/convergence.cc b/deal.II/deal.II/Attic/examples/convergence/convergence.cc index 0934316fa7..a000eaf8e2 100644 --- a/deal.II/deal.II/Attic/examples/convergence/convergence.cc +++ b/deal.II/deal.II/Attic/examples/convergence/convergence.cc @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -241,8 +242,17 @@ int PoissonProblem::run (const unsigned int level) { create_new (); cout << "Refinement level = " << level - << ", using elements of order " << order - << endl; + << ", using elements of type <"; + switch (order) + { + case 0: + cout << "criss-cross"; + break; + default: + cout << "Lagrange-" << order; + break; + }; + cout << ">" << endl; cout << " Making grid... "; tria->create_hyper_ball (); @@ -263,6 +273,11 @@ int PoissonProblem::run (const unsigned int level) { Quadrature *quadrature; Quadrature *boundary_quadrature; switch (order) { + case 0: + fe = new FECrissCross(); + quadrature = new QCrissCross1(); + boundary_quadrature = new QGauss2(); + break; case 1: fe = new FELinear(); quadrature = new QGauss3(); @@ -359,19 +374,19 @@ int PoissonProblem::run (const unsigned int level) { h1_seminorm_error_per_dof); dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof); - dVector projected_solution; - ConstraintMatrix constraints; - constraints.close (); - VectorTools::project (*dof, constraints, *fe, - StraightBoundary(), *quadrature, - sol, projected_solution, false, - *boundary_quadrature); - cout << " Calculating L2 error of projected solution... "; - VectorTools::integrate_difference (*dof_handler, - projected_solution, sol, - l2_error_per_cell, - *quadrature, *fe, L2_norm); - cout << l2_error_per_cell.l2_norm() << endl; +// dVector projected_solution; +// ConstraintMatrix constraints; +// constraints.close (); +// VectorTools::project (*dof, constraints, *fe, +// StraightBoundary(), *quadrature, +// sol, projected_solution, false, +// *boundary_quadrature); +// cout << " Calculating L2 error of projected solution... "; +// VectorTools::integrate_difference (*dof_handler, +// projected_solution, sol, +// l2_error_per_cell, +// *quadrature, *fe, L2_norm); +// cout << l2_error_per_cell.l2_norm() << endl; string filename; @@ -384,7 +399,6 @@ int PoissonProblem::run (const unsigned int level) { DataOut out; ofstream o(filename.c_str()); fill_data (out); - out.add_data_vector (projected_solution, "projected u"); out.add_data_vector (l1_error_per_dof, "L1-Error"); out.add_data_vector (l2_error_per_dof, "L2-Error"); out.add_data_vector (linfty_error_per_dof, "Linfty-Error"); @@ -455,7 +469,7 @@ void PoissonProblem::print_history (string filename) const { int main () { - for (unsigned int order=1; order<5; ++order) + for (unsigned int order=0; order<5; ++order) { PoissonProblem<2> problem (order); @@ -468,6 +482,9 @@ int main () { string filename; switch (order) { + case 0: + filename = "criss_cross"; + break; case 1: filename = "linear"; break; diff --git a/deal.II/deal.II/Attic/examples/convergence/make_ps b/deal.II/deal.II/Attic/examples/convergence/make_ps index 502062d53d..c2df845aec 100644 --- a/deal.II/deal.II/Attic/examples/convergence/make_ps +++ b/deal.II/deal.II/Attic/examples/convergence/make_ps @@ -1,48 +1,52 @@ +set term postscript eps set xlabel "Number of degrees of freedom" -set ylabel "Error" set data style linespoints set logscale xy -set term postscript eps + + +set ylabel "Error" + +set output "criss-cross.eps" + +plot "criss-cross.history" using 1:2 title "L1 error","criss-cross.history" using 1:3 title "L2 error","criss-cross.history" using 1:4 title "Linfty error","criss-cross.history" using 1:5 title "H1 seminorm error","criss-cross.history" using 1:6 title "H1 error" + + + set output "linear.eps" plot "linear.history" using 1:2 title "L1 error","linear.history" using 1:3 title "L2 error","linear.history" using 1:4 title "Linfty error","linear.history" using 1:5 title "H1 seminorm error","linear.history" using 1:6 title "H1 error" -set term postscript eps set output "quadratic.eps" plot "quadratic.history" using 1:2 title "L1 error","quadratic.history" using 1:3 title "L2 error","quadratic.history" using 1:4 title "Linfty error","quadratic.history" using 1:5 title "H1 seminorm error","quadratic.history" using 1:6 title "H1 error" -set term postscript eps set output "cubic.eps" plot "cubic.history" using 1:2 title "L1 error","cubic.history" using 1:3 title "L2 error","cubic.history" using 1:4 title "Linfty error","cubic.history" using 1:5 title "H1 seminorm error","cubic.history" using 1:6 title "H1 error" -set term postscript eps set output "quartic.eps" plot "quartic.history" using 1:2 title "L1 error","quartic.history" using 1:3 title "L2 error","quartic.history" using 1:4 title "Linfty error","quartic.history" using 1:5 title "H1 seminorm error","quartic.history" using 1:6 title "H1 error" -set term postscript eps set output "l2error.eps" set ylabel "L2-error" -plot "linear.history" using 1:3 title "Linear elements", "quadratic.history" using 1:3 title "Quadratic elements", "cubic.history" using 1:3 title "Cubic elements", "quartic.history" using 1:3 title "Quartic elements" +plot "criss-cross.history" using 1:3 title "Criss-cross elements", "linear.history" using 1:3 title "Linear elements", "quadratic.history" using 1:3 title "Quadratic elements", "cubic.history" using 1:3 title "Cubic elements", "quartic.history" using 1:3 title "Quartic elements" -set term postscript eps set output "h1error.eps" set ylabel "H1-error" -plot "linear.history" using 1:6 title "Linear elements", "quadratic.history" using 1:6 title "Quadratic elements", "cubic.history" using 1:6 title "Cubic elements", "quartic.history" using 1:6 title "Quartic elements" +plot "criss-cross.history" using 1:6 title "Criss-cross elements", "linear.history" using 1:6 title "Linear elements", "quadratic.history" using 1:6 title "Quadratic elements", "cubic.history" using 1:6 title "Cubic elements", "quartic.history" using 1:6 title "Quartic elements" diff --git a/tests/big-tests/convergence/Makefile b/tests/big-tests/convergence/Makefile index d3c0974d42..4c40024109 100644 --- a/tests/big-tests/convergence/Makefile +++ b/tests/big-tests/convergence/Makefile @@ -28,7 +28,7 @@ additional-run-action = gnuplot make_ps # To specify which files are to be deleted by "make clean" (apart from # the usual ones: object files, executables, backups, etc), fill in the # following list -delete-files = gnuplot* *.eps +delete-files = *gnuplot *.eps *ucd *history diff --git a/tests/big-tests/convergence/convergence.cc b/tests/big-tests/convergence/convergence.cc index 0934316fa7..a000eaf8e2 100644 --- a/tests/big-tests/convergence/convergence.cc +++ b/tests/big-tests/convergence/convergence.cc @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -241,8 +242,17 @@ int PoissonProblem::run (const unsigned int level) { create_new (); cout << "Refinement level = " << level - << ", using elements of order " << order - << endl; + << ", using elements of type <"; + switch (order) + { + case 0: + cout << "criss-cross"; + break; + default: + cout << "Lagrange-" << order; + break; + }; + cout << ">" << endl; cout << " Making grid... "; tria->create_hyper_ball (); @@ -263,6 +273,11 @@ int PoissonProblem::run (const unsigned int level) { Quadrature *quadrature; Quadrature *boundary_quadrature; switch (order) { + case 0: + fe = new FECrissCross(); + quadrature = new QCrissCross1(); + boundary_quadrature = new QGauss2(); + break; case 1: fe = new FELinear(); quadrature = new QGauss3(); @@ -359,19 +374,19 @@ int PoissonProblem::run (const unsigned int level) { h1_seminorm_error_per_dof); dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof); - dVector projected_solution; - ConstraintMatrix constraints; - constraints.close (); - VectorTools::project (*dof, constraints, *fe, - StraightBoundary(), *quadrature, - sol, projected_solution, false, - *boundary_quadrature); - cout << " Calculating L2 error of projected solution... "; - VectorTools::integrate_difference (*dof_handler, - projected_solution, sol, - l2_error_per_cell, - *quadrature, *fe, L2_norm); - cout << l2_error_per_cell.l2_norm() << endl; +// dVector projected_solution; +// ConstraintMatrix constraints; +// constraints.close (); +// VectorTools::project (*dof, constraints, *fe, +// StraightBoundary(), *quadrature, +// sol, projected_solution, false, +// *boundary_quadrature); +// cout << " Calculating L2 error of projected solution... "; +// VectorTools::integrate_difference (*dof_handler, +// projected_solution, sol, +// l2_error_per_cell, +// *quadrature, *fe, L2_norm); +// cout << l2_error_per_cell.l2_norm() << endl; string filename; @@ -384,7 +399,6 @@ int PoissonProblem::run (const unsigned int level) { DataOut out; ofstream o(filename.c_str()); fill_data (out); - out.add_data_vector (projected_solution, "projected u"); out.add_data_vector (l1_error_per_dof, "L1-Error"); out.add_data_vector (l2_error_per_dof, "L2-Error"); out.add_data_vector (linfty_error_per_dof, "Linfty-Error"); @@ -455,7 +469,7 @@ void PoissonProblem::print_history (string filename) const { int main () { - for (unsigned int order=1; order<5; ++order) + for (unsigned int order=0; order<5; ++order) { PoissonProblem<2> problem (order); @@ -468,6 +482,9 @@ int main () { string filename; switch (order) { + case 0: + filename = "criss_cross"; + break; case 1: filename = "linear"; break; diff --git a/tests/big-tests/convergence/make_ps b/tests/big-tests/convergence/make_ps index 502062d53d..c2df845aec 100644 --- a/tests/big-tests/convergence/make_ps +++ b/tests/big-tests/convergence/make_ps @@ -1,48 +1,52 @@ +set term postscript eps set xlabel "Number of degrees of freedom" -set ylabel "Error" set data style linespoints set logscale xy -set term postscript eps + + +set ylabel "Error" + +set output "criss-cross.eps" + +plot "criss-cross.history" using 1:2 title "L1 error","criss-cross.history" using 1:3 title "L2 error","criss-cross.history" using 1:4 title "Linfty error","criss-cross.history" using 1:5 title "H1 seminorm error","criss-cross.history" using 1:6 title "H1 error" + + + set output "linear.eps" plot "linear.history" using 1:2 title "L1 error","linear.history" using 1:3 title "L2 error","linear.history" using 1:4 title "Linfty error","linear.history" using 1:5 title "H1 seminorm error","linear.history" using 1:6 title "H1 error" -set term postscript eps set output "quadratic.eps" plot "quadratic.history" using 1:2 title "L1 error","quadratic.history" using 1:3 title "L2 error","quadratic.history" using 1:4 title "Linfty error","quadratic.history" using 1:5 title "H1 seminorm error","quadratic.history" using 1:6 title "H1 error" -set term postscript eps set output "cubic.eps" plot "cubic.history" using 1:2 title "L1 error","cubic.history" using 1:3 title "L2 error","cubic.history" using 1:4 title "Linfty error","cubic.history" using 1:5 title "H1 seminorm error","cubic.history" using 1:6 title "H1 error" -set term postscript eps set output "quartic.eps" plot "quartic.history" using 1:2 title "L1 error","quartic.history" using 1:3 title "L2 error","quartic.history" using 1:4 title "Linfty error","quartic.history" using 1:5 title "H1 seminorm error","quartic.history" using 1:6 title "H1 error" -set term postscript eps set output "l2error.eps" set ylabel "L2-error" -plot "linear.history" using 1:3 title "Linear elements", "quadratic.history" using 1:3 title "Quadratic elements", "cubic.history" using 1:3 title "Cubic elements", "quartic.history" using 1:3 title "Quartic elements" +plot "criss-cross.history" using 1:3 title "Criss-cross elements", "linear.history" using 1:3 title "Linear elements", "quadratic.history" using 1:3 title "Quadratic elements", "cubic.history" using 1:3 title "Cubic elements", "quartic.history" using 1:3 title "Quartic elements" -set term postscript eps set output "h1error.eps" set ylabel "H1-error" -plot "linear.history" using 1:6 title "Linear elements", "quadratic.history" using 1:6 title "Quadratic elements", "cubic.history" using 1:6 title "Cubic elements", "quartic.history" using 1:6 title "Quartic elements" +plot "criss-cross.history" using 1:6 title "Criss-cross elements", "linear.history" using 1:6 title "Linear elements", "quadratic.history" using 1:6 title "Quadratic elements", "cubic.history" using 1:6 title "Cubic elements", "quartic.history" using 1:6 title "Quartic elements"