[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:54:46 UTC 2009
The following commit has been merged in the upstream branch:
commit e87734e65e675dcac95b3701df6920eea2e4a97f
Author: Stephane Popinet <popinet at users.sf.net>
Date: Wed Oct 10 09:06:14 2007 +1000
New 'cfactor' parameter for GfsAdapt
darcs-hash:20071009230614-d4795-93735957dbecd8b8d4e6d2baf6c08562036cac38.gz
diff --git a/src/adaptive.c b/src/adaptive.c
index b7d5994..5752ca4 100644
--- a/src/adaptive.c
+++ b/src/adaptive.c
@@ -194,6 +194,17 @@ static void gfs_adapt_read (GtsObject ** o, GtsFile * fp)
if (fp->type == GTS_ERROR)
return;
}
+ else if (!strcmp (fp->token->str, "cfactor")) {
+ gts_file_next_token (fp);
+ if (fp->type != '=') {
+ gts_file_error (fp, "expecting '='");
+ return;
+ }
+ gts_file_next_token (fp);
+ a->cfactor = gfs_read_constant (fp, gfs_object_simulation (*o));
+ if (fp->type == GTS_ERROR)
+ return;
+ }
else if (!strcmp (fp->token->str, "c")) {
GfsDomain * domain;
@@ -253,6 +264,8 @@ static void gfs_adapt_write (GtsObject * o, FILE * fp)
fprintf (fp, "cmax = %g ", a->cmax);
if (a->weight != 1.)
fprintf (fp, "weight = %g ", a->weight);
+ if (a->cfactor != 4.)
+ fprintf (fp, "cfactor = %g ", a->cfactor);
if (a->c != NULL)
fprintf (fp, "c = %s ", a->c->name);
fputc ('}', fp);
@@ -290,6 +303,7 @@ static void gfs_adapt_init (GfsAdapt * object)
object->maxcells = G_MAXINT;
object->cmax = 0.;
object->weight = 1.;
+ object->cfactor = 4.;
object->c = NULL;
}
@@ -956,7 +970,7 @@ static void refine_cell_mark (FttCell * cell, AdaptLocalParams * p)
return;
}
if (level < gfs_function_value (a->minlevel, cell) ||
- (* a->cost) (cell, a) > a->cmax/4.)
+ (* a->cost) (cell, a) > a->cmax/a->cfactor)
COARSENABLE (cell, p) = FALSE;
}
i = i->next;
diff --git a/src/adaptive.h b/src/adaptive.h
index c37c109..d3f52c2 100644
--- a/src/adaptive.h
+++ b/src/adaptive.h
@@ -51,7 +51,7 @@ struct _GfsAdapt {
/*< public >*/
GfsFunction * minlevel, * maxlevel;
guint mincells, maxcells;
- gdouble cmax, weight;
+ gdouble cmax, weight, cfactor;
GfsVariable * c;
GtsKeyFunc cost;
};
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list