[vtkusers] How to extract datas from vtkLSdynaReader

David Doria daviddoria+vtk at gmail.com
Thu Jun 17 13:34:37 EDT 2010


2010/6/11 <c_dinco at sina.com>

>  I used *vtkLSdynaReader* to read a ls-dyna d3plot file which just contain
> a solid object, but program crashed when run to:
>
>
>
> cout<<"number of Solid cell:"<<
> rdr->OutputSolid->GetNumberOfCells()<<endl;
>
>
>
> In fact, all variables Output*****  are defined as *vtkUnstructuredGrid*
> *,
>
> I checked the variable "*OutputSolid*" using function "*getNameclass*",
> and find it is not  "*vtkUnstructuredGrid*" type after program running.So
> I have no idea how to extract data from "*OutputSolid"*.
>
> Could you do me a favor that how to extract all datas from "*OutputSolid*
> "?
>
> By the way, all variables are changed from "protected" to "public" for
> debugging.
>
> Thanks very much!
>
>
>
> Following are my code:
>
> vtkLSDynaReader* rdr = vtkLSDynaReader::New();
>  rdr->SetDatabaseDirectory( "C:\\Users\\sample" );
>
>  rdr->Update();
>
>
>  cout<<"number of Particles cell:"<<
> rdr->OutputParticles->GetNumberOfCells()<<endl;
>  cout<<"number of Beam cell:"<<
> rdr->OutputBeams->GetNumberOfCells()<<endl;
>  cout<<"number of RigidBody cell:"<<
> rdr->OutputRigidBody->GetNumberOfCells()<<endl;
>  cout<<"number of RoadSurface cell:"<<
> rdr->OutputRoadSurface->GetNumberOfCells()<<endl;
>
>  cout<<"number of Shell cell:"<<
> rdr->OutputShell->GetNumberOfCells()<<endl;
>  cout<<"number of Solid cell:"<<
> rdr->OutputSolid->GetNumberOfCells()<<endl;
>  cout<<"number of ThickShell cell:"<<
> rdr->OutputThickShell->GetNumberOfCells()<<endl;
>
>
>
>
>
>
>
> kevin
>
>
Can you upload the file you are trying read and send us a link? A small file
would be highly preferable if you can generate the problem with one.

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100617/0d95c252/attachment.htm>


More information about the vtkusers mailing list