Re: [Paraview] Sequence of TIFF

2018-09-20 Thread kenichiro yoshimi
Hi,

If you want to animate tiff file series, you need to append specific
name to them like something below.
foo_0001.tiff
foo_0002.tiff
...

Then ParaView can recognize them as a tiff sequence, and the file
browser should look like foo_..tiff. In reading it, uncheck "Read As
Image Stack" so as not to read a list as a volume.

Best,

p.s. ParaView discussion has moved to https://discourse.paraview.org.
Please post future questions on that forum.
2018年9月20日(木) 13:03 :
>
> Hello,
>
> I am a beginner in the use of ParaView. I would like to show the
> deformation of a mesh on top of a series of tiff images, where
> 0001.tiff
> 0002.tiff
> ...
>
> correspond to instants 1, 2, etc. I can open the TIFF files in ParaView.
> I tried setting a Force Time filter on each of them. The images are
> displayed, but I would like to show them only at the specified time
> frame. Is that possible? Thanks!
>
> -
>
> ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
> NSA's hands!
> $24.95 ONETIME Lifetime accounts with Privacy Features!
> 15GB disk! No bandwidth quotas!
> Commercial and Bulk Mail Options!
> ___
> Powered by www.kitware.com
>
> ParaView discussion is moving! Please visit https://discourse.paraview.org/ 
> for future posts.
>
> 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
___
Powered by www.kitware.com

ParaView discussion is moving! Please visit https://discourse.paraview.org/ for 
future posts.

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


Re: [Paraview] Unstructured rectilinear mesh vs legacy vtk format

2018-05-20 Thread kenichiro yoshimi
Hi,

I just sent an email with a typo. "Cell Data to Point Data" filter was
correct.

2018年5月20日(日) 13:30 kenichiro yoshimi :

> Hi Aniruddha,
>
> I think the reason why the data looks discontinuous is that it is
> defined as cell data. So the easiest way is to use "Point Data to Cell
> Data" filter to convert from cell data to point data, which is using a
> very basic straight averaging.
>
> Best Regards
>
> 2018-05-20 3:30 GMT+09:00 Aniruddha Panda :
> > I have a cartesian grid on two different codes, one uses the legacy
> format
> > to write the data in vtk format where the co-ordinates of equidistant
> points
> > in x y and z directions are used and the associated velocity (or any
> other
> > state variable) values are written.
> >
> >
> > Whereas in the code which uses the unstructured dataset the each quadrant
> > extents are written and the associated cell data is written. Later the
> idea
> > is to have adaptive mesh refinement on this.
> >
> > When I visualise both the files ( lets say for flow through a square
> duct,
> > pic attached ) I see a smooth representation that paraview automatically
> > calculates for the mesh in case of vtk whereas it appears like a
> > discontinuous data in case of vtu ( i assume vtu does lead to a
> > discontinuous field) . May I know if there is a smoothing filter which
> > allows me to interpolate the data onto an equidistant point cloud in all
> > directions so as to have smooth profile in my postprocessing.
> >
> > Figure1. vtk flow through a square duct
> > Figure2 vtu flow through a square duct
> > Figure3 the velocity profile across the diagonal of the slice ( from vtk
> )
> > Figure4 the velocity profile across the diagonal of the slice ( from vtu)
> >
> > -
> >
> > With thanks & regards
> >
> > Aniruddha
> >
> >
> > ___
> > 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
> >
>
___
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


Re: [Paraview] Unstructured rectilinear mesh vs legacy vtk format

2018-05-19 Thread kenichiro yoshimi
Hi Aniruddha,

I think the reason why the data looks discontinuous is that it is
defined as cell data. So the easiest way is to use "Point Data to Cell
Data" filter to convert from cell data to point data, which is using a
very basic straight averaging.

Best Regards

2018-05-20 3:30 GMT+09:00 Aniruddha Panda :
> I have a cartesian grid on two different codes, one uses the legacy format
> to write the data in vtk format where the co-ordinates of equidistant points
> in x y and z directions are used and the associated velocity (or any other
> state variable) values are written.
>
>
> Whereas in the code which uses the unstructured dataset the each quadrant
> extents are written and the associated cell data is written. Later the idea
> is to have adaptive mesh refinement on this.
>
> When I visualise both the files ( lets say for flow through a square duct,
> pic attached ) I see a smooth representation that paraview automatically
> calculates for the mesh in case of vtk whereas it appears like a
> discontinuous data in case of vtu ( i assume vtu does lead to a
> discontinuous field) . May I know if there is a smoothing filter which
> allows me to interpolate the data onto an equidistant point cloud in all
> directions so as to have smooth profile in my postprocessing.
>
> Figure1. vtk flow through a square duct
> Figure2 vtu flow through a square duct
> Figure3 the velocity profile across the diagonal of the slice ( from vtk )
> Figure4 the velocity profile across the diagonal of the slice ( from vtu)
>
> -
>
> With thanks & regards
>
> Aniruddha
>
>
> ___
> 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
>
___
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


Re: [Paraview] Writer Plugin does not release the handle to the output files

2018-05-02 Thread kenichiro yoshimi
Hello Cory,

Thank you for your time!  I really appreciate your help.
Indeed, the problem was related with the act of closing files. It
works well now.

Best regards,
yoshimi

2018-05-02 22:38 GMT+09:00 Cory Quammen :
> Kenichiro,
>
> I looked at your code for just a minute, but I wonder if you need to close
> your file after writing it at
>
> https://github.com/Kenichiro-Yoshimi/FluentWriterPlugin/blob/master/vtkFluentWriter.cxx#L1245
>
> HTH,
> Cory
>
> On Tue, May 1, 2018 at 10:30 PM kenichiro yoshimi 
> wrote:
>>
>> Hi,
>>
>> I am creating a writer plugin for Fluent in ParaView 5.5.0 built under
>> Windows 10. This plugin aims at writing vtkUnstructuredGrid input out
>> to a Fluent format file as a 3D mesh.
>>
>> The plugin is built and loaded into ParaView successfully. But when
>> Paraview opens the attached input and saves it using this
>> FluentWriterPlugin, a problem occurs. That is, the plugin does not try
>> to lock the output files after writing and closing them. So I can not
>> refer to them until I close the ParaView itself.
>>
>> The following is my implementation.
>> https://github.com/Kenichiro-Yoshimi/FluentWriterPlugin
>>
>> What is going wrong here?
>>
>> Thanks in advance,
>> yoshimi
>> ___
>> 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
>
>
>
> --
> Cory Quammen
> Staff R&D Engineer
> Kitware, Inc.
___
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


[Paraview] Writer Plugin does not release the handle to the output files

2018-05-01 Thread kenichiro yoshimi
Hi,

I am creating a writer plugin for Fluent in ParaView 5.5.0 built under
Windows 10. This plugin aims at writing vtkUnstructuredGrid input out
to a Fluent format file as a 3D mesh.

The plugin is built and loaded into ParaView successfully. But when
Paraview opens the attached input and saves it using this
FluentWriterPlugin, a problem occurs. That is, the plugin does not try
to lock the output files after writing and closing them. So I can not
refer to them until I close the ParaView itself.

The following is my implementation.
https://github.com/Kenichiro-Yoshimi/FluentWriterPlugin

What is going wrong here?

Thanks in advance,
yoshimi


wavelet.tar.gz
Description: GNU Zip compressed data
___
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


Re: [Paraview] [EXT] RE: [EXTERNAL] Calculating cylindrical coordinates

2018-04-27 Thread kenichiro yoshimi
Hi Dennis,

You can calculate cylindrical coordinates by utilizing
vtkCylindricalTransform within the python programmable filter. It is
something like below and faster than numpy.

---
import vtk

input = self.GetInput()
output = self.GetOutput()

transform = vtk.vtkCylindricalTransform()

transformFilter = vtk.vtkTransformFilter()
transformFilter.SetInputData(input)
transformFilter.SetTransform(transform.GetInverse())
transformFilter.Update()

output.ShallowCopy(transformFilter.GetOutput())
---

This converts (x,y,z) coordinates to (r,theta,z) coordinates by GetInverse
method,
where the angles are calculated by the following equation to change range
to [0, 2*pi]:
  theta = pi + atan2(-y, -x).

Regards

2018-04-28 5:25 GMT+09:00 Dennis Conklin :

> Alan,
>
>
>
> Yes, I am calling it many times at the same angular location, but it’s
> tough to know you’re at the same angular location without calculating the
> angle.
>
>
>
> Also, C++ is definitely orders of magnitude quicker, but once I have to
> compile routines into Paravew life gets very complicated.   We barely
> survived compiling for cluster use and I haven’t written C++ for at least
> 20 years.
>
>
>
> So, if possible, I would like a clever external add-on that wouldn’t
> require us to re-compile PV everytime we update our version.   I have
> visions of library errors in my nightmares!
>
>
>
> Dennis
>
>
>
> *From:* Scott, W Alan [mailto:wasc...@sandia.gov]
> *Sent:* Friday, April 27, 2018 4:00 PM
> *To:* Dennis Conklin ; Paraview (
> parav...@paraview.org) 
> *Subject:* [EXT] RE: [EXTERNAL] [Paraview] Calculating cylindrical
> coordinates
>
>
>
>  *CAUTION: *EXTERNAL email. Please think before clicking on any links or
> attachments.
>
>
>
> Are there places on the cylinder you are calling atan2 with the same
> inputs, returning the same data, lots of times?  Alternatively, could you
> calculate this in the simulation, and just add it to the simulation
> output?  I am speculating that a C++ call to atan2 may be faster than numpy?
>
>
>
> Alan
>
>
>
> *From:* ParaView [mailto:paraview-boun...@public.kitware.com
> ] *On Behalf Of *Dennis Conklin
> *Sent:* Friday, April 27, 2018 1:39 PM
> *To:* Paraview (parav...@paraview.org) 
> *Subject:* [EXTERNAL] [Paraview] Calculating cylindrical coordinates
>
>
>
> All,
>
>
>
> If I wanted to run atan2(X,Y) on millions and millions of nodes to
> calculate cylindrical coordinates, but found that numpy.atan2 in a
> Programmable Filter was taking 45 minutes to run,   what should I do to
> make it much faster?
>
>
>
> Thanks for any hints
>
>
>
> 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
>
>
___
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


Re: [Paraview] Simple color issue

2018-03-30 Thread kenichiro yoshimi
Hello HNG,

The easiest way to solve a dull color problem is to add a headlight.
You can find the Lights options by typing "light" in the search bar at
the top of the properties panel and clicking the "Edit" button. Then
turn on "Additional Headlight" and adjust the headlight intensity in
the Lights Editor dialog.

Best,

2018-03-31 4:56 GMT+09:00 Hom Nath Gharti :
> Dear all,
>
> I want to make small values to be white, but it appears more like grey
> as in the attached figure. Is it possible to make small values white
> in this figure?
>
> Thank you for your help.
> HNG
>
> ___
> 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
>
___
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


Re: [Paraview] New variable to a mesh

2018-02-21 Thread kenichiro yoshimi
Hello Moulshree,

Using the function numpy.random.uniform(), you can define the range of
random numbers by the half-open interval [low, high):

  np_rand = np.random.uniform(0,100,numCells)

The details are as follows.
https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.uniform.html

And of course the conditional statements are available in Programmable
filter's script as is the case in normal python script.

Best

2018-02-21 18:06 GMT+09:00 Moulshree Tripathi :
> Hello
>
> Thank you very much for the response. It worked. Also, is it possible to
> give a range between which we want random numbers and could we use
> conditional statements?
>
> Best Regards
>
> Moulshree Tripathi
>
> On Wed, Feb 21, 2018 at 1:42 AM, kenichiro yoshimi 
> wrote:
>>
>> Hi Moulshree,
>>
>> The Programmable filter's script would be more flexible to add an
>> array rather than doing it in the calculator filter since it allows us
>> to use various NumPy modules.
>>
>> Here is a simple example that generates a random numpy array and adds
>> it to the mesh as a vtk array.
>> 
>> import numpy as np
>>
>> input = self.GetInput()
>> numCells = input.GetNumberOfCells()
>> np_rand = np.random.rand(numCells)
>> output.CellData.append(np_rand, "random")
>> 
>>
>> Some information can be found here:
>> https://www.paraview.org/Wiki/Python_Programmable_Filter
>>
>> Thanks
>>
>> 2018-02-20 17:37 GMT+09:00 Moulshree Tripathi :
>> > Greetings!
>> >
>> > I am new to ParaView and have few queries regarding the assigning of a
>> > new
>> > variable in mesh:
>> >
>> > 1: I am using calculator filter to add a new array. Is it possible to
>> > interpolate the values in this array and also is it possible to generate
>> > random numbers? (say if I want values between 0 to 1 in my array of 2000
>> > cells)
>> >
>> > 2: Is there any other method by which I could assign properties to the
>> > mesh?
>> > (say I want to assign different values to my cell - say hydraulic
>> > conductivities in inhomogeneous porous medium) How can I do this with
>> > calculator filter or with any other tool?
>> >
>> > I am sorry if the questions are naive.
>> > Looking forward to your response.
>> >
>> > Regards
>> >
>> > Moulshree Tripathi
>> >
>> > ___
>> > 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
>> >
>
>
___
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


Re: [Paraview] New variable to a mesh

2018-02-20 Thread kenichiro yoshimi
Hi Moulshree,

The Programmable filter's script would be more flexible to add an
array rather than doing it in the calculator filter since it allows us
to use various NumPy modules.

Here is a simple example that generates a random numpy array and adds
it to the mesh as a vtk array.

import numpy as np

input = self.GetInput()
numCells = input.GetNumberOfCells()
np_rand = np.random.rand(numCells)
output.CellData.append(np_rand, "random")


Some information can be found here:
https://www.paraview.org/Wiki/Python_Programmable_Filter

Thanks

2018-02-20 17:37 GMT+09:00 Moulshree Tripathi :
> Greetings!
>
> I am new to ParaView and have few queries regarding the assigning of a new
> variable in mesh:
>
> 1: I am using calculator filter to add a new array. Is it possible to
> interpolate the values in this array and also is it possible to generate
> random numbers? (say if I want values between 0 to 1 in my array of 2000
> cells)
>
> 2: Is there any other method by which I could assign properties to the mesh?
> (say I want to assign different values to my cell - say hydraulic
> conductivities in inhomogeneous porous medium) How can I do this with
> calculator filter or with any other tool?
>
> I am sorry if the questions are naive.
> Looking forward to your response.
>
> Regards
>
> Moulshree Tripathi
>
> ___
> 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
>
___
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


Re: [Paraview] Finding all the points associated with one closed contour line

2018-02-19 Thread kenichiro yoshimi
Hi Shuhao,

In ParaView, the connectivity filter is available to assign a region
id to each of closed loops and generate a RegionId array. And then the
threshold filter can be used to separate them.

Thanks

2018-02-20 6:12 GMT+09:00 Shuhao Wu :
> Hello All,
>
> I'm currently using the Contour filter on a 2D slice. This contour gives me
> a series of closed loops at arbitrary locations of my plot. Does
> Paraview/VTK already expose a way to group the points associated with each
> of these closed loops?
>
> If not, I have two possible strategies to detect these points:
>
> 1. I think the contour filter outputs the points of each closed loops in
> sequential order in the point array. I could compare the geometric distance
> between two sequential points in the array and detect a "large jump"
> followed by a "large decrease" to detect the transition from one loop to the
> next.
>
> 2. I could employ some sort of cluster finding algorithm, although I'm not
> sure which one as I do not know how many of these loops are and likely need
> something that optimizes for boundaries as opposed to centroids.
>
> Are these ideas sane if PV doesn't already expose some functionalities that
> I do not know about?
>
> Thanks,
> Shuhao
> ___
> 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
___
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


Re: [Paraview] [EXT] Re: Good neighbor filter

2018-02-15 Thread kenichiro yoshimi
Hi,

I have experienced a similar situation with a vtkUnstructuredGrid, and
written a programmable filter something like:

import numpy as np

input = self.GetInput()
output = self.GetOutput()

numCells = input.GetNumberOfCells()

volChange = vtk.vtkFloatArray()
volChange.SetName("volumeChange")
volChange.SetNumberOfComponents(1)
volChange.SetNumberOfTuples(numCells)

for cellId in range(numCells):
  cell = input.GetCell(cellId)

  maxVol = -vtk.VTK_DOUBLE_MAX
  minVol = vtk.VTK_DOUBLE_MAX

  nFaces = cell.GetNumberOfFaces()
  for faceId in range(nFaces):
pntIds = cell.GetFace(faceId).GetPointIds()

neighbors = vtk.vtkIdList()
input.GetCellNeighbors(cellId, pntIds, neighbors)

numNei = neighbors.GetNumberOfIds()
for num in range(numNei):
  neiId = neighbors.GetId(num)
  nei = input.GetCell(neiId)
  if nei.GetCellType() == vtk.VTK_TETRA:
p1 = input.GetPoint(nei.GetPointId(0))
p2 = input.GetPoint(nei.GetPointId(1))
p3 = input.GetPoint(nei.GetPointId(2))
p4 = input.GetPoint(nei.GetPointId(3))
vol = vtk.vtkTetra.ComputeVolume(p1, p2, p3, p4)
maxVol = np.maximum(maxVol, vol)
minVol = np.minimum(minVol, vol)

  input.GetCell(cellId)
  #print(str(cellId) + ':' + str(maxVol/minVol))
  volChange.SetValue(cellId, maxVol/minVol)

output.GetCellData().AddArray(volChange)


Notice this computes the volumes of all cells that neighbor a cell on its
faces.

Thanks,

2018-02-15 23:17 GMT+09:00 Dennis Conklin :

> Andy,
>
>
>
> Thanks for that hint – I think I get the idea.   This is a “as time is
> available” project, so I’ll start exploring it, but I appreciate being
> pointed in the right direction.
>
>
>
> Dennis
>
>
>
> *From:* Andy Bauer [mailto:andy.ba...@kitware.com]
> *Sent:* Wednesday, February 14, 2018 1:51 PM
> *To:* Dennis Conklin 
> *Cc:* Paraview (parav...@paraview.org) 
> *Subject:* [EXT] Re: [Paraview] Good neighbor filter
>
>
>
>  *WARNING - External email; exercise caution.*
>
>
>
> 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_conk...@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
>