Reusing fields in multiple pipelines in Ascent possible?

I feel it should be possible to reuse the same field in multiple pipelines and scenes. Specifically, I thought I can define velocity magnitude and then create several slices and visualise in different scenes. I am trying something like this:

pipeline-vmag = [{'type': 'vector_magnitude', 'field': 'velocity', 'output-name': 'vmag'}]

pipeline-slice1 = [{'type': 'slice', 'point/x': 0.0, 'point/y': 0.0, 'point/z': 0.0, 'normal/x': 0.0, 'normal/y': 0.0, 'normal/z': 1.0}]
pipeline-slice2 = [{'type': 'slice', 'point/x': 1.0, 'point/y': 0.0, 'point/z': 0.0, 'normal/x': 1.0, 'normal/y': 0.0, 'normal/z': 0.0}]

scene-s1 = {'type': 'pseudocolor', 'min-value': 0.0, 'max-value': 1.2,
            'color-table_name': 'Black-Body Radiation',
            'field': 'vmag',
            'pipeline': 'slice1',
            'render-1': {'image-name': 'side-{t:05.2f}', 'camera/zoom': 1.2, 'camera_azimuth': 0, 'camera_elevation': 0, 'bg-color': [1.0, 1.0, 1.0], 'color-bar-position': [2.0 ,2.0, 2.0, 2.0]}}
;wake
scene-s2 = {'type': 'pseudocolor', 'min-value': 0.0, 'max-value': 1.2,
            'color-table_name': 'Black-Body Radiation',
            'field': 'vmag',
            'pipeline': 'slice2',
            'render-1': {'image-name': 'wake1-{t:05.2f}', 'camera/zoom': 1.2, 'camera_azimuth': 90, 'camera_elevation': 0, 'bg-color': [1.0, 1.0, 1.0], 'color-bar-position'

When I do it like this vmag is not found as it’s not part of any pipeline fed into scenes, but if I reuse vmag across different pipelines Ascent complains it’s already defined.

I think in this case you could use an explicitly defined field rather than relying on a pipeline to produce the velocity magnitude.

ie

field-vmag = sqrt(u*u + v*v + w*w)

Then you can use the field variable vmag wherever you need it.

1 Like