[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:53:01 UTC 2009
The following commit has been merged in the upstream branch:
commit 34f13428f75d20e94613ffad21a4885ca0b32124
Author: Stephane Popinet <popinet at users.sf.net>
Date: Thu Jan 19 00:55:04 2006 +1100
New criterion for "small" cells
Each direction is tested independently and the presence or absence of
neighbors is taken into account.
darcs-hash:20060118135504-d4795-defbffd37f2a3e856ea3c78333c28ee9ee1a82d8.gz
diff --git a/src/advection.c b/src/advection.c
index a09379a..e73b6ff 100644
--- a/src/advection.c
+++ b/src/advection.c
@@ -21,9 +21,6 @@
#include "advection.h"
#include "source.h"
-
-#include "solid.h"
-
static gdouble transverse_term (FttCell * cell,
gdouble size,
FttComponent c,
@@ -583,11 +580,27 @@ void gfs_face_reset_normal_velocity (const FttCellFace * face)
GFS_FACE_NORMAL_VELOCITY_LEFT (face) = 0.;
}
+static gboolean is_small (FttCell * cell)
+{
+ GfsSolidVector * solid = GFS_STATE (cell)->solid;
+
+ if (solid) {
+ FttDirection d;
+ FttCellNeighbors n;
+
+ ftt_cell_neighbors (cell, &n);
+ for (d = 0; d < FTT_NEIGHBORS; d++)
+ if (n.c[d] && solid->s[d] > 0. && solid->a/solid->s[d] < 0.5)
+ return TRUE;
+ }
+ return FALSE;
+}
+
static void set_merged (FttCell * cell)
{
GfsSolidVector * solid = GFS_STATE (cell)->solid;
- if (!GFS_IS_SMALL (cell))
+ if (!is_small (cell))
solid->merged = NULL;
else {
FttCellNeighbors neighbor;
diff --git a/src/fluid.h b/src/fluid.h
index b282624..13d1356 100644
--- a/src/fluid.h
+++ b/src/fluid.h
@@ -85,8 +85,6 @@ typedef enum {
GFS_STATE (cell)->solid == NULL)
#define GFS_IS_MIXED(cell) ((cell) != NULL &&\
GFS_STATE (cell)->solid != NULL)
-#define GFS_IS_SMALL(cell) (GFS_IS_MIXED (cell) &&\
- GFS_STATE (cell)->solid->a < 0.5)
#define GFS_CELL_IS_BOUNDARY(cell) (((cell)->flags & GFS_FLAG_BOUNDARY) != 0)
#define GFS_CELL_IS_GRADIENT_BOUNDARY(cell) (((cell)->flags & GFS_FLAG_GRADIENT_BOUNDARY) != 0)
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list