]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Revert unintended change to mglocal.cc
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 14 Nov 2000 16:47:25 +0000 (16:47 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 14 Nov 2000 16:47:25 +0000 (16:47 +0000)
git-svn-id: https://svn.dealii.org/trunk@3489 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/mglocal.cc

index d750477fdd934cc32fe49a6e7624725f346bf816..90fff768cac3eedb622c7877859d9d8277cff56d 100644 (file)
@@ -23,7 +23,6 @@
 #include <lac/precondition.h>
 #include <grid/tria.h>
 #include <grid/tria_iterator.h>
-#include <grid/grid_out.h>
 #include <multigrid/mg_dof_handler.h>
 #include <dofs/dof_constraints.h>
 #include <dofs/dof_accessor.h>
@@ -74,7 +73,7 @@ int main()
   logfile.precision (3);
   deallog.attach(logfile);
 //  deallog.log_execution_time(true);
-  deallog.depth_console(10);
+  deallog.depth_console(0);
 
   Helmholtz equation;
   RHSFunction<2> rhs;
@@ -84,9 +83,9 @@ int main()
   FEQ2<2> fe2;
   FEQ3<2> fe3;
   FEQ4<2> fe4;
-  for (unsigned int degree=1;degree<=1;degree++)
+  for (unsigned int degree=1;degree<=3;degree++)
     {
-      Triangulation<2> tr(Triangulation<2>::maximum_smoothing);
+      Triangulation<2> tr;
       MGDoFHandler<2> mgdof(tr);
       DoFHandler<2>& dof(mgdof);
   
@@ -102,38 +101,11 @@ int main()
        }
 
       tr.refine_global(1);
-
-      Triangulation<2>::active_cell_iterator cell, endc;
-      for (int i=0; i<8; ++i) 
-       {
-         int n_levels = tr.n_levels();
-         cell = tr.begin_active();
-         endc = tr.end();
-         
-         for (; cell!=endc; ++cell) 
-           {
-             double r      = rand()*1.0/RAND_MAX,
-                    weight = 1.*
-                             (cell->level()*cell->level()) /
-                             (n_levels*n_levels);
-             
-             if (r <= 0.5*weight)
-               cell->set_refine_flag ();
-           };
-         
-         tr.execute_coarsening_and_refinement ();
-       };
-//        Triangulation<2>::active_cell_iterator cell = tr.begin_active();
-//        cell->set_refine_flag();
+      Triangulation<2>::active_cell_iterator cell = tr.begin_active();
+      cell->set_refine_flag();
       tr.execute_coarsening_and_refinement();
 
-//      tr.refine_global(4);
-      if (true)
-       {
-         ofstream x ("T");
-         GridOut().write_eps (tr, x);
-       };
-      
+      tr.refine_global(1);
       dof.distribute_dofs(*fe);
       const unsigned int size = dof.n_dofs();
       deallog << "DoFs " << size << endl;
@@ -194,7 +166,7 @@ int main()
          SolverCG<> cgsolver(cgcontrol, cgmem);
          PreconditionIdentity cgprec;
          MGCoarseGridLACIteration<SolverCG<>, SparseMatrix<double>, PreconditionIdentity>
-           coarse(cgsolver, mgA[0], cgprec);
+           coarse(cgsolver, mgA[tr.n_levels()-2], cgprec);
          
          MGSmootherRelaxation<double>
            smoother(mgdof, mgA, &SparseMatrix<double>::template precondition_SSOR<double>,
@@ -205,7 +177,7 @@ int main()
          transfer.build_matrices(mgdof);
 
 
-Multigrid<2> multigrid(mgdof, hanging_nodes, mgstruct, mgA, transfer, 0);
+Multigrid<2> multigrid(mgdof, hanging_nodes, mgstruct, mgA, transfer, tr.n_levels()-2);
          PreconditionMG<Multigrid<2> >
            mgprecondition(multigrid, smoother, smoother, coarse);
 

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.