--- /dev/null
+######################################################################
+# $Id$
+######################################################################
+# Postprocess logstream output and create a data file for gnuplot
+######################################################################
+
+use strict;
+
+my $step; # The iteration step in the adaptive loop
+my @dofs; # The number of degrees of freedom in each step
+my @error; # The error of the solution
+my @estimate; # The a posteriori error estimate
+
+while(<>)
+{
+ $step = $1 if m/DEAL::Step\s*(\d+)/;
+ $dofs[$step] = $1 if m/DEAL::DoFHandler\s*(\d+)/;
+ $error[$step] = $1 if m/DEAL::Error\s*(\S+)/;
+ $estimate[$step] = $1 if m/DEAL::Estimate\s*(\S+)/;
+}
+
+for (my $i=0;$i<=$step;++$i)
+{
+ printf "%-3d\t%-7d\t%g\t%g\n", $i, $dofs[$i], $error[$i], $estimate[$i];
+}
// This is the function we use to set
// the boundary values and also the
// exact solution we compare to.
-Functions::LSingularityFunction exact_solution;
+Functions::SlitSingularityFunction<2> exact_solution;
// @sect3{The local integrators}
const double t = dinfo.cell->diameter() * trace(DDuh[k]);
dinfo.value(0) += t*t * fe.JxW(k);
}
+ dinfo.value(0) = std::sqrt(dinfo.value(0));
}
for (unsigned k=0;k<fe.n_quadrature_points;++k)
dinfo.value(0) += penalty * (boundary_values[k] - uh[k]) * (boundary_values[k] - uh[k])
- * fe.JxW(k);
+ * fe.JxW(k);
+ dinfo.value(0) = std::sqrt(dinfo.value(0));
}
dinfo1.value(0) += (penalty * diff1*diff1 + h * diff2*diff2)
* fe.JxW(k);
}
+ dinfo1.value(0) = std::sqrt(dinfo1.value(0));
dinfo2.value(0) = dinfo1.value(0);
}
dof_handler(mg_dof_handler),
estimates(1)
{
- GridGenerator::hyper_L(triangulation, -1, 1);
+ GridGenerator::hyper_cube_slit(triangulation, -1, 1);
}
QGauss<dim> quadrature(n_gauss_points);
VectorTools::integrate_difference(mapping, dof_handler, solution, exact_solution,
- cell_errors, quadrature, VectorTools::L2_norm);
+ cell_errors, quadrature, VectorTools::H1_norm);
deallog << "Error " << cell_errors.l2_norm() << std::endl;
}
std::string filename(fn);
filename += ".gnuplot";
- std::cout << "Writing solution to <" << filename << ">..."
- << std::endl << std::endl;
+ deallog << "Writing solution to <" << filename << ">..."
+ << std::endl << std::endl;
std::ofstream gnuplot_output (filename.c_str());
DataOut<dim> data_out;
int main()
{
- deallog.log_execution_time(true);
+ std::ofstream logfile("step-39.log");
+ deallog.attach(logfile);
FE_DGQ<2> fe1(3);
Step39<2> test1(fe1);
test1.run(20);