<html><head></head><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:16px"><div id="yui_3_16_0_ym18_1_1459073295786_16390"><span>Hey Cory,</span></div><div id="yui_3_16_0_ym18_1_1459073295786_16244"><span><br></span></div><div id="yui_3_16_0_ym18_1_1459073295786_16081" dir="ltr"><span id="yui_3_16_0_ym18_1_1459073295786_16080">Thank you for your email. I tried using the python calculator with the expression you gave me but I got error saying that name ''volumes''  doesn't exist. I also used the python annotation filter to calculate the volume of oil in a region that I can estimate the real volume but  instead of getting a scalar, I got a VTK array. I attached pictures that illustrate every thing, I also attached a picture of the mesh that I created with salome platform.</span></div><div id="yui_3_16_0_ym18_1_1459073295786_16081" dir="ltr"><span><br></span></div><div id="yui_3_16_0_ym18_1_1459073295786_16081" dir="ltr"><span>Regards,</span></div><div id="yui_3_16_0_ym18_1_1459073295786_16081" dir="ltr"><span id="yui_3_16_0_ym18_1_1459073295786_16944">Islem </span></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: verdana, helvetica, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> Le Jeudi 24 mars 2016 15h48, Cory Quammen <cory.quammen@kitware.com> a écrit :<br></font></div>  <br><br> <div class="y_msg_container">Islem,<br clear="none"><br clear="none">One possibility is that the order of vertices in your grid is somehow<br clear="none">different than what VTK expects and gives you inverted cells that have<br clear="none">negative volume. I don't know if this is the case because your<br clear="none">negative volume is much different from the expected positive volume.<br clear="none"><br clear="none">Could you try using the Python Calculator to compute the volumes of<br clear="none">each cell and see if they are all negative? The expression should be<br clear="none">something like<br clear="none"><br clear="none">volumes(input)<br clear="none"><br clear="none">(haven't tested this). This would at least be a first step in<br clear="none">debugging the problem.<br clear="none"><br clear="none">HTH,<br clear="none">Cory<br clear="none"><br clear="none"><br clear="none">On Mon, Mar 21, 2016 at 8:21 AM, Megdich Islem <<a shape="rect" ymailto="mailto:megdich_islem@yahoo.fr" href="mailto:megdich_islem@yahoo.fr">megdich_islem@yahoo.fr</a>> wrote:<br clear="none">> Hi,<br clear="none">><br clear="none">> Thank you for your email, I tried this expression<br clear="none">> sum(alphawater*volume(input)) and it worked fine and gave me some logical<br clear="none">> results for some shapes that I know their volumes, but for the problem that<br clear="none">> I am working on, it gave me negative value for the volume. I am supposed to<br clear="none">> calculate the volume of a quarter of a cylinder with height 0.6 m and radius<br clear="none">> 0.3 m, so the volume should be V=(0.3*0.3*3.14*0.6)/4=0.04239 cubic meter,<br clear="none">> but  the annotation filter gave me this value -2639.95829243. I attached<br clear="none">> here two pictures that illustrate the dimensions of the cylinder and the<br clear="none">> value I got, I couldn't what is wrong.<br clear="none">><br clear="none">> Regards,<br clear="none">> Islem Megdiche<br clear="none">><br clear="none">><br clear="none">> Le Dimanche 20 mars 2016 10h57, Cory Quammen <<a shape="rect" ymailto="mailto:cory.quammen@kitware.com" href="mailto:cory.quammen@kitware.com">cory.quammen@kitware.com</a>> a<br clear="none">> écrit :<br clear="none">><br clear="none">><br clear="none">> Thanks, Utkarsh.<br clear="none">><br clear="none">> Indeed, replacing "alpha.water" with "alphawater" appears to work just fine.<br clear="none">><br clear="none">> - Cory<br clear="none">><br clear="none">> On Sat, Mar 19, 2016 at 7:23 PM, Utkarsh Ayachit<br clear="none">> <<a shape="rect" ymailto="mailto:utkarsh.ayachit@kitware.com" href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>> wrote:<br clear="none">>>> The dot "." in the array name is causing problems. Because it is a Python<br clear="none">>>> expression, the interpreter thinks you are asking for an attribute "water"<br clear="none">>>> from a class or module.<br clear="none">>><br clear="none">>> FYI, ParaView uses paraview.make_name_valid()[1] function to sanitize<br clear="none">>> array names in Python. Any character not a "_" or ASCII letter or<br clear="none">>> number is simply dropped and if the name beings with a number, then a<br clear="none">>> 'a' is prefixed.<br clear="none">>><br clear="none">>> [1]<br clear="none">>> <a shape="rect" href="http://www.paraview.org/ParaView/Doc/Nightly/www/py-doc/_modules/paraview/__init__.html#make_name_valid" target="_blank">http://www.paraview.org/ParaView/Doc/Nightly/www/py-doc/_modules/paraview/__init__.html#make_name_valid</a><br clear="none">><br clear="none">><br clear="none">><br clear="none">><br clear="none">> --<br clear="none">> Cory Quammen<br clear="none">> R&D Engineer<br clear="none">> Kitware, Inc.<div class="yqt5484854812" id="yqtfd14022"><br clear="none">><br clear="none">><br clear="none">><br clear="none"><br clear="none"><br clear="none"><br clear="none">-- <br clear="none">Cory Quammen<br clear="none">R&D Engineer<br clear="none">Kitware, Inc.</div><br><br></div>  </div> </div>  </div></div></body></html>