]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Output efficiency index and orders
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 30 Jul 2011 05:31:07 +0000 (05:31 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 30 Jul 2011 05:31:07 +0000 (05:31 +0000)
git-svn-id: https://svn.dealii.org/trunk@23984 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-39/postprocess.pl

index 567b14e68511cc06a9656bae7e2ba9c18cab99ff..a2faf68f33e183c828a9ae74066598c46320b0b4 100644 (file)
@@ -12,6 +12,10 @@ my @error;    # The energy error of the solution
 my @l2error;  # The L2-error of the solution
 my @estimate; # The a posteriori error estimate
 my @steps;    # The number of multigrid iteration steps
+
+my $energy_order = 0.;
+my $l2_order = 0.;
+
 while(<>)
 {
     $step = $1 if m/DEAL::Step\s*(\d+)/;
@@ -22,7 +26,17 @@ while(<>)
     $steps[$step] = $1 if m/DEAL:\w+::Convergence step\s*(\S+)/;
 }
 
+print '#step dofs error estimate l2error iterations efficiency order l2order', "\n";
+
 for (my $i=0;$i<=$step;++$i)
 {
-    printf "%-3d\t%-7d\t%g\t%g\t%g\t%d\n", $i, $dofs[$i], $error[$i], $estimate[$i], $l2error[$i], $steps[$i];
+    if ($i>0)
+    {
+       my $hlog = -1/2.* log($dofs[$i-1]/$dofs[$i]);
+       $energy_order = log($error[$i-1]/$error[$i]) / $hlog;
+       $l2_order = log($l2error[$i-1]/$l2error[$i]) / $hlog;
+    }
+    my $eff = $error[$i]/$estimate[$i];
+    printf "%-3d\t%-7d\t%e\t%e\t%e\t%d\t%f\t%f\t%f\n", $i, $dofs[$i], $error[$i], $estimate[$i], $l2error[$i],
+    $steps[$i], $eff, $energy_order, $l2_order;
 }

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.