[Paraview] Pb reading a Tensor6 XDMF type from HDF5 file

2018-05-03 Thread Romain Beucher
Hi All,

I have a HDF5 file that contains components of a 2D symmetric tensor in 
an array with dimensions (N, 3) 1:XX, 2:YY, 3:XY

I am trying to create an XDMF Tensor6 type to visualize the field in 
paraview.

Tensor6 has 6 components so I am creating components with zero values 
(XZ, ZZ, YZ) using a JOIN function and a series of hyperslabs...

   
     
   
      0 0 1 1 49665 1 

     projStressField-133.h5:/data
   
   
      0 1 1 1 49665 1 

     projStressField-133.h5:/data
   
   
      0 2 1 1 49665 1 

     projStressField-133.h5:/data
   
     
   


Paraview 5.3.0 crashes with the following error:

XDMF Error in 
/home/romain/Downloads/paraview/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfHDF.cxx
 
line 558 (Source and Target Spaces specify different sizes)
XDMF Error in 
/home/romain/Downloads/paraview/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfHDF.cxx
 
line 559 (Source = 148995 items)
XDMF Error in 
/home/romain/Downloads/paraview/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfHDF.cxx
 
line 560 (Target = 99330 items)
XDMF Error in 
/home/romain/Downloads/paraview/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfHDF.cxx
 
line 905 (Can't Read Temp Dataset)
paraview: malloc.c:2399: sysmalloc: Assertion `(old_top == initial_top 
(av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && 
prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 
0)' failed.
Aborted (core dumped)

I have attached an example.

Any ideas?

Romain Beucher



http://www.w3.org/2001/XInclude; Version="2.0">
  

  
  

  
 0 0 1 1 49152 1 
mesh.h5:/en_map
  
  
 0 1 1 1 49152 1 
mesh.h5:/en_map
  
  
 0 2 1 1 49152 1 
mesh.h5:/en_map
  
  
 0 3 1 1 49152 1 
mesh.h5:/en_map
  

  
  

  
 0 0 1 1 49665 1 
mesh.h5:/vertices
  
  
 0 1 1 1 49665 1 
mesh.h5:/vertices
  

  
  

  
 0 0 1 1 49665 1 
projStressField-133.h5:/data
  
  
 0 1 1 1 49665 1 
projStressField-133.h5:/data
  
  
 0 2 1 1 49665 1 
projStressField-133.h5:/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] generic NetCDFreader support for CellData

2018-05-03 Thread Engelen, J. van (Joeri)
Thank you Cory,

That indeed worked on the toy example, but when I tried it on my full dataset 
(uploaded here as well) Paraview v5.4.1 had trouble rendering it (only rendered 
part of the outer sides, when activating coloring).
I think it is not the script now giving issues, but the renderer. As I 
experience similar issues previously with celldata loaded from a .VTR file (I 
assumed that that file was corrupted).
It seems to me that when you go beyond a certain amount of cells, Paraview does 
not render its output properly.

Could you test whether it works for you on v5.5?

I uploaded my full dataset here:
https://coeri.stackstorage.com/s/ztga1yLO8mjD1EO

To visualize data properly:
Put a threshold filter and filter out 0.0 (as that is NoData) by putting 
minimum on 0.5, furthermore stretch the z direction by a factor 3000.


From: Cory Quammen [mailto:cory.quam...@kitware.com]
Sent: Thursday, May 03, 2018 4:13 PM
To: Engelen, J. van (Joeri)
Cc: Moreland, Kenneth; paraview@public.kitware.com
Subject: Re: [Paraview] generic NetCDFreader support for CellData

Indeed, my original script is not quite right. Here is a more robust version 
that should copy all point data arrays to cell data arrays:


dims = inputs[0].GetDimensions()

ext = inputs[0].GetExtent()

output.SetDimensions(dims[0]+1, dims[1]+1, dims[2]+1)

output.SetExtent(ext[0], ext[1]+1, ext[2], ext[3]+1, ext[4], ext[5]+1)

inputPd = inputs[0].PointData

outputCd = output.CellData

for array in inputPd:

  print(type(array))

  outputCd.append(array, array.GetName())
I hope that does it. It works in my ParaView 5.5 with the sample data you 
provided (thank you for providing that!).

Best regards,
Cory

On Thu, May 3, 2018 at 7:48 AM Engelen, J. van (Joeri) 
> wrote:
Thanks everybody for the support,

I followed Ken’s suggestion, which will simplify things, however when I put 
Cory’s original script in the programmable filter no Data Array can be found in 
the output. So I sense there is a (small) bug in the script?
I tried changing the last three lines to the oneliner 
output.GetCellData().SetScalars(inputs[0].GetPointData().GetScalars())
But that did not help.

I have uploaded a small subset of my data here for you to toy around with 
https://coeri.stackstorage.com/s/0vUfQkVyv2MD3Ml. (Note: It helps for 
visualization to stretch the z-axis by a factor 3000).
This perhaps helps you with helping me.


From: Moreland, Kenneth [mailto:kmo...@sandia.gov]
Sent: Wednesday, May 02, 2018 7:27 PM
To: Quammen, Cory (External Contacts); Engelen, J. van (Joeri)
Cc: paraview@public.kitware.com
Subject: Re: [Paraview] generic NetCDFreader support for CellData

The NetCDF Generic/CF reader has an option named “Output Type” that you can use 
to force the output to a vtkImageData. Then Cory’s original programmable filter 
will work, and you won’t have to deal with the coordinates.

-Ken

From: ParaView 
>
 on behalf of Cory Quammen 
>
Date: Wednesday, May 2, 2018 at 11:19 AM
To: "j.vanengel...@uu.nl" 
>
Cc: "paraview@public.kitware.com" 
>
Subject: [EXTERNAL] Re: [Paraview] generic NetCDFreader support for CellData

On Wed, May 2, 2018 at 11:37 AM Engelen, J. van (Joeri) 
> wrote:
Thank you Cory,

I sense this solution might work. However, the type of my data is “Rectilinear 
Grid”, not sure if that increases the complexity (dx = 1000, dy = 1000, dz = 1).

Ah. From the documentation: "To define a 
vtkRectilinearGrid,
 you must specify the dimensions of the data and provide three arrays of values 
specifying the coordinates along the x-y-z axes". It should be a similar 
script, but you'd have to add an additional X, Y, and Z position at the end of 
those coordinate arrays. So your script would look more like:

dims = inputs[0].GetDimensions()

ext = inputs[0].GetExtent()

output.SetDimensions(dims[0]+1, dims[1]+1, dims[2]+1)

output.SetExtent(ext[0], ext[1]+1, ext[2], ext[3]+1, ext[4], ext[5]+1)

inputPd = inputs[0].GetPointData()

outputCd = output.GetCellData()

outputCd.SetScalars(inputPd.GetScalars())



# Set coordinates

xCoords = inputs[0].GetXCoordinates().NewInstance()

xCoords.DeepCopy(inputs[0].GetXCoordinates())

xCoords.InsertNextValue(1.0) # Should a reasonable x value for your dataset 
larger than previous max x

output.SetXCoordinates(xCoords)



yCoords = inputs[0].GetYCoordinates().NewInstance()

yCoords.DeepCopy(inputs[0].GetYCoordinates())

yCoords.InsertNextValue(1.5) # Should be a reasonable like the x coordinate


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

2018-05-03 Thread Dennis Conklin
Guys,

Just wanted to wrap up loose ends on this.

It turned out the arctan2 call was not the problem – most of the time was spent 
averaging the nodal values onto the cells, but a separate thread has enabled me 
to call vtkPointDataToCellData for selected variables within my Programmable 
Filter.  The filter is now ~ 15 times faster than before and my users have 
stopped grumbling (won’t last though!!)

Thanks for all the support!
Dennis

From: Dennis Conklin
Sent: Monday, April 30, 2018 2:08 PM
To: 'Cory Quammen' ; kenichiro yoshimi 

Cc: Paraview (parav...@paraview.org) 
Subject: RE: [Paraview] [EXT] RE: [EXTERNAL] Calculating cylindrical coordinates

Cory,

No, I’m using numpy.arctan2 – sorry, always think of it as atan2.

What I’m doing now is:

   # Undeformed Sector Angles (degrees about Y-axis, 0=FP)
   numPts=block.GetNumberOfPoints()
   node_angles=zeros( (numPts,1) )
   
x_undef,y_undef,z_undef=calc_node_undeformed_coords(block)
   node_angles=arctan2(x_undef,z_undef)*180.0/pi
return node_angles

So, I’m not looping, as you suggest.   I am later doing a custom 
point-data-to-cell-data by looping over millions of cells and finding each 
cells nodes and averaging them, but I’ve failed to get 
vtk.vtkPointDataToCellData to work inside my Programmable filter, so I don’t 
have a good alternative.

I keep meaning to take out the cell angles and see how much that speeds it up, 
but haven’t done that yet.

Thanks for looking at this.

Dennis

From: Cory Quammen [mailto:cory.quam...@kitware.com]
Sent: Monday, April 30, 2018 1:44 PM
To: kenichiro yoshimi >
Cc: Dennis Conklin 
>; Paraview 
(parav...@paraview.org) 
>
Subject: Re: [Paraview] [EXT] RE: [EXTERNAL] Calculating cylindrical coordinates

Dennis,

First, do you mean numpy.arctan2? I don't see that numpy.atan2 exists,but 
math.atan2 exists.

Second, I suspect you are looping over millions of points in Python and are 
calling numpy.arctan2 on single X, Y values. Looping in Python like that will 
be very slow. Instead, you can get all your X values into one numpy array and 
do the same with your Y values, then make a single call to numpy.atan2. Here's 
an example:


>>> from paraview.simple import *

>>> import numpy

>>> x = [1, 2, 3, 4]

>>> y = [5, 6, 7, 8]

>>> numpy.arctan2(y, x)

array([ 1.37340077, 1.24904577, 1.16590454, 1.10714872])

To get the X and Y arrays, you can use the numpy adapter:


>>> from vtk.numpy_interface import dataset_adapter as dsa

>>> wrappedData = dsa.WrapDataObject(polydata)

>>> X = wrappedData.Points[:,0]

>>> Y = wrappedData.Points[:,1]

>>> result = numpy.arctan2(Y, X)

Hope that helps,
Cory


On Sat, Apr 28, 2018 at 1:25 AM, kenichiro yoshimi 
> wrote:
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 

Re: [Paraview] isosurfaces & slices, lights/shadows

2018-05-03 Thread Michael Müller

Thanks a lot, this works fine.

I always thought the other way round, that I got to keep lights off and 
modify the contour/isofsurface...


Michael


On 03.05.2018 15:10, David E DeMarle wrote:

We can't yet restrict lights to specific objects.

However you can get the effect you want by turning up the ambient
intensity and turning off the diffuse intensity on the objects you
want to be independent of the light (the slices).

See Ambient and Diffuse sliders in the GUI or from python do something
like the following:
obj = FindSource("Slice1")
rep = GetRepresentation()
rep.Diffuse = 0
rep.Ambient = 1


David E DeMarle
Kitware, Inc.
Principal Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Thu, May 3, 2018 at 4:21 AM, Michael Müller
 wrote:

Dear users,

I am having some problem visualizing isosurfaces/contours in combination
with slices. Usually I switch off all lights to get nice coloring:
/
renderView1.UseLight = 0   # for slices etc.
/
(Output without isosurface attached: temp.jpg)

When I include an isosurface using contour-filter, it looks totally 'flat',
there are no contours or shadows visible.
(Output with ugly isosurface attached: temp-iso-nolight.jpg)

What I tried to do was switch on lighting and include additional lights with
intensity 0.6 (to prevent getting too dark coloring of the slices).
/
renderView1.UseLight = 1   # for slices etc.
light1 = AddLight(view=renderView1)# for contour on isosurfaces !!!
light1.Coords= 'Ambient'   # position-less == camera
light1.Intensity = 0.6 # dim intensity [0:1]
/
(Output with nice isosurface attached: temp-iso-light-addlight06.jpg).

Still the problem: while I get a nice isosurface and the vertical slice is
looking okay, the horizontal slices are still darker than the ones in the
default screenshot (see: temp-iso-light-addlight06.jpg vs temp.jpg).

Is there a way, to turn on/off lights on single objects in my pipeline?
Is it possible to include something like shading directly to the isosurface?
Any other ideas!?

Thanks,

Michael


___
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] find minimum on a slice using interpolated values

2018-05-03 Thread Caffagni, Andrea
Unfortunately I am using polyhedral/ hexa mesh with higher order scheme, find 
the minimum on a mesh point is a good start.
But if someone know a programmable filter that, using VTK is able to find the 
minimum would be a lot useful.
The method would be very robust and not very sensitive to variations in the 
mesh that may undergo slight variations.
Do you have any ideas for how to use vtk and / or numpy for this purpose?

Best Regards,
Andrea

From: Cory Quammen [mailto:cory.quam...@kitware.com]
Sent: Thursday, May 03, 2018 16:17
To: Caffagni, Andrea
Cc: Mathieu Westphal; paraview@public.kitware.com
Subject: Re: [Paraview] find minimum on a slice using interpolated values

Andrea,

Are your mesh cells linear (and hence linear interpolation would be used)? If 
so, then the minimum will always be at a mesh point. If they are higher order 
elements, then indeed the minimum could be somewhere inside a cell. Others on 
the list may be able to tell you if there is a way to find this minimum point 
in VTK.

Best regards,
Cory

On Thu, May 3, 2018 at 4:13 AM Caffagni, Andrea 
> wrote:
Thank you Mathieu for your suggestion,
But if I understand correctly with this method I’m able to find only the value 
on the mesh points.
Thus, if I change the mesh with finer or coarser elements the value and the 
location that I can find change.
I would like to avoid this behavior, for this reason I would get the minimum 
value using the interpolated value on the slice.
do you think it's possible to do it? can I manage this with a programmable 
filter (work from script without gui)?

Best Regards,
Andrea

From: Mathieu Westphal 
[mailto:mathieu.westp...@kitware.com]
Sent: Thursday, May 03, 2018 09:07
To: Caffagni, Andrea
Cc: paraview@public.kitware.com
Subject: Re: [Paraview] find minimum on a slice using interpolated values

Hi Andrea,
If your are using ParaView, you can obtain this information quite easilly by 
showing your dataset in a Spreadsheet view and orderinng the data by "Pressure".

Best,

Mathieu Westphal

On Wed, May 2, 2018 at 8:57 PM, Caffagni, Andrea 
> wrote:
Dear users,
I need to find the absolute minimum value on a slice of a certain scalar (like 
pressure).
I would get this point using the interpolation in order to avoid the 
‘sensitivity’ to the mesh (in this way, theoretically, if I change the mesh the 
minimum should always remain at the same point).
For this point I would like to get the three-dimensional position and the value 
of the scalar in question (pressure and/or velocity), maybe I can use the numpy 
functions in a programmable filter?

https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.amin.html

But I have not idea of how use the interpolation…

Thanks for the suggestions,
Andrea

_



Questo messaggio è da intendersi esclusivamente ad uso del destinatario e può 
contenere informazioni che sono di natura privilegiata, confidenziale o non 
divulgabile secondo le leggi vigenti. Se il lettore del presente messaggio non 
è il destinatario designato, o il dipendente/agente responsabile per la 
consegna del messaggio al destinatario designato, si informa che ogni 
disseminazione, distribuzione o copiatura di questa comunicazione è vietata 
anche ai sensi della normativa vigente in materia di protezione dei dati 
personali. Se avete ricevuto questo messaggio per errore, vi preghiamo di 
notificarcelo immediatamente a mezzo e-mail di risposta e successivamente di 
procedere alla cancellazione di questa e-mail e relativi allegati dal vostro 
sistema.

_



This message is intended only for the use of the addressee and may contain 
information that is privileged, confidential and exempt from disclosure under 
applicable law. If the reader of this message is not the intended recipient, or 
the employee or agent responsible for delivering the message to the intended 
recipient, you are hereby notified that any dissemination, distribution or 
copying of this communication is prohibited under the applicable data 
protection law. If you have received this e-mail by mistake, please notify us 
immediately by return e-mail and delete this e-mail and all attachments from 
your system.



_

___
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: 

Re: [Paraview] find minimum on a slice using interpolated values

2018-05-03 Thread Cory Quammen
Andrea,

Are your mesh cells linear (and hence linear interpolation would be used)?
If so, then the minimum will always be at a mesh point. If they are higher
order elements, then indeed the minimum could be somewhere inside a cell.
Others on the list may be able to tell you if there is a way to find this
minimum point in VTK.

Best regards,
Cory

On Thu, May 3, 2018 at 4:13 AM Caffagni, Andrea 
wrote:

> Thank you Mathieu for your suggestion,
>
> But if I understand correctly with this method I’m able to find only the
> value on the mesh points.
>
> Thus, if I change the mesh with finer or coarser elements the value and
> the location that I can find change.
>
> I would like to avoid this behavior, for this reason I would get the
> minimum value using the interpolated value on the slice.
>
> do you think it's possible to do it? can I manage this with a programmable
> filter (work from script without gui)?
>
>
>
> Best Regards,
>
> Andrea
>
>
>
> *From:* Mathieu Westphal [mailto:mathieu.westp...@kitware.com]
> *Sent:* Thursday, May 03, 2018 09:07
> *To:* Caffagni, Andrea
> *Cc:* paraview@public.kitware.com
> *Subject:* Re: [Paraview] find minimum on a slice using interpolated
> values
>
>
>
> Hi Andrea,
>
> If your are using ParaView, you can obtain this information quite easilly
> by showing your dataset in a Spreadsheet view and orderinng the data by
> "Pressure".
>
>
>
> Best,
>
>
> Mathieu Westphal
>
>
>
> On Wed, May 2, 2018 at 8:57 PM, Caffagni, Andrea <
> andrea.caffa...@ferrari.com> wrote:
>
> Dear users,
>
> I need to find the absolute minimum value on a slice of a certain scalar
> (like pressure).
>
> I would get this point using the interpolation in order to avoid the
> ‘sensitivity’ to the mesh (in this way, theoretically, if I change the mesh
> the minimum should always remain at the same point).
>
> For this point I would like to get the three-dimensional position and the
> value of the scalar in question (pressure and/or velocity), maybe I can use
> the numpy functions in a programmable filter?
>
>
>
> https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.amin.html
>
>
>
> But I have not idea of how use the interpolation…
>
>
>
> Thanks for the suggestions,
>
> Andrea
>
>
> _
>
>
>
> Questo messaggio è da intendersi esclusivamente ad uso del destinatario e
> può contenere informazioni che sono di natura privilegiata, confidenziale o
> non divulgabile secondo le leggi vigenti. Se il lettore del presente
> messaggio non è il destinatario designato, o il dipendente/agente
> responsabile per la consegna del messaggio al destinatario designato, si
> informa che ogni disseminazione, distribuzione o copiatura di questa
> comunicazione è vietata anche ai sensi della normativa vigente in materia
> di protezione dei dati personali. Se avete ricevuto questo messaggio per
> errore, vi preghiamo di notificarcelo immediatamente a mezzo e-mail di
> risposta e successivamente di procedere alla cancellazione di questa e-mail
> e relativi allegati dal vostro sistema.
>
>
> _
>
>
>
> This message is intended only for the use of the addressee and may contain
> information that is privileged, confidential and exempt from disclosure
> under applicable law. If the reader of this message is not the intended
> recipient, or the employee or agent responsible for delivering the message
> to the intended recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is prohibited under the
> applicable data protection law. If you have received this e-mail by
> mistake, please notify us immediately by return e-mail and delete this
> e-mail and all attachments from your system.
>
>
>
>
> _
>
>
> ___
> 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
>
>
>
>
> _
>
>
>
> Questo messaggio è da intendersi esclusivamente ad uso del destinatario e
> può contenere informazioni che sono di natura privilegiata, confidenziale o
> non divulgabile secondo le leggi vigenti. Se il lettore del presente
> messaggio non è il destinatario designato, o il dipendente/agente
> responsabile per la consegna del messaggio al 

Re: [Paraview] generic NetCDFreader support for CellData

2018-05-03 Thread Cory Quammen
Indeed, my original script is not quite right. Here is a more robust
version that should copy all point data arrays to cell data arrays:

dims = inputs[0].GetDimensions()

ext = inputs[0].GetExtent()

output.SetDimensions(dims[0]+1, dims[1]+1, dims[2]+1)

output.SetExtent(ext[0], ext[1]+1, ext[2], ext[3]+1, ext[4], ext[5]+1)

inputPd = inputs[0].PointData

outputCd = output.CellData

for array in inputPd:

  print(type(array))

  outputCd.append(array, array.GetName())

I hope that does it. It works in my ParaView 5.5 with the sample data you
provided (thank you for providing that!).

Best regards,
Cory

On Thu, May 3, 2018 at 7:48 AM Engelen, J. van (Joeri) 
wrote:

> Thanks everybody for the support,
>
>
>
> I followed Ken’s suggestion, which will simplify things, however when I
> put Cory’s original script in the programmable filter no Data Array can be
> found in the output. So I sense there is a (small) bug in the script?
>
> I tried changing the last three lines to the oneliner output.GetCellData()
> .SetScalars(inputs[0].GetPointData().GetScalars())
>
> But that did not help.
>
>
>
> I have uploaded a small subset of my data here for you to toy around with
> https://coeri.stackstorage.com/s/0vUfQkVyv2MD3Ml. (Note: It helps for
> visualization to stretch the z-axis by a factor 3000).
>
> This perhaps helps you with helping me.
>
>
>
>
>
> *From:* Moreland, Kenneth [mailto:kmo...@sandia.gov]
> *Sent:* Wednesday, May 02, 2018 7:27 PM
> *To:* Quammen, Cory (External Contacts); Engelen, J. van (Joeri)
> *Cc:* paraview@public.kitware.com
> *Subject:* Re: [Paraview] generic NetCDFreader support for CellData
>
>
>
> The NetCDF Generic/CF reader has an option named “Output Type” that you
> can use to force the output to a vtkImageData. Then Cory’s original
> programmable filter will work, and you won’t have to deal with the
> coordinates.
>
>
>
> -Ken
>
>
>
> *From: *ParaView  on behalf of Cory
> Quammen 
> *Date: *Wednesday, May 2, 2018 at 11:19 AM
> *To: *"j.vanengel...@uu.nl" 
> *Cc: *"paraview@public.kitware.com" 
> *Subject: *[EXTERNAL] Re: [Paraview] generic NetCDFreader support for
> CellData
>
>
>
> On Wed, May 2, 2018 at 11:37 AM Engelen, J. van (Joeri) <
> j.vanengel...@uu.nl> wrote:
>
> Thank you Cory,
>
>
>
> I sense this solution might work. However, the type of my data is
> “Rectilinear Grid”, not sure if that increases the complexity (dx = 1000,
> dy = 1000, dz = 1).
>
>
>
> Ah. From the documentation: "To define a *vtkRectilinearGrid*
> , you
> must specify the dimensions of the data and provide three arrays of values
> specifying the coordinates along the x-y-z axes". It should be a similar
> script, but you'd have to add an additional X, Y, and Z position at the end
> of those coordinate arrays. So your script would look more like:
>
>
>
> dims = inputs[0].GetDimensions()
>
> ext = inputs[0].GetExtent()
>
> output.SetDimensions(dims[0]+1, dims[1]+1, dims[2]+1)
>
> output.SetExtent(ext[0], ext[1]+1, ext[2], ext[3]+1, ext[4], ext[5]+1)
>
> inputPd = inputs[0].GetPointData()
>
> outputCd = output.GetCellData()
>
> outputCd.SetScalars(inputPd.GetScalars())
>
>
>
> *# Set coordinates*
>
> xCoords = inputs[0].GetXCoordinates().NewInstance()
>
> xCoords.DeepCopy(inputs[0].GetXCoordinates())
>
> xCoords.InsertNextValue(1.0) # Should a reasonable x value for your dataset 
> larger than previous max x
>
> output.SetXCoordinates(xCoords)
>
>
>
> yCoords = inputs[0].GetYCoordinates().NewInstance()
>
> yCoords.DeepCopy(inputs[0].GetYCoordinates())
>
> yCoords.InsertNextValue(1.5) # Should be a reasonable like the x coordinate
>
> output.SetYCoordinates(yCoords)
>
>
>
> zCoords = inputs[0].GetZCoordinates().NewInstance()
>
> zCoords.DeepCopy(inputs[0].GetZCoordinates())
>
> zCoords.InsertNextValue(1.0) # Should be a reasonable like the z coordinate
>
> output.SetZCoordinates(zCoords)
>
>
>
> Some extent information also needs to be supplied, but I'm not entirely
> clear on how to do that correctly.
>
>
>
> A better solution would be to add an option to the reader to take care of
> this for you if that is reasonable for your data.
>
>
>
> Best,
>
> Cory
>
>
>
> Regardless, the script you provided does not give me output and it also
> does not throw an error, so I’m left a bit in the dark here.
>
>
>
> *From:* Cory Quammen [mailto:cory.quam...@kitware.com]
> *Sent:* Wednesday, May 02, 2018 5:01 PM
> *To:* Engelen, J. van (Joeri)
> *Cc:* paraview@public.kitware.com
> *Subject:* Re: [Paraview] generic NetCDFreader support for CellData
>
>
>
> Joeri,
>
>
>
> You can try the "Point Data to Cell Data" filter, but that averages the
> point data and places the results in the cell data. You may wind up with
> some incorrect values using that approach.
>
>
>
> Better would be to use a "Progammable Filter" to resize 

Re: [Paraview] isosurfaces & slices, lights/shadows

2018-05-03 Thread David E DeMarle
We can't yet restrict lights to specific objects.

However you can get the effect you want by turning up the ambient
intensity and turning off the diffuse intensity on the objects you
want to be independent of the light (the slices).

See Ambient and Diffuse sliders in the GUI or from python do something
like the following:
obj = FindSource("Slice1")
rep = GetRepresentation()
rep.Diffuse = 0
rep.Ambient = 1


David E DeMarle
Kitware, Inc.
Principal Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Thu, May 3, 2018 at 4:21 AM, Michael Müller
 wrote:
> Dear users,
>
> I am having some problem visualizing isosurfaces/contours in combination
> with slices. Usually I switch off all lights to get nice coloring:
> /
> renderView1.UseLight = 0   # for slices etc.
> /
> (Output without isosurface attached: temp.jpg)
>
> When I include an isosurface using contour-filter, it looks totally 'flat',
> there are no contours or shadows visible.
> (Output with ugly isosurface attached: temp-iso-nolight.jpg)
>
> What I tried to do was switch on lighting and include additional lights with
> intensity 0.6 (to prevent getting too dark coloring of the slices).
> /
> renderView1.UseLight = 1   # for slices etc.
> light1 = AddLight(view=renderView1)# for contour on isosurfaces !!!
> light1.Coords= 'Ambient'   # position-less == camera
> light1.Intensity = 0.6 # dim intensity [0:1]
> /
> (Output with nice isosurface attached: temp-iso-light-addlight06.jpg).
>
> Still the problem: while I get a nice isosurface and the vertical slice is
> looking okay, the horizontal slices are still darker than the ones in the
> default screenshot (see: temp-iso-light-addlight06.jpg vs temp.jpg).
>
> Is there a way, to turn on/off lights on single objects in my pipeline?
> Is it possible to include something like shading directly to the isosurface?
> Any other ideas!?
>
> Thanks,
>
> Michael
>
>
> ___
> 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] generic NetCDFreader support for CellData

2018-05-03 Thread Engelen, J. van (Joeri)
Thanks everybody for the support,

I followed Ken’s suggestion, which will simplify things, however when I put 
Cory’s original script in the programmable filter no Data Array can be found in 
the output. So I sense there is a (small) bug in the script?
I tried changing the last three lines to the oneliner 
output.GetCellData().SetScalars(inputs[0].GetPointData().GetScalars())
But that did not help.

I have uploaded a small subset of my data here for you to toy around with 
https://coeri.stackstorage.com/s/0vUfQkVyv2MD3Ml. (Note: It helps for 
visualization to stretch the z-axis by a factor 3000).
This perhaps helps you with helping me.


From: Moreland, Kenneth [mailto:kmo...@sandia.gov]
Sent: Wednesday, May 02, 2018 7:27 PM
To: Quammen, Cory (External Contacts); Engelen, J. van (Joeri)
Cc: paraview@public.kitware.com
Subject: Re: [Paraview] generic NetCDFreader support for CellData

The NetCDF Generic/CF reader has an option named “Output Type” that you can use 
to force the output to a vtkImageData. Then Cory’s original programmable filter 
will work, and you won’t have to deal with the coordinates.

-Ken

From: ParaView  on behalf of Cory Quammen 

Date: Wednesday, May 2, 2018 at 11:19 AM
To: "j.vanengel...@uu.nl" 
Cc: "paraview@public.kitware.com" 
Subject: [EXTERNAL] Re: [Paraview] generic NetCDFreader support for CellData

On Wed, May 2, 2018 at 11:37 AM Engelen, J. van (Joeri) 
> wrote:
Thank you Cory,

I sense this solution might work. However, the type of my data is “Rectilinear 
Grid”, not sure if that increases the complexity (dx = 1000, dy = 1000, dz = 1).

Ah. From the documentation: "To define a 
vtkRectilinearGrid,
 you must specify the dimensions of the data and provide three arrays of values 
specifying the coordinates along the x-y-z axes". It should be a similar 
script, but you'd have to add an additional X, Y, and Z position at the end of 
those coordinate arrays. So your script would look more like:

dims = inputs[0].GetDimensions()

ext = inputs[0].GetExtent()

output.SetDimensions(dims[0]+1, dims[1]+1, dims[2]+1)

output.SetExtent(ext[0], ext[1]+1, ext[2], ext[3]+1, ext[4], ext[5]+1)

inputPd = inputs[0].GetPointData()

outputCd = output.GetCellData()

outputCd.SetScalars(inputPd.GetScalars())



# Set coordinates

xCoords = inputs[0].GetXCoordinates().NewInstance()

xCoords.DeepCopy(inputs[0].GetXCoordinates())

xCoords.InsertNextValue(1.0) # Should a reasonable x value for your dataset 
larger than previous max x

output.SetXCoordinates(xCoords)



yCoords = inputs[0].GetYCoordinates().NewInstance()

yCoords.DeepCopy(inputs[0].GetYCoordinates())

yCoords.InsertNextValue(1.5) # Should be a reasonable like the x coordinate

output.SetYCoordinates(yCoords)



zCoords = inputs[0].GetZCoordinates().NewInstance()

zCoords.DeepCopy(inputs[0].GetZCoordinates())

zCoords.InsertNextValue(1.0) # Should be a reasonable like the z coordinate

output.SetZCoordinates(zCoords)


Some extent information also needs to be supplied, but I'm not entirely clear 
on how to do that correctly.

A better solution would be to add an option to the reader to take care of this 
for you if that is reasonable for your data.

Best,
Cory

Regardless, the script you provided does not give me output and it also does 
not throw an error, so I’m left a bit in the dark here.

From: Cory Quammen 
[mailto:cory.quam...@kitware.com]
Sent: Wednesday, May 02, 2018 5:01 PM
To: Engelen, J. van (Joeri)
Cc: paraview@public.kitware.com
Subject: Re: [Paraview] generic NetCDFreader support for CellData

Joeri,

You can try the "Point Data to Cell Data" filter, but that averages the point 
data and places the results in the cell data. You may wind up with some 
incorrect values using that approach.

Better would be to use a "Progammable Filter" to resize the cartesian grid read 
by the NetCDF reader and treat the point data as cell data. That is a bit 
involved, but not terrible. Set the Script to


dims = inputs[0].GetDimensions()

ext = inputs[0].GetExtent()

output.SetDimensions(dims[0]+1, dims[1]+1, dims[2]+1)

output.SetExtent(ext[0], ext[1]+1, ext[2], ext[3]+1, ext[4], ext[5]+1)

inputPd = inputs[0].GetPointData()

outputCd = output.GetCellData()

outputCd.SetScalars(inputPd.GetScalars())


This assumes that the NetCDF reader is producing a vtkImageData (you can check 
under the Information panel) which would report the Type: of the data set as 
"Image (Uniform Rectilinear Grid).

HTH,
Cory

On Wed, May 2, 2018 at 10:17 AM Engelen, J. van (Joeri) 
> wrote:
Hi,

I was wondering whether it is possible to read NetCDF files as CellData.

I have categorial data on Cartesian coordinates that 

Re: [Paraview] find minimum on a slice using interpolated values

2018-05-03 Thread Caffagni, Andrea
Thank you Mathieu for your suggestion,
But if I understand correctly with this method I’m able to find only the value 
on the mesh points.
Thus, if I change the mesh with finer or coarser elements the value and the 
location that I can find change.
I would like to avoid this behavior, for this reason I would get the minimum 
value using the interpolated value on the slice.
do you think it's possible to do it? can I manage this with a programmable 
filter (work from script without gui)?

Best Regards,
Andrea

From: Mathieu Westphal [mailto:mathieu.westp...@kitware.com]
Sent: Thursday, May 03, 2018 09:07
To: Caffagni, Andrea
Cc: paraview@public.kitware.com
Subject: Re: [Paraview] find minimum on a slice using interpolated values

Hi Andrea,
If your are using ParaView, you can obtain this information quite easilly by 
showing your dataset in a Spreadsheet view and orderinng the data by "Pressure".

Best,

Mathieu Westphal

On Wed, May 2, 2018 at 8:57 PM, Caffagni, Andrea 
> wrote:
Dear users,
I need to find the absolute minimum value on a slice of a certain scalar (like 
pressure).
I would get this point using the interpolation in order to avoid the 
‘sensitivity’ to the mesh (in this way, theoretically, if I change the mesh the 
minimum should always remain at the same point).
For this point I would like to get the three-dimensional position and the value 
of the scalar in question (pressure and/or velocity), maybe I can use the numpy 
functions in a programmable filter?

https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.amin.html

But I have not idea of how use the interpolation…

Thanks for the suggestions,
Andrea

_



Questo messaggio è da intendersi esclusivamente ad uso del destinatario e può 
contenere informazioni che sono di natura privilegiata, confidenziale o non 
divulgabile secondo le leggi vigenti. Se il lettore del presente messaggio non 
è il destinatario designato, o il dipendente/agente responsabile per la 
consegna del messaggio al destinatario designato, si informa che ogni 
disseminazione, distribuzione o copiatura di questa comunicazione è vietata 
anche ai sensi della normativa vigente in materia di protezione dei dati 
personali. Se avete ricevuto questo messaggio per errore, vi preghiamo di 
notificarcelo immediatamente a mezzo e-mail di risposta e successivamente di 
procedere alla cancellazione di questa e-mail e relativi allegati dal vostro 
sistema.

_



This message is intended only for the use of the addressee and may contain 
information that is privileged, confidential and exempt from disclosure under 
applicable law. If the reader of this message is not the intended recipient, or 
the employee or agent responsible for delivering the message to the intended 
recipient, you are hereby notified that any dissemination, distribution or 
copying of this communication is prohibited under the applicable data 
protection law. If you have received this e-mail by mistake, please notify us 
immediately by return e-mail and delete this e-mail and all attachments from 
your system.



_

___
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


_



Questo messaggio è da intendersi esclusivamente ad uso del destinatario e può 
contenere informazioni che sono di natura privilegiata, confidenziale o non 
divulgabile secondo le leggi vigenti. Se il lettore del presente messaggio non 
è il destinatario designato, o il dipendente/agente responsabile per la 
consegna del messaggio al destinatario designato, si informa che ogni 
disseminazione, distribuzione o copiatura di questa comunicazione è vietata 
anche ai sensi della normativa vigente in materia di protezione dei dati 
personali. Se avete ricevuto questo messaggio per errore, vi preghiamo di 
notificarcelo immediatamente a mezzo e-mail di risposta e successivamente di 
procedere alla cancellazione di questa e-mail e relativi allegati dal vostro 
sistema.

_



This message is intended only for the use of the 

Re: [Paraview] find minimum on a slice using interpolated values

2018-05-03 Thread Mathieu Westphal
Hi Andrea,

If your are using ParaView, you can obtain this information quite easilly
by showing your dataset in a Spreadsheet view and orderinng the data by
"Pressure".

Best,

Mathieu Westphal

On Wed, May 2, 2018 at 8:57 PM, Caffagni, Andrea <
andrea.caffa...@ferrari.com> wrote:

> Dear users,
>
> I need to find the absolute minimum value on a slice of a certain scalar
> (like pressure).
>
> I would get this point using the interpolation in order to avoid the
> ‘sensitivity’ to the mesh (in this way, theoretically, if I change the mesh
> the minimum should always remain at the same point).
>
> For this point I would like to get the three-dimensional position and the
> value of the scalar in question (pressure and/or velocity), maybe I can use
> the numpy functions in a programmable filter?
>
>
>
> https://docs.scipy.org/doc/numpy-1.14.0/reference/
> generated/numpy.amin.html
>
>
>
> But I have not idea of how use the interpolation…
>
>
>
> Thanks for the suggestions,
>
> Andrea
>
> 
> _
>
>
>
> Questo messaggio è da intendersi esclusivamente ad uso del destinatario e
> può contenere informazioni che sono di natura privilegiata, confidenziale o
> non divulgabile secondo le leggi vigenti. Se il lettore del presente
> messaggio non è il destinatario designato, o il dipendente/agente
> responsabile per la consegna del messaggio al destinatario designato, si
> informa che ogni disseminazione, distribuzione o copiatura di questa
> comunicazione è vietata anche ai sensi della normativa vigente in materia
> di protezione dei dati personali. Se avete ricevuto questo messaggio per
> errore, vi preghiamo di notificarcelo immediatamente a mezzo e-mail di
> risposta e successivamente di procedere alla cancellazione di questa e-mail
> e relativi allegati dal vostro sistema.
>
> 
> _
>
>
>
> This message is intended only for the use of the addressee and may contain
> information that is privileged, confidential and exempt from disclosure
> under applicable law. If the reader of this message is not the intended
> recipient, or the employee or agent responsible for delivering the message
> to the intended recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is prohibited under the
> applicable data protection law. If you have received this e-mail by
> mistake, please notify us immediately by return e-mail and delete this
> e-mail and all attachments from your system.
>
>
>
> 
> _
>
> ___
> 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