Operator Models#

class physicsnemo.models.domino.model.DoMINO(*args, **kwargs)[source]#

Bases: Module

DoMINO model architecture for predicting both surface and volume quantities.

The DoMINO (Deep Operational Modal Identification and Nonlinear Optimization) model is designed to model both surface and volume physical quantities in aerodynamic simulations. It can operate in three modes:

  1. Surface-only: Predicting only surface quantities

  2. Volume-only: Predicting only volume quantities

  3. Combined: Predicting both surface and volume quantities

The model uses a combination of:

  • Geometry representation modules via GeometryRep

  • Neural network basis functions via FourierMLP

  • Parameter encoding

  • Local and global geometry processing

  • Aggregation models for final prediction

Parameters:
  • input_features (int) – Number of point input features (typically 3 for x, y, z coordinates).

  • output_features_vol (int, optional, default=None) – Number of output features in volume. Set to None for surface-only mode.

  • output_features_surf (int, optional, default=None) – Number of output features on surface. Set to None for volume-only mode.

  • global_features (int, optional, default=2) – Number of global parameter features for conditioning.

  • model_parameters (Any, optional, default=None) – Model parameters controlled by config.yaml. Contains nested configuration for geometry representation, neural network basis functions, aggregation model, position encoder, and geometry local settings.

Forward:

data_dict (dict[str, torch.Tensor]) – Dictionary containing input tensors with the following keys:

  • "geometry_coordinates": Geometry centers of shape \((B, N_{geo}, 3)\)

  • "grid": Computational domain grid of shape \((B, N_x, N_y, N_z, 3)\)

  • "surf_grid": Surface bounding box grid of shape \((B, N_x, N_y, N_z, 3)\)

  • "sdf_grid": SDF on volume grid of shape \((B, N_x, N_y, N_z)\)

  • "sdf_surf_grid": SDF on surface grid of shape \((B, N_x, N_y, N_z)\)

  • "sdf_nodes": SDF at volume mesh nodes of shape \((B, N_{vol}, 1)\)

  • "pos_volume_closest": Closest surface point to volume nodes of shape \((B, N_{vol}, 3)\)

  • "pos_volume_center_of_mass": Center of mass to volume nodes of shape \((B, N_{vol}, 3)\)

  • "pos_surface_center_of_mass": Center of mass to surface nodes of shape \((B, N_{surf}, 3)\)

  • "surface_mesh_centers": Surface mesh center coordinates of shape \((B, N_{surf}, 3)\)

  • "surface_mesh_neighbors": Surface mesh neighbor coordinates of shape \((B, N_{surf}, K, 3)\)

  • "surface_normals": Surface normals of shape \((B, N_{surf}, 3)\)

  • "surface_neighbors_normals": Surface neighbor normals of shape \((B, N_{surf}, K, 3)\)

  • "surface_areas": Surface cell areas of shape \((B, N_{surf})\)

  • "surface_neighbors_areas": Surface neighbor areas of shape \((B, N_{surf}, K)\)

  • "volume_mesh_centers": Volume mesh center coordinates of shape \((B, N_{vol}, 3)\)

  • "volume_min_max": Volume bounding box min/max of shape \((B, 2, 3)\)

  • "surface_min_max": Surface bounding box min/max of shape \((B, 2, 3)\)

  • "global_params_values": Global parameter values of shape \((B, N_{params}, 1)\)

  • "global_params_reference": Global parameter reference values of shape \((B, N_{params}, 1)\)

Outputs:

tuple[torch.Tensor | None, torch.Tensor | None] – A tuple containing:

  • Volume output tensor of shape \((B, N_{vol}, D_{vol})\) or None if volume-only mode is disabled

  • Surface output tensor of shape \((B, N_{surf}, D_{surf})\) or None if surface-only mode is disabled

Example

>>> from physicsnemo.models.domino.model import DoMINO
>>> from physicsnemo.models.domino.config import DEFAULT_MODEL_PARAMS
>>> import torch
>>> device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
>>> cfg = DEFAULT_MODEL_PARAMS  # already has model_type "combined"
>>> model = DoMINO(
...         input_features=3,
...         output_features_vol=5,
...         output_features_surf=4,
...         model_parameters=cfg
...     ).to(device)
>>> bsize = 1
>>> nx, ny, nz = cfg.interp_res
>>> num_neigh = cfg.num_neighbors_surface
>>> global_features = 2
>>> pos_normals_closest_vol = torch.randn(bsize, 100, 3).to(device)
>>> pos_normals_com_vol = torch.randn(bsize, 100, 3).to(device)
>>> pos_normals_com_surface = torch.randn(bsize, 100, 3).to(device)
>>> geom_centers = torch.randn(bsize, 100, 3).to(device)
>>> grid = torch.randn(bsize, nx, ny, nz, 3).to(device)
>>> surf_grid = torch.randn(bsize, nx, ny, nz, 3).to(device)
>>> sdf_grid = torch.randn(bsize, nx, ny, nz).to(device)
>>> sdf_surf_grid = torch.randn(bsize, nx, ny, nz).to(device)
>>> sdf_nodes = torch.randn(bsize, 100, 1).to(device)
>>> surface_coordinates = torch.randn(bsize, 100, 3).to(device)
>>> surface_neighbors = torch.randn(bsize, 100, num_neigh, 3).to(device)
>>> surface_normals = torch.randn(bsize, 100, 3).to(device)
>>> surface_neighbors_normals = torch.randn(bsize, 100, num_neigh, 3).to(device)
>>> surface_sizes = torch.rand(bsize, 100).to(device) + 1e-6 # Note this needs to be > 0.0
>>> surface_neighbors_areas = torch.rand(bsize, 100, num_neigh).to(device) + 1e-6
>>> volume_coordinates = torch.randn(bsize, 100, 3).to(device)
>>> vol_grid_max_min = torch.randn(bsize, 2, 3).to(device)
>>> surf_grid_max_min = torch.randn(bsize, 2, 3).to(device)
>>> global_params_values = torch.randn(bsize, global_features, 1).to(device)
>>> global_params_reference = torch.randn(bsize, global_features, 1).to(device)
>>> input_dict = {
...            "pos_volume_closest": pos_normals_closest_vol,
...            "pos_volume_center_of_mass": pos_normals_com_vol,
...            "pos_surface_center_of_mass": pos_normals_com_surface,
...            "geometry_coordinates": geom_centers,
...            "grid": grid,
...            "surf_grid": surf_grid,
...            "sdf_grid": sdf_grid,
...            "sdf_surf_grid": sdf_surf_grid,
...            "sdf_nodes": sdf_nodes,
...            "surface_mesh_centers": surface_coordinates,
...            "surface_mesh_neighbors": surface_neighbors,
...            "surface_normals": surface_normals,
...            "surface_neighbors_normals": surface_neighbors_normals,
...            "surface_areas": surface_sizes,
...            "surface_neighbors_areas": surface_neighbors_areas,
...            "volume_mesh_centers": volume_coordinates,
...            "volume_min_max": vol_grid_max_min,
...            "surface_min_max": surf_grid_max_min,
...            "global_params_reference": global_params_values,
...            "global_params_values": global_params_reference,
...        }
>>> output = model(input_dict)
>>> print(f"{output[0].shape}, {output[1].shape}")
torch.Size([1, 100, 5]), torch.Size([1, 100, 4])

Note

At least one of output_features_vol or output_features_surf must be specified.