[vtk-developers] unstructured data partition

张江 zhangjiang.dudu at gmail.com
Sun Jul 3 23:57:23 EDT 2016


Hi,

I would like to partition the unstructured data using vtkUnstructuredGridReader for further parallel application. The thought is to partition and assign one part of the data (mesh) to each process.
The code is at below. However, the generated result of each process is somehow not very correct.
For example, for one data partition of a process, the number of points is 3, and the number of cells is 5. But these 5 cells are the same (actually one cell contains 3 points). So how to avoid this? Can this code reach to my goal of data partitioning?

  vtkMPIController *contr = vtkMPIController::New();
  contr->Initialize(&argc, &argv);

  vtkMultiProcessController::SetGlobalController(contr);
  int numProcs = contr->GetNumberOfProcesses();
  int me = contr->GetLocalProcessId();

  vtkUnstructuredGridReader *reader = vtkUnstructuredGridReader::New();
  vtkUnstructuredGrid *ds = vtkUnstructuredGrid::New();

  reader->SetFileName(“data.vtk");
  reader->Update();
  ds = reader->GetOutput();

  vtkDistributedDataFilter *dd = vtkDistributedDataFilter::New();
  dd->SetInputData(ds);
  dd->SetController(contr);
  dd->UseMinimalMemoryOff();
  dd->SetBoundaryModeToAssignToOneRegion();
  dd->Update();

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160703/e2d0873c/attachment.html>


More information about the vtk-developers mailing list