Difference between revisions of "Contrib:Projectionist"

From CAELinuxWiki
Jump to: navigation, search
Line 6: Line 6:
 
== Code Snippets ==
 
== Code Snippets ==
  
import os
+
=== Salome in terminal mode ===
import sys
+
 
from subprocess import *
+
In the case one wants to repeating analyses it may be practical to do this automated. Salome offers the possibility to use python scripts (TUI - textual user interface) for input besides the graphical user interface (GUI). TUI scripts can be imported by calling ''File -> Import...'' in the menu bar when running Salome with graphical user interface. One can tell Salome to import a script at startup by command line option '''-u'''.
 +
 
 +
SALOME-ROOT/runSalone -u myScript.py
 +
 
 +
If all the operations that need to be done are already in the script, there is no need for the GUI anymore. Then Salome can be run in terminal mode. This happens by adding '''-t''' or '''--terminal''' as command line option.
 +
 
 +
Calling Salome in terminal mode and directly importing a script
 +
 +
/opt/salome_5.1.2/runSalome -t -u myScript.py
 +
 
 +
 
 +
The path and the command to launch Salome may or will differ but this can be found in the readme files.

Revision as of 20:48, 7 September 2009

Hello, this is my page.

I am a student at Johannes Kepler University at Linz in Austria. In the course of some work I do during the summer at the university I came across CAELinux for I was told to look for open source finite element software. I want to share my newly gained experience with SALOME and CodeAster. Maybe somedays it will be helpful to some beginners.


Code Snippets

Salome in terminal mode

In the case one wants to repeating analyses it may be practical to do this automated. Salome offers the possibility to use python scripts (TUI - textual user interface) for input besides the graphical user interface (GUI). TUI scripts can be imported by calling File -> Import... in the menu bar when running Salome with graphical user interface. One can tell Salome to import a script at startup by command line option -u.

SALOME-ROOT/runSalone -u myScript.py

If all the operations that need to be done are already in the script, there is no need for the GUI anymore. Then Salome can be run in terminal mode. This happens by adding -t or --terminal as command line option.

Calling Salome in terminal mode and directly importing a script

/opt/salome_5.1.2/runSalome -t -u myScript.py


The path and the command to launch Salome may or will differ but this can be found in the readme files.