]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Clean out computation of errors (put into a new test case).
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 8 Apr 1998 13:20:16 +0000 (13:20 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 8 Apr 1998 13:20:16 +0000 (13:20 +0000)
git-svn-id: https://svn.dealii.org/trunk@160 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/Attic/examples/poisson/problem.cc
tests/big-tests/poisson/problem.cc

index 6bf93f118f1d0846c2ddb30510df99c4660fd876..93b15092da6e3340c92ad7feaef3455fd1da2735 100644 (file)
@@ -85,18 +85,6 @@ class RHSPoly : public Function<dim> {
 
 
 
-template <int dim>
-class Solution : public Function<dim> {
-  public:
-                                    /**
-                                     * Return the value of the function
-                                     * at the given point.
-                                     */
-    virtual double operator () (const Point<dim> &p) const;
-};
-
-
-
 
 
 
@@ -159,15 +147,6 @@ double RHSPoly<dim>::operator () (const Point<dim> &p) const {
 };
 
 
-template <int dim>
-double Solution<dim>::operator () (const Point<dim> &p) const {
-  double ret_val = 1;
-  for (unsigned int i=0; i<dim; ++i)
-    ret_val *= p(i)*(1.-p(i));
-  return ret_val;
-};
-
-
 
 
 
@@ -467,45 +446,13 @@ void PoissonProblem<dim>::run (ParameterHandler &prm) {
   cout << "    Writing to file <" << prm.get("Output file") << ">..."
        << endl;
 
-  Solution<dim> sol;
-  dVector       l1_error_per_cell, l2_error_per_cell, linfty_error_per_cell;
-  QGauss4<dim>  q;
-  
-  cout << "    Calculating L1 error... ";
-  integrate_difference (sol, l1_error_per_cell, q, fe, L1_norm);
-  cout << l1_error_per_cell.l1_norm() << endl;
-
-  cout << "    Calculating L2 error... ";
-  integrate_difference (sol, l2_error_per_cell, q, fe, L2_norm);
-  cout << l2_error_per_cell.l2_norm() << endl;
-
-  cout << "    Calculating L-infinity error... ";
-  integrate_difference (sol, linfty_error_per_cell, q, fe, Linfty_norm);
-  cout << linfty_error_per_cell.linfty_norm() << endl;
-
-  dVector l1_error_per_dof, l2_error_per_dof, linfty_error_per_dof;
-  dof->distribute_cell_to_dof_vector (l1_error_per_cell, l1_error_per_dof);
-  dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof);
-  dof->distribute_cell_to_dof_vector (linfty_error_per_cell, linfty_error_per_dof);
-
   DataOut<dim> out;
   String o_filename = prm.get ("Output file");
   ofstream gnuplot(o_filename);
   fill_data (out);
-  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, "L3-Error");
   out.write_gnuplot (gnuplot);
   gnuplot.close ();
 
-  cout << "Errors: "
-       << dof->n_dofs() << "    "
-       << l1_error_per_cell.l1_norm() << " "
-       << l2_error_per_cell.l2_norm() << " "
-       << linfty_error_per_cell.linfty_norm() << endl;
-    
-
-
   cout << endl;
 };
 
index 6bf93f118f1d0846c2ddb30510df99c4660fd876..93b15092da6e3340c92ad7feaef3455fd1da2735 100644 (file)
@@ -85,18 +85,6 @@ class RHSPoly : public Function<dim> {
 
 
 
-template <int dim>
-class Solution : public Function<dim> {
-  public:
-                                    /**
-                                     * Return the value of the function
-                                     * at the given point.
-                                     */
-    virtual double operator () (const Point<dim> &p) const;
-};
-
-
-
 
 
 
@@ -159,15 +147,6 @@ double RHSPoly<dim>::operator () (const Point<dim> &p) const {
 };
 
 
-template <int dim>
-double Solution<dim>::operator () (const Point<dim> &p) const {
-  double ret_val = 1;
-  for (unsigned int i=0; i<dim; ++i)
-    ret_val *= p(i)*(1.-p(i));
-  return ret_val;
-};
-
-
 
 
 
@@ -467,45 +446,13 @@ void PoissonProblem<dim>::run (ParameterHandler &prm) {
   cout << "    Writing to file <" << prm.get("Output file") << ">..."
        << endl;
 
-  Solution<dim> sol;
-  dVector       l1_error_per_cell, l2_error_per_cell, linfty_error_per_cell;
-  QGauss4<dim>  q;
-  
-  cout << "    Calculating L1 error... ";
-  integrate_difference (sol, l1_error_per_cell, q, fe, L1_norm);
-  cout << l1_error_per_cell.l1_norm() << endl;
-
-  cout << "    Calculating L2 error... ";
-  integrate_difference (sol, l2_error_per_cell, q, fe, L2_norm);
-  cout << l2_error_per_cell.l2_norm() << endl;
-
-  cout << "    Calculating L-infinity error... ";
-  integrate_difference (sol, linfty_error_per_cell, q, fe, Linfty_norm);
-  cout << linfty_error_per_cell.linfty_norm() << endl;
-
-  dVector l1_error_per_dof, l2_error_per_dof, linfty_error_per_dof;
-  dof->distribute_cell_to_dof_vector (l1_error_per_cell, l1_error_per_dof);
-  dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof);
-  dof->distribute_cell_to_dof_vector (linfty_error_per_cell, linfty_error_per_dof);
-
   DataOut<dim> out;
   String o_filename = prm.get ("Output file");
   ofstream gnuplot(o_filename);
   fill_data (out);
-  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, "L3-Error");
   out.write_gnuplot (gnuplot);
   gnuplot.close ();
 
-  cout << "Errors: "
-       << dof->n_dofs() << "    "
-       << l1_error_per_cell.l1_norm() << " "
-       << l2_error_per_cell.l2_norm() << " "
-       << linfty_error_per_cell.linfty_norm() << endl;
-    
-
-
   cout << endl;
 };
 

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.