[FLASH-USERS] Reading an AMR checkpoint file back into part of a larger grid

Sean Couch smc at flash.uchicago.edu
Wed May 11 15:49:46 EDT 2016


hi Andy,

In the category of “better late than never?”, here is my overdue reply.

FLASH doesn’t have a built-in mechanism for doing this, but it can be done.  I have done it before with FLASH v2.5 years ago.  I never got around to bringing the functionality to FLASH3/4.  The basic idea is to start a “new” simulation with an arbitrary grid setup and read data from a checkpoint file that is interpolated onto the new, arbitrary grid.

I’m attaching the init_block.F90 that I wrote to do this in FLASH2.5.  I only ever did this for 2D simulations.  And the approach in this file is, I now realize, wildly inefficient.  I basically had every processor reading the whole checkpoint file.  Which works if you’ve got loads of memory!  But is dumb (but hey, I was a second-year grad student, so….).  A better approach would be to read the metadata and block bounding boxes on every processor, then search to see what blocks from the checkpoint that the regions of the new domain owned by the current process needs.  Then read in only those blocks from the checkpoint file, interpolate appropriately, and then release the memory used for the checkpoint data.

If I remember correctly, this init_block.F90 does conservative averaging/interpolation so that things like mass and energy are conserved from the old grid to the new.  But no guarantees there!  Caveat emptor!

Best,
Sean


----------------------------------------------------------------------------------------------------------
Sean M. Couch
Assistant Professor
Department of Physics and Astronomy
Department of Computational Mathematics, Science, and Engineering
National Superconducting Cyclotron Laboratory/Facility for Rare Isotope Beams
Michigan State University
567 Wilson Rd, 3250 BPS
East Lansing, MI  48824
(517) 884-5035    ——    couch at pa.msu.edu <mailto:couch at pa.msu.edu>    ——    www.pa.msu.edu/~couch <http://www.pa.msu.edu/~couch>





> On Apr 12, 2016, at 5:53 PM, Andrew Szymkowiak <andrew.szymkowiak at yale.edu> wrote:
> 
> I would like to run an AMR simulation on a paramesh grid for a while.  But later, I would like to start a simulation in a larger grid, and paste the chkpnt file from the first run into the initial conditions of a portion of the larger sim.  I am thinking that others might have wanted to do this, too, and have already solved the difficulties.  While this should not be super difficult to implement, there seem to be enough potential accounting difficulties, that I'm hoping someone else has previously mastered.
> 
> Does anyone on the list have an example Simulation_initBlock.F90 that I may have? (Or pointers to any relevant documentation - I did try to search the docs (both FLASH and Paramesh), and the flash-users archive first, but could easily have missed something).
> 
> Thanks,
>    Andy S.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20160511/e7cbd90c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: init_block.F90
Type: application/octet-stream
Size: 17917 bytes
Desc: not available
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20160511/e7cbd90c/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20160511/e7cbd90c/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1389 bytes
Desc: not available
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20160511/e7cbd90c/attachment.p7s>


More information about the flash-users mailing list