Metafor

ULiege - Aerospace & Mechanical Engineering

User Tools

Site Tools


doc:user:tutorials:premiertest

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:user:tutorials:premiertest [2014/08/07 22:45] jorisdoc:user:tutorials:premiertest [2016/07/11 15:04] (current) – [Making a film with the results] boemer
Line 1: Line 1:
-====== Graphical User Interface (GUI) ======+~~NOTOC~~ 
 +====== How to run an existing test? ======
  
-===== Introduction ===== 
  
-To start Metaforseveral options are available :+===== Preliminary remarks ===== 
 + 
 +<note important>Unlike most programsMetafor must be restarted (which means closing and re-opening the application) before running any simulation.</note>
  
-    * Double-click the program icon (highly recommended). The GUI will then appear and most controls can be performed with the mouse. 
-    * Open a DOS window (Start button - type cmd in the search box - click on cmd.exe) or a Unix shell. Go then to the Metafor directory (''cd C:\Progra~1\Metafor'' for instance) and run Metafor (''Metafor''). It is then possible to run METAFOR in "text" mode, without the GUI, by typing "metafor.exe -nogui". Another advantage is that the window remains open during a critical crash ("This program has performed an illegal operation ..."). To exit Metafor in "text" mode, on Windows, use ''CTRL-BREAK'' (a little rough, but that works), or ''CTRL-Z'' then ''Enter'' on Windows, or finally ''CTRL-D'' on Unix. 
  
-When an error occurs while reading a module, you MUST restart Metafor. Therefore, developing a test case is most often done by clicking on the icon then using the up arrow to recall the last command. 
  
-When the data set is not in the same directory as Metafor (or one of its   * subdirectories) and the console mode is used, the environment variable ''PATH'' must be defined (On Windows: Right click on "computer" - properties - "advanced" tab - "environment variables") and the path to the Metafor directory must be specified (''c:\Progra~1\Metafor'' for example). This allows Metafor to be started without having to type the full path. 
 ===== Running a test with the GUI  ===== ===== Running a test with the GUI  =====
  
-==== Description ====+==== Description of the main window ====
  
- +Double-click the "Run Metafor" icon on your desktop. The GUI is displayed:
-To check that all is going well, a first test should be run using the GUI. +
- +
-Double-click the "Run Metafor " icon on your desktop. The GUI opens:+
  
 {{ doc:user:desc-gui.png |}} {{ doc:user:desc-gui.png |}}
  
-  - The title bar. It contains the version number of your executable Metafor.+  - The title bar. It contains the version number of your Metafor executable.
   - The menu bar. It is useful for managing interface options (File menu / GUI Options) and 3D active display windows (Windows menu).   - The menu bar. It is useful for managing interface options (File menu / GUI Options) and 3D active display windows (Windows menu).
-  - The toolbar. It gathers the most commonly used commands, such as the "meta ()button (blue PLAY button) which initiates a Metafor integration+  - The toolbar. It gathers the most commonly used commands, such as the ''meta()'' button (blue PLAY button) which initiates a Metafor calculation
-  - The python command line : it allows the user to enter Metafor commands by hand or to use Metafor as a simple python interpreter. +  - The python command line: it allows the user to enter Metafor commands by hand or to use Metafor as a simple python interpreter. 
-  - The history command window : it allows a quick access to past commands. A contextual menu allows the user to manage the history. +  - The history command window: quick access to copy/paste older commands. A contextual menu allows the user to manage the history. 
-  - The output python window. It is a contextual menu which allows to print or set different layout options+  - The output python windowwhich displays the text output of the program
-  - The "python path". It lists all available python modules that can be imported. +  - The "Python PATH", which lists all available python modules that can be imported. 
-  - The "base", main Metafor directory. It can be changed to add a new directory to the "python path". This is very useful to run a test located on a nonstandard path (on another disk for example). +  - The "base" folderwhich is the current folder at startup. It can be changed to a new folder which will be added to the "Python PATH". This is very useful to run a test located on a non-standard path (e.g. on another hard disk partition). 
-  - The links. It gathers the last loaded modules for faster access. +  - The links. This widget gathers the last loaded modules for faster access. 
-  - The "workspace"It displays the current directory (workspace). This tab allows, for example, to go search results in nonstandard location. +  - The "workspace"This is the place where the results of calculation are written to disk.
- +
- +
- +
  
 ==== Loading a Module ==== ==== Loading a Module ====
Line 41: Line 32:
 {{ doc:user:loadmodule.png|}}  {{ doc:user:loadmodule.png|}} 
  
-Each Metafor test case corresponds to python module.+test case of Metafor corresponds to usually one python module.
  
-Therefore, the first step usually consists in loading the right module with the "''load()''" command. This command tells the program that you wish to work with this file, whether for running an integration or viewing results.+Therefore, the first step usually consists in loading this module into memory. This operation tells the program that you wish to work with this file, whether for running an integration or viewing results.
  
-To load a module in the GUI, just get it in the "Python Path" treeright-click on it and choose "Load".+To load a module with the GUI, just find it in the "Python PATH" tree. then right-click on it and choose "Load".
  
 Alternatively, use the command Alternatively, use the command
Line 51: Line 42:
   load('apps.ale.angleReZoner'   load('apps.ale.angleReZoner'
  
-in the python command line. This command loads the module angleReZoner.py, located in ''apps/ale/''.+in the python command line. This command loads the module ''angleReZoner.py'', located in ''c:\Program Files\Metafor\apps\ale''.
  
-This command "imports" the module and keeps a pointer to it for future orders. The interface also switches from "Python Path" to "Workspace". In this view, a working directory (in which the results of the integration are/will be stored) can be chosen. By default, its name is ''workspace/module_name''. If it already exists, this directory is chosen by the interface. If not, it will be created at the start of integration. +Metafor "imports" the module and keeps a pointer to it for subsequent commands. The interface on the right switches from "Python PATHview to "Workspace" view. In this view, a working directory (in which the results of the simulation will be stored) can be chosen. By default, its name is ''workspace/module_name''. If it already exists, this directory is selected by the interface. If not, it will be created before the beginning of the time integration. 
  
-In command line, this is done with the command ''setDir()''+If the module to be loaded is not in the "Python PATH", a ''rebase'' must be performed. To do so, the directory which contains the test case is chosen using the button on the "Base" line of the "Python Path" tab. Doing so, this directory is added to the "Python path". It is equivalent to starting Metafor from this directory. 
  
-  setDir(r'e:\results\angleReZoner')+==== Starting the time integration ====
  
-If the module which must be loaded is not in the "Python Path", a ''rebase'' must be performed. To do so, the directory which contains the test case is chosen using the button on the "Base" line of the "Python Path" tab. Doing so, this directory is added to the "Python path". It is equivalent to starting Metafor from this directory.  +Click on the blue "PLAY" button in the toolbar. You can also type the command:
- +
-In command line, this is done with the command ''rebase()'' +
- +
-  rebase(r'e:\test_case\test01'+
- +
-==== Starting the integration ==== +
- +
-It is very easy to start an integration, just click on the blue "PLAY" button in the toolbar. You can also type the command :+
  
   meta()   meta()
  
-This command calls the function ''getMetafor()'' from the module previously loaded, and starts the integration. If no working directory was selected, the default name (''workspace/test_name'') is used. If this directory is not empty, those files are first deleted (a windows will appear to warn you).+This command calls the function ''getMetafor()'' defined in the module previously loaded, and starts the time integration. If no working directory was explicitly selected, the default name (''workspace/test_name'') is used. If this directory already contains older results, those files will be first deleted (after user's approval).
  
-Then, the integration opens a 3D graphics window, which will be refreshed during computation. Most display options can be changed using the "Config" button.+Then, the time integration procedure opens a 3D graphics window, which will be continuously refreshed during computation displaying the current resultsThe display options can be modified using the "Config" button of this window.
  
 It is possible to close the display windows, and reopen them using the "Windows" menu. It is possible to close the display windows, and reopen them using the "Windows" menu.
  
-When the integration is finished, you MUST restart Metafor to run another test ! +When the time integration finishes, you MUST restart Metafor to run another test !
- +
  
  
Line 86: Line 67:
 {{ doc:user:loadfac.png|}} {{ doc:user:loadfac.png|}}
  
-To load results, the corresponding module must be loaded first, as was done before starting the integration. +To load previously-computed results, the corresponding module must be loaded first, as was done before starting the time integration. 
 Then, if the workspace used is the default one, Metafor automatically sets its working directory to it. Otherwise, it must be changed manually, using the workspace window. Then, if the workspace used is the default one, Metafor automatically sets its working directory to it. Otherwise, it must be changed manually, using the workspace window.
  
-Once the right folder is selected, simply locate the FAC files (extension ''.bfac.gz''), choose one and load it with the context menu ("Load Fac"). A viewing window opens and displays the results+Once the right folder is selected, simply locate the "FACfiles (extension ''.bfac.gz''), choose one and load it with the context menu ("Load Fac"). The results are displayed in a graphical window. 
  
-To load other results, repeat the operation with another FAC file. The display window is updated automatically.+To load other results, repeat the operation with other FAC files. The display window is updated automatically.
 \\ \\
 \\ \\
Line 104: Line 85:
 {{ doc:user:restartmodule.png|}} {{ doc:user:restartmodule.png|}}
  
-For various reasons (power cut, abrupt closure of Metafore...), a simulation may have ended earlier than expected. However, it can be restarted from an intermediate FAC, usually the last one that was written before the breakdown (therefore, several saving points should be planned before running long computations).+For various reasons (power cut, abrupt closure of Metafor...), a simulation may have ended earlier than expected. However, it can be restarted from an intermediate FAC, usually the last one that was written before the breakdown (therefore, several saving points should be planned before running long computations).
  
 This is rather straightforward : This is rather straightforward :
Line 140: Line 121:
 To show results in a pleasant way, an ".avi" file, showing the integration over time, can be created. To show results in a pleasant way, an ".avi" file, showing the integration over time, can be created.
  
-  * First, increase the number of times that results will be saved on disk. (command ''setNextTime'' of ''TimeStepManager'', see [[doc:user:integration:general:time_step]])+  * First, increase the number of times that results will be saved to disk. (command ''setNextTime'' of ''TimeStepManager'', see [[doc:user:integration:general:time_step]])
   * Run the test.   * Run the test.
   * Load the last FAC file. Set up the scale of displayed scalar values according to their final value. Do the same for vectors, if needed. Then save the graphical options ("Save" button).   * Load the last FAC file. Set up the scale of displayed scalar values according to their final value. Do the same for vectors, if needed. Then save the graphical options ("Save" button).
Line 150: Line 131:
  
 ===== Metafor in command line ===== ===== Metafor in command line =====
 +{{:doc:user:ico-advanced.png?40 |}}
  
 Should you need to run Metafor in command line, open a command line (''cmd.exe'', or a Unix shell). Then : Should you need to run Metafor in command line, open a command line (''cmd.exe'', or a Unix shell). Then :
-  * ''metafor -help''displays help +  * ''metafor -help''display help 
-  * ''metafor -nogui''starts Metafor without the GUI+  * ''metafor -nogui''start Metafor without the GUI
   * ''metafor -nogui -run apps.qs.cont2'' : run  ''load''/''meta'' on ''apps/qs/cont2.py''   * ''metafor -nogui -run apps.qs.cont2'' : run  ''load''/''meta'' on ''apps/qs/cont2.py''
-  * ''metafor -nogui myscript.py'' :  executes commands written in ''myscript.py''.+  * ''metafor -nogui myscript.py'' :  execute commands written in ''myscript.py''.
  
-In interactive mode, after ''metafor -nogui'', we find ourselves in a python interpreter where some specific Metafor modules were loaded.+In interactive mode, after ''metafor -nogui'', we find ourselves in a python interpreter where some specific Metafor modules were loaded. To exit Metafor in "text" mode, on Windows, use ''CTRL-BREAK'' (a little rough, but that works), or ''CTRL-Z'' then ''Enter'' on Windows, or finally ''CTRL-D'' on Unix.
  
 To run a test : To run a test :
Line 170: Line 152:
 To exit the command line, use CTRL-Z on Windows, CTRL-D on Linux/Unix. To exit the command line, use CTRL-Z on Windows, CTRL-D on Linux/Unix.
  
- 
-\\ 
 \\ \\
  
doc/user/tutorials/premiertest.1407444304.txt.gz · Last modified: 2016/03/30 15:22 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki