0
$\begingroup$

I'm trying to plot the solution of a numerical method using a vtk file in paraview.

The structure is very simple, and I going to explain with an example. I have a mesh of the unit square [0,1]x[0,1] consisting on 4 squares (CELLS) of equal dimensions, and then this mesh has 9 POINTS. I have a constant solution on each one of these 4 squares.

I'm trying to use the following vtk file, but does not work, What I'm doing wrong?

# vtk DataFile Version 3.0
Little example
ASCII

DATASET UNSTRUCTURED_GRID
POINTS 9 DOUBLE
  0.0  0.0  0.0
  0.5  0.0  0.0
  1.0  0.0  0.0
  0.0  0.5  0.0
  0.5  0.5  0.0
  1.0  0.5  0.0
  0.0  1.0  0.0
  0.5  1.0  0.0
  1.0  1.0  0.0

CELLS 4 20
  4  0  1  3  4
  4  1  2  4  5
  4  3  4  6  7
  4  4  5  7  8

CELL_TYPES 4
  9
  9
  9
  9

CELL_DATA 4
SCALARS pressure DOUBLE
LOOKUP_TABLE DEFAULT
    0.00000
    1.00000
    2.00000
    3.00000
```
$\endgroup$
2
  • 1
    $\begingroup$ The connectivity of cells is not correct. The correct order is counter-clockwise. For example, for cell 1, it should be "4 0 1 4 3". $\endgroup$
    – Chenna K
    Commented Apr 1, 2021 at 17:48
  • $\begingroup$ Thanks @ChennaK !! that solves my problem. $\endgroup$
    – yemino
    Commented Apr 1, 2021 at 17:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.