<div dir="ltr">Hello, all,<br><br>I am new to yt Project. I want to create new derived fields.<br>I have two data arrays: one for vertex coordinate, and the other for vertex indexes of face.<br>I also create two datasets of particle type: one for vertex coordinate, and the other for face info.<br>For face dataset, the particle position is the coordinate of face center, which is calculated from data arrays.<br><pre style="background-color:rgb(39,40,34);color:rgb(248,248,242);font-family:"DejaVu Sans Mono";font-size:9pt"><span style="color:rgb(117,113,94)"># Associate data with fields<br></span><span style="background-color:rgb(71,44,71)">data</span> <span style="color:rgb(249,38,114)">= </span><span style="color:rgb(102,217,239)">dict</span>(<span style="color:rgb(253,151,31);font-style:italic">particle_position_x</span><span style="color:rgb(249,38,114)">=</span>face_pos[<span style="color:rgb(174,129,255)">0</span>],<br>            <span style="color:rgb(253,151,31);font-style:italic">particle_position_y</span><span style="color:rgb(249,38,114)">=</span>face_pos[<span style="color:rgb(174,129,255)">1</span>],<br>            <span style="color:rgb(253,151,31);font-style:italic">particle_position_z</span><span style="color:rgb(249,38,114)">=</span>face_pos[<span style="color:rgb(174,129,255)">2</span>])<br><br><span style="color:rgb(117,113,94)"># Create bounding box<br></span>bbox <span style="color:rgb(249,38,114)">= </span>utility.create_bounding_box(face_pos)<br><br><span style="color:rgb(117,113,94)"># Create dataset for face<br></span>ds_face <span style="color:rgb(249,38,114)">= </span>yt.load_particles(<span style="background-color:rgb(60,60,87)">data</span>, <span style="color:rgb(253,151,31);font-style:italic">bbox</span><span style="color:rgb(249,38,114)">=</span>bbox)</pre>(p.s. utility.create_bounding_box() is user-defined function by me)<br><br>I create three derived fields (before loading the data): neighbor vertex index 1-3, for future use.<br>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.<br><pre style="background-color:rgb(39,40,34);color:rgb(248,248,242);font-family:"DejaVu Sans Mono";font-size:9pt"><span style="color:rgb(117,113,94)"># Define 1st neighbor index<br></span><span style="color:rgb(249,38,114)">@</span><span style="color:rgb(166,226,46)">derived_field</span>(<span style="color:rgb(253,151,31);font-style:italic">name</span><span style="color:rgb(249,38,114)">=</span><span style="color:rgb(230,219,116)">"neighbor_index_1"</span>)<br><span style="color:rgb(102,217,239);font-style:italic">def </span><span style="color:rgb(166,226,46)">_neighbor_index_1</span>(<span style="color:rgb(253,151,31);font-style:italic">field</span>, <span style="color:rgb(253,151,31);font-style:italic">data</span>)<span style="color:rgb(249,38,114)">:</span></pre>If this is not a good way to create the relationship for vertices, please give me suggestions.<br>Besides, after that, I want to render the mesh given the vertex coordinate and face info. Is there a function to do this?<br><br>Thank you very much. <img goomoji="gtalk.328" style="margin: 0px 0.2ex; vertical-align: middle;" src="cid:gtalk.328@goomoji.gmail"><br><br>Best regards,<br>Mew<br></div>