Skip to content

PhysicsNeMo crash example vtp_reader.py small enhancement #1577

@HoussemMouradi

Description

@HoussemMouradi

in the load_vtp_file function:

disp_names = [
        name
        for name in poly.point_data.keys()
        if re.match(r"displacement_t0\.[0-9]{3}$", name)
    ]
    if not disp_names:
        disp_names = [
            name for name in poly.point_data.keys() if name.startswith("displacement_t")
        ]

The vtp reader expect the time steps in seconds (displacement_t0.000, displacement_t0.005, displacement_t0.010,...) while my dataset is in milliseconds (displacement_t0.000, displacement_t10.000, displacement_t20.000,...) witch makes the reader take only the first time step of displacement,
A quick fix is to simply replace it with:

disp_names = [
        name
        for name in poly.point_data.keys()
        if re.match(r"^displacement_t\d+\.\d{3}$", name)
    ]
    if not disp_names:
        disp_names = [
            name for name in poly.point_data.keys() if name.startswith("displacement_t")
        ]

For info, my dataset is now available on Hugging Face if anyone wants to try it :
🔗https://huggingface.co/datasets/AIRBORNEPANDA/BumperBeamCrashExample
P.S. Huge thanks to @ghasemiAb for the great support!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions