]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Scale the pressure variable into physical units right after
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 23 Sep 2011 00:16:15 +0000 (00:16 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 23 Sep 2011 00:16:15 +0000 (00:16 +0000)
solving. Scale the initial guess right before solving.

git-svn-id: https://svn.dealii.org/trunk@24380 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 8f7c09449043fd028c50e725108af649ab178369..6e967ad51639cdffc78a32f71abd2ed3ef292fec 100644 (file)
@@ -3166,6 +3166,11 @@ namespace Step32
       distributed_stokes_solution.block(0).reinit(stokes_solution.block(0),false,true);
       distributed_stokes_solution.block(1).reinit(stokes_solution.block(1),false,true);
 
+                                      // before solving we scale the
+                                      // initial solution to the right
+                                      // dimensions
+      distributed_stokes_solution.block(1) /= EquationData::MaterialModel::pressure_scaling;
+
 
       const unsigned int
        start = (distributed_stokes_solution.block(0).size() +
@@ -3232,6 +3237,11 @@ namespace Step32
 
 
       stokes_constraints.distribute (distributed_stokes_solution);
+
+                                      // now rescale the pressure
+                                      // back to real physical units
+      distributed_stokes_solution.block(1) *= EquationData::MaterialModel::pressure_scaling;
+
       stokes_solution.block(0).reinit(distributed_stokes_solution.block(0),
                                      false, true);
       stokes_solution.block(1).reinit(distributed_stokes_solution.block(1),
@@ -3455,7 +3465,7 @@ namespace Step32
            = (uh[q](d) *  EquationData::year_in_seconds * 100);
 
                                         // pressure
-       const double pressure = (uh[q](dim)-minimal_pressure) * EquationData::pressure_scaling;
+       const double pressure = (uh[q](dim)-minimal_pressure);
        computed_quantities[q](dim) = pressure;
 
                                         // temperature

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.