[Yt-dev] DivV in < 3D

Britton Smith brittonsmith at gmail.com
Wed Jul 13 02:50:36 PDT 2011


Hey Sam,

It's not clear to me why it doesn't work without the if statement around the
z dimension.  What data would it be getting in that case?

Either way, I think adding the if statement is good, because the calculation
does not need to be done.  Perhaps for generality, it's worth putting the y
dimension calculation in an if statement as well so that this also works in
1D.

Britton

On Tue, Jul 12, 2011 at 7:05 PM, j s oishi <jsoishi at gmail.com> wrote:

> Hi Sam,
>
> I looked over the ValidateSpatial briefly, but I'm not sure I
> understand it. However,
>
> > I could see us using a fix that does something like:
> >     if len(data.pf.dimensions) > 2:
> >         ds = div_fac * data['dz'].flat[0]
> >         f += data["z-velocity"][1:-1,1:-1,sl_right]/ds
> >         f -= data["z-velocity"][1:-1,1:-1,sl_left ]/ds
>
> seems pretty reasonable to me.
>
> j
> _______________________________________________
> Yt-dev mailing list
> Yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20110713/450a3dd1/attachment.html>


More information about the yt-dev mailing list