[vtkusers] Subdomains in vtk
Jochen
jochen.kling at email.de
Tue May 22 10:59:45 EDT 2012
Hi Andrew,
I'm not very experienced with the exodus file format but I found out from
the source vtkExodusIIWriter.cxx
that the block ids are written if an array named "ElementBlockIds" exists by
default and
how you said before WriteOutBlockIdArrayOn() is called.
So you probably could do something like this:
...
vtkSmartPointer<vtkUnstructuredGrid> grid =
vtkSmartPointer<vtkUnstructuredGrid>::New();
...
vtkSmartPointer<vtkIdTypeArray> blockIds =
vtkSmartPointer<vtkIdTypeArray>::New();
/* you can set another name, but then you must call
myVtkExodusIIWriter->SetBlockIdArrayName("yourElementBlockIdsName")
in your IO-method. */
blockIds->SetName("ElementBlockIds");
for (vtkIdType i = 0; i < grid->GetNumberOfCells(); i++) {
blockIds->InsertNextValue(blockId[i]); // blockId is a c++ integer array
which
contains your block ids
}
grid->GetCellData()->AddArray(blockIds);
...
Hope this helps a bit and take you one step further ;-)
with kind regards
Jochen
--
View this message in context: http://vtk.1045678.n5.nabble.com/Subdomains-in-vtk-tp5713081p5713303.html
Sent from the VTK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120522/b3793e4d/attachment.htm>
More information about the vtkusers
mailing list