diff options
Diffstat (limited to 'src/IsoSurfacer.c')
-rw-r--r-- | src/IsoSurfacer.c | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/src/IsoSurfacer.c b/src/IsoSurfacer.c index 7db611b..e48a8a7 100644 --- a/src/IsoSurfacer.c +++ b/src/IsoSurfacer.c @@ -286,29 +286,46 @@ static void computeIso(int vindex, const cGH *GH, isosurfacerGH *myGH) free (fullname); } -int IsoSurfacer(const cGH *GH){ +int IsoSurfacer (const cGH *GH) +{ + int i, n, retval; + isosurfacerGH *myGH; DECLARE_CCTK_PARAMETERS - int i,n; - isosurfacerGH *myGH = (isosurfacerGH *) GH->extensions [CCTK_GHExtensionHandle ("IsoSurfacer")]; - if(!myGH->RunIsoSurfacer) return 0; /* not running */ - IsoSurfacerHandleCommands(GH); + + + myGH = (isosurfacerGH *) CCTK_GHExtension (GH, "IsoSurfacer"); + + if (! myGH->RunIsoSurfacer) + { + return (0); /* not running */ + } + + IsoSurfacerHandleCommands (GH); myGH->isovalue=isovalue; /* take the contents of the "steered" isosurface value and put it here */ /* do a check for new isosurfaces */ /* Perhaps do a bcast for "changed" flags. which are embedded in each iso. */ - for (i = 0,n=CCTK_NumVars(); i<n; i++) { /* for each Grid */ - if (!doIso(i, GH, myGH)) + + /* for each Grid */ + for (i = retval = 0, n = CCTK_NumVars (); i < n; i++) + { + if (! doIso (i, GH, myGH)) + { continue; - - if (CCTK_QueryGroupStorageI(GH,CCTK_GroupIndexFromVarI(i))) { + } + if (CCTK_QueryGroupStorageI(GH,CCTK_GroupIndexFromVarI(i))) + { computeIso(i, GH, myGH); + retval++; } - else { + else + { CCTK_VWarn (9, __LINE__, __FILE__, CCTK_THORNSTRING, "No storage assigned for '%s'", CCTK_VarName (i)); } } - return 1; + + return (retval); } /***************************************************************************/ |