[prev in list] [next in list] [prev in thread] [next in thread] 

List:       paraview
Subject:    Re: [Paraview] get the sum of a cell or point variable (UNCLASSIFIED)
From:       Utkarsh Ayachit <utkarsh.ayachit () kitware ! com>
Date:       2014-07-22 20:26:39
Message-ID: CADHSJjBpwpnT5GM+cMDwKLCtetHA7E7k6CBc=H3rg45=VQYjNw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Simon,

So there are two types of Python scripts in ParaView: the data processing
(which goes in programmable filter, python calculator etc.) and the
client-side. For automation, you'd be interested in the scripting the
client. For that, you have WriteData() (or something like that) in the
simple.py module (
http://www.paraview.org/ParaView3/Doc/Nightly/www/py-doc/paraview.simple.html).
It's not there yet, the code went in git/master earlier today. But you'll
be able to use Python trace to determine what call to use :).

Utkarsh


On Tue, Jul 22, 2014 at 4:20 PM, Su, Simon M CTR USARMY ARL (US) <
simon.m.su.ctr@mail.mil> wrote:

> Classification: UNCLASSIFIED
> Caveats: NONE
>
> Errr.... what would be the equivalent to "menu->save" in python script?
> Sorry
> for making it difficult as the whole thing is a part of a elaborate
> automation
> from running simulation to getting the final result. Calling python
> calculator
> to calculate sum will be in a script run with pvbatch in parallel
> environment.
> Is CSV file format the best format if I just want to write that sum value
> out
> to a file? Any example script on writing 1 variable to CSV file format?
>
> Thanks
> -simon
>
> -----Original Message-----
> From: Utkarsh Ayachit [mailto:utkarsh.ayachit@kitware.com]
> Sent: Tuesday, July 22, 2014 4:11 PM
> To: Su, Simon M CTR USARMY ARL (US)
> Cc: paraview@paraview.org
> Subject: Re: [Paraview] get the sum of a cell or point variable
> (UNCLASSIFIED)
>
> Hey, once the sum() is computed by the calculator, you can just use "save
> data" from the menu and save it out as a CSV :P.
>
> Utkarsh
>
>
> On Tue, Jul 22, 2014 at 3:49 PM, Su, Simon M CTR USARMY ARL (US)
> <simon.m.su.ctr@mail.mil> wrote:
>
>
>         Classification: UNCLASSIFIED
>         Caveats: NONE
>
>         Hi Utkarsh,
>
>         That's great. That will eliminate the programmable filter part of
> my
> pipeline.
>         You didn't happen to also pushed update to VTK/ParaView that will
> write the
>         expression "sum(EQPS)" to a file that will work in parallel, did
> you? :)
>
>         Thanks
>         -simon
>
>
>         -----Original Message-----
>         From: Utkarsh Ayachit [mailto:utkarsh.ayachit@kitware.com]
>         Sent: Tuesday, July 22, 2014 3:43 PM
>         To: Su, Simon M CTR USARMY ARL (US)
>         Cc: paraview@paraview.org
>         Subject: Re: [Paraview] get the sum of a cell or point variable
> (UNCLASSIFIED)
>
>         Simon,
>
>         As I am cleaning my inbox, I ran into this email. Since there have
> been other
>         emails about this I'll skip your original query :). Just wanted to
> give you
> an
>         update on recent developments in ParaView. We recently pushed
> updates to
>         VTK/ParaView to allow you to use Python calculator to compute
> "sum" in
>         parallel across all blocks in the dataset. e.g. for can.ex2, you
> can apply
> the
>         Python Calculator and select "Cell Data", with expression
> "sum(EQPS)" the
>         result array will have the true global sum. This also includes
> operations
> like
>         min/max/mean etc.
>
>         Utkarsh
>
>
>         On Wed, Jun 25, 2014 at 11:21 AM, Su, Simon M CTR USARMY ARL (US)
>         <simon.m.su.ctr@mail.mil> wrote:
>
>
>                 Classification: UNCLASSIFIED
>                 Caveats: NONE
>
>                 Hello,
>
>                 Running in PV client/server mode, is there a calculator
> function that
> will
>                 add up all the values of a variable (cell or point
> variable).
>
>                 I can use the programmable filter to write a python loop
> to iterate
> through
>                 all the cell/point of the variable and add them up. But,
> running in a
>                 client/server mode, how would you store that value? Can I
> just add a
> single
>                 value (not array) to the data? If so, what vtk data
> structure shall I
> use to
>                 store a double variable? vtk.vtkDouble()? Or is there a
> way to write
> that
>                 value out to a file. Running it in parallel, how would
> that be
> handled?
>
>                 Thanks
>                 -simon
>
>                 Classification: UNCLASSIFIED
>                 Caveats: NONE
>
>
>
>                 _______________________________________________
>                 Powered by www.kitware.com
>
>                 Visit other Kitware open-source projects at
>         http://www.kitware.com/opensource/opensource.html
>
>                 Please keep messages on-topic and check the ParaView Wiki
> at:
>         http://paraview.org/Wiki/ParaView
>
>                 Follow this link to subscribe/unsubscribe:
>                 http://public.kitware.com/mailman/listinfo/paraview
>
>
>
>
>
>
>         Classification: UNCLASSIFIED
>         Caveats: NONE
>
>
>
>
>
>
> Classification: UNCLASSIFIED
> Caveats: NONE
>
>
>

[Attachment #5 (text/html)]

<div dir="ltr">Simon,<div><br></div><div>So there are two types of Python scripts in \
ParaView: the data processing (which goes in programmable filter, python calculator \
etc.) and the client-side. For automation, you&#39;d be interested in the scripting \
the client. For that, you have WriteData() (or something like that) in the simple.py \
module (<a href="http://www.paraview.org/ParaView3/Doc/Nightly/www/py-doc/paraview.sim \
ple.html">http://www.paraview.org/ParaView3/Doc/Nightly/www/py-doc/paraview.simple.html</a>). \
It&#39;s not there yet, the code went in git/master earlier today. But you&#39;ll be \
able to use Python trace to determine what call to use :).</div> \
<div><br></div><div>Utkarsh</div> </div><div class="gmail_extra"><br><br><div \
class="gmail_quote">On Tue, Jul 22, 2014 at 4:20 PM, Su, Simon M CTR USARMY ARL (US) \
<span dir="ltr">&lt;<a href="mailto:simon.m.su.ctr@mail.mil" \
target="_blank">simon.m.su.ctr@mail.mil</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
                solid;padding-left:1ex">Classification: UNCLASSIFIED<br>
Caveats: NONE<br>
<br>
Errr.... what would be the equivalent to &quot;menu-&gt;save&quot; in python script? \
Sorry<br> for making it difficult as the whole thing is a part of a elaborate \
automation<br> from running simulation to getting the final result. Calling python \
calculator<br> to calculate sum will be in a script run with pvbatch in parallel \
environment.<br> Is CSV file format the best format if I just want to write that sum \
value out<br> to a file? Any example script on writing 1 variable to CSV file \
format?<br> <div class=""><br>
Thanks<br>
-simon<br>
<br>
-----Original Message-----<br>
From: Utkarsh Ayachit [mailto:<a \
href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>]<br> \
                </div><div><div class="h5">Sent: Tuesday, July 22, 2014 4:11 PM<br>
To: Su, Simon M CTR USARMY ARL (US)<br>
Cc: <a href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>
Subject: Re: [Paraview] get the sum of a cell or point variable (UNCLASSIFIED)<br>
<br>
Hey, once the sum() is computed by the calculator, you can just use &quot;save<br>
data&quot; from the menu and save it out as a CSV :P.<br>
<br>
Utkarsh<br>
<br>
<br>
On Tue, Jul 22, 2014 at 3:49 PM, Su, Simon M CTR USARMY ARL (US)<br>
&lt;<a href="mailto:simon.m.su.ctr@mail.mil">simon.m.su.ctr@mail.mil</a>&gt; \
wrote:<br> <br>
<br>
            Classification: UNCLASSIFIED<br>
            Caveats: NONE<br>
<br>
            Hi Utkarsh,<br>
<br>
            That&#39;s great. That will eliminate the programmable filter part of \
my<br> pipeline.<br>
            You didn&#39;t happen to also pushed update to VTK/ParaView that will \
                write the<br>
            expression &quot;sum(EQPS)&quot; to a file that will work in parallel, \
did you? :)<br> <br>
            Thanks<br>
            -simon<br>
<br>
<br>
            -----Original Message-----<br>
            From: Utkarsh Ayachit [mailto:<a \
href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>]<br>  Sent: \
Tuesday, July 22, 2014 3:43 PM<br>  To: Su, Simon M CTR USARMY ARL (US)<br>
            Cc: <a href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>
            Subject: Re: [Paraview] get the sum of a cell or point variable<br>
(UNCLASSIFIED)<br>
<br>
            Simon,<br>
<br>
            As I am cleaning my inbox, I ran into this email. Since there have been \
                other<br>
            emails about this I&#39;ll skip your original query :). Just wanted to \
give you<br> an<br>
            update on recent developments in ParaView. We recently pushed updates \
                to<br>
            VTK/ParaView to allow you to use Python calculator to compute \
                &quot;sum&quot; in<br>
            parallel across all blocks in the dataset. e.g. for can.ex2, you can \
apply<br> the<br>
            Python Calculator and select &quot;Cell Data&quot;, with expression \
                &quot;sum(EQPS)&quot; the<br>
            result array will have the true global sum. This also includes \
operations<br> like<br>
            min/max/mean etc.<br>
<br>
            Utkarsh<br>
<br>
<br>
            On Wed, Jun 25, 2014 at 11:21 AM, Su, Simon M CTR USARMY ARL (US)<br>
            &lt;<a href="mailto:simon.m.su.ctr@mail.mil">simon.m.su.ctr@mail.mil</a>&gt; \
wrote:<br> <br>
<br>
                        Classification: UNCLASSIFIED<br>
                        Caveats: NONE<br>
<br>
                        Hello,<br>
<br>
                        Running in PV client/server mode, is there a calculator \
function that<br> will<br>
                        add up all the values of a variable (cell or point \
variable).<br> <br>
                        I can use the programmable filter to write a python loop to \
iterate<br> through<br>
                        all the cell/point of the variable and add them up. But, \
                running in a<br>
                        client/server mode, how would you store that value? Can I \
just add a<br> single<br>
                        value (not array) to the data? If so, what vtk data structure \
shall I<br> use to<br>
                        store a double variable? vtk.vtkDouble()? Or is there a way \
to write<br> that<br>
                        value out to a file. Running it in parallel, how would that \
be<br> handled?<br>
<br>
                        Thanks<br>
                        -simon<br>
<br>
                        Classification: UNCLASSIFIED<br>
                        Caveats: NONE<br>
<br>
<br>
<br>
                        _______________________________________________<br>
                        Powered by <a href="http://www.kitware.com" \
target="_blank">www.kitware.com</a><br> <br>
                        Visit other Kitware open-source projects at<br>
            <a href="http://www.kitware.com/opensource/opensource.html" \
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br> <br>
                        Please keep messages on-topic and check the ParaView Wiki \
                at:<br>
            <a href="http://paraview.org/Wiki/ParaView" \
target="_blank">http://paraview.org/Wiki/ParaView</a><br> <br>
                        Follow this link to subscribe/unsubscribe:<br>
                        <a href="http://public.kitware.com/mailman/listinfo/paraview" \
target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br> <br>
<br>
<br>
<br>
<br>
<br>
            Classification: UNCLASSIFIED<br>
            Caveats: NONE<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div></div>Classification: UNCLASSIFIED<br>
Caveats: NONE<br>
<br>
<br>
</blockquote></div><br></div>



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic