[yt-users] Unstructured grid yt support

Matthew Turk matthewturk at gmail.com
Thu Jul 3 08:50:42 PDT 2014


Hi Ariadna,

On Wed, Jul 2, 2014 at 5:16 PM, Ariadna Murguia <doggies012 at hotmail.com> wrote:
> Hi,
> I wanted to visualize a dataset in an unstructured grid with AMR and a vtk
> output file. I went into the live chat and I was told the NSCA was working
> on a simple visualization. Could you please send me a sample script to
> visualize the data?

Heh, I'm not sure it's quite NCSA that's working on it, but I was ... :)

So, first the caveats: this is not true FEM/unstructured support.
Such support *is* coming, but this is a semi-reasonable approximation
to it for the purposes of visualization only.  I would encourage you
to be careful in how you use it, as in some cases it may give
incorrect answers, particularly in anything that is weighted or
averaged by volume or "mass", unless you have computed that
independently.  Additionally, it's a lot slower than I'd like, which
will be improved in the coming months.

The backstory of this is that I have been working with Earthquake
simulators on analyzing and visualizing axially symmetric FEM
simulations of the globe.  The output from these is a series of
cylindrical (or spherical, depending on how the coordinates get
converted) quadrilaterals, which are rotated around the axis to make
the Earth.  There's some functional-form modulation that gets applied
as a function of phi.  The quantities are defined at the vertex points
of the quadrilaterals.  As a first pass, what I've been doing is
loading in the vertices as points ("particles"), indexing these with a
relatively fine-grained mesh, and then using either nearest neighbor
or an inverse distance weighted (p=4) scheme to then deposit the
vertices into that mesh.

I've attached a couple images, to show what this looks like -- nearest
neighbor and P4 IDW for deposition.  As you can see, it's not great
yet, but it's not the worst either.  Here's the script I was using,
which requires the bookmark "axisem" from my repo, or for this pull
request to be included:

https://bitbucket.org/yt_analysis/yt/pull-request/990/non-cartesian-particles-and-nn-deposition/diff

http://paste.yt-project.org/show/4879/

I think for the purposes of a generic cartesian FEM, you can cut
nearly all of this out, and just use the IDW and load_particles bits.

Let me know if that's helpful -- I'm happy to help out a bit more, but
this next week will be somewhat tricky as a bunch of us are going to
SciPy and we'll be sprinting on yt there.

-Matt

> Thank you very much,
> Ariadna Murguia
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: frame_idw_p4_0060.png
Type: image/png
Size: 674561 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140703/6c2659c0/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: frame_nearest_0060.png
Type: image/png
Size: 747185 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140703/6c2659c0/attachment-0003.png>


More information about the yt-users mailing list