Python ABAQUS debugging problem.

Mahendra g2mahendra at gmail.com
Thu May 10 10:31:39 EDT 2012


Dear all,
            I am learning to use python script for running ABAQUS
(commerical finite element program). I am having a bug in the
following chunk of code and am not sure what it is. I have three loops
in my code. The first two loops work fine. The third loop is a
combination of loop 1 and loop 2. It doesnt work. There is some syntax
issue which it is not clear to me.

#--------------------------#-------------------#
# Creating a list of moduli for parametric study
moduli = [ 1000, 500]

#--------------------------#-------------------#
# This loop works fine

for E in moduli:
    print E
    lengthE='length'+str(E)
    print lengthE
#--------------------------#-------------------#

#--------------------------#-------------------#
# This loop works fine.

for E in moduli:
#   lengthE = 'length'+str(E)
#	print E
#	print lengthE
	
mdb.models['Model-1'].materials['Elastic'].elastic.setValues(table=((E,
0.18), ))
	job.submit()
	job.waitForCompletion()
	print 'Completed job for %s E' % (E)
#--------------------------#-------------------#

#--------------------------#-------------------#
# This loop doesnt work.
# It says syntax error in lengthE = 'length' + str(E)
#--------------------------#-------------------#
for E in moduli:
    print E
	lengthE = 'length' + str(E)
	
mdb.models['Model-1'].materials['Elastic'].elastic.setValues(table=((E,
0.18), ))
	job.submit()
	job.waitForCompletion()
#	print lengthE
	print 'Completed job for %s E' % (E)
#--------------------------#-------------------#


Any help is deeply appreciated in this regard.
Sincerely,
Mahendra.



More information about the Python-list mailing list