[vtkusers] Polyhedral volume computation

Jochen K. jochen.kling at email.de
Fri Jun 15 22:00:58 EDT 2012


Hi Andy,

I wrote a filter which can be applied to an unstructured grid to compute the
sums for all cells.

The basic idea is to compute the volume of each cells just by applying this
filter to unstructured grids in a usual manner:


  cellMassProperties->SetInputConnection(ugrid->GetProducerPort());

Then retrieve the volume of a single cell, e.g. with cellId like follows:
  
  cellMassProperties->GetCellSum(36);

or get the volume of the whole grid:
  cellMassProperties->GetTotalSum(3);

NOTE: it's in an alpha state

        Some basic tests with unstructured grid containing tetrahedrons and
hexahedrons

        and a cross-check with vtkMassProperties for the total volume has
been done so far


http://www.femcs.com/vtkjk/ Doxygen documentation for
vtkjkCellMassProperties filter 

http://www.femcs.com/vtkjk/vtkJkCellMassProperties.zip zipped source for
vtkjkCellMassProperties filter with an example 


It's probably not perfect (it's a long time ago I used to develop in C++ and
I'm relatively new to VTK)
Nevertheless I did my very best.

Let me know what you think of it. Any write-ups and suggestions are welcome.

with best regards

Jochen




--
View this message in context: http://vtk.1045678.n5.nabble.com/Polyhedral-volume-computation-tp5713778p5713939.html
Sent from the VTK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120615/daf0aa01/attachment.htm>


More information about the vtkusers mailing list