22

If your only worry is file size, then you want binary files. For an illustrative example, lets assume you are writing 1 double precision floating point number to a file. Let's assume that the file system can handle this perfectly and holding the file, headers, and padding are all 0. For a binary file, that number would take the exact size of the number in ...


16

In practice, you rarely need data in visualization files that's more accurate than, say, 3 valid digits. In that case, ASCII is -- maybe surprisingly -- often more compact than binary form. If you're thinking about archiving, then bzip-ing these ASCII files is likely going to yield the smallest files you can get. That said, Paraview reads VTU format which ...


4

Reading the Paraview python API, found the following solution to convert back and forth between VTKArray and numpy arrays. This uses the numpy_support and vtk.dataset_adapter modules : from paraview.numpy_support import vtk_to_numpy from paraview.vtk.dataset_adapter import numpyTovtkDataArray, vtkDataArrayToVTKArray import numpy as np # get paraview.vtk....


3

StackOverflow has a similar question to yours. Although, it is not exactly the same. The following is a pipeline for what you want: StreamTracer1 |— Transform1 |— Transform2 |— Transform3 Where each transformation correspond to a projection and a translation, namely: $$P_x = \begin{pmatrix} 0 &0 &0 &\Delta x\\ 0 &1 &0 &0\\ 0 &...


3

You will have to interpolate the points to a 3D grid (a regular grid will do) and then do the volume rendering. See https://www.visitusers.org/index.php?title=Volume_Rendering for some examples.


3

Unfortunately (unless things have changed very recently) VTK doesn't fully support anything higher than second order cells in terms of mesh visualisation and filtering. Various common workarounds based on upscaling have been attempted, see for example this related question.


2

A good way to achieve this is to use the Warp By Vector filter to warp your field in the Z direction using the value of your scalar. Just to give a brief overview, The warp by vector warps your field in a direction using a vector. If you wish to warp your field in the Z direction perpendicular to your XY plane, then you need to create a warp vector in the Z ...


2

The best way I can think of doing it without doing any C++ or Python programming is the following steps, all with a serial run of ParaView: Use the Extract Surface filter Use either selections or clip filter to get rid of the caps of the cylinder (optional but better for viewing) Use a Clip filter to cut away the positive X side of the cylinder Use the ...


2

With ParaView 4.2, your original code will work as expected. The following is now acceptable. output.PointData.append(numpyarray, "name")


2

It is not surprising that VTK can't generate a volume rendering for the poly_vertex cell type since there is no topology associated with that type of cell. The way finite element integration point results is often dealt with is described below: It is common in finite element methods to calculate results (e.g. stresses) at the element integration points. ...


2

I think you are looking for Kitware VTK, basically, the main library for interaction with VTK files. Examples page will contain a lot of samples, including the one you are looking for: output of an unstructured grid. As an addition, GMSH itself (I am using 3.0.5) is also able to export the mesh into VTK without the need to go through IO procedure. That can ...


2

Sorry not quite the answer that you are after... I have never been able to get the ParaView Python interface to do anything that useful. Though I admit I am only passable at Python and the stuff I want to do is normally outside the box. I would recommend you get your head around VTK, you will be able to do much much more. Not only are you not restricted by ...


1

What I want to do can be done by adding cell information to the VTK file, or in ParaView by using Filter->Clip with the "crinkle cut" activated.


1

For volume rendering in ParaView your vtk file should contain a scalar, vector, or tensor data array. Otherwise, it does not show anything to you. You can create a test data array by going to Filters -> Calculator. Then you should see something in your volume rendering.


1

I use VisIt to see vtk files but this may work with Paraview also. Each partition saves its own file which is a standard format and you name them with partition number, e.g., sol01.vtk sol02.vtk sol03.vtk then VisIt can open them together. Make sure the cells in the partitions overlap by adding some ghost cells, otherwise you may have gaps in the ...


1

Yes -- in VTK you can output data as lines even if you are in 2d (and in 3d). You can see an example here, as part of the deal.II tutorial program step-51: https://dealii.org/developer/doxygen/deal.II/step_51.html#Results


1

As @TylerOlsen suggests, it is probably a good idea to do this particular plot using another tool. But if you insist on doing it using Paraview, you can Apply a Temporal Shift Scale Filter; and Then plot over the shifted/scaled time. In my example below I scaled my time by 0.1, turning the maximum to 25 (it has 250 timesteps).


1

Following the comments from origimbo, the solution is actually very simple. You just need to generate a sufficient script using the trace option of paraview, if this script is functional (load your file, generate your image, save it to the format you wish), then you can save it as an independent script. Then, if you run this script using pvpython SCRIPT ...


1

We can use the UNSTRUCTURED_GRID dataset attribute format in VTK. Here I'm going to provide you a very simple example. Suppose that you had a set of vertices of the triangle mesh and a scalar field valued at the vertices. For example, we firstly generate vertices like this: $(x_0, y_0) = (0,0)$ and $$ (x_{j+1}, ~ y_{j+1}) = \Big( \cos(\frac{j\pi}{4}), ~ \...


1

In the loop over your instances of 100 random values for $k$, you could write the value for $k$ into a file, and call your finite element code; the finite element code could then open the file, read the value for $k$ from it and then use it for whatever computation you may want to do with it. As for your second question, visualizing uncertainty is difficult....


1

If you managed to of load a single file and plot what you want from it you can try to rename the files. In Paraview, when you have multiple files with the same base name but consecutive enumeration you can plot them over time.


1

The answer to your question is that you can change your Programmable Filter output type to a vtkPolyData and set the Script to: phi0 = inputs[0].PointData['phi'] phi1 = inputs[1].PointData['phi'] dd = abs(phi1-phi0) #note absolute value here ss = sum(dd) points = vtk.vtkPoints() points.InsertPoint(0, [0, 0, 0]) output.SetPoints(points) globalsum = vtk....


1

The way this is done in the deal.II library (http://www.dealii.org; disclaimer: this is a project I am affiliated with) is that we describe an unstructured data set of 3d points and then create cells that happen to be two-dimensional. In other words, just output a set of quadrilaterals that happen to live in a three-dimensional space. To give an example, ...


1

You may want to use these for reference: The Paraview Tutorial Paraview/Python Scripting


1

I think the most powerful use of python scripting are programmable filters, rather than python shells, since they allow to create objects in the pipeline (and your script will be processed by the server, not the client). You can find some examples in http://www.paraview.org/Wiki/ParaView/Simple_ParaView_3_Python_Filters If you want to try those script in ...


Only top voted, non community-wiki answers of a minimum length are eligible