[Paraview] common calculations module
Berk Geveci
berk.geveci at gmail.com
Fri Jan 27 11:37:25 EST 2006
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
>
>
More information about the ParaView
mailing list