[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:53:10 UTC 2009
The following commit has been merged in the upstream branch:
commit f71cf048454f345a2353180dc02674ea033fccd9
Author: Stephane Popinet <popinet at users.sf.net>
Date: Fri Mar 24 11:10:56 2006 +1100
RefineDistance uses a lower-bound for the distance...
... rather than the distance from the center of the cell.
darcs-hash:20060324001056-d4795-5e8daa10b37fa872ca1737cfc444049ce5423d34.gz
diff --git a/src/refine.c b/src/refine.c
index f95fbc2..5958059 100644
--- a/src/refine.c
+++ b/src/refine.c
@@ -386,12 +386,14 @@ static gdouble cell_distance (FttCell * cell,
GfsRefineDistance * refine)
{
FttVector pos;
+ gdouble h = GFS_DIAGONAL*ftt_cell_size (cell), d;
GtsPoint p;
ftt_cell_pos (cell, &pos);
p.x = pos.x; p.y = pos.y; p.z = pos.z;
- return gts_bb_tree_point_distance (refine->stree, &p,
- (GtsBBoxDistFunc) gts_point_triangle_distance, NULL);
+ d = gts_bb_tree_point_distance (refine->stree, &p,
+ (GtsBBoxDistFunc) gts_point_triangle_distance, NULL);
+ return d > h ? d - h : 0.;
}
static void refine_distance_read (GtsObject ** o, GtsFile * fp)
diff --git a/src/refine.h b/src/refine.h
index eb36d05..b08d2ab 100644
--- a/src/refine.h
+++ b/src/refine.h
@@ -26,6 +26,12 @@ extern "C" {
#include "simulation.h"
+#if FTT_2D
+# define GFS_DIAGONAL 0.707106781187
+#else /* 3D */
+# define GFS_DIAGONAL 0.866025403785
+#endif /* 3D */
+
/* GfsRefine: Header */
typedef struct _GfsRefine GfsRefine;
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list