Commit 4662a523 authored by Francois Bertel's avatar Francois Bertel
Browse files

BUG:Finally fixed probing of vtkQuatraticTetra by fixing EvaluatePosition()....

BUG:Finally fixed probing of vtkQuatraticTetra by fixing EvaluatePosition(). The parametric center is 0.5,0.5,0.5 not 0.33,0.33,0.33. Now we get a better initial guess for the Newton-Raphson method and more important, some of the partial derivatives equations were just wrong in InterpolationDerivs()
parent 7ea3cb48
......@@ -22,7 +22,7 @@
#include "vtkDoubleArray.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkQuadraticTetra, "1.3");
vtkCxxRevisionMacro(vtkQuadraticTetra, "1.4");
vtkStandardNewMacro(vtkQuadraticTetra);
//----------------------------------------------------------------------------
......@@ -121,8 +121,7 @@ int vtkQuadraticTetra::EvaluatePosition(double* x,
// set initial position for Newton's method
subId = 0;
pcoords[0] = pcoords[1] = pcoords[2] = params[0] = params[1] = params[2]=0.333;
pcoords[0] = pcoords[1] = pcoords[2] = params[0] = params[1] = params[2]=0.25;
// enter iteration loop
for (iteration=converged=0;
!converged && (iteration < VTK_TETRA_MAX_ITERATION); iteration++)
......@@ -490,8 +489,8 @@ void vtkQuadraticTetra::InterpolationDerivs(double pcoords[3], double derivs[30]
double s = pcoords[1];
double t = pcoords[2];
// r-derivatives
derivs[0] = 4.0*r + 4.0*s + 4.0*t - 3.0;
// r-derivatives: dW0/dr to dW9/dr
derivs[0] = 4.0*(r + s + t) - 3.0;
derivs[1] = 4.0*r - 1.0;
derivs[2] = 0.0;
derivs[3] = 0.0;
......@@ -499,11 +498,11 @@ void vtkQuadraticTetra::InterpolationDerivs(double pcoords[3], double derivs[30]
derivs[5] = 4.0*s;
derivs[6] = -4.0*s;
derivs[7] = -4.0*t;
derivs[8] = 0.0;
derivs[9] = 4.0*t;
derivs[8] = 4.0*t;
derivs[9] = 0.0;
// s-derivatives
derivs[10] = 4.0*r + 4.0*s + 4.0*t - 3.0;
// s-derivatives: dW0/ds to dW9/ds
derivs[10] = 4.0*(r + s + t) - 3.0;
derivs[11] = 0.0;
derivs[12] = 4.0*s - 1.0;
derivs[13] = 0.0;
......@@ -511,21 +510,20 @@ void vtkQuadraticTetra::InterpolationDerivs(double pcoords[3], double derivs[30]
derivs[15] = 4.0*r;
derivs[16] = 4.0 - 4.0*r - 8.0*s - 4.0*t;
derivs[17] = -4.0*t;
derivs[18] = 4.0*t;
derivs[19] = 0.0;
derivs[18] = 0.0;
derivs[19] = 4.0*t;
// t-derivatives
derivs[20] = 4.0*r + 4.0*s + 4.0*t - 3.0;
// t-derivatives: dW0/dt to dW9/dt
derivs[20] = 4.0*(r + s + t) - 3.0;
derivs[21] = 0.0;
derivs[22] = 0.0;
derivs[23] = 4.0*t - 1.0;
derivs[24] = -4.0*r;
derivs[25] = 0.0;
derivs[26] = -4.0*t;
derivs[27] = 4.0 - 4.0*r - 8.0*s - 4.0*t;
derivs[28] = 4.0*s;
derivs[29] = 4.0*t;
derivs[26] = -4.0*s;
derivs[27] = 4.0 - 4.0*r - 4.0*s - 8.0*t;
derivs[28] = 4.0*r;
derivs[29] = 4.0*s;
}
//----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment