<br><br><div class="gmail_quote">On Tue, Jun 12, 2012 at 8:56 AM, Jeff Lee <span dir="ltr">&lt;<a href="mailto:jlee1549@gmail.com" target="_blank">jlee1549@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
did you look at vtkMassProperties?  it uses divergence theorem to compute volume which is face based and works on arbitrary polyhedra.<div><span class="HOEnZb"><font color="#888888">Jeff</font></span><div><div class="h5">
<br><br><div class="gmail_quote">On Tue, Jun 12, 2012 at 8:48 AM, Andrew Parker <span dir="ltr">&lt;<a href="mailto:andy.john.parker@googlemail.com" target="_blank">andy.john.parker@googlemail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>Many thanks, yes, linear only but an arbitrary number of faces.  I would have bet there was another way of doing this, and that I&#39;ve used it, I just can&#39;t remember how I did it. </div>


<div><br>
</div><div>Do you not think it&#39;s rather odd there is a lack of support for simple metrics like this given an arbitrary polyhedra?  One needs only the faces and nodes.  Under the assumption each face is planer then this sort of thing is quite easy, and would at least make the vtk support for this for type of metric with planer faces much more applicable to a significantly larger number of users.  See the following as a good example which is used in CFD and has been for many years:</div>



<div><br></div><div><a href="http://www.public.iastate.edu/~zjw/papers/1999-AIAAJ.pdf" target="_blank">http://www.public.iastate.edu/~zjw/papers/1999-AIAAJ.pdf</a> </div><div><br></div><div>I appreciate in the non-planer case something else needs to be done, but all of this could be hidden behind a wrapper class that provides metrics regardless of cell type.  If this is indeed in vtk and anybody can point me to it then that would be really helpful.</div>



<div><br></div><div>Cheers,</div><div>Andy<div><div><br><br><div class="gmail_quote">On 12 June 2012 12:59, Jochen K. <span dir="ltr">&lt;<a href="mailto:jochen.kling@email.de" target="_blank">jochen.kling@email.de</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Andy,<br>
<br>
do you address only linear elements with arbitrary polyhedrons?<br>
Or should support be given to quadratic, biquadratic, triquadratic and even<br>
convexPointSets elements too?<br>
<br>
In any case all cells must be traversed, right?<br>
<br>
While traversing all cells I would check the celltype and store the cellid<br>
(for cell assignment of the calculated volume later on).<br>
<br>
If the current cell is a primitve type like tetrahedron etc. calculate the<br>
volume and traverse next cell.<br>
<br>
In case it&#39;s a more complicated element I would tetrahedralize it, and sum<br>
up the volume of each given tetrahedron.<br>
<br>
That&#39;s it.<br>
<br>
If the grid consists of a lot of nonlinear elements the result will probably<br>
deviate a bit from the correct value. The questionis how exactly you want<br>
the result to be.<br>
<br>
For a cross-check I would apply a surfacefilter to the whole grid,<br>
tetrahedralize it, and sum up the tetrahedron volumes.<br>
Then compare the volume of both approaches. They should be more or less<br>
identical.<br>
<br>
<br>
with best regards<br>
Jochen<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Polyhedral-volume-computation-tp5713778p5713792.html" target="_blank">http://vtk.1045678.n5.nabble.com/Polyhedral-volume-computation-tp5713778p5713792.html</a><br>




Sent from the VTK - Users mailing list archive at Nabble.com.<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 VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><p>__________________________________</p><p>   Dr Andrew Parker</p><p>   <a href="mailto:Em@il" target="_blank">Em@il</a>:  <a href="mailto:andrew.parker@cantab.net" target="_blank">andrew.parker@cantab.net</a></p>



<br>
</font></span></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 VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>
</div></div></div>
</blockquote></div><br>