[yt-users] Field based on neighbour cells

José Utreras jutreras at das.uchile.cl
Fri Dec 19 10:14:54 PST 2014


Thanks for your answer John
I have to define sl_right, sl_center :global name 'sl_right' is not defined

I'm not really sure how to do it. I want to do something like these:

vx = data["gas", "velocity_x"][sl_right,sl_center,sl_center]
vx+= data["gas", "velocity_x"][sl_center,sl_right,sl_center]
...

add the x velocity of 6 neighbour cells.

Thanks


2014-12-19 13:31 GMT-03:00 John ZuHone <jzuhone at gmail.com>:
>
> Jose,
>
> Presuming that you have sl_right and sl_center defined in your field
> already, you should be able to just substitute “gas” for ftype, since the
> velocity fields are “gas" fields.
>
> Best,
>
> John
>
> > On Dec 19, 2014, at 11:04 AM, José Utreras <jutreras at das.uchile.cl>
> wrote:
> >
> > Hi everyone,
> >
> > I want to write a new field based on the neighbour cells like this:
> >
> > vx = data[ftype, "velocity_x"][sl_right,sl_center,sl_center]
> >
> > but I got " global name 'ftype' is not defined". I suppose that I have
> the same problem with sl_left, sl_right , sl_center.
> >
> > Thanks,
> >
> > Jose
> > _______________________________________________
> > 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/20141219/885b1246/attachment.htm>
-------------- next part --------------
_______________________________________________
yt-users mailing list
yt-users at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org


More information about the yt-users mailing list