[yt-users] Enzo cic_particle_* error
Casey W. Stark
caseywstark at gmail.com
Thu Feb 23 19:47:49 PST 2012
Okay, that explains it. Thanks Matt.
I will try the shadow region solution tomorrow.
Best,
Casey
On Thu, Feb 23, 2012 at 7:26 PM, Matthew Turk <matthewturk at gmail.com> wrote:
> Hi Casey,
>
> On Thu, Feb 23, 2012 at 10:23 PM, Casey W. Stark <caseywstark at gmail.com>
> wrote:
> > Hi all.
> >
> > I'm trying to make a covering grid of the full domain of an enzo
> > (cosmological) simulation, getting the dark matter density and velocity
> > fields. This works fine with the gas:
> >
> > In [1]: cg = pf.h.covering_grid(0, [0,0,0], [256,256,256],
> > fields=["Density", "x-velocity", "y-velocity", "z-velocity"])
> >
> > But then I try the DM fields:
> >
> > In [2]: cg = pf.h.covering_grid(0, [0,0,0], [256,256,256],
> > fields=["Dark_Matter_Density", "cic_particle_velocity_x",
> > "cic_particle_velocity_y", "cic_particle_velocity_z"])
> >
> > ... ipython cruft ...
> >
> >
> /project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/data_objects/data_containers.pyc
> > in __init__(self, level, left_edge, dims, fields, pf, num_ghost_zones,
> > use_pbar, **kwargs)
> > 3342 self.domain_width = na.rint((self.pf.domain_right_edge -
> > 3343
> > self.pf.domain_left_edge)/self.dds).astype('int64')
> > -> 3344 self._refresh_data()
> > 3345
> > 3346 def _get_list_of_grids(self, buffer = 0.0):
> >
> >
> /project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/data_objects/data_containers.pyc
> > in _refresh_data(self)
> > 3359
> > 3360 def _refresh_data(self):
> > -> 3361 AMR3DData._refresh_data(self)
> > 3362 self['dx'] = self.dds[0] * na.ones(self.ActiveDimensions,
> > dtype='float64')
> > 3363 self['dy'] = self.dds[1] * na.ones(self.ActiveDimensions,
> > dtype='float64')
> >
> >
> /project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/data_objects/data_containers.pyc
> > in _refresh_data(self)
> > 307 """
> > 308 self.clear_data()
> > --> 309 self.get_data()
> > 310
> > 311 def keys(self):
> >
> >
> /project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/data_objects/data_containers.pyc
> > in get_data(self, fields)
> > 3377 try:
> > 3378 #print "Generating", field
> >
> > -> 3379 self._generate_field(field)
> > 3380 continue
> > 3381 except NeedsOriginalGrid, ngt_exception:
> >
> >
> /project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/data_objects/data_containers.pyc
> > in _generate_field(self, field)
> > 3404 # First we check the validator; this might even
> raise!
> >
> > 3405 self.pf.field_info[field].check_available(self)
> > -> 3406 self[field] = self.pf.field_info[field](self)
> > 3407 else: # Can't find the field, try as it might
> > 3408 raise KeyError(field)
> >
> >
> /project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/data_objects/field_info_container.pyc
> > in __call__(self, data)
> > 314 ii = self.check_available(data)
> > 315 original_fields = data.keys() # Copy
> > --> 316 dd = self._function(self, data)
> > 317 dd *= self._convert_function(data)
> > 318 for field_name in data.keys():
> >
> >
> /project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/frontends/enzo/fields.pyc
> > in _cic_particle_field(field, data)
> > 332 particle_field = field.name[4:]
> > 333 top = na.zeros(data.ActiveDimensions, dtype='float32')
> > --> 334 if data.NumberOfParticles == 0: return top
> > 335 particle_field_data = data[particle_field] *
> > data['particle_mass']
> > 336
> > amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
> >
> > AttributeError: 'AMRCoveringGrid' object has no attribute
> > 'NumberOfParticles'
> >
> > Are you not supposed to use a covering grid with these fields or am I
> > creating the covering grid incorrectly? I get reasonable looking plots
> if I
> > slice/project cic_particle_velocity_x, so I believe it's working
> otherwise.
>
> As it stands, covering grids do not yet have particle support.
>
> Adding support should be relatively straightforward; inside get_data,
> if it's a particle field, set up a shadow region from the left_edge to
> the right_edge, and then retrieve the field from that.
>
> -Matt
>
> >
> > Best,
> > Casey
> >
> > _______________________________________________
> > yt-users mailing list
> > yt-users at lists.spacepope.org
> > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> >
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20120223/3c870590/attachment.html>
More information about the yt-users
mailing list