[cig-commits] r8201 - mc/3D/CitcomS/trunk/lib

tan2 at geodynamics.org tan2 at geodynamics.org
Thu Nov 1 16:33:30 PDT 2007


Author: tan2
Date: 2007-11-01 16:33:30 -0700 (Thu, 01 Nov 2007)
New Revision: 8201

Modified:
   mc/3D/CitcomS/trunk/lib/Stokes_flow_Incomp.c
Log:
Print dv/v=dp/p=1.0 for the 1st Uzawa iteraion

Modified: mc/3D/CitcomS/trunk/lib/Stokes_flow_Incomp.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Stokes_flow_Incomp.c	2007-11-01 18:35:41 UTC (rev 8200)
+++ mc/3D/CitcomS/trunk/lib/Stokes_flow_Incomp.c	2007-11-01 23:33:30 UTC (rev 8201)
@@ -103,6 +103,27 @@
 
 /* ========================================================================= */
 
+static void print_convergence_progress(struct All_variables *E,
+                                       int count, double time0,
+                                       double sq_vdotv,
+                                       double dvelocity, double dpressure)
+{
+    double CPU_time0();
+
+    fprintf(E->fp, "AhatP (%03d) after %6.2f s v=%.3e  div/v=%.3e "
+            "dv/v=%.3e and dp/p=%.3e for step %d\n",
+            count, CPU_time0()-time0, sq_vdotv,E->monitor.incompressibility,
+            dvelocity, dpressure, E->monitor.solution_cycles);
+    fprintf(stderr, "AhatP (%03d) after %6.2f s v=%.3e div/v=%.3e "
+            "dv/v=%.3e and dp/p=%.3e for step %d\n",
+            count, CPU_time0()-time0, sq_vdotv, E->monitor.incompressibility,
+            dvelocity, dpressure, E->monitor.solution_cycles);
+
+    return;
+}
+
+
+
 static float solve_Ahat_p_fhat(struct All_variables *E,
                                double **V, double **P, double **F,
                                double imp, int *steps_max)
@@ -209,23 +230,17 @@
 
     sq_vdotv = sqrt(E->monitor.vdotv);
 
-    if (E->control.print_convergence && E->parallel.me==0)  {
-        fprintf(E->fp,"AhatP (%03d) after %6.2f s v=%.3e div/v=%.3e "
-                "dv/v=%.3e and dp/p=%.3e for step %d\n",
-                count, CPU_time0()-time0, sq_vdotv,E->monitor.incompressibility,
-                0.0, 0.0, E->monitor.solution_cycles);
-        fflush(E->fp);
-        fprintf(stderr,"AhatP (%03d) after %6.2f s v=%.3e div/v=%.3e "
-                "dv/v=%.3e and dp/p=%.3e for step %d\n",
-                count, CPU_time0()-time0, sq_vdotv,E->monitor.incompressibility,
-                0.0, 0.0, E->monitor.solution_cycles);
-    }
-
-
     /* pressure and velocity corrections */
     dpressure = 1.0;
     dvelocity = 1.0;
 
+
+    if (E->control.print_convergence && E->parallel.me==0)  {
+        print_convergence_progress(E, count, time0, sq_vdotv,
+                                   dvelocity, dpressure);
+    }
+
+
     valid = 1;
     r0dotz0 = 0;
 
@@ -309,15 +324,9 @@
 
 	sq_vdotv = sqrt(E->monitor.vdotv);
 
-        if(E->control.print_convergence && E->parallel.me==0) {
-            fprintf(E->fp, "AhatP (%03d) after %6.2f s v=%.3e  div/v=%.3e "
-                    "dv/v=%.3e and dp/p=%.3e for step %d\n",
-                    count, CPU_time0()-time0, sq_vdotv,E->monitor.incompressibility,
-                    dvelocity, dpressure, E->monitor.solution_cycles);
-            fprintf(stderr, "AhatP (%03d) after %6.2f s v=%.3e div/v=%.3e "
-                    "dv/v=%.3e and dp/p=%.3e for step %d\n",
-                    count, CPU_time0()-time0, sq_vdotv, E->monitor.incompressibility,
-                    dvelocity, dpressure, E->monitor.solution_cycles);
+        if (E->control.print_convergence && E->parallel.me==0)  {
+            print_convergence_progress(E, count, time0, sq_vdotv,
+                                       dvelocity, dpressure);
         }
 
 
@@ -435,24 +444,17 @@
 
     sq_vdotv = sqrt(E->monitor.vdotv);
 
+    /* pressure and velocity corrections */
+    dpressure = 1.0;
+    dvelocity = 1.0;
 
+
     if (E->control.print_convergence && E->parallel.me==0)  {
-        fprintf(E->fp,"AhatP (%03d) after %g s, v=%.3e div/v=%.3e "
-                "dv/v=%.3e and dp/p=%.3e for step %d\n",
-                count, CPU_time0()-time0, sq_vdotv,E->monitor.incompressibility,
-                0.0, 0.0, E->monitor.solution_cycles);
-        fflush(E->fp);
-        fprintf(stderr,"AhatP (%03d) after %g s, v=%.3e div/v=%.3e "
-                "dv/v=%.3e and dp/p=%.3e for step %d\n",
-                count, CPU_time0()-time0, sq_vdotv,E->monitor.incompressibility,
-                0.0, 0.0, E->monitor.solution_cycles);
+        print_convergence_progress(E, count, time0, sq_vdotv,
+                                   dvelocity, dpressure);
     }
 
 
-    /* pressure and velocity corrections */
-    dpressure = 1.0;
-    dvelocity = 1.0;
-
     valid = 1;
     r0dotrt = alpha = omega = 0;
 
@@ -573,18 +575,12 @@
 
 
         count++;
-	
+
 	sq_vdotv = sqrt(E->monitor.vdotv);
 
         if(E->control.print_convergence && E->parallel.me==0) {
-            fprintf(E->fp, "AhatP (%03d) after %g s, v=%.3e, div/v=%.3e "
-                    "dv/v=%.3e and dp/p=%.3e for step %d\n",
-                    count, CPU_time0()-time0, sq_vdotv ,E->monitor.incompressibility,
-                    dvelocity, dpressure, E->monitor.solution_cycles);
-            fprintf(stderr, "AhatP (%03d) after %g s, v=%.3e div/v=%.3e "
-                    "dv/v=%.3e and dp/p=%.3e for step %d\n",
-                    count, CPU_time0()-time0, sq_vdotv,E->monitor.incompressibility,
-                    dvelocity, dpressure, E->monitor.solution_cycles);
+            print_convergence_progress(E, count, time0, sq_vdotv,
+                                       dvelocity, dpressure);
         }
 
 



More information about the cig-commits mailing list