×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Restart Job with Python Script

Restart Job with Python Script

Restart Job with Python Script

(OP)
Hi,

I want to restart a job after a step. Doing it in the cae viewer works well. But i need to restart the job many times. So i want to implement a python script.

By Creating a Macro, i got the commands:

mdb.Job(name=JobName, model=modelName, description='', type=RESTART,
atTime=None, waitMinutes=0, waitHours=0, queue=None, memory=70,
memoryUnits=PERCENTAGE, getMemoryFromAnalysis=True,
explicitPrecision=SINGLE, nodalOutputPrecision=SINGLE, echoPrint=OFF,
modelPrint=OFF, contactPrint=OFF, historyPrint=OFF, userSubroutine='',
scratch='', resultsFormat=ODB)


but if i run the python script i get the error message:

mdb.Job(name=JobName, model=modelName, description='', type=RESTART,
NameError: name 'RESTART' is not defined


I dont find my way with this message.
Could anybody help me, please?

Many thx

RE: Restart Job with Python Script

I think your script is not aware of the Abaqus specific commands. You have to import them at the beginning.

Start CAE and then open the .rpy in the work directory. Take out all the import commands and add them into your script.

RE: Restart Job with Python Script

(OP)
You mean the .py File in which the macros are saved? I copied all import lines, but the problem don't disappear...

Is the command right?

Many thx

RE: Restart Job with Python Script

I've just tried it and it worked fine.

CODE -->

from abaqus import *
from abaqusConstants import *
from caeModules import *

mdb.Job(name='Job-2', model='Model-2', description='', type=RESTART,
    atTime=None, waitMinutes=0, waitHours=0, queue=None, memory=30,
    memoryUnits=PERCENTAGE, getMemoryFromAnalysis=True,
    explicitPrecision=SINGLE, nodalOutputPrecision=SINGLE, echoPrint=OFF,
    modelPrint=OFF, contactPrint=OFF, historyPrint=OFF, userSubroutine='',
    scratch='', resultsFormat=ODB, multiprocessingMode=DEFAULT, numCpus=2,
    numDomains=2, numGPUs=0) 

RE: Restart Job with Python Script

(OP)
Many thanks. I forgot those lines. I only used import job, and so on.

Now it works well.

Best regards.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources