<p dir="ltr">Hi Melinda and Nathan,</p>
<p dir="ltr">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.</p>

<p dir="ltr">Matt</p>
<div class="gmail_quote">On Jul 12, 2014 2:40 PM, "Nathan Goldbaum" <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Melinda,<div><br></div><div>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.</div>
<div>

<br></div><div>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.</div>


<div><br></div><div>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.</div><div><br></div><div>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.  </div>


<div><br></div><div>Take a look at my radial_flux_analyzer, which does this calculation: <a href="https://bitbucket.org/ngoldbaum/galaxy_analysis_fork/src" target="_blank">https://bitbucket.org/ngoldbaum/galaxy_analysis_fork/src</a>. </div>


<div><br></div><div>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.</div>


<div><br></div><div>Sorry to not have a more concrete solution for you.</div><div><br></div><div>-Nathan</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jul 12, 2014 at 12:18 AM, Melinda Soares-Furtado <span dir="ltr"><<a href="mailto:msoares.physics@gmail.com" target="_blank">msoares.physics@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;text-align:justify"><font face="tahoma, sans-serif"><span style="color:rgb(0,0,0);line-height:22.399999618530273px">I created a surface using </span><span style="color:rgb(0,0,0);line-height:22.399999618530273px"><b>surf = p1.h.surface(sp,"Radius",cluster_radius)</b></span></font></pre>



<pre style="margin-top:0px;margin-bottom:0px;padding:0px;text-align:justify"><font color="#000000" face="tahoma, sans-serif"><span style="line-height:22.399999618530273px">and then gathered the density values for the cells in this surface with</span></font></pre>



<pre style="margin-top:0px;margin-bottom:0px;padding:0px;text-align:justify"><font color="#000000" face="tahoma, sans-serif"><span style="line-height:22.399999618530273px"><b>dens = surf['Density'], </b>which I can export as a textfile.</span></font></pre>



<pre style="margin-top:0px;margin-bottom:0px;padding:0px;text-align:justify"><font color="#000000" face="tahoma, sans-serif"><span style="line-height:22.399999618530273px">I now need to get the area of each cell, but I'm having trouble doing this.</span></font></pre>



<pre style="margin-top:0px;margin-bottom:0px;padding:0px;text-align:justify"><font color="#000000" face="tahoma, sans-serif"><span style="line-height:22.399999618530273px">Any advice?</span></font></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;text-align:justify">


<br></pre><div><div dir="ltr"><div><div><div><br></div></div></div></div></div>
</div></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div>