×
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

ABAQUS-Python : cyclic application of 3 static steps
2

ABAQUS-Python : cyclic application of 3 static steps

ABAQUS-Python : cyclic application of 3 static steps

(OP)
plain and simple: I have 3 seperate Static steps (each with their own loading conditions) and I want ABAQUS to run them in a loop for 50 times. how can I get this done?! i.e. step1,step2,step3,step1,step2,step3,...

more info: each step should be run for 1 increment, so the whole analysis should be done in 150 increments. this seems irrelevant but I am running urdfil and usdfld subroutines on this model.

to solve this problem for 5 loops (15 increments) , i have written a python script that creates 15 seperate steps. but for 150 steps, that approach does not seem optimized and will lead to big file size (150steps, 150loadings) so i am looking for a better approach.

my previous approach:
this python script (1) creates 15 static steps (2) copies the 3 seperate loadings into desires step (3) deactivates the load in the next step

CODE --> Python

for i in range(15):
	mdb.models['Model-1'].StaticStep(amplitude=STEP, maxNumInc=1, name='Steps-%d'%(i+1), 
		noStop=OFF, previous='Steps-%d'%(i), timeIncrementationMethod=FIXED)

for i in range(5):
	mdb.models['Model-1'].Load(name='Load-1-%d'%(i+1), objectToCopy=
		mdb.models['Model-1'].loads['Load-1'], toStepName='Steps-%d'%(3*i+1))
	mdb.models['Model-1'].loads['Load-1-%d'%(i+1)].deactivate('Steps-%d'%(3*i+2))
	mdb.models['Model-1'].Load(name='Load-2-%d'%(i+1), objectToCopy=
		mdb.models['Model-1'].loads['Load-2'], toStepName='Steps-%d'%(3*i+2))
	mdb.models['Model-1'].loads['Load-2-%d'%(i+1)].deactivate('Steps-%d'%(3*i+3))
	mdb.models['Model-1'].Load(name='Load-3-%d'%(i+1), objectToCopy=
		mdb.models['Model-1'].loads['Load-3'], toStepName='Steps-%d'%(3*i+3))
	mdb.models['Model-1'].loads['Load-3-%d'%(i+1)].deactivate('Steps-%d'%(3*i+4)) 

result:


this approach works but it is not practical for 150 steps. so i am looking for a way to creat 3 steps and run them in a loop.
any help is appreciated.

RE: ABAQUS-Python : cyclic application of 3 static steps

If it is really necessary to have those 50*3 steps, then I would define the first 3 steps in A/CAE, write out the input file and create the 49 cycles on ASCII level with Python. You could write them in a extra file and use *Include to link them together.

RE: ABAQUS-Python : cyclic application of 3 static steps

(OP)

Quote (IceBreakerSours)

Can you not use *Amplitude with your loads? I rarely use Abaqus anymore so I am not certain.

IceBreaker,
I don't think I can, cuz I need the subroutines to do their thing after each loading, so having several steps is unavoidable as subroutines only run after each step.
btw i saw you were wondering why does usdfld run twice after each step. could you find the answer? it is really annoying and leads to a number of complications.

Quote (Mustaine3)

If it is really necessary to have those 50*3 steps, then I would define the first 3 steps in A/CAE, write out the input file and create the 49 cycles on ASCII level with Python. You could write them in a extra file and use *Include to link them together.

Mustaine3,
could you please explain more about "creating the 49 cycles on ASCII level with Python" ?
I am not very experienced with python, do you mean what I did above? or something else?
thanks

RE: ABAQUS-Python : cyclic application of 3 static steps

Correct. In the first iteration of an increment all user subroutines are called twice (except, may be, UEXTERNALDB?). Initial stiffness matrix is formed in the first call and a new stiffness matrix is created in the next call. It was a hassle when I first started playing with USDFLD a while ago.

I am not sure what having steps has to do with *Amplitude. Back when I was a power user of Abaqus, I ran some models with hundreds of steps in them with/without subroutines.

*********************************************************
Are you new to this forum? If so, please read these FAQs:

http://www.eng-tips.com/faqs.cfm?fid=376
http://www.eng-tips.com/faqs.cfm?fid=1083

RE: ABAQUS-Python : cyclic application of 3 static steps

Quote (could you please explain more about "creating the 49 cycles on ASCII level with Python" ? I am not very experienced with python, do you mean what I did above? or something else?)


No, I mean something else.

When you write out the Input File from A/CAE to you hard disk, then you can open that file with an ASCII-editor to see the Abaqus keyword. Then you could modify the file and submit it with a command line to the solver.
Python has nice capabilities to modify ASCII files, so this is an option. Every Python tutorial explains how to read text from a file, work with that and write it back or in a new ASCII file.

RE: ABAQUS-Python : cyclic application of 3 static steps

(OP)
IceBreaker,

Quote (IceBreaker)

I am not sure what having steps has to do with *Amplitude
what I meant was: even though the *amplitude may help with the high number of loadings, it still won't help me get rid of 150 time steps! I am trying to find a way to cycle through those 3 step; if so, then no need to define 150loads or use *amplitude.
I have to add: But if I don't find a way and I am forced to define 150 steps, then using the *amplitude is a better idea than what I did above, I will surely use it, thanks.

Quote (IceBreaker)

Correct. In the first iteration of an increment all user subroutines are called twice (except, may be, UEXTERNALDB?). Initial stiffness matrix is formed in the first call and a new stiffness matrix is created in the next call. It was a hassle when I first started playing with USDFLD a while ago.
yes it is really annoying, given the fact that I am using 100s of increments and each for 1 iteration, then every increment calls usdfld twice literally! (but not urdfil)
if you have something like i=i+1 in your routine (and "i" is defined in a seperate module), it will be increased by 2 every increment! and this will cause convergence issues. I have worked my way around this problem, but this may a pitfall to many users. tnx for your comment.

Mustaine,

Quote (Mustaine3)

When you write out the Input File from A/CAE to you hard disk, then you can open that file with an ASCII-editor to see the Abaqus keyword. Then you could modify the file and submit it with a command line to the solver
I think this is the solution I am looking for.
I tried to add a few python commands to the *.inp file (adding a "for" loop before "step") but abaqus didn't run it, so i guess this is not as simple as it looks.
Just to get me started, would you please tell me which one of the input files (if not *.inp) is the one I have to edit? (file format?)
Does abaqus help documentation hold any section about this approach and the python commands we can use?
tnx

RE: ABAQUS-Python : cyclic application of 3 static steps

Quote:


I think this is the solution I am looking for.
I tried to add a few python commands to the *.inp file (adding a "for" loop before "step") but abaqus didn't run it, so i guess this is not as simple as it looks.
Just to get me started, would you please tell me which one of the input files (if not *.inp) is the one I have to edit? (file format?)
Does abaqus help documentation hold any section about this approach and the python commands we can use?

Noooo! An Abaqus input file is no python script. It has it's own format and commands, that have nothing to do with python.
I mean you can use a python script to manipulate this file or create a second file with Abaqus commands and link it to the first one.

The Abaqus Users Manual and Keyword Reference Manual have information about the Abaqus commands and format.

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