]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bug fix and clean-up.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 6 Apr 1998 17:32:08 +0000 (17:32 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 6 Apr 1998 17:32:08 +0000 (17:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@148 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/base.cc

index bae1b0ee03642b75221c7e7dc1b28ceae9ae4f26..69e88f9bfbc68c98d1369a72fd31d99a7bc230c5 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <map.h>
 #include <algo.h>
-
+#include <cmath>
 
 
 
@@ -110,17 +110,18 @@ void ProblemBase<dim>::assemble (const Equation<dim>               &equation,
     }
   while ((++assembler).state() == valid);
 
+                                  // condense system matrix in-place
+  constraints.condense (system_matrix);
+
+                                  // condense right hand side in-place
+  constraints.condense (right_hand_side);
+
                                   // apply Dirichlet bc as described
                                   // in the docs
   apply_dirichlet_bc (system_matrix, solution,
                      right_hand_side,
                      dirichlet_bc, fe);
   
-                                  // condense system matrix in-place
-  constraints.condense (system_matrix);
-
-                                  // condense right hand side in-place
-  constraints.condense (right_hand_side);
 };
 
 
@@ -223,12 +224,6 @@ void ProblemBase<dim>::integrate_difference (const Function<dim>      &exact_sol
            for (unsigned int j=0; j<n_dofs; ++j) 
              for (unsigned int i=0; i<n_dofs; ++i)
                psi[j] -= dof_values[i]*shape_values(i,j);
-           cout << "  Cell = " << cell << ", ";
-           cout << "    Delta = ";
-           for (unsigned int i=0; i<psi.size(); ++i)
-             cout << psi[i] << " ";
-           cout << ", av = " << (psi[0]+psi[1]+psi[2]+psi[3])/4;
-           cout << endl;
 
                                             // for L1_norm and Linfty_norm:
                                             // take absolute
@@ -241,7 +236,7 @@ void ProblemBase<dim>::integrate_difference (const Function<dim>      &exact_sol
                case L1_norm:
                case Linfty_norm:
                      transform (psi.begin(), psi.end(),
-                                psi.begin(), ptr_fun(abs));
+                                psi.begin(), ptr_fun(fabs));
                      break;
                case L2_norm:
                      transform (psi.begin(), psi.end(),
@@ -258,6 +253,10 @@ void ProblemBase<dim>::integrate_difference (const Function<dim>      &exact_sol
              {
                case mean:
                case L1_norm:
+                     diff = inner_product (psi.begin(), psi.end(),
+                                           fe_values.get_JxW_values().begin(),
+                                           0.0);
+                     break;
                case L2_norm:
                      diff = sqrt(inner_product (psi.begin(), psi.end(),
                                                 fe_values.get_JxW_values().begin(),
@@ -268,9 +267,6 @@ void ProblemBase<dim>::integrate_difference (const Function<dim>      &exact_sol
                      break;
              };
            
-           if (norm==L2_norm)
-             diff = sqrt(diff);
-           
            break;
          };
 

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.