How to Launch Flux via Command Line?
What’s New
Here is a quick look at the latest features available in Flux 2019.
- -runPy replaces -executeSpy
- -runPyInSilentMode replaces -executeBatchSpy
- -runPyInSilentModeAndExit replaces -executeBatchSpyAndExit
Command-line interface
- On Windows: FLUX_HOME= C:\Program Files\Altair\2019\flux\Flux
- On Linux: FLUX_HOME=/root/2019/altair/flux/Flux
- On Windows: FLUX_EXE=%FLUX_HOME%\Bin\prg\win64\flux.exe
- On Linux: FLUX_EXE=$FLUX_HOME/Bin/prg/lin64/flux
- On Windows: %FLUX_EXE% –application <app> [options]
- On Linux: $FLUX_EXE –application <app> [options]
with <app> = Flux2D, FluxSkewed, Flux3D or FluxPEEC
[options] | Function |
---|---|
-batch |
to launch Flux in batch mode. The batch mode enables Flux to be launched without user interface. |
-newproject | to create a new project with the <app> application. |
-file <fluxProject> | to open an existing project located at <fluxProject>. fluxProject is the path to the Flux project (C:\work\project1.FLU, for example). |
-runPy <pyFile> | to launch Flux and run a python script located at <pyFile>. |
-runPyInSilentMode <pyFile> | to run a python script located at <pyFile> with the user interface frozen and being refreshed only at the end of the execution of the python script. |
-runPyInSilentModeAndExit <pyFile> | to run a python script located at <pyFile> with no graphical refresh, and then exit. Using the command runPyInSilentMode may not terminate the Flux process when encountering an error. |
-help | to display the help. |
- <pyFile> is the path to the python script to run (Example: C:\python\project1.py).
- the application <app> must be the same as the python script to run or the Flux project to open or create.
To be able to launch Flux, the next environment variables must be defined.
Environment variables
- On Windows, use the set command, as below:
set MY_VAR=2
- On Linux, in the case of common interpreter sh, ksh and
bash, use the export command (see example
below):
export MY_VAR=2
- Mandatory environment variables
The mandatory environment variables are listed below:
- Number of cores to use:
FLUX_NCORES.
Use FLUX_NCORES=<NCORES> to use NCORES cores.
If NCORES=0, Flux will use all the cores available.
-
Numerical memory (in Bytes): MEMSIZN3.
The numerical memory is the memory used for the different modeling actions (import, mesh, solving process, ...).Warning: For PEEC, this is not this memory which is used for the solving process, but JVM_MEMORY (see below "GUI memory + PEEC Solver").If user enters a value different from 0 in this variable, Flux will be executed in static (or user) memory mode with the memory amount set in this variable.
A variable value of MEMSIZN3=0 will launch Flux in dynamic memory mode.
- Character memory (in Bytes):
MEMSIZC3.
The character memory is the memory used for the storage of entity names (parameters, transformations, regions, conductors, …) and the project names in the working directory.
If user enters a value different from 0 in this variable, Flux will be executed in static (or user) memory mode with the memory amount set in this variable.
A variable value of MEMSIZC3=0 will launch Flux in dynamic memory mode.
- GUI memory + PEEC Solver (in MiB):
JVM_MEMORY.This memory is the memory used for everything related to the Graphical User Interface (graphical display, …).Warning: For PEEC, this memory is also used for the solving process.Default value for:
- 2D: JVM_MEMORY=1024
- Skew: JVM_MEMORY=1536
- 3D: JVM_MEMORY=2048
- PEEC: JVM_MEMORY=4096
- Number of cores to use:
FLUX_NCORES.
- Additional environment variablesYou can find below a list of optional variables:
-
Allow multiple instances of Flux on the same machine:
Set the variable SYNC_SOCKET=0.
-
Force linear solver for pre and main resolution:
FORCE_FLUX_SOLVER and FORCE_FLUX_PRESOLVER, respectively.
These 2 variables allow to force a specific solver (Mumps, ICCG, SuperLu…). When solving the project, the solver used is the one defined in the environment variable.
For example:
FORCE_FLUX_SOLVER = LinearSystemSolverMumps
FORCE_FLUX_PRESOLVER = LinearSystemSolverIccg
will set ICCG for pre-solving and Mumps sequential for main solving.
The possible choices are:- Direct solvers:
- LinearSystemSolverMumps: Mumps
- LinearSystemSolverMumpsDistributed: Mumps distributed
- LinearSystemSolverSuperlu: Super LU
- Iterative solvers:
- LinearSystemSolverIccg: Incomplete Cholesky Conjugate Gradient
- LinearSystemSolverBiCGStab: BiConjugate Gradient Stabilized
- LinearSystemSolverGmres: Generalized Minimum RESidual
- Others:
- LinearSystemSolverByUserSubroutine
- LinearSystemSolverAutomatic
- Direct solvers:
-
Short example
-
On Windows:
If Flux is installed in C:\Program Files\Altair\2019\flux\Flux
And if the Flux 3D project named Project_3D i.e. Project_3D.FLU is located in the directory C:\work
"C:\Program Files\Altair\2019\flux\Flux\Bin\prg\win64\flux.exe" –application Flux3D –file C:\work\Project_3D.FLU
-
On Linux:
If Flux is installed in /root/2019/altair/flux/Flux
And if the Flux 3D project named Project_3D i.e. Project_3D.FLU is located in the directory /home
/root/2019/altair/flux/Flux/Bin/prg/lin64/flux –application Flux3D –file /home/Project_3D.FLU