Closed karma0704 closed 5 months ago
There is no bdf_2_vtk or op2_2_vtk function. I believe the function you’re after is nastran_to_vtk. The usage is in the docstring and there are examples of it in the code.
You can also just load up the gui and export.
On Tue, Mar 19, 2024 at 11:35 PM karma0704 @.***> wrote:
Hello, gentleman, can you realize the function of converting the geometric shape and topology of the bdf file and the displacement, stress, and strain extracted from the op2 file into the corresponding data blocks in the VTK text file? If you have implemented these functions, can you provide some test examples?
— Reply to this email directly, view it on GitHub https://github.com/SteveDoyle2/pyNastran/issues/772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICUWPMCVUSGIWSMIH76RTYZEU4RAVCNFSM6AAAAABE637VH2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGE4TMNZWGIYDIOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
from pyNastran.converters.nastran.nastran_to_vtk import nastran_to_vtk
"""
Converts a Natsran geometry/results to vtk *.vtu
Parameters
----------
bdf_filename: str, BDF, OP2Geom
the geometry
op2_filename: str, OP2, OP2Geom
the results; can be '' for no op2
vtk_filename : str
the output filename; expected to be a *.vtu file
Examples
--------
bdf_filename = 'fem.bdf'
op2_filename = 'fem.op2'
vtk_filename = 'fem.vtu'
bdf_model = read_bdf(bdf_filename)
op2_model = read_op2(op2_filename)
model = read_op2_geom(op2_filename)
nastran_to_vtk(bdf_model, op2_model, vtk_filename)
nastran_to_vtk(bdf_filename, op2_filename, vtk_filename)
nastran_to_vtk(model, model, vtk_filename)
There is no bdf_2_vtk or op2_2_vtk function. I believe the function you’re after is nastran_to_vtk. The usage is in the docstring and there are examples of it in the code. You can also just load up the gui and export. … On Tue, Mar 19, 2024 at 11:35 PM karma0704 @.> wrote: Hello, gentleman, can you realize the function of converting the geometric shape and topology of the bdf file and the displacement, stress, and strain extracted from the op2 file into the corresponding data blocks in the VTK text file? If you have implemented these functions, can you provide some test examples? — Reply to this email directly, view it on GitHub <#772>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICUWPMCVUSGIWSMIH76RTYZEU4RAVCNFSM6AAAAABE637VH2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGE4TMNZWGIYDIOA . You are receiving this because you are subscribed to this thread.Message ID: @.>
Thank you very much for your reply. I called the nastran_to_vtk function to complete the output of the VTK file as you said. However, after the function was executed, the following error occurred:
oops! Didn't notice that in the CI. It's fixed.
There is no bdf_2_vtk or op2_2_vtk function. I believe the function you’re after is nastran_to_vtk. The usage is in the docstring and there are examples of it in the code. You can also just load up the gui and export. … On Tue, Mar 19, 2024 at 11:35 PM karma0704 @.> wrote: Hello, gentleman, can you realize the function of converting the geometric shape and topology of the bdf file and the displacement, stress, and strain extracted from the op2 file into the corresponding data blocks in the VTK text file? If you have implemented these functions, can you provide some test examples? — Reply to this email directly, view it on GitHub <#772>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICUWPMCVUSGIWSMIH76RTYZEU4RAVCNFSM6AAAAABE637VH2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGE4TMNZWGIYDIOA . You are receiving this because you are subscribed to this thread.Message ID: @.>
Sorry to bother you again
Do you mean that both bdf and op2 files need to be present in order to convert them into vtk files? Can I convert an op2 file without a bdf file to a vtk file?
The op2 file seems to contain geometric information. I tried the following example but encountered an error
# op2_filename = 'fem.op2'
# vtk_filename = 'fem.vtu'
# model = read_op2_geom(op2_filename)
# nastran_to_vtk(model, model, vtk_filename)
Traceback (most recent call last):
File "d:\WORK\CODE\op2_to_vtu\op2_to_vtu.py", line 23, in
Please don't reference closed tickets especially with unrelated errors
Hello, gentleman, can you realize the function of converting the geometric shape and topology of the bdf file and the displacement, stress, and strain extracted from the op2 file into the corresponding data blocks in the VTK text file? If you have implemented these functions, can you provide some test examples?