<div dir="ltr"><div><div>Hi all,<br><br></div>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).<br>
<br></div><div>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?<br><br></div><div>Thank you<br></div><div>
<br>ERROR: In /home/hector/LOCAL/VTK-6.1.0/Filters/FlowPaths/vtkStreamer.cxx, line 502<br>vtkStreamLine (0x2441040): No vector data defined!<br></div><div><br>vtkUnstructuredGrid (0x2429400)<br> Data Released: False<br> Global Release Data: Off<br>
Field Data:<br> Debug: Off<br> Modified Time: 258<br> Reference Count: 1<br> Registered Events: (none)<br> Number Of Arrays: 0<br> Number Of Components: 0<br> Number Of Tuples: 0<br> Number Of Points: 5626103<br>
Number Of Cells: 31639134<br> Cell Data:<br> Number Of Arrays: 1<br> Array 0 name = GeometryIds<br> Number Of Components: 1<br> Number Of Tuples: 31639134<br> Scalars: (none)<br> Vectors: (none)<br> Point Data:<br>
Number Of Arrays: 3<br> Array 0 name = potential<br> Array 1 name = joule heating<br> Array 2 name = volume current<br> Number Of Components: 5<br> Number Of Tuples: 5626103<br> Scalars: <br> Name: potential<br>
Data type: double<br> Size: 5626103<br> MaxId: 5626102<br> NumberOfComponents: 1<br> Name: potential<br> Number Of Components: 1<br> Number Of Tuples: 5626103<br> Vectors: <br> Name: volume current<br>
Data type: double<br> Size: 16878309<br> MaxId: 16878308<br> NumberOfComponents: 3<br> Name: volume current<br> Number Of Components: 3<br> Number Of Tuples: 5626103<br><br><br><br> vtkRungeKutta4 *integ = vtkRungeKutta4::New();<br>
<br> vtkAssignAttribute* aa = vtkAssignAttribute::New();<br> aa->SetInputData(ugrid);<br> aa->Assign("volume current", vtkDataSetAttributes::VECTORS, vtkAssignAttribute::POINT_DATA);<br><br> vtkSmartPointer<vtkStreamLine> streamLine =<br>
vtkSmartPointer<vtkStreamLine>::New();<br>#if VTK_MAJOR_VERSION <= 5<br> streamLine->SetInputConnection(aa->GetOutputPort());<br> streamLine->SetSource(seeds->GetOutput());<br>#else<br> reader->Update();<br>
streamLine->SetInputData(aa->GetOutput());<br> streamLine->SetSourceData(seeds->GetOutput());<br>#endif<br> streamLine->SetIntegrator(integ);<br> streamLine->SetMaximumPropagationTime(200);<br> streamLine->SetIntegrationStepLength(.2);<br>
streamLine->SetStepLength(.001);<br> streamLine->SetNumberOfThreads(1);<br> streamLine->SetIntegrationDirectionToIntegrateBothDirections();<br> streamLine->VorticityOn();<br> streamLine->Update();<br>
<br> vtkSmartPointer<vtkPolyDataMapper> streamLineMapper =<br> vtkSmartPointer<vtkPolyDataMapper>::New();<br> streamLineMapper->SetInputConnection(streamLine->GetOutputPort());<br><br> vtkSmartPointer<vtkActor> streamLineActor =<br>
vtkSmartPointer<vtkActor>::New();<br> streamLineActor->SetMapper(streamLineMapper);<br> streamLineActor->VisibilityOn();<br></div></div>