<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Jochen,<br>
    <br>
    I think your solution will work great, but I the line
    grid-&gt;GetCellData()-&gt;AddArray(blockIds) is giving me the
    following error. If I remove this line the program compiles and
    executes fine.<br>
    <br>
    I link these vtk libraries: vtkHybrid vtkIO vtkexoIIc vtkCommon
    vtkFiltering<br>
    <br>
    And include these vtk headers:<br>
    &nbsp;&nbsp;&nbsp; #include &lt;vtkPoints.h&gt;<br>
    &nbsp;&nbsp;&nbsp; #include &lt;vtkUnstructuredGrid.h&gt;<br>
    &nbsp;&nbsp;&nbsp; #include &lt;vtkCellArray.h&gt;<br>
    &nbsp;&nbsp;&nbsp; #include &lt;vtkType.h&gt;<br>
    &nbsp;&nbsp;&nbsp; #include &lt;vtkIdTypeArray.h&gt;<br>
    <br>
    Any help would be greatly appreciated. <br>
    Thanks,<br>
    Andrew<br>
    <br>
    --- ERROR ---<br>
    In file included from
    /home/slaughter/Documents/programs/source/vol2mesh/vol2mesh.cpp:19:0:<br>
    /home/slaughter/Documents/programs/include/vol2mesh/Complex_3_subdomain_in_triangulation_3_to_vtk.h:
    In function &#8216;vtkUnstructuredGrid*
    CGAL::output_c3t3_subdomain_to_vtk_unstructured_grid(const
    C3T3&amp;, vtkUnstructuredGrid*)&#8217;:<br>
    /home/slaughter/Documents/programs/include/vol2mesh/Complex_3_subdomain_in_triangulation_3_to_vtk.h:122:21:
    error: invalid use of incomplete type &#8216;struct vtkCellData&#8217;<br>
    /usr/include/vtk-5.8/vtkDataSet.h:43:7: error: forward declaration
    of &#8216;struct vtkCellData&#8217;<br>
    make[3]: ***
    [source/vol2mesh/CMakeFiles/vol2mesh.dir/vol2mesh.cpp.o] Error 1<br>
    make[2]: *** [source/vol2mesh/CMakeFiles/vol2mesh.dir/all] Error 2<br>
    make[1]: *** [source/vol2mesh/CMakeFiles/vol2mesh.dir/rule] Error 2<br>
    make: *** [vol2mesh] Error 2<br>
    <br>
    <br>
    On 05/22/2012 10:59 AM, Jochen wrote:
    <blockquote cite="mid:1337698785486-5713303.post@n5.nabble.com"
      type="cite">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("yourElementBlockIdsName")
          <br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in your IO-method. */</font></p>
      <p><font face="Consolas" size="3">&nbsp;&nbsp;
          blockIds-&gt;SetName("ElementBlockIds"); <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 moz-do-not-send="true"
href="http://vtk.1045678.n5.nabble.com/Subdomains-in-vtk-tp5713081p5713303.html">Re:
        Subdomains in vtk</a><br>
      Sent from the <a moz-do-not-send="true"
        href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html">VTK
        - Users mailing list archive</a> at Nabble.com.<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the VTK FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>
</pre>
    </blockquote>
  </body>
</html>