]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use a more interesting geometry. Precondition the DGQ0 mass matrix, which while diago...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 17 Oct 2007 19:45:08 +0000 (19:45 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 17 Oct 2007 19:45:08 +0000 (19:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@15340 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 43690c31e7a1445870b4f5fd35e5ef67e2960b35..c08c0d5f14c6f2a77056b4b3a0bd2db895a4e654 100644 (file)
@@ -29,6 +29,7 @@
 #include <grid/grid_generator.h>
 #include <grid/tria_accessor.h>
 #include <grid/tria_iterator.h>
+#include <grid/tria_boundary_lib.h>
 #include <grid/grid_tools.h>
 
 #include <dofs/dof_handler.h>
@@ -163,7 +164,7 @@ InitialValues<dim>::value (const Point<dim>  &p,
                            const unsigned int component) const 
 {
   if (component == dim+1)
-    return (p.distance (Point<dim>(.25,.5)) < .1 ? 1 : 0);
+    return (p.distance (Point<dim>(.05,-.95)) < .05 ? 1 : 0);
   else
     return 0;
 }
@@ -378,7 +379,11 @@ BoussinesqFlowProblem<dim>::BoussinesqFlowProblem (const unsigned int degree)
 template <int dim>
 void BoussinesqFlowProblem<dim>::make_grid_and_dofs ()
 {
-  GridGenerator::hyper_cube (triangulation, 0, 1);  
+  GridGenerator::half_hyper_shell (triangulation, Point<dim>(), 0.5, 1.0);
+
+  static HalfHyperShellBoundary<dim> boundary;
+  triangulation.set_boundary (0, boundary);
+  
   triangulation.refine_global (n_refinement_steps);
   
   dof_handler.distribute_dofs (fe); 
@@ -792,11 +797,13 @@ void BoussinesqFlowProblem<dim>::solve ()
     SolverControl solver_control (system_matrix.block(2,2).m(),
                                   1e-8*system_rhs.block(2).l2_norm());
     SolverCG<>   cg (solver_control);
-
+    PreconditionJacobi<> preconditioner;
+    preconditioner.initialize (system_matrix.block(2,2));
+    
     try
       {
        cg.solve (system_matrix.block(2,2), solution.block(2), system_rhs.block(2),
-                 PreconditionIdentity());
+                 preconditioner);
       }
     catch (...)
       {
@@ -929,7 +936,7 @@ void BoussinesqFlowProblem<dim>::run ()
 
       std::cout << std::endl;
     }
-  while (time <= 10);
+  while (time <= 40);
 }
 
     

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.