[yt-users] Surface extraction in FLASH

C.S. Howard howardcs at mcmaster.ca
Mon Feb 27 13:37:52 PST 2017


Hi Nathan,

Thanks for the reply! As I mentioned earlier, I'm not interested in the
total flux of photons across the surface, but the total number of photons
crossing it. The flux in each cell can vary and is not spherically
symmetric so I cannot find the total flux and multiply by 4*pi*r^2, for
example.

This means that, for each cell, I need to take the dot product between the
flux and the area vector of the small bit of the surface in that cell (to
get the outwards flux), and multiply by the area of the surface in that
cell. This is all fine, as long as I know the shape of the surface within
each cell.

I think I'm just confused what the returned triangles actually are. Looking
at the info for the marching cubes algorithm didn't clear things up because
it seems there can be multiply triangles within one cell depending on the
shape of the surface.

Thanks again,
Corey



On Mon, Feb 27, 2017 at 1:44 PM, Nathan Goldbaum <nathan12343 at gmail.com>
wrote:

>
>
> On Mon, Feb 27, 2017 at 12:34 PM, C.S. Howard <howardcs at mcmaster.ca>
> wrote:
>
>> Hi all,
>>
>> I'm trying to calculate the total amount of photons crossing a spherical
>> surface using FLASH simulation data. I noticed yt has a surface extraction
>> method, and I used this to extract the spherical surface. I only have the
>> flux of photons in each cell and therefore need to mulitply by the
>> cross-sectional area of each cell to get what I need.
>>
>> I have a couple questions about this surface extraction method:
>> - What exactly does it return?
>>
>
> It's not clear what you're referring to in this question. What does what
> return?
>
>
>> - Can I get the cross sectional area of each cell on the surface (as seen
>> from the center of the simulation volume)
>>
>
> Sure:
>
> ad = ds.all_data()
>
> # create surface at an isodensity of 5x10^-27 g/cm^3
> surf = ds.surface(ad, "density", 5e-27)
>
> # sample the "density" field at the isodensity surface
> surf['density']
>
> # The locations of all of the vertices of the surface
> surf.vertices
>
> # Coordinates of the vertices of the triangles that make up the surface
> surf.triangles
>
> For the dataset I'm looking at to help write this e-mail, the
> surf.vertices.shape is (3, 295197) (i.e. one 3D coordinate for every
> vertex) and surf.triangles.shape is (98399, 3, 3) (i.e. for each triangle
> [the first axis] there are three vertices [the second axis], each with
> three coordinates [the last axis]. Note also that there are exactly a third
> as many triangles as vertices.
>
>
>> - If not, is there a better way to do this using yt?
>>
>
> yt can calculate the flux of a vector field across a surface:
>
> http://yt-project.org/docs/dev/reference/api/generated/
> yt.data_objects.data_containers.YTSelectionContainer3D.
> calculate_isocontour_flux.html#yt.data_objects.data_containers.
> YTSelectionContainer3D.calculate_isocontour_flux
>
> This method is defined on any 3D data object. If you already have a
> surface object, there's also the calculate_flux method:
>
> http://yt-project.org/docs/dev/reference/api/generated/
> yt.data_objects.construction_data_containers.YTSurface.
> calculate_flux.html#yt.data_objects.construction_data_
> containers.YTSurface.calculate_flux
>
>
>>
>> Cheers and thanks for the help,
>> Corey
>>
>>
>>
>> _______________________________________________
>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170227/fee713bc/attachment-0001.html>


More information about the yt-users mailing list