[vtkusers] VTK hexahedronal unstructured grid
David E DeMarle
dave.demarle at kitware.com
Tue Jul 24 09:14:02 EDT 2012
In ParaView (3.14.1), the information tab shows the number of points
and cells. The Spreadsheet view will show you every point and every
cell. I say 3.14.1 because it's spreadsheet view shows the point ids
for every cell.
Also, post the code and data for the example where you make two cells.
If the code you post isn't the same as the code you use, it makes it
kind of hard to figure out what is wrong with the code you use,
because we haven't seen it.
>From the snippet you did post, there isn't a cell loop. You are only
making one cell.
Also in that I suspect you have the same problem as before. You are
telling that cell that it consists of points 0,1,2,3,4,5,6,7,8. If you
are making a another cell somewhere and you use that same j=0..8 loop,
the two cells will cover the same space.
David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909
On Tue, Jul 24, 2012 at 8:55 AM, ISTB <f.dshabarow at gmail.com> wrote:
> Here is the code, modified, but still not doing what it need.. Tested it by
> storing in vtk and opening it with Paraview, but Paraview shows the same my
> vtk window show, a shape that does not make sense. In vtk file I see exactly
> what I wrote in the code, so it does not make sense to poste it. It has
> 400'000 point coordinates and 8 ids of hexahedron.
>
> vtkSmartPointer<vtkUnstructuredGrid> vUGrid =
> vtkSmartPointer<vtkUnstructuredGrid>::New();
> vtkSmartPointer<vtkCellArray> vCellArray =
> vtkSmartPointer<vtkCellArray>::New();
> vtkSmartPointer<vtkPoints> vPoints =
> vtkSmartPointer<vtkPoints>::New();
> vtkSmartPointer<vtkHexahedron> vHexahedron =
> vtkSmartPointer<vtkHexahedron>::New();
>
>
> vPoints->Initialize();
> for (unsigned int i = 0; i < mElements.size(); i++)
> {
> //Adding approximately 400'000 points to vPoints
> }
>
> vHexahedron->Initialize();
> vHexahedron->GetPointIds()->SetNumberOfIds(8);
> for (unsigned int j = 0; j < 8; j++) {
> vHexahedron->GetPointIds()->SetId(j,j);
> }
>
> vUGrid->SetPoints(vPoints);
> vUGrid->InsertNextCell(vHexahedron->GetCellType(),
> vHexahedron->GetPointIds());
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/VTK-hexahedronal-unstructured-grid-tp5714868p5714883.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list