[vtkusers] How to use the vtkLSDynaReader class to handle FEM data in LSDYNA database

Viet H.Q.H viet at bakuhatsu.jp
Sat Feb 20 04:04:27 EST 2010


Dear David,

Thank you very much for your quick responding.

As you had explained, I ran the following code for directories containing
d3plot files generated from three examples at the site:
http://www.dynaexamples.com

    vtkLSDynaReader *plLD=vtkLSDynaReader::New( );
    //string dir="/home/viet/vtk_test/airbag/";
    //string dir="/home/viet/vtk_test/taylor/";
    //string dir="/home/viet/vtk_test/billet/";
    //plLD->SetDatabaseDirectory(dir.c_str());
    plLD->SetDatabaseDirectory("/home/viet/vtk_test/taylor/");
    plLD->Update();

I get the following error:

    ERROR: In /home/viet/VTK/IO/vtkPLOT3DReader.cxx, line 126
    vtkPLOT3DReader (0x194f5500): Must specify geometry file

How can I specify the geometry file?
The directory "taylor" is the directory containing a d3plot file generated
from the file taylor1.k downloaded at the site:
http://www.dynaexamples.com/sph/bar-iv.

# ls taylor
adptmp      d3dump01.0000  d3dump01.0003  d3plot    glstat      messag0001
mf         scr0000   scr0001h  scr0003     taylor1.k
bg_switch   d3dump01.0001  d3full01       d3plot01  log.txt     messag0002
run.sh     scr0000h  scr0002   scr0003h
binout0000  d3dump01.0002  d3hsp          dyna.str  messag0000  messag0003
run.sh.bk  scr0001   scr0002h  status.out

I also got the same error message for the directories
"airbag"<http://www.dynaexamples.com/examples-manual/misc/airbag>and
"billet" <http://www.dynaexamples.com/examples-manual/control/timestep>.
Thank you in advance and best regards,

Viet.


On Sat, Feb 20, 2010 at 9:49 AM, David Thompson <dcthomp at sandia.gov> wrote:

> I am a beginner of using VTK. I was trying to use the vtkLSDynaReader class
>> to handle FEM data in LSDYNA database but found no program examples to
>> start.
>>
>> I checked some functions of vtkLSDynaReader class and found that they
>> didn't function well.
>>
>> For instance, the function CanReadFile always return the value of 1
>> regarless of the exitence of files.
>>
>
> Unlike many file formats, LS-Dyna stores results in many files located in a
> single directory. These files have canonical names, not user-specified
> names. So CanReadFile attempts to determine the directory containing
> whatever filename you pass it and looks for these canonically-named files
> (d3plot, for instance) in that directory. Therefore, instead of using
> SetFileName() it is recommended that you use SetDatabaseDirectory() to the
> name of a directory containing d3plot files.
>
> If you have a specific circumstance where this is failing, some more
> information would help. For instance, does d3plot exist in that directory?
> Does it work if you pass CanReadFile an absolute path instead of a relative
> one like the example you included?
>
>
>  Are there any starting points to use the VTK to visualize FEM data in
>> LSDYNA database?
>>
>
> It should be as simple as
>  vtkLSDynaReader* rdr = vtkLSDynaReader::New();
>  rdr->SetDatabaseDirectory( "/path/to/output" );
>  rdr->Update();
> After calling Update(), GetOutput() should return a pointer to a
> vtkMultiBlockDataSet that you can render.
>
> I have tested the reader with LS-Dyna output generated from many examples
> at http://www.dynaexamples.como/ including
>
> http://www.dynaexamples.com/examples-manual/misc/airbag
> http://www.dynaexamples.com/examples-manual/control/timestep
> http://www.dynaexamples.com/sph/bar-iv
>
> One important thing to note is that the reader only parses LS-Dyna
> *output*, not LS-Dyna input decks.
>
>        David
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100220/f74baa7d/attachment.htm>


More information about the vtkusers mailing list