]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Finish documentation.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 12 Feb 2006 23:54:51 +0000 (23:54 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 12 Feb 2006 23:54:51 +0000 (23:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@12341 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 9d69e9eaf58f00ed9349300795fed334db024da4..5aac1cc90b31e234c7100fe4c95fb25e2b58f78a 100644 (file)
@@ -1272,30 +1272,73 @@ void MixedLaplaceProblem<dim>::compute_errors () const
 }
 
 
+                                 // @sect4{MixedLaplace::output_results}
+
+                                 // The last interesting function is
+                                 // the one in which we generate
+                                 // graphical output. Everything here
+                                 // looks obvious and familiar. Note
+                                 // how we construct unique names for
+                                 // all the solution variables at the
+                                 // beginning, like we did in step-8
+                                 // and other programs later on. The
+                                 // only thing worth mentioning is
+                                 // that for higher order elements, in
+                                 // seems inappropriate to only show a
+                                 // single bilinear quadrilateral per
+                                 // cell in the graphical output. We
+                                 // therefore generate patches of size
+                                 // (degree+1)x(degree+1) to capture
+                                 // the full information content of
+                                 // the solution. See the step-7
+                                 // tutorial program for more
+                                 // information on this.
 template <int dim>
 void MixedLaplaceProblem<dim>::output_results () const
 {
+  std::vector<std::string> solution_names;
+  switch (dim)
+    {
+      case 2:
+            solution_names.push_back ("u");
+            solution_names.push_back ("v");
+            solution_names.push_back ("p");
+            break;
+            
+      case 3:
+            solution_names.push_back ("u");
+            solution_names.push_back ("v");
+            solution_names.push_back ("w");
+            solution_names.push_back ("p");
+            break;
+            
+      default:
+            Assert (false, ExcNotImplemented());
+    }
+  
+  
   DataOut<dim> data_out;
 
   data_out.attach_dof_handler (dof_handler);
-  data_out.add_data_vector (solution, "solution");
+  data_out.add_data_vector (solution, solution_names);
 
   data_out.build_patches (degree+1);
 
-  std::ofstream output (dim == 2 ?
-                       "solution-2d.gmv" :
-                       "solution-3d.gmv");
+  std::ofstream output ("solution.gmv");
   data_out.write_gmv (output);
 }
 
 
 
+                                 // @sect4{MixedLaplace::run}
+
+                                 // This is the final function of our
+                                 // main class. It's only job is to
+                                 // call the other functions in their
+                                 // natural order:
 template <int dim>
 void MixedLaplaceProblem<dim>::run () 
 {
-  std::cout << "Solving problem in " << dim
-            << " space dimensions." << std::endl;
-  
   make_grid_and_dofs();
   assemble_system ();
   solve ();

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.