]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix performance problem.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 9 Apr 2001 14:29:09 +0000 (14:29 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 9 Apr 2001 14:29:09 +0000 (14:29 +0000)
git-svn-id: https://svn.dealii.org/trunk@4410 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 29e929524131848fc3b83041878c6934a64db817..5843d39490f8ca789c69a2fb96f244ade81b32b1 100644 (file)
@@ -323,15 +323,22 @@ void KellyErrorEstimator<1>::estimate (const Mapping<1>                    &mapp
                                               // the gradients field which
                                               // will be used later on.
              {
-//TODO: [WB] Only ask once, then copy          
                if (n_components==1)
-                 for (unsigned int s=0; s<n_solution_vectors; ++s)
-                   neumann_bc.find(n)->second->value(cell->vertex(0),
-                                                     grad_neighbor[s](0));
+                 {
+                   double v;
+                   neumann_bc.find(n)->second->value(cell->vertex(0), v);
+                   
+                   for (unsigned int s=0; s<n_solution_vectors; ++s)
+                     grad_neighbor[s](0) = v;
+                 }
                else
+                 {
+                   Vector<double> v(n_components);
+                   neumann_bc.find(n)->second->vector_value(cell->vertex(0), v);
+                   
                  for (unsigned int s=0; s<n_solution_vectors; ++s)
-                   neumann_bc.find(n)->second->vector_value(cell->vertex(0),
-                                                            grad_neighbor[s]);
+                   grad_neighbor[s] = v;
+                 };
              }
            else
                                               // fill with zeroes.

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.