[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203

Stephane Popinet popinet at users.sf.net
Fri May 15 02:54:42 UTC 2009


The following commit has been merged in the upstream branch:
commit 08fc52d97e4d39b11fb038f38c37690ed71dd01a
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Fri Sep 14 11:28:16 2007 +1000

    New option 'data' for gerris (when splitting or partitioning)
    
    darcs-hash:20070914012816-d4795-bffa4bd436afa6a00bb7dc6c0cf78b4464d625df.gz

diff --git a/src/gerris.c b/src/gerris.c
index e295fb8..15c0838 100644
--- a/src/gerris.c
+++ b/src/gerris.c
@@ -51,6 +51,7 @@ int main (int argc, char * argv[])
   guint npart = 0;
   gboolean profile = FALSE, macros = FALSE;
   gchar * m4_options = g_strdup ("-P");
+  gint maxlevel = -2;
 
   gfs_init (&argc, &argv);
 
@@ -63,15 +64,16 @@ int main (int argc, char * argv[])
       {"profile", no_argument, NULL, 'P'},
       {"define", required_argument, NULL, 'D'},
       {"macros", no_argument, NULL, 'm'},
+      {"data", no_argument, NULL, 'd'},
       {"help", no_argument, NULL, 'h'},
       {"version", no_argument, NULL, 'V'},
       { NULL }
     };
     int option_index = 0;
-    switch ((c = getopt_long (argc, argv, "hVs:p:PD:m",
+    switch ((c = getopt_long (argc, argv, "hVs:p:PD:md",
 			      long_options, &option_index))) {
 #else /* not HAVE_GETOPT_LONG */
-    switch ((c = getopt (argc, argv, "hVs:p:PD:m"))) {
+    switch ((c = getopt (argc, argv, "hVs:p:PD:md"))) {
 #endif /* not HAVE_GETOPT_LONG */
     case 'P': /* profile */
       profile = TRUE;
@@ -91,6 +93,9 @@ int main (int argc, char * argv[])
     case 'm': /* macros */
       macros = TRUE;
       break;
+    case 'd': /* data */
+      maxlevel = -1;
+      break;
     case 'h': /* help */
       fprintf (stderr,
              "Usage: gerris [OPTION] FILE\n"
@@ -100,6 +105,7 @@ int main (int argc, char * argv[])
              "                       the corresponding simulation\n"
              "  -p N   --partition=N partition the domain in 2^N subdomains and returns\n" 
              "                       the corresponding simulation\n"
+	     "  -d     --data        when splitting or partitioning, output all data\n"
 	     "  -P     --profile     profiles calls to boundary conditions\n"
 #ifdef HAVE_M4
 	     "  -m     --macros      Turn macros support on\n"
@@ -152,7 +158,6 @@ int main (int argc, char * argv[])
       command = g_strjoin (NULL, awk, argv[optind], " | m4 ", m4_options, NULL);
     fptr = popen (command, "r");
     g_free (command);
-    g_free (m4_options);
   }
   else { /* no macros */
     if (!strcmp (argv[optind], "-"))
@@ -160,6 +165,7 @@ int main (int argc, char * argv[])
     else
       fptr = fopen (argv[optind], "r");
   }
+  g_free (m4_options);
 
   if (fptr == NULL) {
     fprintf (stderr, "gerris: unable to open file `%s'\n", argv[optind]);
@@ -202,6 +208,7 @@ int main (int argc, char * argv[])
     partition = gts_graph_recursive_bisection (GTS_WGRAPH (simulation),
 					       npart, 
 					       ntry, mmax, nmin, imbalance);
+
     i = partition;
     while (i) {
       gts_container_foreach (GTS_CONTAINER (i->data), 
@@ -211,7 +218,7 @@ int main (int argc, char * argv[])
     }
     gts_graph_partition_print_stats (partition, stderr);
     gts_graph_partition_destroy (partition);
-    gfs_simulation_write (simulation, -2, stdout);
+    gfs_simulation_write (simulation, maxlevel, stdout);
     return 0;
   }
 
@@ -224,7 +231,7 @@ int main (int argc, char * argv[])
       gfs_domain_split (domain, TRUE);
       split--;
     }
-    gfs_simulation_write (simulation, -2, stdout);
+    gfs_simulation_write (simulation, maxlevel, stdout);
     return 0;
   }
 

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list