]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
more step-32
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 3 May 2013 01:02:19 +0000 (01:02 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 3 May 2013 01:02:19 +0000 (01:02 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29436 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-32/step-32.cc

index 89e1907695a5a44dfe74c18e9dc58dae6df1f846..b250e387dc5a2f1450e05753b22583a75a3d8b24 100644 (file)
@@ -1845,7 +1845,7 @@ namespace Step32
   {
     stokes_matrix.clear ();
 
-#ifdef PETSC_LA    
+#ifdef USE_PETSC_LA
     LA::MPI::CompressedBlockSparsityPattern sp(stokes_partitioning, MPI_COMM_WORLD);
 #else
     LA::MPI::CompressedBlockSparsityPattern sp(stokes_partitioning);    
@@ -2822,15 +2822,28 @@ namespace Step32
 
     if (use_bdf2_scheme == true)
       {
+#ifdef USE_PETSC_LA
+        temperature_matrix = temperature_mass_matrix; // TODO: fast?
+        temperature_matrix *= (2*time_step + old_time_step) /
+                              (time_step + old_time_step);
+        temperature_matrix.add (temperature_stiffness_matrix, time_step);
+       
+#else
         temperature_matrix.copy_from (temperature_mass_matrix);
         temperature_matrix *= (2*time_step + old_time_step) /
                               (time_step + old_time_step);
         temperature_matrix.add (time_step, temperature_stiffness_matrix);
+#endif
       }
     else
       {
+#ifdef USE_PETSC_LA
+        temperature_matrix = temperature_mass_matrix;
+        temperature_matrix.add (temperature_stiffness_matrix, time_step);
+#else
         temperature_matrix.copy_from (temperature_mass_matrix);
         temperature_matrix.add (time_step, temperature_stiffness_matrix);
+#endif
       }
 
     if (rebuild_temperature_preconditioner == true)
@@ -3095,6 +3108,7 @@ namespace Step32
                               };
       double global_temperature[2];
 
+      
       for (unsigned int i=0; i<distributed_temperature_solution.local_size(); ++i)
         {
           temperature[0] = std::min<double> (temperature[0],

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.