[Commits] [svn:einsteintoolkit] Hydro_Analysis/trunk/src/ (Rev. 112)

knarf at cct.lsu.edu knarf at cct.lsu.edu
Wed Sep 22 09:14:00 CDT 2010


User: knarf
Date: 2010/09/22 09:14 AM

Modified:
 /trunk/src/
  Hydro_Analysis.c

Log:
 complain when multiple maxima have been found

File Changes:

Directory: /trunk/src/
======================

File [modified]: Hydro_Analysis.c
Delta lines: +9 -4
===================================================================
--- trunk/src/Hydro_Analysis.c	2010-08-18 18:54:33 UTC (rev 111)
+++ trunk/src/Hydro_Analysis.c	2010-09-22 14:14:00 UTC (rev 112)
@@ -127,10 +127,15 @@
   if (CCTK_ReduceLocArrayToArray1D(cctkGH, -1, handle_sum, &local_rho_max_loc,
                                    level_rho_max_loc, 4, CCTK_VARIABLE_REAL))
     CCTK_WARN(0, "Error while reducing local_rho_max_loc");
-  if (level_rho_max_loc[3]) {
-    Hydro_Analysis_rho_max_loc[0] = level_rho_max_loc[0];
-    Hydro_Analysis_rho_max_loc[1] = level_rho_max_loc[1];
-    Hydro_Analysis_rho_max_loc[2] = level_rho_max_loc[2];
+  if (fabs(level_rho_max_loc[3]) < 1.e-14) {
+    if (fabs(level_rho_max_loc[3]-1.) < 1.e-14)
+    {
+      Hydro_Analysis_rho_max_loc[0] = level_rho_max_loc[0];
+      Hydro_Analysis_rho_max_loc[1] = level_rho_max_loc[1];
+      Hydro_Analysis_rho_max_loc[2] = level_rho_max_loc[2];
+    } else
+      CCTK_WARN(1, "Found more than one identical maximum, not setting anything.");
+
   }
 /*  CCTK_VInfo(CCTK_THORNSTRING, "New location: %g,%g,%g",
     Hydro_Analysis_rho_max_loc[0],



More information about the Commits mailing list