[yt-users] About creating derived fields

Matthew Turk matthewturk at gmail.com
Tue Jun 2 06:04:00 PDT 2015


Hi Mew,

Coincidentally, getting vertex and face support is a high priority right
now, and Andrew Myers, Allyson Julian and I have been working on it (and
are working on it today in fact.)  I think that what you're describing
should be feasible, and I think what you are describing should work for
now.  I am planning to send some design documents and example code to the
yt-dev mailing list sometime in the next couple days, if you want to sign
up for that list and take a look, or stop by #yt on IRC on freenode.

-Matt

On Mon, Jun 1, 2015 at 10:12 PM, 孫伯符 <loveofwitwisthirunwongkul at gmail.com>
wrote:

> Hello, all,
>
> I am new to yt Project. I want to create new derived fields.
> I have two data arrays: one for vertex coordinate, and the other for
> vertex indexes of face.
> I also create two datasets of particle type: one for vertex coordinate,
> and the other for face info.
> For face dataset, the particle position is the coordinate of face center,
> which is calculated from data arrays.
>
> # Associate data with fields
> data = dict(particle_position_x=face_pos[0],
>             particle_position_y=face_pos[1],
>             particle_position_z=face_pos[2])
>
> # Create bounding box
> bbox = utility.create_bounding_box(face_pos)
>
> # Create dataset for face
> ds_face = yt.load_particles(data, bbox=bbox)
>
> (p.s. utility.create_bounding_box() is user-defined function by me)
>
> I create three derived fields (before loading the data): neighbor vertex
> index 1-3, for future use.
> The problem is that I want to feed the value from face data array. How do
> I access other data array in derived field function.
>
> # Define 1st neighbor index
> @derived_field(name="neighbor_index_1")
> def _neighbor_index_1(field, data):
>
> If this is not a good way to create the relationship for vertices, please
> give me suggestions.
> Besides, after that, I want to render the mesh given the vertex coordinate
> and face info. Is there a function to do this?
>
> Thank you very much. [?]
>
> Best regards,
> Mew
>
> _______________________________________________
> 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/20150602/fab6e916/attachment.htm>


More information about the yt-users mailing list