[cig-commits] [commit] master: Added time statistics to the screen output file for timestep 0 (if Timing output frequency is zero), and add numbers and timing information to the nonlinear itterations. (d5b2d49)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed May 21 08:55:12 PDT 2014


Repository : https://github.com/geodynamics/aspect

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/dda1edd743a39bfe5b21db0f612927a420cf25c5...450a04072c3e64be3c5b43c961481ad07c80df06

>---------------------------------------------------------------

commit d5b2d4956f569548949dbd74501137b95ac66fcd
Author: MFraters <menno.fraters at hotmail.com>
Date:   Tue May 20 21:13:05 2014 +0200

    Added time statistics to the screen output file for timestep 0 (if Timing output frequency is zero), and add numbers and timing information to the nonlinear itterations.


>---------------------------------------------------------------

d5b2d4956f569548949dbd74501137b95ac66fcd
 source/simulator/core.cc   | 4 +++-
 source/simulator/solver.cc | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/source/simulator/core.cc b/source/simulator/core.cc
index 8a27b31..b03bd94 100644
--- a/source/simulator/core.cc
+++ b/source/simulator/core.cc
@@ -1389,6 +1389,7 @@ namespace aspect
                   (parameters.prescribed_velocity_boundary_indicators.size() > 0))
                 rebuild_stokes_matrix = rebuild_stokes_preconditioner = true;
 				
+				//pcout << i+1 << ": ";
               assemble_stokes_system();
               build_stokes_preconditioner();
               const double stokes_residual = solve_stokes();
@@ -1397,7 +1398,7 @@ namespace aspect
                 initial_stokes_residual = stokes_residual;
               else
                 {
-                  pcout << "      residual: " << stokes_residual/initial_stokes_residual << std::endl;
+                  pcout << "      " << i+1 << " residual: " << stokes_residual/initial_stokes_residual << std::endl;
                   if (stokes_residual/initial_stokes_residual < parameters.nonlinear_tolerance)
                     {
                       break; // convergence reached, exist nonlinear iteration.
@@ -1506,6 +1507,7 @@ namespace aspect
         if ((timestep_number == 0) &&
             (pre_refinement_step < parameters.initial_adaptive_refinement))
           {
+			computing_timer.print_summary ();
             output_statistics();
 
             if (parameters.run_postprocessors_on_initial_refinement)
diff --git a/source/simulator/solver.cc b/source/simulator/solver.cc
index 902dab9..a97be0a 100644
--- a/source/simulator/solver.cc
+++ b/source/simulator/solver.cc
@@ -377,6 +377,8 @@ namespace aspect
     computing_timer.enter_section ("   Solve Stokes system");
     pcout << "   Solving Stokes system... " << std::flush;
 	
+	time_t starttime=std::time(NULL); // start timer for the stokes solve
+
     if (parameters.use_direct_stokes_solver)
       {
         LinearAlgebra::BlockVector distributed_stokes_solution (introspection.index_sets.stokes_partitioning, mpi_communicator);
@@ -534,6 +536,8 @@ namespace aspect
     else
       pcout << solver_control_cheap.last_step() << '+'
             << solver_control_expensive.last_step() << " iterations.";
+	//time_t timediff = ; 
+	pcout << " Time: " << std::time(NULL)-starttime << "s."; // calculate and output the time it took to solve the stokes of this the nonlinear itteration
     pcout << std::endl;
 
     statistics.add_value("Iterations for Stokes solver",



More information about the CIG-COMMITS mailing list