Hi Andrew,<br /><br />

I'm not very experienced with the exodus file format but I found out from the source vtkExodusIIWriter.cxx<br />that the block ids are written if an array named "ElementBlockIds" exists by default and<br />how you said before WriteOutBlockIdArrayOn() is called.
<br /><br />
So you probably could do something like this:<br /><br />
     
<p><font face="Consolas" SIZE="3" >&nbsp;&nbsp; ...<br>
<font color="#2B91AF">&nbsp;&nbsp;
vtkSmartPointer</font>&lt;<font color="#2B91AF">vtkUnstructuredGrid</font>&gt; grid = 
<font color="#2B91AF">vtkSmartPointer</font>&lt;<font color="#2B91AF">vtkUnstructuredGrid</font>&gt;::New();<br>
&nbsp;&nbsp;
...<br>
<br>
<font color="#2B91AF">&nbsp;&nbsp;
vtkSmartPointer</font>&lt;<font color="#2B91AF">vtkIdTypeArray</font>&gt; blockIds = 
<font color="#2B91AF">vtkSmartPointer</font>&lt;<font color="#2B91AF">vtkIdTypeArray</font>&gt;::New();<br>
&nbsp;&nbsp; /* you can set another name, but then you must call<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myVtkExodusIIWriter-&gt;SetBlockIdArrayName(&quot;yourElementBlockIdsName&quot;) <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in your IO-method. */</font></p>
<p><font face="Consolas" SIZE="3">&nbsp;&nbsp;
blockIds-&gt;SetName(&quot;ElementBlockIds&quot;); <br>
<br>
&nbsp;&nbsp;
for (vtkIdType i = 0; i &lt; grid-&gt;GetNumberOfCells(); i++) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
blockIds-&gt;InsertNextValue(blockId[i]); // blockId is a c++ integer array which 
contains your block ids<br>
&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;
grid-&gt;GetCellData()-&gt;AddArray(blockIds);</font></p>
<p><font face="Consolas" SIZE="3">&nbsp;&nbsp;
...<br>
&nbsp;</font></p>
<br /><br />
Hope this helps a bit and take you one step further ;-)
<br /><br />
with kind regards<br />
Jochen
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Subdomains-in-vtk-tp5713081p5713303.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/>