[Paraview] Good neighbor filter
Andy Bauer
andy.bauer at kitware.com
Wed Feb 14 13:51:13 EST 2018
Hi Dennis,
I'm assuming you're dealing with a vtkUnstructuredGrid (for the
topologically regular grids you should just use the extent information).
You'll want to look at the GetCellNeighbors() method --
https://www.vtk.org/doc/nightly/html/classvtkUnstructuredGrid.html#ac532485599a5d92acf4d9ca1e8818bfc.
Here, cellId is the cell you want to get the neighbors from, ptIds is the
list of points that need to be shared by both cells and cellIds is the
return list. You'll have to iterate over all points of the cell you're
interested in (i.e. call GetCellNeighbors() 8 times for a hex).
The basic algorithm is:
loop over cells:
for each cell, loop over all of its points
for each point call GeCellNeighbors(cellid, point id list with a single
point)
loop through cellids to compare cell sizes
Please let me know if this isn't clear enough to get you going...
Cheers,
Andy
On Wed, Feb 14, 2018 at 1:38 PM, Dennis Conklin <dennis_conklin at goodyear.com
> wrote:
> All,
>
>
>
> I am looking to calculate a mesh quality measure that would be the ratio
> of the max/min of the element volumes of each element and all it’s
> neighbors (other elements with common nodes). I intend to use this to
> quantify grid refinement transitions and perhaps establish some design
> standards for them. I have tried Gradient of Element Volume, but I need
> to eliminate the distance part of that to get the number that I want.
> So, if I have a hex element in a regular grid, I would expect to have 26
> “neighbor” elements plus the original element. The number I want is
> (max of 27 element volumes)/(min of 27 element volumes). This quantity
> will highlight mesh refinement transitions.
>
>
>
> My question (at last) is: how do I find all the neighbor elements
> (share at least 1 node) of each element in my model? I’d like to do this
> in a Programmable Filter. I’m afraid I don’t know much about how
> connectivity is implemented in vtk.
>
>
>
> Dennis
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180214/b02eed14/attachment.html>
More information about the ParaView
mailing list