paraview

Displaying an Elevation grid in ParaView

北战南征 提交于 2019-12-01 10:50:24
I'm new to ParaView and completely lost with all the different data formats. All I want to do is display an elevation grid which is produced by a program. I store the elevation grid in a two dimensional array of floats which is indexed by x and y coordinates and stores the z coordinate. In other words elevationGrid[x][y] stores the height above the point (x, y). Which file format should I use for this and how is it defined? It would be ideal if someone could give an example file for, say, a 3x3 grid. A first approach with a 5x5 grid and equation z = x^2+y^2, using a very simple input format.

Controlling Paraview GUI from Python IDLE

旧城冷巷雨未停 提交于 2019-12-01 09:28:46
I am trying to control Paraview interactively using IDLE. This would involve sending commands from IDLE and seeing the changes occur in Paraview. I would rather not use the in-Paraview python shell. So far, I have succeeded in importing the Paraview modules (simple, servermanager…etc) from IDLE. However the commands sent do not reflect in Paraview. For instance: >>> from paraview.simple import * >>> cone = Cone() >>> Show() >>> Render() does indeed create a cone. However the cone is output to a new, independent OpenGL window, and not the Paraview GUI. Is it possible to control Paraview

Displaying an Elevation grid in ParaView

邮差的信 提交于 2019-12-01 08:45:22
问题 I'm new to ParaView and completely lost with all the different data formats. All I want to do is display an elevation grid which is produced by a program. I store the elevation grid in a two dimensional array of floats which is indexed by x and y coordinates and stores the z coordinate. In other words elevationGrid[x][y] stores the height above the point (x, y). Which file format should I use for this and how is it defined? It would be ideal if someone could give an example file for, say, a

How to add a custom array to a polydata in paraview?

爷,独闯天下 提交于 2019-12-01 06:40:34
I know that I can use the Calculator filter for operations on arrays, but I want to perform some more complicated computations. I managed to do it in Paraview python shell, but the missing step now is to go back to the viewer again (or save the new polydata to file). Here is what I have so far: polydata = servermanager.Fetch(FindSource("mydataalreadyopeninparaview")) region_size = paraview.vtk.vtkIntArray() region_size.SetNumberOfComponents(0) region_size.SetName("regionsize") for i in range(polydata .GetNumberOfPoints()): region_size.InsertNextValue(somecomputedvalue) polydata.GetPointData()

Controlling Paraview GUI from Python IDLE

☆樱花仙子☆ 提交于 2019-12-01 06:06:50
问题 I am trying to control Paraview interactively using IDLE. This would involve sending commands from IDLE and seeing the changes occur in Paraview. I would rather not use the in-Paraview python shell. So far, I have succeeded in importing the Paraview modules (simple, servermanager…etc) from IDLE. However the commands sent do not reflect in Paraview. For instance: >>> from paraview.simple import * >>> cone = Cone() >>> Show() >>> Render() does indeed create a cone. However the cone is output to

Binary VTK for RECTILINEAR_GRID from fortran code

谁说胖子不能爱 提交于 2019-12-01 01:43:21
I am having a fortran code to generate a grid in binary VTK format. This code produces a binary VTK file like this one: # vtk DataFile Version 3.0 vtk output BINARY DATASET RECTILINEAR_GRID DIMENSIONS 2 2 1 X_COORDINATES 2 float ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ Y_COORDINATES 2 float ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ Z_COORDINATES 1 float ^@^@^@^@^@^@^@^@ When, I try to open it with ParaView it crashes with the following error message: ERROR: In /home/user/OpenFOAM/ThirdParty-2.3.0/ParaView-4.1.0/VTK/IO/Legacy/vtkRectilinearGridReader.cxx, line 311 vtkRectilinearGridReader (0x379f4b0):

Exporting a 3D numpy to a VTK file for viewing in Paraview/Mayavi

泄露秘密 提交于 2019-11-30 07:31:57
问题 For those that want to export a simple 3D numpy array (along with axes) to a .vtk (or .vtr) file for post-processing and display in Paraview or Mayavi there's a little module called PyEVTK that does exactly that. The module supports structured and unstructured data etc.. Unfortunately, even though the code works fine in unix-based systems I couldn't make it work (keeps crashing) on any windows installation which simply makes things complicated. Ive contacted the developer but his suggestions

Exporting a 3D numpy to a VTK file for viewing in Paraview/Mayavi

人盡茶涼 提交于 2019-11-29 04:36:34
For those that want to export a simple 3D numpy array (along with axes) to a .vtk (or .vtr) file for post-processing and display in Paraview or Mayavi there's a little module called PyEVTK that does exactly that. The module supports structured and unstructured data etc.. Unfortunately, even though the code works fine in unix-based systems I couldn't make it work (keeps crashing) on any windows installation which simply makes things complicated. Ive contacted the developer but his suggestions did not work Therefore my question is: How can one use the from vtk.util import numpy_support function

Writing Fortran unformatted files with Python

南楼画角 提交于 2019-11-26 21:42:59
问题 I have some single-precision little-endian unformatted data files written by Fortran77. I am reading these files using Python using the following commands: import numpy as np original_data = np.dtype('float32') f = open(file_name,'rb') original_data = np.fromfile(f,dtype='float32',count=-1) f.close() After some data manipulation in Python, I (am trying to) write them back in the original format using Python using the following commands: out_file = open(output_file,"wb") s = struct.pack('f'