[Commits] [svn:einsteintoolkit] Hydro_Analysis/trunk/src/ (Rev. 108)
knarf at cct.lsu.edu
knarf at cct.lsu.edu
Fri Jun 4 14:27:33 CDT 2010
User: knarf
Date: 2010/06/04 02:27 PM
Modified:
/trunk/src/
Hydro_Analysis.c
Log:
Fix search for density maximum if finer levels do not contain it
File Changes:
Directory: /trunk/src/
======================
File [modified]: Hydro_Analysis.c
Delta lines: +13 -2
===================================================================
--- trunk/src/Hydro_Analysis.c 2010-05-02 20:49:45 UTC (rev 107)
+++ trunk/src/Hydro_Analysis.c 2010-06-04 19:27:33 UTC (rev 108)
@@ -86,10 +86,11 @@
DECLARE_CCTK_PARAMETERS
/* Initialized MPI-local quantities */
- CCTK_REAL local_rho_max_loc[3];
+ CCTK_REAL local_rho_max_loc[4], level_rho_max_loc[4];
local_rho_max_loc[0] = 0.0;
local_rho_max_loc[1] = 0.0;
local_rho_max_loc[2] = 0.0;
+ local_rho_max_loc[3] = 0.0; // Information if it was found at all on this level
/* Look for the location of the global maximum.
* This algorithm will have problems when that occurs at more than
@@ -110,6 +111,7 @@
local_rho_max_loc[0] = x[i3D];
local_rho_max_loc[1] = y[i3D];
local_rho_max_loc[2] = z[i3D];
+ local_rho_max_loc[3] = 1.;
}
}
}
@@ -123,7 +125,16 @@
if (handle_sum < 0)
CCTK_WARN(0, "Unable to get reduction handle 'sum'.");
if (CCTK_ReduceLocArrayToArray1D(cctkGH, -1, handle_sum, &local_rho_max_loc,
- Hydro_Analysis_rho_max_loc, 3, CCTK_VARIABLE_REAL))
+ 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];
+ }
+/* CCTK_VInfo(CCTK_THORNSTRING, "New location: %g,%g,%g",
+ Hydro_Analysis_rho_max_loc[0],
+ Hydro_Analysis_rho_max_loc[1],
+ Hydro_Analysis_rho_max_loc[2]); */
}
More information about the Commits
mailing list