[Paraview] Algorithmically what is d(vx)/dx in vtkCell.h?

Aditya Saurabh saurabh.aditya at gmail.com
Fri Dec 1 15:53:10 EST 2006


Hi!
There are several numerical methods to calculate dx, dy, dz at a cell. I am
searching for the exact numerical method implemented in vtkCellDerivatives.
My dataset is rectilinear with equally spaced x,y,z. That makes the
hexahedron required to compute derivatives to be cube in my case.

What exactly is d(vx)/dx in vtkCell.h then?

Is it just the difference in value of vx across cell?
Also,

I could NOT find Derivatives function implementation in any of
vtkGenericCell.cxx, vtkCell.cxx, vtkCell3D.cxx.

My aim here is to check how exactly vorticity is calculated and verify if
that is what we want to use or write our own implementation, as the current
visualizations give some artifacts in vorticity isosurfaces which isn't
technically correct.

Thanks a ton in advance.
Aditya

Calculating vorticity
----------------------
http://www.cs.utah.edu/classes/cs5630/vtk%204.4.2/vtk-src-unix/Graphics/vtkCellDerivatives.cxx
...
  vtkDataSet *input = this->GetInput();
...
 input->GetCell(cellId, cell);
...
      if ( computeVectorDerivs )
        {
        inVectors->GetTuples(cell->PointIds, cellVectors);
        vectors = cellVectors->GetPointer(0);
...
        cell->Derivatives(0, pcoords, vectors, 3, derivs);
      if ( this->VectorMode == VTK_VECTOR_MODE_COMPUTE_VORTICITY )
          {
          w[0] = derivs[7] - derivs[5];
          w[1] = derivs[2] - derivs[6];
          w[2] = derivs[3] - derivs[1];
          outVectors->SetTuple(cellId, w);
          }
....

http://www.cs.utah.edu/classes/cs5630/vtk%204.4.2/vtk-src-unix/Common/vtkGenericCell.cxx

void vtkGenericCell::Derivatives(int subId, double pcoords[3], double *values,
                                 int dim, double *derivs)
{
  this->Cell->Derivatives(subId, pcoords, values, dim, derivs);
}
....
http://www.cs.utah.edu/classes/cs5630/vtk%204.4.2/vtk-src-unix/Common/vtkCell.h

// Description:
  // Compute derivatives given cell subId and parametric coordinates. The
  // values array is a series of data value(s) at the cell points. There is a
  // one-to-one correspondence between cell point and data value(s). Dim is
  // the number of data values per cell point. Derivs are derivatives in the
  // x-y-z coordinate directions for each data value. Thus, if computing
  // derivatives for a scalar function in a hexahedron, dim=1, 8 values are
  // supplied, and 3 deriv values are returned (i.e., derivatives in x-y-z
  // directions). On the other hand, if computing derivatives of velocity
  // (vx,vy,vz) dim=3, 24 values are supplied ((vx,vy,vz)1, (vx,vy,vz)2,
  // ....()8), and 9 deriv values are returned
  // ((d(vx)/dx),(d(vx)/dy),(d(vx)/dz), (d(vy)/dx),(d(vy)/dy), (d(vy)/dz),
  // (d(vz)/dx),(d(vz)/dy),(d(vz)/dz)).
  virtual void Derivatives(int subId, double pcoords[3], double *values,
                           int dim, double *derivs) = 0;
....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/paraview/attachments/20061201/53b0d145/attachment.html


More information about the ParaView mailing list