<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Dear Users.<br>
<br>
Does your work on this topic include the information of the
cell-coordinates as well?<br>
Or is there allready a way of accessing the cell centers coordinate
with the current VTK version?<br>
<br>
Sebastian<br>
</font></font><br>
Am 19.02.2010 14:01, schrieb David Doria:
<blockquote
cite="mid:c19fcadc1002190501m57bd93aby5b18177e12e2fbed@mail.gmail.com"
type="cite">
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
<div>On Fri, Feb 19, 2010 at 6:30 AM, Sebastian Gatzka <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:sebastian.gatzka@stud.tu-darmstadt.de">sebastian.gatzka@stud.tu-darmstadt.de</a>></span>
wrote:</div>
<div class="gmail_quote">
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000"><font size="-1"><font
face="Helvetica, Arial, sans-serif">Hello.<br>
<br>
This time I'm trying to set cell (centroid) values (scalar and vector)
to a structured grid.<br>
All the examples I have found set values to the grid points - not the
cell-centroids.<br>
<br>
This should lead to a classical CFD / finite-volume representation of
field data like temperature, density or velocities.<br>
So beside the actual assignment to the field I need to know how to
display the field data, and maybe how to switch between them.<br>
<br>
Have a nice day.<br>
Sebastian<br>
</font></font>
</div>
<div bgcolor="#ffffff" text="#000000"><font size="-1"><font
face="Helvetica, Arial, sans-serif"><br>
</font></font></div>
</blockquote>
<div><br>
</div>
<div>Sebastian,</div>
<div><br>
</div>
<div>You can access cells via their (i,j,k) coordinates using this
function:</div>
<div> </div>
<div>vtkCell* GetCell(vtkStructuredGrid* grid, int i, int j, int k)</div>
<div>{</div>
<div> int dims[3];</div>
<div> grid->GetDimensions(dims);</div>
<div><br>
</div>
<div> if(i < 0 || i > dims[0] - 1 || </div>
<div> j < 0 || j > dims[1] - 1 || </div>
<div> k < 0 || k > dims[2] - 1 )</div>
<div> {</div>
<div> return NULL; // out of bounds!</div>
<div> }</div>
<div> </div>
<div> int pos[3];</div>
<div> pos[0] = i;</div>
<div> pos[1] = j;</div>
<div> pos[2] = k;</div>
<div><br>
</div>
<div> vtkIdType id;</div>
<div> id = vtkStructuredData::ComputeCellId(dims, pos);</div>
<div> </div>
<div> return grid->GetCell(id); </div>
<div>}</div>
<div><br>
</div>
<div>I'm working on adding it to vtk so you can directly call</div>
<div><br>
</div>
<div>grid->GetCell(i,j,k)</div>
<div><br>
</div>
<div>Hope this helps,</div>
<br>
David</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the VTK FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>
</pre>
</blockquote>
</body>
</html>