MantisBT - ParaView
View Issue Details
0010433ParaViewFeaturepublic2010-03-17 20:582016-08-12 09:58
Alan Scott 
Kitware Robot 
highminoralways
closedmoved 
 
5.1 
Sandia
incorrect functionality
0010433: Generate cell volume filter
Users have requested the ability to get at the volume of cells. One of the primary uses of this is to calculate density - density = mass (an input var) / cell volume. This needs to work correctly for strange size cells, such as cells around a cylinder.

Please create a filter that generates and returns cell volume.
No tags attached.
child of 0011586closed Kitware Robot integralVolume filter 
png DerivedQuantitiesPanel.png (61,549) 2011-03-01 11:25
https://www.vtk.org/Bug/file/8733/DerivedQuantitiesPanel.png
png
Issue History
2010-03-17 20:58Alan ScottNew Issue
2010-09-01 11:31Utkarsh AyachitTarget Version4.0 => 3.10.shortlist
2010-12-08 15:49Alan ScottNote Added: 0023818
2010-12-08 15:54Alan ScottRelationship addedchild of 0011586
2011-02-07 12:42Alan ScottNote Added: 0025315
2011-02-07 12:44Alan ScottNote Added: 0025316
2011-02-07 12:44Alan ScottPrioritynormal => high
2011-03-01 11:25Utkarsh AyachitTarget Version3.10.shortlist => 3.10.1
2011-03-01 11:25Utkarsh AyachitFile Added: DerivedQuantitiesPanel.png
2011-03-01 11:26Utkarsh AyachitNote Added: 0025613
2011-03-31 11:24Utkarsh AyachitTarget Version3.10.1 => 3.12
2011-05-06 22:00Alan ScottNote Added: 0026455
2011-06-16 13:10Zack GalbreathCategoryFeature Request => Feature
2011-09-01 10:56Utkarsh AyachitProject => Sandia
2011-09-02 12:31Utkarsh AyachitAssigned To => Sankhesh Jhaveri
2011-09-02 12:35Utkarsh AyachitStatusbacklog => todo
2012-05-31 10:23Utkarsh AyachitStatustodo => backlog
2015-01-15 11:13Alan ScottNote Added: 0034084
2015-01-15 11:59Alan ScottNote Edited: 0034084bug_revision_view_page.php?bugnote_id=34084#r1000
2015-01-15 12:00Alan ScottType => incorrect functionality
2015-01-15 12:00Alan ScottTarget Version => 4.4
2015-07-01 08:42Utkarsh AyachitNote Added: 0034640
2015-07-01 08:44Utkarsh AyachitNote Added: 0034641
2015-07-01 08:44Utkarsh AyachitStatusbacklog => customer review
2015-07-01 08:44Utkarsh AyachitResolutionopen => suspended
2015-07-01 08:44Utkarsh AyachitAssigned ToSankhesh Jhaveri => David C. Lonie
2015-07-01 08:44Utkarsh AyachitNote Edited: 0034641bug_revision_view_page.php?bugnote_id=34641#r1120
2015-09-02 21:23Alan ScottNote Added: 0035147
2015-09-02 21:23Alan ScottNote Added: 0035148
2015-09-02 21:24Alan ScottStatuscustomer review => todo
2015-09-02 21:24Alan ScottTarget Version4.4 => 4.5
2015-09-11 16:44Utkarsh AyachitTarget Version4.5 => 5.1
2015-10-16 15:05Alan ScottNote Added: 0035304
2016-03-03 11:13Utkarsh AyachitStatustodo => backlog
2016-03-03 11:15David C. LonieAssigned ToDavid C. Lonie =>
2016-03-03 11:16David C. LonieNote Added: 0035820
2016-08-12 09:58Kitware RobotNote Added: 0037796
2016-08-12 09:58Kitware RobotStatusbacklog => closed
2016-08-12 09:58Kitware RobotResolutionsuspended => moved
2016-08-12 09:58Kitware RobotAssigned To => Kitware Robot

Notes
(0023818)
Alan Scott   
2010-12-08 15:49   
Ask me for volume formulas if desired. We have a group that works on these formulas.
(0025315)
Alan Scott   
2011-02-07 12:42   
From an e-mail from Berk: (This sounds like a very good way to go.)

What about this:

We add a filter calculate "Calculate Derived Quantities". This can be a replacement for calculator in the long term. On the GUI of this filter, there is a drop-down menu with all of the functions it supports. So if you want to calculate the volume, you do
- apply "Calculate Derived Quantities"
- choose volume from the drop-down menu
   * this would add "volume()" in the entry box
- apply

The only reason I am trying to steer us this way is that it would make everyone's life easier to be able to calculate derived quantities in the same filter. So if you need density, you can:

- apply "Calculate Derived Quantities"
- choose volume from the drop-down menu
   * this would add "volume()" in the entry box
- edit the entry box to say mass / volume() (assuming that there is an array called mass)
- apply

We can also do a drop-down that has all the array names if needed.

If we had a separate filter for volume, to calculate mass, you'd have to create an additional calculator filter. I am trying to minimize the number of filters people have to create to do something very common.

What do you think?
(0025316)
Alan Scott   
2011-02-07 12:44   
Changing to high priority, since this functionality that is really needed.
(0025613)
Utkarsh Ayachit   
2011-03-01 11:26   
Added a panel mockup. If that looks good, we can go ahead with this one.
(0026455)
Alan Scott   
2011-05-06 22:00   
panel looks ok. I would rather have specific variable names, but this should be used rarely enough that this is OK.
(0034084)
Alan Scott   
2015-01-15 11:13   
(edited on: 2015-01-15 11:59)
Lets implement this functionality in the normal GUI calculator. Although this can be done in the Python Calculator, the commands are not trivial or intuitive, and many users don't know Python or use the Python Calculator.

This can be done in the Python Calculator, as follows:

Python Calculator.
Array Association: Cell Data
Expression: volume(inputs[0])
Array Name: Cell Volume
Apply

(0034640)
Utkarsh Ayachit   
2015-07-01 08:42   
Alan,

I am not sure how this could be implemented in the normal GUI calculator. How does the user identify which array is the "mass" array. Or do you want to add "cell-volume" as a available operations?

Another options, we simply add a new filter named "Cell Volume" that computes cell volume. Then one can apply the calculator to pick the mass and volume arrays to perform the operation? Internally, the "Cell Volume" filter can use Python Calculator.
(0034641)
Utkarsh Ayachit   
2015-07-01 08:44   
Moved to customer review to get feedback. Alan, move back to backlog/todo with your comments please. Thanks!

(0035147)
Alan Scott   
2015-09-02 21:23   
I changed my mind. Lets do this as presented by Utkarsh. Basically, do it as easily as possible, lets get users using it. If they then want to copy this functionality to an easier tool, we will deal with it then.
(0035148)
Alan Scott   
2015-09-02 21:23   
Moving to 4.5.. 4.4 is already out of the barn, and I don't want it messed up.
(0035304)
Alan Scott   
2015-10-16 15:05   
With help from Cory and Utkarsh, here are my notes on python ways to get volume:

Python Calculator:

Expression: volume(inputs[0])
Array Association: Cell Data
Result: cellVolume






Programmable filter:

Output Data Set Type: Same as Input (default)

In the Script entry block, type in the following:

from vtk.numpy_interface import algorithms as algs

volume = algs.volume(inputs[0])
output.CellData.append(cellVolume, volume)
(0035820)
David C. Lonie   
2016-03-03 11:16   
Removed my assignment, as this is not an issue I'm currently funded to work on.
(0037796)
Kitware Robot   
2016-08-12 09:58   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current ParaView Issues page linked in the banner at the top of this page.