[FLASH-USERS] Grid_putPointData vs. Grid_getBlkPtr

Klaus Weide klaus at flash.uchicago.edu
Wed Dec 14 14:07:41 EST 2016


On Wed, 14 Dec 2016, Slavin, Jonathan wrote:

> Hi all,
> 
> I'm wondering what the effective difference is for initiating a simulation
> between 1) using Grid_putPointData and 2) using assignment to the elements
> of solnData (where solnData is returned by Grid_getBlkPtr).  In the default
> supplied Simulation_initBlock for the Sedov simulation, the latter is used
> if FL_NON_PERMANENT_GUARDCELLS is defined and the former is used
> otherwise.  In the Simulation_initBlock for the BlastBS simulation, there
> is no test whether FL_NON_PERMANENT_GUARDCELLS is defined and method 2 is
> used, despite the fact that (as far as I can tell) that symbol is not
> defined.  Any help on this would be appreciated.  Also it'd be helpful if
> someone could tell me under what circumstances FL_NON_PERMANENT_GUARDCELLS
> gets defined.

Jon,

The symbol FL_NON_PERMANENT_GUARDCELLS should only be defined if FLASH is 
set up to use the no_permanent_guardcells mode of PARAMESH 4.0 or 
PARAMESH4dev. You should be able to find more information on this mode in 
the PARAMESH documentation.

We have experimented with this mode years ago, as a way to lower memory 
requirements for large simulations. There is some supporting code still
in the FLASH distribution - including support for optionally running some 
of the tests in no_permanent_guardcells mode, as you have found - but to 
my knowledge this has not been exercised in several years.

About the question which routine should be called for UNK variable 
initialization - both Grid_putPointData and 
Grid_getBlkPtr/Grid_releaseBlockPtr work and can be used (as well
as the further alternatives Grid_put{Blk,Plane,Row}Data).
I consider this  matter of personal preference and convenience.

There are probably differences in performance (I would expect the
variant that works with pointers to be the fastest), but this should not 
matter much for Simulation_initBlock which is only called at 
initialization.

Klaus



More information about the flash-users mailing list