[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
s.popinet at niwa.co.nz
Fri May 15 02:52:31 UTC 2009
The following commit has been merged in the upstream branch:
commit 4d9be5f85c442c0cc2641054d69626c0af905426
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date: Mon Aug 29 08:12:45 2005 +1000
Simplified center-of-mass checks
darcs-hash:20050828221245-fbd8f-9d32d083bcc01f7ecbbb459bb87d849cbe444044.gz
diff --git a/src/solid.c b/src/solid.c
index 4ac74ad..2e9bda5 100644
--- a/src/solid.c
+++ b/src/solid.c
@@ -740,22 +740,6 @@ void gfs_domain_init_solid_fractions (GfsDomain * domain,
gts_object_destroy (GTS_OBJECT (p.status));
}
-static gboolean pos_is_inside (FttVector * p, const FttCell * cell)
-{
- FttVector p1, p2;
- gdouble h = ftt_cell_size (cell)/2.;
-
- ftt_cell_pos (cell, &p1);
- p2.x = (p->x - p1.x)/h;
- p2.y = (p->y - p1.y)/h;
- p2.z = (p->z - p1.z)/h;
- if (fabs (p2.x) > 1. || fabs (p2.y) > 1. || fabs (p2.z) > 1.) {
- g_warning ("cell: (%g,%g,%g) p2: (%g,%g,%g)", p1.x, p1.y, p1.z, p2.x, p2.y, p2.z);
- return FALSE;
- }
- return TRUE;
-}
-
static gboolean check_area_fractions (const FttCell * root)
{
guint i, level;
@@ -768,13 +752,16 @@ static gboolean check_area_fractions (const FttCell * root)
solid = GFS_STATE (root)->solid;
if (solid) {
- if (!pos_is_inside (&solid->cm, root)) {
+ GtsBBox bb;
+
+ ftt_cell_bbox (root, &bb);
+ if (!gts_bbox_point_is_inside (&bb, &solid->cm)) {
g_warning ("file %s: line %d (%s): cm is not inside cell",
__FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION);
ret = FALSE;
g_assert_not_reached ();
}
- if (!pos_is_inside (&solid->ca, root)) {
+ if (!gts_bbox_point_is_inside (&bb, &solid->ca)) {
g_warning ("file %s: line %d (%s): ca is not inside cell",
__FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION);
ret = FALSE;
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list