[Paraview] common calculations module

Simone Crippa crippa at kth.se
Fri Jan 27 13:38:22 EST 2006


Yep, that's it! 

This is not yet what Dan Goldstein and I first had in mind, but for now
it's good enough for me. 

It would still be nice though, to have a module/filter that enables
"standard" CFD calculations to be executed on the fly ... once I knew
how to write such a xml/pvsm file (where calculations are executed via a
button press), it wouldn't be a big problem to implement more complex
stuff like e.g. boundary layer feature extraction (thickness, momentum
thickness, ...).


Thanks a lot for the help so far!


Regards, Simone
   


On Fri, 2006-01-27 at 13:24 -0500, Berk Geveci wrote:
> Try changing
> 
> mydialog Create
> 
> to
> 
> mydialog Create $Application
> 
> -Berk
> 
> 
> On 1/27/06, Simone Crippa <crippa at kth.se> wrote:
> > On Fri, 2006-01-27 at 13:03 -0500, Berk Geveci wrote:
> > > Oops. Which version of ParaView are you using?
> > >
> >
> > paraview 2.2.0 built from source
> >
> >
> > > On 1/27/06, Simone Crippa <crippa at kth.se> wrote:
> > > > Hi,
> > > >
> > > > I tried to do the same as before, but this time I received an error:
> > > >
> > > >       * ErrorMessage
> > > >       * # Error or warning: There was a VTK Error in
> > > >         file: /usr/local/src/paraview-2.2.0/GUI/Widgets/vtkKWApplication.cxx (1300)
> > > >       *
> > > >       *     Script:
> > > >       * /[...]/test2.pvs
> > > >       *     Returned Error on line 4:
> > > >       *       Object named: mydialog, could not find requested method:
> > > >         Create
> > > >       * or the method was called with incorrect arguments.
> > > >       * ErrorMessage end
> > > >
> > > > Then I thought I might have forgot to paste something, so I checked and
> > > > ran again, but still an error:
> > > >
> > > >       * ErrorMessage
> > > >       * # Error or warning: There was a VTK Error in
> > > >         file: /usr/local/src/paraview-2.2.0/GUI/Widgets/vtkKWApplication.cxx (1300)
> > > >       *
> > > >       *     Script:
> > > >       * /[...]/test2.pvs
> > > >       *     Returned Error on line 1:
> > > >       *       mydialog: a vtk object with that name already exists.
> > > >       * ErrorMessage end
> > > >
> > > >
> > > >
> > > >
> > > > Regards, Simone
> > > >
> > > >
> > > >
> > > > On Fri, 2006-01-27 at 11:37 -0500, Berk Geveci wrote:
> > > > > Now you are getting fancy :-) Try the one below:
> > > > >
> > > > >
> > > > > vtkKWSimpleEntryDialog mydialog
> > > > > mydialog SetApplication $Application
> > > > > mydialog SetMasterWindow [$Application GetMainWindow]
> > > > > mydialog Create
> > > > > mydialog SetTitle "Enter value"
> > > > > mydialog SetText "Value for free-stream pressure:"
> > > > > mydialog Invoke
> > > > >
> > > > > set value [[[mydialog GetEntry] GetWidget] GetValue]
> > > > > mydialog Delete
> > > > >
> > > > > set EQUATION "RTData*7*$value"
> > > > >
> > > > > set kw(vtkTemp1) [$Application GetMainWindow]
> > > > >
> > > > > set calc [$kw(vtkTemp1) CreatePVSource Calculator]
> > > > > set calcWidget [$calc GetPVWidget {Equation}]
> > > > > $calcWidget SetFunctionLabel $EQUATION
> > > > >
> > > > >
> > > > > On 1/27/06, Simone Crippa <crippa at kth.se> wrote:
> > > > > > Thanks Berk, that's already very useful!
> > > > > >
> > > > > > Now how can I do it if I need to specify a certain value which differs
> > > > > > from array to array ... say a case constant such as free-stream
> > > > > > pressure.
> > > > > > That's why I thought of going through a module/filter, where one can
> > > > > > have an input field to specify a case constant ... say I have to
> > > > > > calculate pressure(local)/pressure(far-field).
> > > > > >
> > > > > >
> > > > > > Regards, Simone
> > > > > >
> > > > > >
> > > > > > On Fri, 2006-01-27 at 10:43 -0500, Berk Geveci wrote:
> > > > > > > Save the following to a .pvs file, change the equation, create your
> > > > > > > source, load the .pvs file. Of course, make sure that the names in the
> > > > > > > equation match the array names.
> > > > > > >
> > > > > > > set EQUATION {RTData*7}
> > > > > > >
> > > > > > > set kw(vtkTemp1) [$Application GetMainWindow]
> > > > > > >
> > > > > > > set calc [$kw(vtkTemp1) CreatePVSource Calculator]
> > > > > > > set calcWidget [$calc GetPVWidget {Equation}]
> > > > > > > $calcWidget SetFunctionLabel $EQUATION
> > > > > > >
> > > > > > >
> > > > > > > On 1/27/06, Daniel Goldstein <Daniel.E.Goldstein at colorado.edu> wrote:
> > > > > > > > Simone Crippa wrote:
> > > > > > > >
> > > > > > > > >Hi All,
> > > > > > > > >
> > > > > > > > >I am wondering what is the best way to implement in Paraview often
> > > > > > > > >recurring calculations ... maybe an example is better:
> > > > > > > > >
> > > > > > > > >I have to postprocess CFD data. My solver gives out pressure,
> > > > > > > > >density, ... for each point of an unstructured grid, which I import in
> > > > > > > > >Paraview. If I want to calculate e.g. the entropy production in the
> > > > > > > > >whole field I open the calculator and calculate it out of the field
> > > > > > > > >values, e.g. density, pressure and with the constant undisturbed
> > > > > > > > >(free-stream) values.
> > > > > > > > >
> > > > > > > > >I feel a bit dumb to type down the equation(s) every time (in this case
> > > > > > > > >relative easy, but sometimes it can be pretty complicated to get all the
> > > > > > > > >braces right), so I thought that maybe I could use the "import modules"
> > > > > > > > >functionality to first write a module (.xml and .pvsm) which
> > > > > > > > >incorporates my equation(s) and then "filter" my dataset with this
> > > > > > > > >module.
> > > > > > > > >
> > > > > > > > >Is this the recommended way? How should I do it then? ... use the
> > > > > > > > >vtkCalculator class, somehow?
> > > > > > > > >The problem is that I am not very good at coding xml ... actually as an
> > > > > > > > >engineer I seldom need to code with anything more complex than Fortran
> > > > > > > > >or Matlab. So if someone out there has solved this type of "problem"
> > > > > > > > >before, it would be nice to know how. (In a way I can emulate :-)
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >Thanks, Simone
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >  Hi Simone
> > > > > > > >     I have been looking at how to do this also.  I do CFD and also would
> > > > > > > > like to setup some startdard post processing in Paraview.
> > > > > > > > I do not yet have any good solution though. Perhaps a TCL script that
> > > > > > > > calls the calculator tool with different equations?
> > > > > > > > Has anyone come up with a way to set this up?  If anyone has some TCL
> > > > > > > > scripts that they use to do standard post processing could
> > > > > > > > you post some examples for us?
> > > > > > > >
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > > Dan
> > > > > > > >
> > > > > > > > -----------------------------------------
> > > > > > > > Dan Goldstein
> > > > > > > > Research Scientist
> > > > > > > > NorthWest Research Associates, Inc.
> > > > > > > > Colorado Research Associates Division
> > > > > > > > Colorado, U.S.A.
> > > > > > > > -----------------------------------------
> > > > > > > >
> > > > > > > >
> > > > > > > > _______________________________________________
> > > > > > > > ParaView mailing list
> > > > > > > > ParaView at paraview.org
> > > > > > > > http://www.paraview.org/mailman/listinfo/paraview
> > > > > > > >
> > > > > > > _______________________________________________
> > > > > > > ParaView mailing list
> > > > > > > ParaView at paraview.org
> > > > > > > http://www.paraview.org/mailman/listinfo/paraview
> > > > > > --
> > > > > > Simone Crippa
> > > > > > Research assistant, Dipl.-Ing.
> > > > > > Royal Institute of Technology (KTH)
> > > > > > Aeronautical and Vehicle Engineering
> > > > > > Division of Aerodynamics
> > > > > > Teknikringen 8
> > > > > > SE-10044 Stockholm, Sweden
> > > > > > +46 (0)8 790 6465
> > > > > >
> > > > > >
> > > > --
> > > > Simone Crippa
> > > > Research assistant, Dipl.-Ing.
> > > > Royal Institute of Technology (KTH)
> > > > Aeronautical and Vehicle Engineering
> > > > Division of Aerodynamics
> > > > Teknikringen 8
> > > > SE-10044 Stockholm, Sweden
> > > > +46 (0)8 790 6465
> > > >
> > > >
> > --
> > Simone Crippa
> > Research assistant, Dipl.-Ing.
> > Royal Institute of Technology (KTH)
> > Aeronautical and Vehicle Engineering
> > Division of Aerodynamics
> > Teknikringen 8
> > SE-10044 Stockholm, Sweden
> > +46 (0)8 790 6465
> >
> >
-- 
Simone Crippa
Research assistant, Dipl.-Ing.
Royal Institute of Technology (KTH)
Aeronautical and Vehicle Engineering
Division of Aerodynamics
Teknikringen 8
SE-10044 Stockholm, Sweden
+46 (0)8 790 6465



More information about the ParaView mailing list