[vtkusers] Select attribute (using vtkassignattribute?) to streamline

Hector Dejea hectordejea at gmail.com
Thu Jul 31 05:30:14 EDT 2014


Hi all,

I have an unstructured grid with some features in it. It contains
potential, joule heating and volume current in point data and geometryids
in cell data (see some part of the print below).

I am trying to represent volume current in my unstructured grid with the
code below, but it returns an error, does anybody know if what I am missing
or what is wrong?

Thank you

ERROR: In /home/hector/LOCAL/VTK-6.1.0/Filters/FlowPaths/vtkStreamer.cxx,
line 502
vtkStreamLine (0x2441040): No vector data defined!

vtkUnstructuredGrid (0x2429400)
  Data Released: False
  Global Release Data: Off
  Field Data:
    Debug: Off
    Modified Time: 258
    Reference Count: 1
    Registered Events: (none)
    Number Of Arrays: 0
    Number Of Components: 0
    Number Of Tuples: 0
  Number Of Points: 5626103
  Number Of Cells: 31639134
  Cell Data:
    Number Of Arrays: 1
    Array 0 name = GeometryIds
    Number Of Components: 1
    Number Of Tuples: 31639134
    Scalars: (none)
    Vectors: (none)
  Point Data:
    Number Of Arrays: 3
    Array 0 name = potential
    Array 1 name = joule heating
    Array 2 name = volume current
    Number Of Components: 5
    Number Of Tuples: 5626103
    Scalars:
      Name: potential
      Data type: double
      Size: 5626103
      MaxId: 5626102
      NumberOfComponents: 1
      Name: potential
      Number Of Components: 1
      Number Of Tuples: 5626103
    Vectors:
      Name: volume current
      Data type: double
      Size: 16878309
      MaxId: 16878308
      NumberOfComponents: 3
      Name: volume current
      Number Of Components: 3
      Number Of Tuples: 5626103



  vtkRungeKutta4 *integ = vtkRungeKutta4::New();

  vtkAssignAttribute* aa = vtkAssignAttribute::New();
    aa->SetInputData(ugrid);
    aa->Assign("volume current", vtkDataSetAttributes::VECTORS,
vtkAssignAttribute::POINT_DATA);

  vtkSmartPointer<vtkStreamLine> streamLine =
    vtkSmartPointer<vtkStreamLine>::New();
#if VTK_MAJOR_VERSION <= 5
  streamLine->SetInputConnection(aa->GetOutputPort());
  streamLine->SetSource(seeds->GetOutput());
#else
  reader->Update();
  streamLine->SetInputData(aa->GetOutput());
  streamLine->SetSourceData(seeds->GetOutput());
#endif
  streamLine->SetIntegrator(integ);
  streamLine->SetMaximumPropagationTime(200);
  streamLine->SetIntegrationStepLength(.2);
  streamLine->SetStepLength(.001);
  streamLine->SetNumberOfThreads(1);
  streamLine->SetIntegrationDirectionToIntegrateBothDirections();
  streamLine->VorticityOn();
  streamLine->Update();

  vtkSmartPointer<vtkPolyDataMapper> streamLineMapper =
    vtkSmartPointer<vtkPolyDataMapper>::New();
  streamLineMapper->SetInputConnection(streamLine->GetOutputPort());

  vtkSmartPointer<vtkActor> streamLineActor =
    vtkSmartPointer<vtkActor>::New();
  streamLineActor->SetMapper(streamLineMapper);
  streamLineActor->VisibilityOn();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140731/40a3690b/attachment.html>


More information about the vtkusers mailing list