Abaqus Scripting Seminar Oct1st
Abaqus Scripting Seminar Oct1st
Abaqus Scripting Seminar Oct1st
: 3DS_Document_2014
Shikta Mishra
Technical Specialist, Simulia Central
Agenda
Motivation
Python Basics
Abaqus Python
Abaqus Object Model
Plug-ins
Demonstration: RSG Dialog Builder
Automate
repetitive tasks
Model building
Postprocessing
Extend
functionality
Enhance
the interface
Graphical
Nongraphical
Provides automated
environment for experienced
analysts
Customized versions of
Abaqus provide an
effective analysis tool for
a wide range of user
expertise
Customized
application
Provides
advanced analysis functionality
to non-FEA users
Why Python?
Scripting
Language
Programming
Language
High Level
(# Instr/Stmnt)
Low Level
(# Instr/Stmnt)
Weakly Typed
Strongly Typed
Rapid Development
Rapid Run-Time
Examples: Python,
Tcl, Perl, etc
Examples: C, C++,
Fortran, etc
Python Syntax
QA00000008185
Abaqus provides a style
A consistent style:
Accessing Python
From Abaqus/CAE
Accessing Python
3DS.COM Dassault Systmes | Confidential Information | 10/6/2015 | ref.: 3DS_Document_2014
>>>
import sys
>>> sys.version
'2.7.3 (default, May
Running Python
abaqus cae startup = myscript.py
abaqus cae script = myscript.py
abaqus viewer startup = myscript.py
Running
Python
10
Abaqus/CAE
1
GUI
command
line interface
(CLI)
commands
Python interpreter
Abaqus/CAE
kernel
input file
Abaqus/Standard
Abaqus/Explicit
11
3
script
replay
files
Building Scripts
12
Macro Manager
Abaqus Replay(.rpy) File
abaqus.rpy
13
2) Cut and paste this command into a new text file. Add a Python statement to loop over the command:
for x in range(36):
session.currentViewportName.view.rotate(xAngle=10,
yAngle=0,zAngle=0, mode=MODEL)
14
4) Run Script
15
kernel or GUI
Debug Python script
or plug-in
Object 2
Object 1
Object 3
Object 4
16
The Abaqus
The
Object 5
hierarchy and the relationship between these objects is called the Abaqus Object model.
Use commands
object model
cell4 = mdb.models['block'].parts['crankcase'].cells[4]
Variable cell4 Model database
mdb
17
model named
block
18
Field Data
History Data
19
20
Job Submission
3DS.COM Dassault Systmes | Confidential Information | 10/6/2015 | ref.: 3DS_Document_2014
21
Method
# scr_auto_run1.py
import os
Same behavior
Job Submission
3DS.COM Dassault Systmes | Confidential Information | 10/6/2015 | ref.: 3DS_Document_2014
22
Method
# scr_auto_run2.py
import job
jobs=['auto_job1', 'auto_job2', 'auto_job3']
for job in jobs:
job = mdb.JobFromInputFile(
name = job, inputFileName = job + '.inp',
type = ANALYSIS)
job.submit()
job.waitForCompletion()
commands
onCaeStartup()
function
onJobStartup()
function
def onJobStartup():
print 'The job is starting'
onJobCompletion()
function
23
Plug-ins
24
What is a plug-in?
An Abaqus plug-in is a piece of software that is automatically installed into
Abaqus/CAE to extend its functionality.
Kernel Plug-in
GUI Plug-in
Resources
25
26
It
is an Abaqus/CAE plug-in
Interactive
Includes
Layout
widgets (controls)
RSG Demonstration
27
Next steps
3DS.COM/SIMULIA Dassault Systmes | Confidential Information | 10/6/2015 | ref.: 3DS_Document_2014
28
29