# OpenVOGEL Console

OpenVOGEL offers a console application because it can give a lot of extra power compared to a GUI based program:
* It can easily run in different operating systems.
* It can be used for automated analysis and customized post processing.
* It does not run under the GUI thread (it is an independent process).
* It can be driven by a different process.
* It is faster for pure data mining.
Aditionally, the OpenVOGEL console will let you bind the Intel Math Kernel Library, which is highly efficient when solving large systems of linear equations.

### Running the console

It is very easy to run the Console in windows, simply open a terminal and call its executable, or double click on it. You can also associate the console to the *.ave file extension and then simply double click OpenVOGEL script files to launch them (recommend method). This can be easily configured in Windows using the Open with... tool.
The console can run in two modes:
* Command line mode: you enter a command keyword and it is executed. Eventually you have to feed more information at request, like file paths. The console always starts up in this mode.
* Server mode: when you enter the server mode, the console stops reading to commands entered via the keyboard and start listening to UDP messages in port 11000. These messages are very short commands that tell the console what to do. The purpose of this mode is to establish a communication with Tucan.
Maybe you will wonder what is the benefit of a calculation server. Well, basically, the highest benefit is that you can plug it to Tucan in just a second without having to recompile Tucan! So you can test different versions of the calculation core on the same model without even closing the model in Tucan. The only thing you have to do in Tucan is tell that you want the calculation to run on the active server, just before pressing the start button.
Security warning: since the console opens an UDP socket, be careful not to run a version coming from a suspicious publisher (this applies to any program anyway). Someone could generate a malicious version that attacks your computer while you are "calculating". Normally, windows defender or other firewalls should become aware of this and close the socket for the outside world, but if you want to be 100% sure, download the official version from the Github website (which is supposed to be very safe) or compile your own local version. Don't ever install software from suspicious websites providing "third party services" unless you trust them 100%.

### Commands and syntax

An OpenVOGEL Console command is a keyword followed by a series of arguments. All arguments for a given command are written in the same line and separated by a semicolon (the ";" character). This separator has been chosen simply to to allow entering file paths that contain spaces.

#### Overview of keywords

The next list gives all available commands. The notation of the commands is as follows:
General utility commands:
File I/O:
MKL setup:
Control surface deflection:
Stream properties:
Simulations:
Server mode:

### Scrips

The OpenVOGEL Console lets you load a sequence of commands at once through an input file. For this, use the load_script command, giving as argument the path to the scriping file. This feature is mainly handy to avoid having to re-enter all commands and arguments, since it is often necessary to adjust the arguments after having seen the results of a first simulation.
When running a scrip the Console will not interrogate about the necessary data, so this have to be passed as argument. For example, if you call the command load, it would normally ask for the file path. However, in the scrip you would load it as argument:

### Activating Intel MKL

Since 2020 we are finally able to link the Intel Math Kernel Library (MKL) for higher calculation performance. This library is currently accessible from the OpenVOGEL server (apparently MKL doesn't like residing in Tucan's thread). The first thing you will need to do is installing Intel MKL from the packages provided by Intel. After doing this, you need to search the folder containing the mkl_rt.dll file, which is a dynamic library containing the whole collection of LAPACK and BLAS procedures (in fact, we only need a couple of them, but to avoid the tedious work of creating a specific dll, we have to go this way). Then you open the Console and type:
The console will attempt to perform some simple operations with the library, and if they succeed you will read TEST PASSED. Every time you open the Console from there on, MKL will be used by default. To turn it off again, you need to pass the mkl_off command. To turn it on again (no surprise) you enter mkl_on. If you forgot the status, enter mkl_status.