Using Tracks in Field Functions and Derived Parts

In simulations where many particle tracks are present, it is likely that only a small number are required for plotting in a graphics scene. You can create a field function to filter the available tracks and apply the filter in a derived part.

A field function is created that returns the Track Parcel Index number for every eighth track. The function name for the Track Parcel Index is TrackParcelId (which can be found from the Function Name property of the Track: Parcel Index node in Automation > Field Functions).

To use tracks in field functions and derived parts:

  1. Right-click the Automation > Field Functions node and select New > Scalar from the pop-up menu.
  2. Rename the User Field Function 1 node to TrackFilter.
  3. Select the Track Filter node and set the following properties:
    Property Setting
    Function Name Track Filter
    Dimensions Dimensionless
    Definition (fmod($TrackParcelId, 8) <= 0.0001) ? $TrackParcelId : -1

The function entered here uses the fmod function and the conditional expression that is defined by the ternary operator “?:”. The function essentially says that if an integer results from the division of TrackParcelId by 8, then the TrackParcelId is returned; otherwise the value -1 is returned.

Create a derived part based on a threshold to use this behavior.

  1. Right-click Derived Parts and select New Part > Threshold from the pop-up menu.

    The Create Threshold dialog appears above the object tree.

  2. In the Input Parts box, click the drop-down menu. In the dialog that appears, use (Column Selection) to Deselect All, expand the Particle Tracks node and select Phase 1 tracks item.


  3. Click OK.
  4. Click the drop-down menu in the Scalar box and choose item Track Filter as shown.


  5. Set the Extraction Mode to All Above and the Threshold Value to 0.001.
  6. Select No Displayer in the Display box.

    The completed panel is shown below.



  7. Click Create and then Close.

    A new derived part named threshold appears in the object tree.



  8. Rename the threshold node to Filtered Tracks.

Modify Scalar Scene 1 to display the filtered tracks:

  1. Select the Scenes > Scalar Scene 1 > Scalar 1 > Parts node.


  2. Click the right half of the Parts property.
  3. In the dialog that appears, click the drop-down menu.
  4. In the dialog that appears, use (Column Selection) to Deselect All, expand the Derived Parts node and select Filtered tracks as shown below.


  5. Click OK.

Scalar Scene 1 now shows the filtered set of particle tracks.