<div dir="ltr">Can you insert the the cell associated values at the same time or in the same order that you inserted the cells themselves?<div><span style="font-family:Verdana;font-size:12px">Like so:</span></div><div><span style="font-family:Verdana;font-size:12px"> unstructeredgirdP-></span><span style="font-family:Verdana;font-size:12px">InsertNextCell(hex-></span><span style="font-family:Verdana;font-size:12px">GetCellType(), hex->GetPointIds());</span><br>
</div><div><span style="font-family:Verdana;font-size:12px"> floatarrayP->InsertNextTuple(</span><span style="font-family:Verdana;font-size:12px">uuTmp);</span></div><div><span style="font-family:Verdana;font-size:12px"><br>
</span></div><div style><span style="font-family:Verdana;font-size:12px">If not, use the fact that InsertNextCell returns a vtkIdType indicating the new cell's location (or you could just maintain a counter). Store the cell location's in a map indexed by your elemId for the cell, and use that when you make the cell associated data array to find the corresponding location in the cell array.</span></div>
</div><div class="gmail_extra"><br clear="all"><div>David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div>
<br><br><div class="gmail_quote">On Thu, Jun 6, 2013 at 4:04 AM, Dennis Pfleiderer <span dir="ltr"><<a href="mailto:Pfleide@gmx.de" target="_blank">Pfleide@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-family:Verdana;font-size:12.0px"><div>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Hello;</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">iīm writing a paraview reader for my specific geo-file, combined with a specific solution-file.the files donīt have any vtk format, only a list of floats.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">First I created a vtkHexahedron out of vtkpoints and than i commited the cells to an vtkunstructeredgrid. this is only a geo-file.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">the points i read in and then i set them with InsertPoint(nodeId, x_coord, y_coord, z_coord) and the hexahedron i created so:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">vtkSmartPointer<vtkHexahedron> hex = vtkHexahedron::New();</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">hex->GetPointIds()->SetId(0,vl[0]);</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">hex->GetPointIds()->SetId(1,vl[1]);</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">...</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">next i commited the cells to the unstructeredgrid with</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">unstructeredgirdP->InsertNextCell(hex->GetCellType(), hex->GetPointIds());</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">the elements(cells) are unordered.for example elem1 then elem20...</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Later i read in the solution the nodes (points) in and buffered in the float array with</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">floatarrayP->InsertTuple(nodeId, uuTmp);</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Then i combined geo file and solution file of the nodes in the unstrutered grid.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">unstructeredgridP->GetPointData()->AddArray(uu);</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Allright.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">I want to do the same with the cells, i have to combine the cells which i created with the solution of the cell.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Therefore i want to create a new float arrays with the solution.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">floatarrayP->InsertTuple(elemId, uuTmp);</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">now my problem:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">for the points i set the id consciously in the unstructeredegrid. the cells8hexahedron i set by and by.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">but i need the exact id of element for InsertTuple(elemId, uuTmp).</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">is there a possibility to set the id for cells by while read in the geometry or can i get the possibly existing id?</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Thanks</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
</div></div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>