[cig-commits] commit 1923 by heister to /var/svn/dealii/aspect

dealii.demon at gmail.com dealii.demon at gmail.com
Fri Sep 27 11:25:01 PDT 2013


Revision 1923

speed up temperature assembly by a few percent

U   trunk/aspect/source/simulator/assembly.cc


http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=1923&peg=1923

Diff:
Modified: trunk/aspect/source/simulator/assembly.cc
===================================================================
--- trunk/aspect/source/simulator/assembly.cc	2013-09-26 17:40:30 UTC (rev 1922)
+++ trunk/aspect/source/simulator/assembly.cc	2013-09-27 18:24:37 UTC (rev 1923)
@@ -1293,6 +1293,8 @@
 
 
         const Tensor<1,dim> current_u = scratch.current_velocity_values[q];
+        const double factor = (use_bdf2_scheme)? ((2*time_step + old_time_step) /
+                                                  (time_step + old_time_step)) : 1.0;
 
         for (unsigned int i=0; i<dofs_per_cell; ++i)
           {
@@ -1305,12 +1307,10 @@
 
             for (unsigned int j=0; j<dofs_per_cell; ++j)
               {
-                const double factor = (use_bdf2_scheme)? ((2*time_step + old_time_step) /
-                                                          (time_step + old_time_step)) : 1.0;
                 data.local_matrix(i,j)
                 += (
                      (time_step * (conductivity + nu)
-                      * scratch.grad_phi_field[i] * scratch.grad_phi_field[j])
+                      * (scratch.grad_phi_field[i] * scratch.grad_phi_field[j]))
                      + ((time_step * (current_u * scratch.grad_phi_field[j] * scratch.phi_field[i]))
                         + (factor * scratch.phi_field[i] * scratch.phi_field[j])) *
                      density_c_P


More information about the CIG-COMMITS mailing list