[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
s.popinet at niwa.co.nz
Fri May 15 02:51:54 UTC 2009
The following commit has been merged in the upstream branch:
commit 34bd2c49e6efa1c32555c9514775fdb4480277f3
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date: Wed Jun 1 15:54:12 2005 +1000
Restructuring of checks for interpolation in face_bilinear
darcs-hash:20050601055412-fbd8f-629de74e4103c50232ef32bb4051ac6ab63a0c33.gz
diff --git a/src/fluid.c b/src/fluid.c
index 6e3bfa9..cf8abca 100644
--- a/src/fluid.c
+++ b/src/fluid.c
@@ -847,11 +847,17 @@ static gboolean face_bilinear (const FttCellFace * face,
#if FTT_2D
for (i = 0; i < 3; i++) {
FttVector cm;
+ guint j;
(*cell_pos) (n[i + 1], &cm);
- cm.x = (cm.x - o->x)/size;
- cm.y = (cm.y - o->y)/size;
- g_assert (fabs (cm.x) <= 4. && fabs (cm.y) <= 4.);
+
+ for (j = 0; j < FTT_DIMENSION; j++) {
+ (&cm.x)[j] -= (&o->x)[j];
+ /* fixme: this does not work for periodic boundaries */
+ (&cm.x)[j] /= size;
+ g_assert (fabs ((&cm.x)[j]) <= 4.);
+ }
+
m[i][0] = cm.x;
m[i][1] = cm.y;
m[i][2] = cm.x*cm.y;
@@ -900,11 +906,15 @@ static gboolean face_bilinear (const FttCellFace * face,
output_error_mesh (n);
(*cell_pos) (n[i + 1], &cm);
- cm.x = (cm.x - o->x)/size;
- cm.y = (cm.y - o->y)/size;
- cm.z = (cm.z - o->z)/size;
- if (fabs (cm.x) > 4. || fabs (cm.y) > 4. || fabs (cm.z) > 4.)
- output_error_mesh (n);
+
+ for (j = 0; j < FTT_DIMENSION; j++) {
+ (&cm.x)[j] -= (&o->x)[j];
+ /* fixme: this does not work for periodic boundaries */
+ (&cm.x)[j] /= size;
+ if (fabs ((&cm.x)[j]) > 4.)
+ output_error_mesh (n);
+ }
+
m[i][0] = cm.x;
m[i][1] = cm.y;
m[i][2] = cm.z;
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list