Environment Variables¶
The following environment variables can be used to configure the package.
- ABAQUS_BAT_PATH¶
Type: string
The file path of the
abaquscommand line batch file (.bat). Only set this environment variable ifabaqusis not the default Abaqus command line executable. This variable is used byabqpyto run the Abaqus command line procedure inside the Python interpreter environment where it is installed.
- ABAQUS_COMMAND_OPTIONS¶
Type: string of a Python dictionary
The default execution procedure invoked by
abqpyinside the Python interpreter environment where it is installed is to run one of the two following command lines:When there is a
import abaqusorfrom abaqus import ...statement:abaqus cae noGUI=script.py -- [args ...]When there is a
import odbAccessorfrom odbAccess import ...statement:abaqus python script.py [args ...]
However, there are other execution procedures that can be run with the
abaquscommand and also another options that could be passed to these commands. To define these procedures and options you can create a new system environment variable namedABAQUS_COMMAND_OPTIONS, and set a dictionary to this variable with the options you want to use. The values of the dictionary keys would be booleans or strings, e.g.:{'gui': True, 'database': 'file.odb'}The possible options are:
Using
abaqus caecommand line options (importabaqusmodule):Using
abaqus pythoncommand line options (importodbAccessmodule):{ "sim": "sim_file_name", "log": "log_file_name", }
One advantage in using this alternative is to change the options at run time inside the code.
备注
The environment variable
ABAQUS_COMMAND_OPTIONSmust be a valid string that can be parsed to a Python dictionary, which means that you must useTrueorFalsefor boolean options. However, in the following individual environment variables, you can usetrue,on,yesor1(or capitalized ones since they are not case sensitive) to set the boolean option toTrueand any other values to set it toFalse.
- ABAQUS_CAE_DATABASE¶
Type: string
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set thedatabaseoption but has higher priority.
- ABAQUS_CAE_REPLAY¶
Type: string
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set thereplayoption but has higher priority.
- ABAQUS_CAE_RECOVER¶
Type: string
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set therecoveroption but has higher priority.
- ABAQUS_CAE_STARTUP¶
Type: string
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set thestartupoption but has higher priority.
- ABAQUS_CAE_GUI¶
Type: bool {true, false, on, off, yes, no, 1, 0}
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set theguioption but has higher priority.
- ABAQUS_CAE_ENVSTARTUP¶
Type: bool {true, false, on, off, yes, no, 1, 0}
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set theenvstartupoption but has higher priority.
- ABAQUS_CAE_SAVED_OPTIONS¶
Type: bool {true, false, on, off, yes, no, 1, 0}
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set thesavedOptionsoption but has higher priority.
- ABAQUS_CAE_SAVED_GUI_PREFS¶
Type: bool {true, false, on, off, yes, no, 1, 0}
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set thesavedGuiPrefsoption but has higher priority.
- ABAQUS_CAE_STARTUP_DIALOG¶
Type: bool {true, false, on, off, yes, no, 1, 0}
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set thestartupDialogoption but has higher priority.
- ABAQUS_CAE_CUSTOM¶
Type: string
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set thecustomoption but has higher priority.
- ABAQUS_CAE_GUI_TESTER¶
Type: string
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set theguiTesteroption but has higher priority.
- ABAQUS_CAE_GUI_RECORD¶
Type: bool {true, false, on, off, yes, no, 1, 0}
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set theguiRecordoption but has higher priority.
- ABAQUS_PYTHON_SIM¶
Type: string
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set thesimoption but has higher priority.
- ABAQUS_PYTHON_LOG¶
Type: string
A shortcut to the
ABAQUS_COMMAND_OPTIONSenvironment variable to set thelogoption but has higher priority.
- ABQPY_DEBUG¶
Type: bool {true, false, on, off, yes, no, 1, 0}
Set this environment variable to
Trueto enable debug mode inabqpy.
- ABQPY_SKIP_ABAQUS¶
Type: bool {true, false, on, off, yes, no, 1, 0}
Set this environment variable to
Trueto skip the Abaqus command line procedure execution.
- ABQPY_MAKE_DOCS¶
Type: bool {true, false, on, off, yes, no, 1, 0}
This environment variable is set to true when the
abqpypackage is being used to generate the documentation.
- ABQPY_CLI_TRACEBACK_LIMIT¶
Type: int
The maximum number of levels of the traceback (
sys.tracebacklimit) to show in the command line interface. The default value is 0.
- ABQPY_EXECUTION_METHOD¶
Type: string {os, subprocess}
Method to run the Abaqus command line procedure. The default method is
oswhich uses theos.systemfunction to run the command. Thesubprocessmethod uses thesubprocess.runfunction to run the command.
Example¶
The snippet bellow changes the default procedure options before calling abaqus cae command procedure, at run time.
import os
os.environ["ABAQUS_COMMAND_OPTIONS"] = str({"gui": True, "database": "file.odb"})
from abaqus import *
...
In this specific case, the procedure will use the graphical user interface (GUI mode) and load a database file, i.e., it will run the following command line.
abaqus cae script=script.py database=file.odb -- [args ...]