[yt-users] Area of Surface Cell

Nathan Goldbaum nathan12343 at gmail.com
Sat Jul 12 12:39:39 PDT 2014


Hi Melinda,

Looking at the code, it looks like yt doesn't expose the individual flux or
area values, only returning the total flux from the
`calculate_isocontour_flux` function.

That said, these values are calculated inline in the march_cubes_grid_flux
function but are not cached or returned to the user.  In principle it
should be possible to cache and return them to do the analysis you're
trying to do, but it will require modifying yt.  march_cubes_grid_flux is
defined in the cython file yt/utilities/lib/marching_cubes.pyx.

I think this would be a generally useful modification to yt, so if you do
go down the path of doing this we would certainly welcome your patch as a
pull request.

That said, since you only care about fluxes across a spherical surface, it
should be possible to take advantage of the symmetry of the sphere to
calculate the fluxes without doing the marching cubes isosurface
calculation.  In the past, I've had a lot of success calculating fluxes
across cylindrical surfaces by first exporting AMR data from yt to a
uniform fixed resolution using a covering_grid data object and then
postprocessing using custom code.

Take a look at my radial_flux_analyzer, which does this calculation:
https://bitbucket.org/ngoldbaum/galaxy_analysis_fork/src.

I think it would be generally useful to extend what it does to spheres and
other simple geometric shapes.  In principle it should also be possible to
do the same fast calculation inside of yt its self using the
multiresolution AMR data, but that has so far proven unnecessary for my
purposes.

Sorry to not have a more concrete solution for you.

-Nathan




On Sat, Jul 12, 2014 at 12:18 AM, Melinda Soares-Furtado <
msoares.physics at gmail.com> wrote:

> I created a surface using *surf = p1.h.surface(sp,"Radius",cluster_radius)*
>
> and then gathered the density values for the cells in this surface with
>
> *dens = surf['Density'], *which I can export as a textfile.
>
> I now need to get the area of each cell, but I'm having trouble doing this.
>
> Any advice?
>
>
>
>
> _______________________________________________
> 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/20140712/9dcecf04/attachment.html>


More information about the yt-users mailing list