To start an interactive session in graphics mode on Linux systems, enter the following command at the prompt:
ansys242 -g
To start Mechanical APDL from the command prompt on a Windows system, type the following command:
ansys242
Always use the ansys242 command for running Mechanical APDL. User-written scripts for running Mechanical APDL products are not supported.
You can specify any of the following options for the Mechanical APDL execution command:
-aas | Enables server mode. When enabling server mode, a custom name for the
keyfile can be specified using the -iorFile option. For
more information, see Mechanical APDL as a Server User's Guide. |
-acc
device | Enables the use of GPU hardware to accelerate the analysis. See GPU Accelerator Capability in the Parallel Processing Guide for more information. |
-amfg | Enables the additive manufacturing capability (requires an additive manufacturing license). For general information about this feature, see Additive Simulation in Mechanical. |
-ansexe | In the Ansys Workbench environment, activates a custom Mechanical APDL executable. |
-apip on | To include usage data specific to your simulation in the Ansys Product Improvement Program. |
-b list or
nolist | Activates the Mechanical APDL program in batch mode. The options
-b
list or -b by itself cause
the input listing to be included in the output. The -b
nolist option causes the input listing not to
be included. For more information about running Mechanical APDL in batch mode,
see Batch Mode. |
-custom | Calls a custom Mechanical APDL executable. See Running Your Custom Executable in the Programmer's Reference for more information. |
-d
device | Specifies the type of graphics device. This option applies only to interactive mode. For Linux systems, graphics device choices are X11, X11C, or 3D. For Windows systems, graphics device options are WIN32 or WIN32C, or 3D. |
-db
value | Defines the portion of workspace (memory) to be used as the initial
allocation for the database. The default is 1024 MB. Specify a negative
number (-value ) to force a fixed size
throughout the run; useful on small memory systems. |
-dir | Defines the initial working directory. Using the
-dir option overrides the
ANSYS242_WORKING_DIRECTORY
environment variable. |
-dis | Enables distributed-memory parallel processing (DMP). See the Parallel Processing Guide for more information. |
-dvt | Enables Ansys DesignXplorer advanced task (add-on). |
-g
| Launches the Mechanical APDL program with the Graphical User Interface (GUI)
on. If you select this option, an X11 graphics device is assumed for
Linux unless the -d option specifies a different
device. This option is not used on Windows systems. To
activate the GUI after Mechanical APDL has started, enter two commands in the
input window: /SHOW to define the graphics device,
and /MENU,ON to activate the GUI. The
-g option is valid only for interactive mode. Note: If you start Mechanical APDL via the |
-i
inputname | Specifies the name of the file to read input into Mechanical APDL for batch processing. On Linux, the preferred method to indicate an input file is <. |
-iorFile
keyfile_name | Specifies the name of the server keyfile when enabling server mode. If this option is not supplied, the default name of the keyfile is aas_MapdlID.txt. For more information, see Mechanical APDL as a Server Keyfile in the Mechanical APDL as a Server User's Guide. |
-j
Jobname | Specifies the initial jobname, a name assigned to all files generated
by the program for a specific model. If you omit the -j
option, the jobname is assumed to be file. |
-l
language | Specifies a language file to use other than US English. This option is valid only if you have a translated message file in an appropriately named subdirectory in /ansys_inc/v242/ansys/docu (or Program Files\ANSYS Inc\V242\ANSYS\docu on Windows systems). |
-m
workspace | Specifies the total size of the workspace (memory) in megabytes used
for the initial allocation. If you omit the -m option,
the default is 2 GB (2048 MB). Specify a negative number
(-value ) to force a fixed size throughout
the run. |
-machines | Specifies the machines on which to run a DMP analysis (see Starting a DMP Analysis in the Parallel Processing Guide). |
-mpi | Specifies the type of MPI to use. See the Parallel Processing Guide for more information. |
-mpifile | Specifies an existing MPI file (appfile) to be used in a DMP run. See Using MPI Files in the Parallel Processing Guide for more information. |
-na | Specifies the number of GPU accelerator devices per machine or compute node when running with the GPU accelerator feature. See GPU Accelerator Capability in the Parallel Processing Guide for more information. |
value | Defines Mechanical APDL parameters at program start-up. The parameter name must be at least two characters long. For details about parameters, see the Ansys Parametric Design Language Guide. |
-np | For a shared-memory parallel processing (SMP)
analysis, -np specifies the number of
threads/process. Since there is only one process for SMP,
-np is the number of threads or CPU cores to be
used.For a DMP analysis, For a hybrid parallel processing
analysis, See the Parallel Processing Guide for more information. |
-nt | For a hybrid parallel processing analysis,
-nt specifies the number of threads/process to be
used. Along with the -np value, this option relates to
how many CPU cores will be used. See the Parallel Processing Guide for more
information. |
-o
outputname | Specifies the name of the file to store the output from a batch execution of Mechanical APDL. On Linux, the preferred method to indicate an output file is >. |
-p
productname | Defines which Ansys product will run during the session. For
more detailed information about the -p option, see
Selecting an Ansys Product via the Command Line. |
-ppf
license feature name | Specifies which HPC license to use during a parallel processing run. See HPC Licensing in the Parallel Processing Guide for more information. |
-rcopy | On a Linux cluster, specifies the full path to the program used to perform remote copy of files. The default value is /usr/bin/scp. |
-s
read or noread | Specifies whether the program reads the
start.ans file at start-up. If you omit the
-s option, Mechanical APDL reads the
start.ans file in interactive mode and not in
batch mode. |
-schost
host name | Specifies the host machine on which the coupling service is running (to which the co-simulation participant/solver must connect) in a System Coupling analysis. |
-scid
value | Specifies the licensing ID of the System Coupling analysis. |
-sclic
port @host | Specifies the licensing port@host to use for the System Coupling analysis. |
-scname
name of the solver | Specifies the unique name used by the co-simulation participant to
identify itself to the coupling service in a System Coupling analysis.
For Linux systems, you need to quote the name to have the name
recognized if it contains a space: ansys242 -scname "Solution 1" |
-scport
port number | Specifies the port on the host machine upon which the coupling service is listening for connections from co-simulation participants in a System Coupling analysis. |
-smp | Enables shared-memory parallelism. See the Parallel Processing Guide for more information. |
-usersh | Directs the MPI software (used in DMP or hybrid parallel processing) to use the remote shell (rsh) protocol instead of the default secure shell (ssh) protocol. See Configuration Requirements for DMP Processing in the Parallel Processing Guide for more information. |
-v | Returns the Mechanical APDL release number, update number, copyright date, customer number, and license manager version number. |
There may be times when Mechanical APDL exits abnormally. Check the file.err file to see if Mechanical APDL wrote an exit code to the file before ending. These error codes may help you to understand what caused the abnormal program exit:
Table 4.1: Mechanical APDL Exit Codes
Code | Explanation |
---|---|
0 | Normal exit |
1 | Indicated error |
5 | Command line argument error |
7 | Licensing failure |
8 | End of run |
11 | Error in user routine |
12 | Macro stop command |
14 | Untrapped geometry kernel error |
15 | Fatal error |
16 | Possible full disk |
17 | Possible corrupted or missing file |
18 | Possible corrupted database |
21 | Unauthorized feature accessed |
25 | Unable to open x11 server |
30 | Quit signal |
31 | Failure to get signal in max time |
33 | Crash signal (bus error, seg vi, FPE, etc.) |
35 | Fatal error on another MPI process (DMP) |
100 | Job already running (.lock file error) |
134[a] | Job aborted by the program. |
137[b] | Job killed by user or operating system. |
[a] This exit code, specifically for Linux, occurs when the program aborts the job. An unexpected error may be the cause, and sending the data leading to the unexpected abort to your technical support provider can enable ANSYS, Inc. to improve the program.
[b] This exit code, specifically for Linux, occurs when either the user or the OS kills the job. The OS may kill the simulation process(es) if the simulation consumes too much memory, and thus reducing the model size or running on a system with more RAM may achieve a successfully completed simulation.