<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->GetCellData()->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>
#include <vtkPoints.h><br>
#include <vtkUnstructuredGrid.h><br>
#include <vtkCellArray.h><br>
#include <vtkType.h><br>
#include <vtkIdTypeArray.h><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 ‘vtkUnstructuredGrid*
CGAL::output_c3t3_subdomain_to_vtk_unstructured_grid(const
C3T3&, vtkUnstructuredGrid*)’:<br>
/home/slaughter/Documents/programs/include/vol2mesh/Complex_3_subdomain_in_triangulation_3_to_vtk.h:122:21:
error: invalid use of incomplete type ‘struct vtkCellData’<br>
/usr/include/vtk-5.8/vtkDataSet.h:43:7: error: forward declaration
of ‘struct vtkCellData’<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"> ...<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="3">
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>
<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>