[Paraview] Python calculator and max bug
Scott, W Alan
wascott at sandia.gov
Fri Jun 20 19:30:05 EDT 2014
Berk,
After looking at this, yep - it's a bug. I wrote it up as bug number 14816, with a good example using can.exo.
I like what you wrote below - max-per-block, or maxPerBlock?
Alan
>From the ParaView e-mail list:
Simply max(von_mises) doesn't do it? The calculator is supposed to convert scalars to arrays automatically but maybe there is an issue there...
PS: This is somewhat ironic. I am working on changes to support things like min/max over all blocks. Those changes would make min/max over block impossible :-) So I guess we want both. What would a good function name for XXX per block be?
-berk
On Mon, Jun 9, 2014 at 6:24 PM, Scott, W Alan <wascott at sandia.gov<mailto:wascott at sandia.gov>> wrote:
Hi,
I am coloring blocks by the maximum value of a variable that occurs within that given block. I am dealing with a large number of blocks, so I don't want to extract each block and color one by one.
I'm currently using the python calculator to do this, since the function "max()" returns block-by-block maximum (scalar), which is what I want. The issue is that paraview doesn't return the returned value as an array, so using the maximum values per block directly in an expression doesn't work. I'm using a pretty sad-looking syntax to get the job done. My expression is something along the lines of:
Expression: ((von_mises - von_mises)+1)*max(von_mises)
So, I'm creating an array of 1's for each cell and then scaling it by the maximum value in a given block. There must be a better way of doing this, right? Something like "max_by_block()" or "create_cell_array_ones()." If not, perhaps that could become a feature request.
Thanks,
Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20140620/390e594e/attachment.html>
More information about the ParaView
mailing list