]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add the criss-cross element to the convergence testcase.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 27 Jul 1998 22:13:57 +0000 (22:13 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 27 Jul 1998 22:13:57 +0000 (22:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@460 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/Attic/examples/convergence/Makefile
deal.II/deal.II/Attic/examples/convergence/convergence.cc
deal.II/deal.II/Attic/examples/convergence/make_ps
tests/big-tests/convergence/Makefile
tests/big-tests/convergence/convergence.cc
tests/big-tests/convergence/make_ps

index d3c0974d421681b5bd0e9ed3fb2dd3542ba7a74d..4c40024109e8a2bc5e052c7152aa0dac7041bc1e 100644 (file)
@@ -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
 
 
 
index 0934316fa71618eced14e3639361f7d475798cc6..a000eaf8e25238da49d18e5a1188d75684d2ff47 100644 (file)
@@ -10,6 +10,7 @@
 #include <basic/function.h>
 #include <basic/data_io.h>
 #include <fe/fe_lib.h>
+#include <fe/fe_lib.criss_cross.h>
 #include <fe/quadrature_lib.h>
 #include <numerics/base.h>
 #include <numerics/assembler.h>
@@ -241,8 +242,17 @@ int PoissonProblem<dim>::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<dim>::run (const unsigned int level) {
   Quadrature<dim>      *quadrature;
   Quadrature<dim-1>    *boundary_quadrature;
   switch (order) {
+    case 0:
+         fe         = new FECrissCross<dim>();
+         quadrature = new QCrissCross1<dim>();
+         boundary_quadrature = new QGauss2<dim-1>();
+         break;
     case 1:
          fe         = new FELinear<dim>();
          quadrature = new QGauss3<dim>();
@@ -359,19 +374,19 @@ int PoissonProblem<dim>::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<dim>::project (*dof, constraints, *fe,
-                                StraightBoundary<dim>(), *quadrature, 
-                                sol, projected_solution, false,
-                                *boundary_quadrature);
-      cout << "    Calculating L2 error of projected solution... ";
-      VectorTools<dim>::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<dim>::project (*dof, constraints, *fe,
+//                              StraightBoundary<dim>(), *quadrature, 
+//                              sol, projected_solution, false,
+//                              *boundary_quadrature);
+//       cout << "    Calculating L2 error of projected solution... ";
+//       VectorTools<dim>::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<dim>::run (const unsigned int level) {
       DataOut<dim> 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<dim>::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;
index 502062d53d2279400c1ba072953b583c1fd4f70d..c2df845aec68b338c1482eb54e76fda2e87259c3 100644 (file)
@@ -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"
 
 
index d3c0974d421681b5bd0e9ed3fb2dd3542ba7a74d..4c40024109e8a2bc5e052c7152aa0dac7041bc1e 100644 (file)
@@ -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
 
 
 
index 0934316fa71618eced14e3639361f7d475798cc6..a000eaf8e25238da49d18e5a1188d75684d2ff47 100644 (file)
@@ -10,6 +10,7 @@
 #include <basic/function.h>
 #include <basic/data_io.h>
 #include <fe/fe_lib.h>
+#include <fe/fe_lib.criss_cross.h>
 #include <fe/quadrature_lib.h>
 #include <numerics/base.h>
 #include <numerics/assembler.h>
@@ -241,8 +242,17 @@ int PoissonProblem<dim>::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<dim>::run (const unsigned int level) {
   Quadrature<dim>      *quadrature;
   Quadrature<dim-1>    *boundary_quadrature;
   switch (order) {
+    case 0:
+         fe         = new FECrissCross<dim>();
+         quadrature = new QCrissCross1<dim>();
+         boundary_quadrature = new QGauss2<dim-1>();
+         break;
     case 1:
          fe         = new FELinear<dim>();
          quadrature = new QGauss3<dim>();
@@ -359,19 +374,19 @@ int PoissonProblem<dim>::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<dim>::project (*dof, constraints, *fe,
-                                StraightBoundary<dim>(), *quadrature, 
-                                sol, projected_solution, false,
-                                *boundary_quadrature);
-      cout << "    Calculating L2 error of projected solution... ";
-      VectorTools<dim>::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<dim>::project (*dof, constraints, *fe,
+//                              StraightBoundary<dim>(), *quadrature, 
+//                              sol, projected_solution, false,
+//                              *boundary_quadrature);
+//       cout << "    Calculating L2 error of projected solution... ";
+//       VectorTools<dim>::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<dim>::run (const unsigned int level) {
       DataOut<dim> 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<dim>::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;
index 502062d53d2279400c1ba072953b583c1fd4f70d..c2df845aec68b338c1482eb54e76fda2e87259c3 100644 (file)
@@ -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"
 
 

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.