]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix small problems.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 28 Apr 1998 12:30:00 +0000 (12:30 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 28 Apr 1998 12:30:00 +0000 (12:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@211 0785d39b-7218-0410-832d-ea1e28bc413d

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

index cf4fad227e6d8d7fbd57e415234ed017e1a97348..da58fa61af4cf96eaa28293297314af3b2435279 100644 (file)
@@ -214,7 +214,7 @@ void ProblemBase<dim>::integrate_difference (const Function<dim>      &exact_sol
            const unsigned int n_dofs = fe.total_dofs;
            const unsigned int n_q_points = q.n_quadrature_points;
            const dFMatrix & shape_values = fe_values.get_shape_values();
-           vector<double>   dof_values;
+           vector<double>   dof_values(fe.total_dofs, 0);
            cell->get_dof_values (solution, dof_values);
            
            vector<double>   psi;
@@ -299,7 +299,7 @@ void ProblemBase<dim>::integrate_difference (const Function<dim>      &exact_sol
            const unsigned int n_dofs = fe.total_dofs;
            const unsigned int n_q_points = q.n_quadrature_points;
            const vector<vector<Point<dim> > > & shape_grads = fe_values.get_shape_grads();
-           vector<double>   dof_values;
+           vector<double>   dof_values(fe.total_dofs, 0);
            cell->get_dof_values (solution, dof_values);
            
            vector<Point<dim> >   psi;
@@ -359,7 +359,7 @@ void ProblemBase<dim>::fill_data (DataOut<dim> &out) const {
 
 template <int dim>
 pair<char*,char*> ProblemBase<dim>::get_solution_name () const {
-  return pair<char*,char*>("solution", "");
+  return pair<char*,char*>("solution", "<dimensionless>");
 };
 
 
index 26250d2fe0c026f560e0e1d8136665d30b463d17..26f568a07c7bacace1221b49a8a88c67f26afdf7 100644 (file)
@@ -59,20 +59,25 @@ void KellyErrorEstimator<dim>::estimate_error (const DoFHandler<dim>    &dof,
                                   // to a face, for the present cell and its
                                   // neighbor.
   FEFaceValues<dim> fe_face_values_cell (fe, quadrature,
-                                        UpdateFlags(update_gradients | update_JxW_values |
-                                                    update_jacobians | update_q_points |
+                                        UpdateFlags(update_gradients  |
+                                                    update_JxW_values |
+                                                    update_jacobians  |
+                                                    update_q_points   |
                                                     update_normal_vectors)); 
   FEFaceValues<dim> fe_face_values_neighbor (fe, quadrature,
-                                            UpdateFlags(update_gradients)); 
+                                            UpdateFlags(update_gradients |
+                                                        update_jacobians));
+
+                                  // loop variables
   DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
                                        endc = dof.end();
-  
                                   // loop over all cells
   for (unsigned int present_cell=0; cell!=endc; ++cell, ++present_cell)
                                     // loop over all faces of this cell
     for (unsigned int face_no=0; face_no<2*dim; ++face_no)
       {
-       const unsigned char boundary_indicator = cell->face(face_no)->boundary_indicator();
+       const unsigned char boundary_indicator
+         = cell->face(face_no)->boundary_indicator();
        if ((boundary_indicator != 255) &&
            neumann_bc.find(boundary_indicator)==neumann_bc.end())
                                           // this face is part of the boundary
@@ -97,13 +102,14 @@ void KellyErrorEstimator<dim>::estimate_error (const DoFHandler<dim>    &dof,
                                         // get a list of the values of
                                         // the solution for the ansatz
                                         // functions on this cell
-       vector<double>   dof_values;
+       vector<double>   dof_values(fe.total_dofs, 0);
        cell->get_dof_values (solution, dof_values);
 
                                         // get a list of the gradients of
                                         // the ansatz functions on this
                                         // cell at the quadrature points
-       const vector<vector<Point<dim> > > &shape_grads(fe_face_values_cell.get_shape_grads());
+       const vector<vector<Point<dim> > > &shape_grads(fe_face_values_cell.
+                                                       get_shape_grads());
 
                                         // compute the gradients of the solution
                                         // at the quadrature points by summing
@@ -123,7 +129,8 @@ void KellyErrorEstimator<dim>::estimate_error (const DoFHandler<dim>    &dof,
            Assert (cell->neighbor(face_no).state() == valid,
                    ExcInternalError());
            unsigned int neighbor_neighbor;
-           DoFHandler<dim>::active_cell_iterator neighbor = cell->neighbor(face_no);
+           DoFHandler<dim>::active_cell_iterator neighbor
+             = cell->neighbor(face_no);
 
                                             // find which number the current
                                             // face has relative to the neighboring
@@ -137,7 +144,8 @@ void KellyErrorEstimator<dim>::estimate_error (const DoFHandler<dim>    &dof,
                                             // get restriction of finite element
                                             // function of #neighbor# to the
                                             // common face.
-           fe_face_values_neighbor.reinit (neighbor, neighbor_neighbor, fe, boundary);
+           fe_face_values_neighbor.reinit (neighbor, neighbor_neighbor,
+                                           fe, boundary);
 
                                             // get a list of the values of
                                             // the solution for the ansatz
@@ -178,7 +186,8 @@ void KellyErrorEstimator<dim>::estimate_error (const DoFHandler<dim>    &dof,
                                         //
                                         // let phi be the name of the integrand
        vector<double> phi(n_q_points,0);
-       const vector<Point<dim> > &normal_vectors(fe_face_values_cell.get_normal_vectors());
+       const vector<Point<dim> > &normal_vectors(fe_face_values_cell.
+                                                 get_normal_vectors());
        for (unsigned int point=0; point<n_q_points; ++point)
          phi[point] = psi[point]*normal_vectors[point];
        
@@ -222,7 +231,7 @@ void KellyErrorEstimator<dim>::estimate_error (const DoFHandler<dim>    &dof,
        error(present_cell)
          += sqrt(inner_product (phi.begin(), phi.end(),
                                 fe_face_values_cell.get_JxW_values().begin(),
-                                0.0));
+                                0.0)) * cell->diameter();
       };
 };
 

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.