<p><font face="Consolas" SIZE="3">Andrew,<br>
<br>
I guess my code do have a bug, isn't it? Sorry for that. But I'm using C# and
ActiViz<br>
and do not have a working environment for C++/VTK. <br />
So the shown code was just out of my mind without testing.<br />
Accidently I missed a line ( see bold line in the code segement below).<br />
</font></p>
<p><font face="Consolas" SIZE="3" > </font><font face="Consolas" SIZE="2" > ...<br>
<font color="#2B91AF">
vtkSmartPointer</font><<font color="#2B91AF">vtkUnstructuredGrid</font>> grid =
<font color="#2B91AF">vtkSmartPointer</font><<font color="#2B91AF">vtkUnstructuredGrid</font>>::New();<br>
...<br>
<br>
<font color="#2B91AF">
vtkSmartPointer</font><<font color="#2B91AF">vtkIdTypeArray</font>> blockIds =
<font color="#2B91AF">vtkSmartPointer</font><<font color="#2B91AF">vtkIdTypeArray</font>>::New();<br>
/* you can set another name, but then you must call<br>
myVtkExodusIIWriter->SetBlockIdArrayName("yourElementBlockIdsName") <br>
in your IO-method. */</font></p>
<p><font face="Consolas" SIZE="2">
</font><font face="Consolas" SIZE="3"><b>blockIds->SetNumberOfComponents(1);</b></font><font face="Consolas" SIZE="2">
// <------------- sorry, I forgot this line<br>
blockIds->SetName("ElementBlockIds"); <br>
<br>
for (vtkIdType i = 0; i < grid->GetNumberOfCells(); i++) {<br>
blockIds->InsertNextValue(blockId[i]); // blockId is a c++ integer array which
contains your block ids<br>
}<br>
grid->GetCellData()->AddArray(blockIds);</font></p>
<p><font face="Consolas" SIZE="3">
...<br>
</font></p>
<p><font face="Consolas" SIZE="3">To make things clear to me did it fail to
compile or did it fail during execution?<br /><br />
with best regards<br>
Jochen</font></p>
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Subdomains-in-vtk-tp5713081p5713312.html">Re: Subdomains in vtk</a><br/>
Sent from the <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html">VTK - Users mailing list archive</a> at Nabble.com.<br/>