![]() Pro: Rather straightforward implementation, preserves all relations and properties of the original solution.Ĭon: Since this is a completely new cell type, many (most) of the existing plugins will not work anymore and will probably have to be rewritten. ![]() Use the built-in support for quadrature schemes. Pro: Easiest to implement, easy to specify multiple points at the same location with different solutions.Ĭon: Capability to visualize data as "cells" is lost, plus the same disadvantages as above. Also, the hierarchical information (domain divided into elements, each element contains several points) is lost. Also, the solution can be defined twice on the cell surfaces, as the DG framework allows discontinuous solutions. Pro: All plugins that work with the standard VTK unstructured cell types will continue to work without changing anything.Ĭon: Since the integration points are not distributed evenly, it might be difficult to find the correct location of the vertices. Use one voxel for each integration point. Several possible ways come to my mind, but I do not know which one is the most promising: My question is whether anyone has experience with visualizing such data efficiently with ParaView/VTK, and what approach you chose to represent the data in VTK. As opposed to finite volume methods, within each cell there is not just one value for the solution vector $\mathbf$ at multiple Gauss integration points. Similarly to finite volume methods, the problem domain is divided into cube-shaped cells ("elements"). Write_data(sg, '/pathToFile/filename.I would like to visualize simulation results, obtained using the discontinuous Galerkin (DG) approach, within ParaView. Sg = tvtk.StructuredGrid(dimensions=xx.shape, points=pts) Vtkwrite('/pathToFile/filename.vtk','structured_grid',x,y,z,'vectors','velocity',vx,vy,vz) Ģ) Python from tvtk.api import tvtk, write_data Consider vx, vy, vz the 3D vectorial velocity components I want to process.ġ) MATLAB: =ndgrid(1:size(vx,1),1:size(vx,2),1:size(vx,3)) Binary floats are recommended for large matrices. The files can be produced in ASCII and BINARY formats. This function takes 2D and 3D matrices arrays and writes a structured grid of point in VTK 2.0 format. Here some coding I used to export the data. Here is what I need from the file format: easy to understand for a part-time, self-taught programmer like myself decent support in ParaView (obviously) at least scalar and 3D vector quantities, symmetric tensors would be nice to have. A function to export either 2D/3D Matlab arrays as a binary. What is the reason for these differences? T tensor (C, 15270 54 21) create the tensor object K double (T) Nx,Ny,Nz size (K) fid fopen ('tensor.vtk', 'wt') if fid -1 error ('Cannot open file for writing.') end fprintf (fid,' vtk DataFile Version 3. The MATLAB data is way more smoother than the Python version. Also when I visualize streamlines in ParaView, both data look quite different. I managed to export my vector-data with tvtk and Python to *.vtk-format, but compared to the MATLAB exported data, the files are quite different! First of all, the MATLAB version is almost twice as big as the Python version (67.2MB to 46.2MB). This works fine so far, but I wanted to change to Python using tvtk because of license reasons. However, since now I was using MATLAB and especially a script called vtkwrite.m which can be found here. I got some trouble exporting vector-data to *.vtk-file format for later use in ParaView.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |