
Hi David, thanks for your useful tips. Just a few more questions:
- change some global parameters like StopCycle, CycleDataDump, GlobalDir,... Would it work if I only edit the files DDnnnn/CommonEnvelopennnn ? Wouldn't it create a conflict somewhere ?
Changing cycle based outputs won't change the answer. Changing timestep based outputs (like DtDataDump, Redshift) might introduce a little diffusion, because there will usually be a short timestep to make the output time right.
As long as you replace GlobalDir everywhere, you're fine.
ls -1 |grep -v grid | sed -i 's/GlobalDir.*/GlobalDir = $A'
should do it, but double check. (that's ls -One, not ls -Ell)(On some platforms, like the native sed on OSX and AIX, sed doesn't have a -i option, so you have to do this through some temp file.)
- keep all BaryonFields the same except the velocity that I need to set up to 0. Is there an easy way to do that ?
This is pretty easy with Python and h5py. Basically, loop over all the grid files, open them, and re-write the file into a new directory,but make V = 0 as you go. Then copy all the files that aren't *.grid* files to your new directory. (I don't think there's a way to kill a dataset directly, so you need to copy everything. )
Something like:
for grid in glob.glob("*.grid"): file1 = h5py.File(grid,'r') file2 = h5py.File(other_dir + grid, 'w') for group in file1.listitems(): open the group. for field in group: if field is not velocity: file2.create_datasete(field, shape, data=file1[group][field) else: file2.create_dataset( field, shape, data=numpy.zeros( file1[group][field].shape) )
with the appropriate syntax improvements.
There is no more *.grid* file. That was for Enzo 1.0 if I am not wrong. You probably meant the *.cpu* files, right ? To go further, is there a way I can: - restart Enzo with WritePotential = 1 using a file that had WritePotential = 0 ? - restart Enzo and use Tracer Particles with a file that did not have any of them ? Thanks again for your help, JC