[yt-users] Area of Surface Cell

Msoares.physics@gmail.com msoares.physics at gmail.com
Sat Jul 12 14:23:51 PDT 2014


Thanks, Michael. I did that last night, but it raised some concerns when the total flux I computed was off by a factor of 1.6 from the calculate flux command. I assumed the triangles were equal. Thanks again.

> On Jul 12, 2014, at 2:19 PM, Michael Zingale <michael.zingale at stonybrook.edu> wrote:
> 
> This sound like what you want, in which case, I would also suggest taking the cross product of two edges to evaluate the normal direction of that local triangle.  I'll likely want to play with this later in the summer (after I'm done traveling), since this is good functionality for stellar simulations.
> 
> 
>> On Sat, Jul 12, 2014 at 4:14 PM, Matthew Turk <matthewturk at gmail.com> wrote:
>> Hi Melinda and Nathan,
>> 
>> I'm currently boarding my flight, but I just saw this. You can get the area by examining the triangle vertices which hang off the surface object. You can compute the area this way by using them as corners of the triangles and inputting that into an area calculation.
>> 
>> Matt
>> 
>>> On Jul 12, 2014 2:40 PM, "Nathan Goldbaum" <nathan12343 at gmail.com> wrote:
>>> 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
>>> 
>>> 
>>> _______________________________________________
>>> 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
> 
> 
> 
> -- 
> Michael Zingale
> Associate Professor
> 
> Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800
> phone:  631-632-8225
> e-mail: Michael.Zingale at stonybrook.edu
> web: http://www.astro.sunysb.edu/mzingale
> _______________________________________________
> 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/1ceee59a/attachment.htm>


More information about the yt-users mailing list