Unsymmetric contour rendered by symmetric data

Hi all,

I’m a green hand of Paraview. I have a test dataset (UNSTRUCTURED_GRID) that is symmetic about the x axis, however the contour is unsymmetric rendered by Paraview. I am puzzled and can’t find out the reason. The followings are the contour and dataset:


test.vtk (358 Bytes)

I do not see any not symmetric things here, can you point it out ?

In my understanding, a symmetric contour should be like this:

Ok, got it.

Well you would need to share your original dataset for us to try and reproduce the problem.

Thanks a lot. This is my original dataset:

 # vtk DataFile Version 3.0
 StrainSum
ASCII
DATASET UNSTRUCTURED_GRID
POINTS    8 float
-1	-4  0
 1	-4  0
-1	-2  0
 1	-2  0
-1	 2  0
 1	 2  0
-1	 4  0
 1	 4  0

CELLS     2    10
    4  0  1  3  2
    4  4  5  7  6
		
CELL_TYPES     2
9
9

Point_DATA    8
SCALARS StrainSum_xx float
LOOKUP_TABLE custom_table_1
0
1
1
0
1
0
0
1

Also in attachment:
test.vtk (358 Bytes)

Your dataset is just not symmetric.

It should read.

0
1
1
0
0
1
1
0

Unlike what you said, if a dataset is symmetric about the x-axis, it should be arranged like this


Therefore the data should be
0
1
1
0
1
0
0
1

my bad, this is due to the way the interpolation is done. The data is actually symmetrical.

So what can I do to get a symmetrical contour in paraview?

In order to get a symmetrical visual result you would need to invert the order of the points of the second cell.

(this is not a contour in the ParaView sense, just an visual interpolation of the data on the point)

Thanks for your suggestion.
I’m trying to understand the way that Paraview renders the contour. It seem that Paraview render the field value by 1-D interpolation along diagonal so that you recommend to invert the order of the points.

I’m wondering if Paraview can render the contour by 2-D interpolation so that the visual looks better, just like the following produced by python

That’s a very good question, but, afaik this is not supported by ParaView yet.

That’s a pity. Thanks for your useful information!

I just wanted to add a little clarity of what is happening. ParaView is loading your data correctly, but rendering it a bit wrong. The asymmetry you are seeing is an artifact from the rendering library that ParaView is using. Just about every rendering system will take quadrilaterals and internally divide them into triangles before rendering. This is because interpolating colors/texture coordinates is a lot faster for a triangle. This is true for pretty much every OpenGL implementation I have encountered as well as the OSPRay rendering backend. This is why you are seeing that either red or blue diagonal line through the squares. You are seeing the triangles the rendering system is interpolating on.

Even though the rendering system is simplifying your data, ParaView itself will do a proper bilinear interpolation. So for example, in the following screenshot I have run the Resample To Image filter on your data. You can see that when a ParaView filter probes your data, you get the correct interpolation. (The blue in between is just the resample filter trying to probe the empty space between your quadrilaterals.)

2 Likes

Thank you Moreland,
Your comments are really constructive. I got a perfect contour following your guides.

Thanks @Kenneth_Moreland

This thread also explains why I get the asymmetric visualization of my symmetric data. The problem is a mesh of quadrilaterals under point load which creates symmetric deformation about vertical axis in the middle. Similarly reduced Von Mieses stresses are symmetric. However due to this internal subdivision of quads into triangles the bi-linear interpolation produces wrong impression of asymmetry. See the attached screenshots of deformation (displacements) and Von Mieses stress and the data vtu file.bous_T1.0000000000e 00_P1.vtu (6.8 KB)


Edit: I know there are some mechanical and civil engineering software which render this kind of problems correctly. I will find and show a screenshot from a program how it should be rendered.

Edit 2: Below is the Von Mieses stress map from Cast3m software

Edit 3: I found more insightful resources on the interpolation of quadrilaterals:


http://reedbeta.com/blog/quadrilateral-interpolation-part-1/
http://reedbeta.com/blog/quadrilateral-interpolation-part-2/

Looking at what other dedicated finite element visualization software is doing with symmetric quad data I found that they seems to split a quadrilateral into four triangles (instead of only two). It involves creation of additional node at the quad centroid (sum of x coordinates / 4, sum of y coordinates / 4, value at the centroid sum of values at nodes divided by four). I include here two python matplotlib scripts which illustrate this procedure.
quad_2el_paraview_quad22tri.py (1.5 KB)
quad_2el_paraview_quad24tri.py (2.7 KB)

And below are the plots they are producing:
quad-2el-paraview_quad22tri
quad-2el-paraview_quad24tri

Perhaps in Paraview this kind of internal splitting for quadrilateral can be applied?

Further issue:
What if the geometry is curving? Resample filter cannot help.

I am having similar issues in VTK, described here:

https://discourse.vtk.org/t/vtkwarpscalar-produces-hexagonal-peaks/5208/5

Can someone please help me out. Greatly appreciated.