The addImportCallback statement instructs
Abaqus
to call a function when the user first imports a module. In this example
Abaqus
calls the setJobPreferences function when the
user first enters the
Job module,
and
Abaqus
calls the setVisPreferences function when the
user first enters
the Visualization module.
The setJobPreferences function creates a queue
on a remote host. The setVisPreferences function
sets default options for contour plots.
The example environment file uses the
onCaeStartup() function to control a set of
Python statements that are executed when
Abaqus/CAE
first starts. The environment file can also contain the following:
-
The onJobStartup() function controls a
set of statements that execute when an analysis job starts. For example,
def onJobStartup():
import os, shutil
restartDir = savedir + id + '_restart'
if (os.path.exists(restartDir)):
shutil.rmtree(restartDir)
-
The onJobCompletion() function controls a
set of statements that execute when an analysis job completes. For example,
def onJobCompletion():
import os
extensions = ('res','stt','mdl','prt','abq','pac')
restartDir = savedir + os.sep + id + '_restart'
if (not os.path.exists(restartDir)):
os.mkdir(restartDir)
for extension in extensions:
fileName = id + '.' + extension
if (os.path.exists(savedir + os.sep + fileName)):
os.rename(savedir + os.sep + fileName,
restartDir + os.sep + fileName)
The following variables are available to the
onJobStartup() and
onJobCompletion() functions:
- id
-
The job identifier that was specified as the value of the job option from
the command line.
- savedir
-
The path to the directory from which the job was submitted.
- scrdir
-
The path to the scratch directory.
- analysisType
-
The type of analysis to be executed. Possible values are
STANDARD and EXPLICIT.
For a list of the variables that are available outside of the
onJobStartup() and
onJobCompletion() functions, see
Job variables.
For more information on the environment file, see
Environment File Settings
and
Customizing the Abaqus environment.