[vtkusers] Adding Vector Results to Cell

shankarjee at ucla.edu shankarjee at ucla.edu
Fri Sep 24 18:41:48 EDT 2010


Hi
    I am trying to add a set to vector results to cell in an  
unstructured grid. The way I do it is


    vtkSmartPointer<vtkDoubleArray> fiberdata[3]; // I need  the 3 vectors
     char resName[100];
     for (int i=0; i< 3; i++ ) {
       fiberdata[i] = vtkSmartPointer<vtkDoubleArray>::New();
       fiberdata[i]->SetNumberOfComponents(3);
       sprintf(resName,"EigenVector %d", i);
       fiberdata[i]->SetName(resName);
     } // Initialize the SmartPointers
     for( vtkIdType i =0; i <elmcon.size(); i++) {
       for( int j=0; j<3; j++) {
         double res[3];
         for(int k=0; k<3;k++) res[k] = fibers[i][3*j+k];
         fiberdata[j]->InsertNextTupleValue(res);
       }
     }

The code compiles fine. When I load the vtu file I see the EigenVector  
0/1/2 as results. However I am not able to do a vector plot of these  
results. I just get options to plot the magnitude, X, Y, Z components.  
When I choose glyph I do no see eigenvector listed in the Vectors  
region. What am I doing wrong. Your suggestions please

Thanks

Jee




More information about the vtkusers mailing list