Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

addData abaqus script - VonMises FieldOutput 1

Status
Not open for further replies.

ricardMag

Mechanical
Joined
Dec 21, 2016
Messages
1
Location
CA
Hello,

I'm trying to create a new fieldOutput of the VonMises results. I want to add the +/- sign to this new field indicating if the element is either in tension or compression state.

I get the following error when I run my script:
OdbError: Length od data sequence incorrect. Data at 1200 locations expected. Data at 150 locations provided. Element data request failed.

Test Exmaple Data:
- Simple beam bending
- 150 C3D20R elements (1200 integration points)


elLab is a list with 150 items
elData is a tuple list with 150 items but each item has 8 values

Python Script section:

for v in S.values:
if abs(v.maxPrincipal)<abs(v.minPrincipal):
misesSign.setdefault(v.elementLabel,[]).append(v.mises)​
else:
misesSign.setdefault(v.elementLabel,[]).append(-v.mises)​
misesSign2.append(-v.mises)​
elLab = []
elData = []
for key in sorted(misesSign.iterkeys()):
elLab.append(key)​
elData.append(misesSign[key])​
elementDataTuple = tuple(tuple(x) for x in elData)
misesPM = frame.FieldOutput(name='MisesPM', description='VonMisesPM', type=SCALAR)
misesPM.addData(position=INTEGRATION_POINT, instance=instance1, labels=elLabels, data=elData)

Any ideas why my elData list is not valid?

Thanks in advance.
 
Try the following code section instead of the one you have posted above.

Python:
misesPM = frame.FieldOutput(name='MisesPM', description='VonMisesPM', type=SCALAR)
elData = []
for v in S.values:
    if abs(v.maxPrincipal)<abs(v.minPrincipal):
        elData.append([v.mises])
    else:
        elData.append([-v.mises])
elLabels = [ v.label for v in instance1.elements ]
misesPM.addData(position=INTEGRATION_POINT, instance=instance1, labels=elLabels, data=elData)

addData accepts lists of lists for its arguments labels and data.
instance1 above is found from the option
Python:
odb.rootAssembly.instances[[i]name[/i]]
I have run it with an example odb and it worked.

Best regards
George Papazafeiropoulos
gpapazafeiropoulos<at>yahoo.gr
 
I think you can do this without looping through elements.

Create a field output and multiply the von mises stress by [eqv. pressure stress/abs(eqv. pressure stress)].

Positive values should indicate elements in compression, negative values should indicate elements in tension.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top