how to multiply point data by global variable

Is it possible to multiply point data by a global variable? How is it done?

Thanks team!

@cory.quammen @utkarsh.ayachit

1 Like

There’s nothing in the Calculator filter to access global variables stored in field data, but you can use the Python Calculator to do that.

As an example, if you open the can.exo file, you can add a Python Calculator with the Expression property set to inputs[0].FieldData['KE'][0] * ACCL. Make sure you set the Array Association to “Point Data”.

Exactly what I was looking for. Thanks.

Cory, I believe your formula is incorrect. the [0] is forcing time step zero. What worked for me, using the can.exo dataset, is inputs[0].FieldData[‘NSTEPS’][time_index] * DISPL. I originally missed it, but this is documented in bottom of the ParaView Guide, section

Note, to find the NSTEPS, I used the Annotate Global Data filter.

Ah, thanks for the correction! Here is the section you cited in the ParaView Guide.

This is useful enough, and requested enough, that I added it into the SNL tutorial.