Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c1a0c48
update license headers- second try
mnabian Oct 24, 2025
0690510
Merge branch 'NVIDIA:main' into main
mnabian Oct 24, 2025
c16dcc7
Merge branch 'NVIDIA:main' into main
mnabian Oct 28, 2025
13af4ae
modularize reader
mnabian Oct 28, 2025
53838e2
configurable features, node features as a dict of tensors
mnabian Oct 29, 2025
074d4d1
update readme
mnabian Oct 29, 2025
cc4bbc7
formatting
mnabian Oct 29, 2025
5eb7148
add vtp reader, update readme
mnabian Oct 29, 2025
5c23e50
add crash animation
mnabian Oct 29, 2025
5a59fee
readme reformatting
mnabian Oct 29, 2025
f719022
update readme
mnabian Oct 29, 2025
57ee2b9
add roof crash and crushcan results
mnabian Oct 30, 2025
055546a
readme formatting
mnabian Oct 30, 2025
241d13f
add roof crash and crushcan results
mnabian Oct 30, 2025
6527320
add roof crash and crushcan results
mnabian Oct 30, 2025
be8b07e
readme references
mnabian Oct 30, 2025
b2ade88
Update examples/structural_mechanics/crash/vtp_reader.py
mnabian Oct 30, 2025
ef5226f
Update examples/structural_mechanics/crash/vtp_reader.py
mnabian Oct 30, 2025
c6be395
Update examples/structural_mechanics/crash/README.md
mnabian Oct 30, 2025
65b1f59
Update examples/structural_mechanics/crash/vtp_reader.py
mnabian Oct 30, 2025
90cef44
Update examples/structural_mechanics/crash/vtp_reader.py
mnabian Oct 30, 2025
7449a25
Update examples/structural_mechanics/crash/vtp_reader.py
mnabian Oct 30, 2025
8ae9056
Update examples/structural_mechanics/crash/vtp_reader.py
mnabian Oct 30, 2025
900db79
address review comments
mnabian Oct 30, 2025
9479c1e
formatting
mnabian Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/img/crash/crash_case4_reduced.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/crash/crushcan.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/crash/roof_crash.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
276 changes: 249 additions & 27 deletions examples/structural_mechanics/crash/README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/structural_mechanics/crash/conf/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ experiment_desc: "unified training recipe for crash models"
run_desc: "unified training recipe for crash models"

defaults:
- reader: vtp #d3plot
- datapipe: point_cloud # will be overridden by model configs
- model: transolver_autoregressive_rollout_training
- training: default
Expand Down
3 changes: 2 additions & 1 deletion examples/structural_mechanics/crash/conf/datapipe/graph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
# limitations under the License.

_target_: datapipe.CrashGraphDataset
_convert_: all
data_dir: ${training.raw_data_dir}
name: crash_train
split: train
num_samples: ${training.num_training_samples}
num_steps: ${training.num_time_steps}
wall_node_disp_threshold: 1.0
features: [thickness]
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# limitations under the License.

_target_: datapipe.CrashPointCloudDataset
_convert_: all
data_dir: ${training.raw_data_dir}
num_samples: ${training.num_training_samples}
num_steps: ${training.num_time_steps}
wall_node_disp_threshold: 1.0
features: [thickness]
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

_target_: rollout.MeshGraphNetAutoregressiveRolloutTraining
_convert_: all

input_dim_nodes: 7 # pos(3) + vel(3) + thickness(1)
input_dim_edges: 4 # dx, dy, dz, distance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

_target_: rollout.MeshGraphNetAutoregressiveRolloutTraining
_convert_: all

input_dim_nodes: 7 # pos(3) + vel(3) + thickness(1)
input_dim_edges: 4 # dx, dy, dz, distance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

_target_: rollout.MeshGraphNetTimeConditionalRollout
_convert_: all

input_dim_nodes: 5 # pos(3) + thickness(1) + time(1)
input_dim_edges: 4 # dx, dy, dz, distance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

_target_: rollout.TransolverAutoregressiveRolloutTraining
_convert_: all

functional_dim: 5
embedding_dim: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

_target_: rollout.TransolverOneStepRollout
_convert_: all

functional_dim: 4
embedding_dim: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

_target_: rollout.TransolverTimeConditionalRollout
_convert_: all

functional_dim: 1 # thickness
embedding_dim: 3 # position
Expand Down
20 changes: 20 additions & 0 deletions examples/structural_mechanics/crash/conf/reader/d3plot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2025 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

_target_: d3plot_reader.Reader
_convert_: all
wall_node_disp_threshold: 1.0

18 changes: 18 additions & 0 deletions examples/structural_mechanics/crash/conf/reader/vtp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2025 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

_target_: vtp_reader.Reader
_convert_: all
44 changes: 35 additions & 9 deletions examples/structural_mechanics/crash/d3plot_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import pyvista as pv

from lasso.dyna import D3plot, ArrayType
from typing import Dict, List, Optional
from typing import Optional


def find_run_folders(base_data_dir: str) -> List[str]:
def find_run_folders(base_data_dir: str) -> list[str]:
"""
Find run directories containing LS-DYNA d3plot files.

Expand All @@ -43,7 +43,7 @@ def find_run_folders(base_data_dir: str) -> List[str]:
return run_dirs


def parse_k_file(k_file_path: str) -> Dict[int, float]:
def parse_k_file(k_file_path: str) -> dict[int, float]:
"""
Parse LS-DYNA keyword (.k) file to extract part thickness values.

Expand All @@ -53,8 +53,8 @@ def parse_k_file(k_file_path: str) -> Dict[int, float]:
Returns:
Dictionary mapping part ID -> thickness.
"""
part_to_section: Dict[int, int] = {}
section_thickness: Dict[int, float] = {}
part_to_section: dict[int, int] = {}
section_thickness: dict[int, float] = {}

with open(k_file_path, "r") as f:
lines = [
Expand Down Expand Up @@ -187,7 +187,7 @@ def build_edges_from_mesh_connectivity(mesh_connectivity) -> set:
def compute_node_thickness(
mesh_connectivity,
part_ids,
part_thickness_map: Dict[int, float],
part_thickness_map: dict[int, float],
actual_part_ids: Optional[np.ndarray] = None,
) -> np.ndarray:
"""
Expand Down Expand Up @@ -404,8 +404,34 @@ def process_d3plot_data(
write_vtp,
logger,
)
point_data_all.append(
{"mesh_pos": mesh_pos_all, "thickness": filtered_thickness}
)
point_data_all.append({"coords": mesh_pos_all, "thickness": filtered_thickness})

return srcs, dsts, point_data_all


class Reader:
"""
Reader for LS-DYNA d3plot files.

Args:
wall_node_disp_threshold: threshold for filtering wall nodes
"""

def __init__(self, wall_node_disp_threshold: float = 1.0):
self.wall_node_disp_threshold = wall_node_disp_threshold

def __call__(
self,
data_dir: str,
num_samples: int,
split: str,
logger=None,
):
write_vtp = False if split == "train" else True
return process_d3plot_data(
data_dir=data_dir,
num_samples=num_samples,
wall_node_disp_threshold=self.wall_node_disp_threshold,
write_vtp=write_vtp,
logger=logger,
)
Loading