Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def build_domin_surface_datadict(
normed_stl_vertices_cp = normalize(stl_vertices_t, s_max, s_min)
surf_grid_normed = normalize(surf_grid, s_max, s_min)

sdf_surf_grid, _ = signed_distance_field(
sdf_surf_grid, *_ = signed_distance_field(
normed_stl_vertices_cp,
mesh_indices_flattened_t,
surf_grid_normed,
Expand Down Expand Up @@ -329,7 +329,7 @@ def build_domin_volume_datadict(
normed_stl_vertices_cp = normalize(stl_vertices_t, s_max, s_min)
surf_grid_normed = normalize(surf_grid, s_max, s_min)

sdf_surf_grid, _ = signed_distance_field(
sdf_surf_grid, *_ = signed_distance_field(
normed_stl_vertices_cp,
mesh_indices_flattened_t,
surf_grid_normed,
Expand Down Expand Up @@ -426,14 +426,14 @@ def build_domin_volume_datadict(
center_of_mass_normalized = center_of_mass
normed_stl_vertices_vol = stl_vertices_t

sdf_grid, _ = signed_distance_field(
sdf_grid, *_ = signed_distance_field(
normed_stl_vertices_vol,
mesh_indices_flattened_t,
grid,
use_sign_winding_number=True,
)

sdf_nodes, sdf_node_closest_point = signed_distance_field(
sdf_nodes, sdf_node_closest_point, *_ = signed_distance_field(
normed_stl_vertices_vol,
mesh_indices_flattened_t,
volume_coordinates,
Expand Down
2 changes: 1 addition & 1 deletion physicsnemo/cfd/postprocessing_tools/metrics/l2_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def compute_error_vs_sdf(
query_points_np, dtype=torch.float32, device=torch_device
)

sdf_field, _ = signed_distance_field(
sdf_field, *_ = signed_distance_field(
stl_vertices, stl_indices, query_points, use_sign_winding_number=True
)
sdf_field = sdf_field.detach().cpu().numpy()
Expand Down
7 changes: 4 additions & 3 deletions workflows/domino_design_sensitivities/design_datapipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ def _compute_sdf_np(

Thin numpy-in / numpy-out wrapper around the v2
``physicsnemo.nn.functional.signed_distance_field`` op, which is itself
torch-only and always returns ``(sdf, hit_points)`` (no
``include_hit_points`` kwarg).
torch-only and returns at least ``(sdf, hit_points)`` (no
``include_hit_points`` kwarg). This wrapper discards any additional
return values provided by newer PhysicsNeMo versions.

Args:
mesh_vertices: Mesh vertex coordinates, shape ``(n_vertices, 3)``.
Expand All @@ -87,7 +88,7 @@ def _compute_sdf_np(
``input_points.shape[:-1]`` and ``hit_points`` has shape
``input_points.shape``. Returned on CPU regardless of input device.
"""
sdf, hit_points = signed_distance_field(
sdf, hit_points, *_ = signed_distance_field(
mesh_vertices=torch.as_tensor(mesh_vertices, device=device),
mesh_indices=torch.as_tensor(mesh_indices, device=device),
input_points=torch.as_tensor(input_points, device=device),
Expand Down
Loading