[SCM] Gerris Flow Solver branch, upstream, updated. e8f73a07832050124d2b8bf6c6f35b33180e65a8
Stephane Popinet
popinet at users.sf.net
Tue Nov 24 12:24:06 UTC 2009
The following commit has been merged in the upstream branch:
commit c3c790dbde4e12ed355d6789ae1fc0070dc12710
Author: Stephane Popinet <popinet at users.sf.net>
Date: Wed May 13 19:38:58 2009 +1000
Adaptivity cannot coarsen by more than one level per timestep
darcs-hash:20090513093858-d4795-821cf5f2259a61d7c6467471cb48fa557d7e4529.gz
diff --git a/src/adaptive.c b/src/adaptive.c
index 38b94ad..c859543 100644
--- a/src/adaptive.c
+++ b/src/adaptive.c
@@ -1054,7 +1054,7 @@ static void refine_cell_mark (FttCell * cell, AdaptLocalParams * p)
GfsAdapt * a = i->data;
if (a->active) {
guint maxlevel = gfs_function_value (a->maxlevel, cell);
- if (level < maxlevel && (* a->cost) (cell, a) > a->cmax) {
+ if (FTT_CELL_IS_LEAF (cell) && level < maxlevel && (* a->cost) (cell, a) > a->cmax) {
REFINABLE (cell, p) = TRUE;
COARSENABLE (cell, p) = FALSE;
return;
@@ -1065,6 +1065,11 @@ static void refine_cell_mark (FttCell * cell, AdaptLocalParams * p)
}
i = i->next;
}
+ if (!FTT_CELL_IS_LEAF (cell)) {
+ FttCell * parent = ftt_cell_parent (cell);
+ if (parent)
+ COARSENABLE (parent, p) = FALSE;
+ }
}
static gboolean adapt_local (GfsSimulation * sim, guint * depth, GfsAdaptStats * s)
diff --git a/src/event.c b/src/event.c
index 71e9291..1b7f767 100644
--- a/src/event.c
+++ b/src/event.c
@@ -1610,7 +1610,10 @@ FILE * gfs_popen (GfsSimulation * sim, const char * command, const char * type)
g_return_val_if_fail (type != NULL, NULL);
gchar sname[] = "/tmp/gfsXXXXXX";
- mktemp (sname);
+ if (!mktemp (sname)) {
+ g_warning ("gfs_popen() cannot create unique temporary filename");
+ return NULL;
+ }
if (mkfifo (sname, 0666)) {
g_warning ("gfs_popen() cannot create FIFO: %s", strerror (errno));
return NULL;
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list