[cig-commits] r1379 - in branches/s-wang: . source/simulator

s-wang at dealii.org s-wang at dealii.org
Mon Nov 19 09:23:17 PST 2012


Author: s-wang
Date: 2012-11-19 10:23:16 -0700 (Mon, 19 Nov 2012)
New Revision: 1379

Modified:
   branches/s-wang/simple_2d_shell.prm
   branches/s-wang/source/simulator/assembly.cc
   branches/s-wang/source/simulator/core.cc
   branches/s-wang/source/simulator/solver.cc
Log:
petsc solution converges while it takes too many iterations. checking Simulator<dim>::build_stokes_preconditioner() for the paramter of the AMG preconditioner.

Modified: branches/s-wang/simple_2d_shell.prm
===================================================================
--- branches/s-wang/simple_2d_shell.prm	2012-11-19 04:33:02 UTC (rev 1378)
+++ branches/s-wang/simple_2d_shell.prm	2012-11-19 17:23:16 UTC (rev 1379)
@@ -337,7 +337,8 @@
   # 
   # `heat flux statistics': A postprocessor
   # that computes some statistics about the heat flux across boundaries.
-  set List of postprocessors = visualization,velocity statistics,temperature statistics,heat flux statistics, depth average
+  set List of postprocessors = visualization
+  #,velocity statistics,temperature statistics,heat flux statistics, depth average
 
 
   subsection Visualization
@@ -351,7 +352,7 @@
     # value of zero indicates that output should be generated in each time
     # step. Units: years if the 'Use years in output instead of seconds'
     # parameter is set; seconds otherwise.
-    set Time between graphical output = 1e6
+    set Time between graphical output = 0
   end
 
   subsection Depth average

Modified: branches/s-wang/source/simulator/assembly.cc
===================================================================
--- branches/s-wang/source/simulator/assembly.cc	2012-11-19 04:33:02 UTC (rev 1378)
+++ branches/s-wang/source/simulator/assembly.cc	2012-11-19 17:23:16 UTC (rev 1379)
@@ -1111,7 +1111,7 @@
     Mp_preconditioner.reset (new LinearAlgebra::PreconditionILU());
     Amg_preconditioner.reset (new LinearAlgebra::PreconditionAMG());
 
-    LinearAlgebra::PreconditionAMG::AdditionalData Amg_data;
+    LinearAlgebra::PreconditionAMG::AdditionalData Amg_data(true);
     //Amg_data.constant_modes = constant_modes;
     //Amg_data.elliptic = true;
     //Amg_data.higher_order_elements = true;
@@ -1306,7 +1306,7 @@
          internal::Assembly::CopyData::
          StokesSystem<dim> (finite_element));
 
-    system_matrix.compress();
+    system_matrix.compress(dealii::VectorOperation::add);
     system_rhs.compress(dealii::VectorOperation::add);
 
     if (material_model->is_compressible())
@@ -1315,8 +1315,8 @@
 //    system_matrix.block(0,1).write_ascii();
 //    system_matrix.block(1,0).write_ascii();
 //    system_matrix.block(0,0).write_ascii();
-    system_rhs.print(std::cout,7,false,false);
-    exit(0);
+//    system_rhs.print(std::cout,7,false,false);
+//    exit(0);
 
     rebuild_stokes_matrix = false;
 
@@ -1614,8 +1614,8 @@
     system_matrix.compress();
     system_rhs.compress(dealii::VectorOperation::add);
 
-    system_matrix.block(2,2).write_ascii();
-    exit(0);
+//    system_matrix.block(2,2).write_ascii();
+//    exit(0);
 
     computing_timer.exit_section();
   }

Modified: branches/s-wang/source/simulator/core.cc
===================================================================
--- branches/s-wang/source/simulator/core.cc	2012-11-19 04:33:02 UTC (rev 1378)
+++ branches/s-wang/source/simulator/core.cc	2012-11-19 17:23:16 UTC (rev 1379)
@@ -807,7 +807,7 @@
   template <int dim>
   void Simulator<dim>::postprocess ()
   {
-    return;   // shuqiangwang
+//    return;   // shuqiangwang
 
     computing_timer.enter_section ("Postprocessing");
     pcout << "   Postprocessing:" << std::endl;
@@ -1431,6 +1431,7 @@
           }
 
         postprocess ();
+        exit(0);
 
         // see if this is a time step where additional refinement is requested
         // if so, then loop over as many times as this is necessary

Modified: branches/s-wang/source/simulator/solver.cc
===================================================================
--- branches/s-wang/source/simulator/solver.cc	2012-11-19 04:33:02 UTC (rev 1378)
+++ branches/s-wang/source/simulator/solver.cc	2012-11-19 17:23:16 UTC (rev 1379)
@@ -333,8 +333,8 @@
     }
     computing_timer.exit_section();
 
-    solution.block(index+2).print(std::cout,7,false,false);
-    exit(0);
+//    solution.block(index+2).print(std::cout,7,false,false);
+//    exit(0);
 
     return initial_residual;
   }
@@ -383,7 +383,7 @@
 
     // then overwrite it again with the current best guess and solve the linear system
     distributed_stokes_solution.block(0) = remap.block(0);
-    distributed_stokes_solution.block(1) = remap.block(1);
+    distributed_stokes_solution.block(1) = remap.block(1);		distributed_stokes_solution.compress();
 
     // extract Stokes parts of rhs vector
     LinearAlgebra::BlockVector distributed_stokes_rhs;
@@ -398,10 +398,19 @@
     const double solver_tolerance = std::max (parameters.linear_solver_tolerance *
                                               distributed_stokes_rhs.l2_norm(),
                                               1e-12 * initial_residual);
-    SolverControl solver_control_cheap (300, solver_tolerance);
+    SolverControl solver_control_cheap (3000, solver_tolerance);
     SolverControl solver_control_expensive (system_matrix.block(0,1).m() +
                                             system_matrix.block(1,0).m(), solver_tolerance);
 
+//    system_matrix.block(0,0).write_ascii();
+//    system_matrix.block(0,1).write_ascii();
+//    system_matrix.block(1,0).write_ascii();
+//    system_matrix.block(2,2).write_ascii();
+//    distributed_stokes_rhs.print(std::cout,7,true,false);
+//    std::cout << "initial_residual = " << initial_residual << std::endl;
+//    std::cout << "solver_tolerance = " << solver_tolerance << std::endl;
+//    exit(0);
+
     try
       {
         const internal::BlockSchurPreconditioner<LinearAlgebra::PreconditionAMG,
@@ -413,7 +422,7 @@
         SolverGMRES<LinearAlgebra::BlockVector>
         solver(solver_control_cheap, mem,
         		SolverGMRES<LinearAlgebra::BlockVector>::
-               AdditionalData(300, true));
+               AdditionalData(3000, true));
         solver.solve(stokes_block, distributed_stokes_solution,
                      distributed_stokes_rhs, preconditioner);
       }
@@ -445,6 +454,9 @@
     solution.block(0) = distributed_stokes_solution.block(0);
     solution.block(1) = distributed_stokes_solution.block(1);
 
+//    solution.print(std::cout,7,true,false);
+//    exit(0);
+
     // now rescale the pressure back to real physical units
     solution.block(1) *= pressure_scaling;
 



More information about the CIG-COMMITS mailing list