Manual for ElmerPost scripting

Post processing utility for Elmer
Post Reply
Fem_Guy
Posts: 17
Joined: 30 Nov 2011, 15:34
Antispam: Yes

Manual for ElmerPost scripting

Post by Fem_Guy »

hi,

Is there any manual or any guide for scripting in ElmerPost? I looked every possible place to find reserved, keyword etcc.. definition or examples to be used in ElmerPost. There are short script snippets in ElmerTutorial pdf and in the forum, the code make sense but is just entrypoint, where get more coprehensible info.

For example :

Code: Select all

math tmp = size(Deflection.1)
math n = tmp(1)
math nodes(2,0:n-1) = 50 * Deflection.1
save file "def_file.dat" = math nodes(2,0:n-1) =  Deflection.1
Why use math as prefix, is it somekind of namespace, reserved, keyword etc..?
Is that Deflection and nodes are global arrays?
How to properly save the z-deflection for all nodes in a file?

Regards,
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Manual for ElmerPost scripting

Post by raback »

Hi

The prefix "math" passes the stuff further to the MATC parser that is econimically described in its own manual. MATC is sort of poor-mans-matlab. It is also the one that you may also use in ElmerSolver command file. The ones that start with "MATC" are passed on as strings and evaluated on-the-fly when needed, and the ones starting with '$' are evaluated when the parser goes through the command file while reading in the case.

-Peter
meniou
Posts: 3
Joined: 21 Oct 2011, 11:23
Antispam: Yes

Re: Manual for ElmerPost scripting

Post by meniou »

As for Elmerpost scripting documentation,I figured out that elmerpost scripting files are TCL files, so you can use all the flow control etc. provided by TCL.
Concerning the name of variables that you can set or functions that you can call, I look at the tcl source files in the elmer/share/elmerpost/tcl folder.
For example, colorscale.tcl starts with :
set ColorScaleStyle 1
set ColorScaleEntries 6
set ColorScaleDecimals 4
set ColorScaleX -0.8
set ColorScaleY -0.8
set ColorScaleThickness 0.1
set ColorScaleLength 1.5
set ColorScaleFont "-adobe-helvetica-bold-r-normal--17-120-100-100-p-88-iso8859-1"
set ColorScaleFontColor [@ 256*256*255+256*255+255]
set ColorScaleColor "none"
set ColorScaleColorMin 0.0
set ColorScaleColorMax 1.0

and this tells you the name of variables that you can change to control the colorscale (like 'set ColorScaleColor "Stress_xx" ' to choose the color scale variable).

Hope this helps.
Post Reply