]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Hopefully fix a bug in arrays that were accessed in the wrong order.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 5 Jun 1999 20:53:03 +0000 (20:53 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 5 Jun 1999 20:53:03 +0000 (20:53 +0000)
git-svn-id: https://svn.dealii.org/trunk@1370 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 587ff508139ef83d06c924b649da575d217a7545..a1ecfd31b6f39c610744f803d5c59a95363402e3 100644 (file)
@@ -317,11 +317,11 @@ integrate_over_regular_face (const active_cell_iterator &cell,
     fe_face_values_cell.get_function_grads (solution, psi);
   else
     {
-      vector<vector<Tensor<1,dim> > > tmp (n_components,
-                                          psi);
+      vector<vector<Tensor<1,dim> > > tmp (n_q_points,
+                                          vector<Tensor<1,dim> >(n_components));
       fe_face_values_cell.get_function_grads (solution, tmp);
-
-      psi.swap (tmp[selected_component]);
+      for (unsigned int i=0; i<n_q_points; ++i)
+       psi[i] = tmp[i][selected_component];
     };
   
   
@@ -361,10 +361,11 @@ integrate_over_regular_face (const active_cell_iterator &cell,
        fe_face_values_neighbor.get_function_grads (solution, neighbor_psi);
       else
        {
-         vector<vector<Tensor<1,dim> > > tmp (n_components,
-                                              neighbor_psi);
+         vector<vector<Tensor<1,dim> > > tmp (n_q_points,
+                                              vector<Tensor<1,dim> >(n_components));
          fe_face_values_neighbor.get_function_grads (solution, tmp);
-         neighbor_psi.swap (tmp[selected_component]);
+         for (unsigned int i=0; i<n_q_points; ++i)
+           psi[i] = tmp[i][selected_component];
        };
 
       
@@ -518,10 +519,11 @@ integrate_over_irregular_face (const active_cell_iterator &cell,
        fe_subface_values.get_function_grads (solution, psi);
       else
        {
-         vector<vector<Tensor<1,dim> > > tmp (n_components,
-                                              psi);
+         vector<vector<Tensor<1,dim> > > tmp (n_q_points,
+                                              vector<Tensor<1,dim> >(n_components));
          fe_subface_values.get_function_grads (solution, tmp);
-         psi.swap (tmp[selected_component]);
+         for (unsigned int i=0; i<n_q_points; ++i)
+           psi[i] = tmp[i][selected_component];
        };
 
                                       // restrict the finite element on the
@@ -533,10 +535,11 @@ integrate_over_irregular_face (const active_cell_iterator &cell,
        fe_face_values.get_function_grads (solution, neighbor_psi);
       else
        {
-         vector<vector<Tensor<1,dim> > > tmp (n_components,
-                                              neighbor_psi);
+         vector<vector<Tensor<1,dim> > > tmp (n_q_points,
+                                              vector<Tensor<1,dim> >(n_components));
          fe_face_values.get_function_grads (solution, tmp);
-         neighbor_psi.swap (tmp[selected_component]);
+         for (unsigned int i=0; i<n_q_points; ++i)
+           psi[i] = tmp[i][selected_component];
        };
       
                                       // compute the jump in the gradients

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.