[vtkusers] Subdomains in vtk
Jochen
jochen.kling at email.de
Tue May 22 14:08:26 EDT 2012
Andrew,
I guess my code do have a bug, isn't it? Sorry for that. But I'm using C#
and
ActiViz
and do not have a working environment for C++/VTK.
So the shown code was just out of my mind without testing.
Accidently I missed a line ( see bold line in the code segement below).
...
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->SetNumberOfComponents(1);*
// <------------- sorry, I forgot this line
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);
...
To make things clear to me did it fail to
compile or did it fail during execution?
with best regards
Jochen
--
View this message in context: http://vtk.1045678.n5.nabble.com/Subdomains-in-vtk-tp5713081p5713312.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/6c09c525/attachment.htm>
More information about the vtkusers
mailing list