How to export/get scatter coordinate data from NVIDIA Modulus?

Hello! I’m currently using NVIDIA Modulus for a physics simulation and need to export scatter coordinate data for subsequent analysis. I would appreciate any help from the community.

Current situation:

  1. I’ve completed a simulation of a physical field using Modulus
  2. I’ve set up an inflow boundary condition using PointwiseBoundaryConstraint
  3. I need to extract the scatter point coordinates from this constraint for further analysis

Here’s my current code:

from modulus.sym.domain.constraint import PointwiseBoundaryConstraint
from modulus.sym.geometry.primitives_2d import Rectangle, Line, Channel2D

left_inlet = Line((0, 1), (0, 2))
left_inflow = PointwiseBoundaryConstraint(
    nodes=nodes,
    geometry=left_inlet,
    outvar={"u": 4.0, "v": 0.0, "normal_gradient_c":0},
    batch_size=cfg.batch_size.left_inflow,
    parameterization={t: (0, 10)},
)
domain.add_constraint(left_inflow, "left_inflow")

Specific questions:

  1. Does Modulus provide a specific API for exporting scatter point coordinates from PointwiseBoundaryConstraint?
  2. If yes, what is the correct method to use it?
  3. If there’s no official API, are there any alternative approaches you would recommend?

Thank you in advance for any help! I’m happy to provide additional information if needed.

Hi,
I may need some clarification to fully understand your query, but I believe the constraint (left_inflow.vtp) contains the coordinate information you’re looking for. You can use ParaView to open the .vtp file and export the scatter point coordinates as a CSV file for your analysis.


Hello, thank you for your reply, this is the information from the CSV file I exported from left_inflow.vtp using ParaView and does not contain the coordinate information.

Hi,

Did you try checking the columns labeled as:

  • "Points_0" for x coordinates,
  • "Points_1" for y coordinates, and
  • "Points_2" for z coordinates?

These should contain the coordinate information you’re looking for.

1 Like

Thank you very much for your detailed reply, I confirmed that this is the coordinate information.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.