<HTML>
<HEAD>
<TITLE>Re: [Paraview] Computation of gradients fails</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>After taking a look at your mesh, I see that the problem is that you have some degenerate tetrahedra. &nbsp;That is, there are tetrahedra where all 4 vertices are in a plane. &nbsp;In this case the tetrahedron is self-intersecting and the gradient is ill-defined (over constrained I believe), which is why the linear solver is failing to compute it. &nbsp;You can find the degenerate tetrahedra by running the Mesh Quality filter to compute the volume of the tetrahedra and look for any resulting &#8220;Quality&#8221; that is not strictly greater than 0.<BR>
<BR>
So, you can do one of two things. &nbsp;The first is to ignore the errors. &nbsp;I don&#8217;t think that any of the degenerate cells are part of the surface (although I can&#8217;t be sure), and since the end game is to compute values on the surface it might not effect anything.<BR>
<BR>
The second thing you can do is to fix the mesh. &nbsp;The best thing to do is to go back to whatever created the original mesh, fix it, and rerun the simulation. &nbsp;There is a reasonable chance that these degenerate tetrahedra also had a negative impact on the simulation results. &nbsp;If that&#8217;s not practical, you can use the volume computed by the Mesh Quality filter and the Threshold filter to remove any tetrahedra that don&#8217;t have a strictly positive volume. &nbsp;That will mess up the connectivity of the mesh though.<BR>
<BR>
-Ken<BR>
<BR>
<BR>
On 9/22/10 9:30 AM, &quot;Martin Vymazal&quot; &lt;<a href="martin.vymazal@vki.ac.be">martin.vymazal@vki.ac.be</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hello Ken,<BR>
<BR>
&nbsp;&nbsp;I computed the x-velocity component using a calculator filter. Then <BR>
I applied the 'Gradient of Unstructured Data Set' filter to the output <BR>
of the previous filter. This is the place where the computation fails. <BR>
I sent you the data in a private email.<BR>
<BR>
Best regards,<BR>
<BR>
&nbsp;&nbsp;Martin Vymazal<BR>
<BR>
<BR>
Quoting &quot;Moreland, Kenneth&quot; &lt;<a href="kmorel@sandia.gov">kmorel@sandia.gov</a>&gt;:<BR>
<BR>
&gt; More information please.<BR>
&gt;<BR>
&gt; How are you extracting the x-component of the velocity? &nbsp;What filter <BR>
&gt; are you running to compute the gradient? &nbsp;Would it be possible to <BR>
&gt; post some example data that exhibits the problem so that we can <BR>
&gt; replicate it?<BR>
&gt;<BR>
&gt; -Ken<BR>
&gt;<BR>
&gt;<BR>
&gt; On 9/22/10 7:12 AM, &quot;Martin Vymazal&quot; &lt;<a href="martin.vymazal@vki.ac.be">martin.vymazal@vki.ac.be</a>&gt; wrote:<BR>
&gt;<BR>
&gt; Dear ParaView developers,<BR>
&gt;<BR>
&gt; &nbsp;&nbsp;I'm trying to compute gradient of my x-component of velocity on a<BR>
&gt; grid of tetrahedra which has 55244 DOF. ParaView fails to compute the<BR>
&gt; gradients with the following error message:<BR>
&gt;<BR>
&gt; Generic Warning: In<BR>
&gt; /home/kitware/Dashboard/MyTests/ParaView-3-8/ParaView-3.8/ParaView/VTK/Common/vtkMath.cxx, <BR>
&gt; line<BR>
&gt; 1338<BR>
&gt; Unable to factor linear system<BR>
&gt;<BR>
&gt; The mesh does not have degenerate/ugly elements, but it has some sharp<BR>
&gt; edges (in the inlet/outlet area). Is this a problem? If not, is there<BR>
&gt; a way of avoiding the error?<BR>
&gt;<BR>
&gt; Thank you very much.<BR>
&gt;<BR>
&gt; &nbsp;&nbsp;Martin Vymazal<BR>
&gt;<BR>
&gt; ----------------------------------------------------------------<BR>
&gt; This message was sent using IMP, the Internet Messaging Program.<BR>
&gt;<BR>
&gt;<BR>
&gt; _______________________________________________<BR>
&gt; Powered by www.kitware.com<BR>
&gt;<BR>
&gt; Visit other Kitware open-source projects at <BR>
&gt; <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><BR>
&gt;<BR>
&gt; Please keep messages on-topic and check the ParaView Wiki at: <BR>
&gt; <a href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a><BR>
&gt;<BR>
&gt; Follow this link to subscribe/unsubscribe:<BR>
&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a><BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt; &nbsp;&nbsp;&nbsp;**** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kenneth Moreland<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sandia National Laboratories<BR>
&gt; ***********<BR>
&gt; *** *** *** &nbsp;email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
&gt; ** &nbsp;*** &nbsp;** &nbsp;phone: (505) 844-8919<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;web: &nbsp;&nbsp;<a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
&gt;<BR>
&gt;<BR>
<BR>
<BR>
<BR>
----------------------------------------------------------------<BR>
This message was sent using IMP, the Internet Messaging Program.<BR>
<BR>
<BR>
<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
&nbsp;&nbsp;&nbsp;**** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kenneth Moreland<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sandia National Laboratories<BR>
*********** &nbsp;<BR>
*** *** *** &nbsp;email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** &nbsp;*** &nbsp;** &nbsp;phone: (505) 844-8919<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;web: &nbsp;&nbsp;<a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>