<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Matt, <br>
<br>
I will try to explain what my goal is.<br>
I have a 1D profile of a star that is physically at the equilibrium.
Regarding the problem initialization, I set up the density and the
total specific energy fields according to the model, velocities equal
0. However, the star is not numerically stable so I have to relax it.
Therefore, I divide the velocity by 2 at each timestep, and I let Enzo
run for a few dynamical times. Then, I read the last data dump and
create an relaxed_model.dat:<br>
<br>
<address>##########################################################<br>
region = pf.h.region([0.5, 0.5, 0.5], [0.0, 0.0, 0.0], [1.0, 1.0, 1.0])</address>
<address>output = 'relaxed_model.dat'</address>
<address>f = open(output,'w')</address>
<address>print >>f, '# Grid Index rho pressure'</address>
<address>density = region["Density"]</address>
<address>pressure = region["Pressure"]</address>
<address>size = NP.size(density)</address>
<address><br>
for i in range(0,size,1):</address>
<address>            dtmp = density[i]</address>
<address>            ptmp = pressure[i]</address>
<address>            print >>f, "0", i, '%06e' % dtmp, '%06e' %
ptmp<br>
##########################################################<br>
</address>
<br>
so I end up with a file like this:<br>
<br>
<address>##########################################################</address>
<address># Restart file for only one grid<br>
</address>
<address># Grid Index rho pressure</address>
<address>0 0 5.099011e-10 2.568020e+05</address>
<address>0 1 5.099011e-10 2.568020e+05</address>
<address>0 2 5.099011e-10 2.568020e+05<br>
...<br>
</address>
<address>##########################################################</address>
<br>
Finally, I read index, density, pressure from that previous file and do:<br>
<br>
<address>##########################################################</address>
<address> for (k = 0; k < GridDimension[2]; k++)</address>
<address>      for (j = 0; j < GridDimension[1]; j++)</address>
<address>        for (i = 0; i < GridDimension[0]; i++) {</address>
<address><br>
          index = i + GridDimension[0]*(j + GridDimension[1]*k);</address>
<address>          density  /= DensityUnits;</address>
<address>          pressure /= PressureUnits;</address>
<address>          BaryonField[0][index] = density;</address>
<address>          BaryonField[1][index] = pressure / ((Gamma - 1.0) *
density);</address>
<address>##########################################################</address>
<br>
The problem is GridDimensions contain the ghost zones so the variable
index does not match with the actual index read in the file
relaxed_model.dat.
That is why I wanted to have that file values for the ghost zones as
well.<br>
<br>
Does it make sense ? Do you have any suggestion ?<br>
<br>
Thanks for your help,<br>
<br>
<br>
JC<br>
<br>
Matthew Turk a écrit :
<blockquote
 cite="mid:AANLkTik3Rn5XQudJUZXMi-EtB2oclGcqsWhosbA10pJ8@mail.gmail.com"
 type="cite">
  <pre wrap="">Hi Jean-Claude,

There are a couple aspects to this.  The first is that Enzo doesn't
output the ghost zones -- so any ghost zones handled inside yt are
generated by yt.  Were Enzo to output the ghost zones, we would
probably be able to handle this, but it does not.

Derived fields can depend on the generation of ghost zones, but keep
in mind that these are ghost zones generated by yt.  These ghost zones
are constructed in a similar manner to how Enzo generates them, but
there may be minor differences.  You can manually inspect ghost zones
on a *grid* by calling retrieve_ghost_zones on that grid.

If you could tell us a bit more about your goal, maybe we could help
out a bit more?

-Matt

On Wed, Jun 2, 2010 at 9:32 AM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Dear all,

in order to set up my simulation, I need to access the values of certain
fields in the ghost zones.
If I do something like:

pf = load(data) region = pf.h.region(...) x = region[field]

x contains the values of field for the physical grid only. Is there a way I
can get the same 1D-array but with the ghost zones included as well ?

Thanks for your help,

Jean-Claude

_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org


    </pre>
  </blockquote>
</blockquote>
</body>
</html>