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@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@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@lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

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