Tag Info

16

The easiest way I could find to subtract two fields from different VTK files with the same structured grid is to use a programmable filter in Paraview, which lets you manipulate data using Python scripts. In the programmable filter dialogue box, you can subtract the two arrays and write to output with the code: phi_0 = inputs.CellData['Phi'] phi_1 ...

11

Here I have an example: x = linspace(-5,5,100); y = linspace(-5,5,100); z = linspace(-5,5,100); [X, Y, Z] = meshgrid(x, y, z); Ex = sin(2*pi/5*Z); Ey = 0*X; Ez = 0*X; [Bx, By, Bz, V] = curl(X, Y, Z, Ex, Ey, Ez); Eplot = 0*x; Bplot = 0*x; for i=1:100 %% Integration-like procedure Eplot(i) = mean(mean(Ex(:,:,i),1),2); Bplot(i) = mean(mean(By(:,:,...

9

I doubt there is a standard tool/technique for this kind of task. Nevertheless, there are some approaches. You would need at least one of the following strategies, according to ref. 1 (ch. 8): dimension subsetting: selecting some of the dimensions to display. dimension reduction: transforming the data into a lower-dimensional dataset. dimension embedding: ...

9

Since your figure is a closed loop, its parametric curves $x(t)$ and $y(t)$ must be periodic functions. This suggests one way to generate such figures, by constructing random smooth periodic functions $x(t)$ and $y(t)$ via summation of sinusoids/harmonics with randomized amplitude and phase. Unfortunately, it would be difficult to guarantee such a figure ...

8

I would suggest that a full database may be overkill for your purposes, though it would certainly work. Even $5 \cdot 10^5$ rows should be no more than around 25mb of data. I would strongly recommend doing the analysis/plotting/etc with the same tool that you will use for querying your data. It is my experience that when changing what to analyse only takes ...

8

[I took your sample program as a starting point and adapted Colormap Normalization from the matplotlib wiki.] Almost everything of the picture just looks red. Indeed. They problem is that there is a very narrow divergence in your data and because the colormap is scaled linearly almost all of the plot will be mapped to the lower limit of the colorbar. Q ...

8

You can try Geogebra (it is free). With SolveODE command and sliders you can do what yo want. For the usage of SolveODE command see. For example by using following command SolveODE[ <f'(x, y)>, <Start x>, <Start y>, <End x>, <Step> ] with SolveODE[A + B y + C sin(y), l, m, 10, 0.1] I got the solution curve below. You can vary ...

7

I think you could use the "marching cubes" algorithm. If memory serves, it requires a grid of samples as input, so at the very least you should be able to sample your function and run the algorithm as-is. You also might be able to modify the algorithm to callback to f directly. There's a popular implementation at http://paulbourke.net/geometry/polygonise/ ...

6

The selection of colormap should be based on your dataset and audience, e.g., you do not want to use a colormap that have some cultural background for a group of people. Also, if your images are going to be printed (in grey scale), you should consider using a colormap that will preserve the ordering after the color transformation. Then, you should take into ...

6

I'd venture the guess that most people in computational science use either Visit or Paraview for flow visualizations. These are simply the two most widely used programs I use. It's true that there is a bit of a barrier in the beginning, but my students are quite proficient after using it for a class period or two. If you want to see an interactive ...

6

Problem Formulation I can't guarantee that this is a perfect (or smallest-possible) formulation of the problem, but maybe it will help guide a better one. The road network is a directed graph consisting of intersections (nodes) connected by roads (edges). As input information, assume that you have an adjacency matrix $\mathcal{A}$ enumerating the edges. $\... 5 I highly recommend using a tool such as Sumatra for this. I used to have a similar "pedestrian" approach to yours for keeping track of many simulation runs with varying parameters, but in the end it just becomes a huge mess because it's next to impossible to design such an ad-hoc approach correctly upfront and to anticipate all the use cases and extensions ... 5 The program VisIt can do plots of tensor ellipsoids, but I don't think it has anything for hyperstreamlines. While it does make nice plots, I've found VisIt hard to install, if not impossible on some platforms; I know people who have been desperate enough to set up a virtual machine for it, but I haven't done that myself. When it does work, I have found it ... 5 In addition to the voxel-based approach that rchilton suggests, you could also look at Delaunay-type algorithms. For example, the Computational Geometry Algorithms Library (CGAL) has some built-in functionality for surface mesh generation with examples here. You could also try distmesh, the essential idea of which has been ported to a number of other ... 4 Programs like Visit and Paraview can do "volume rendering", which is what you show in your figure. You just need to export the data you have in a format that either of these programs can read. 4 This is actually a standard modeling problem if you consider the medium that flows through the network to be incompressible (e.g., liquids, or gases at low velocity). Then, you formulate everything in terms of fluxes (liters or kg per second) rather than in discrete parcels. The key realization is that the flux that goes into one end of the pipe equals the ... 4 For higher order elements, I refine each element a few times so I have more points to work with. If I just need to visualize the solution for myself. Let's use quadratic Lagrange elements as examples. You need the mesh data, points p and triangles t, also the numerical solution$u_h$. For visualization purpose, we merely need the nodal values from the ... 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.... 4 {Assuming you still need the code} Let A1.wrl is your wrl file. import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np import re holder = [] with open("A1.wrl", "rb") as vrml: for lines in vrml: a = re.findall("[-0-9]{1,3}.[0-9]{6}", lines) if len(a) == 3: holder.append(map(float, a)) ... 4 I agree that using the same color scale is generally good practice. Not doing so is confusing. Now, as you note, there are cases where this doesn't leave very much information in each picture. In such cases, you should at least make it clear in the caption that you are using different color scales for different panels of a figure. 4 I don't know why do you want vector graphics for your visualizations. It works ok for 2D cases, but in 3D I believe that there is need for raster images. In Paraview you can export to PDF, for example. Also, you might find Mayavi interesting. The next example generates a vector image (use with caution this simple example is 1.8 MB). import numpy as np from ... 4 You can use DifferentialEquations.jl Online to visualize solutions to differential equations without a hassle. It's built using the Julia suite DifferentialEquations.jl, and the online interface is a subset of features which includes explicit parameters and visualization. Here's an example of your equation, assuming that l was the initial time point and ... 4 Cubit/Trelis for generating meshes (Exodus.II files) and Paraview/Visit usually work well for low order FE codes. The advantage of Exodus.II is that it is a standard and therefore edge/side/face numbering etc. are consistent. E.g., see slide 121 here. 4 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 ... 4 New versions of VTK support what you are asking for, and new versions of Paraview can also display this. The current version of Visit can not yet, though, at the time of writing this. The trick is figuring out the specifics of how this should be described in the VTK file format. You can take a look at these two links to see the discussion and implementation ... 4 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

There is a nice volume rendering toolbox for MATLAB: http://www.mathworks.com/matlabcentral/fileexchange/22940-vol3d-v2 I think you could tweak it for your purposes.

3

In ParaView there is the Append Attributes filter which can be used for this. It requires that the same number of points are in the data set for appending point data properly and the same number of cells are in the data set for appending cell data properly. It will have problems though with arrays of the same name (i.e. Phi in your example). You can copy ...

3

You could output your data in one of the widely used file formats, for example VTK, and then use either VisIt or Paraview to visualize. These programs are used a lot for visualizing PDE solutions and are made for this purpose.

3

I'm surprised nobody has mentioned Nico Schlömer's excellent tools matlab2tikz and matplotlib2tikz yet. If you are using LaTeX for document preparation and either Matlab or Python for data processing, you can easily get high quality vector plots which you can post process to your heart's content: Prepare your plots in Matlab or Python, including axes, ...

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