×
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

Macro to Retrieve Displacement Data from ODB File

Macro to Retrieve Displacement Data from ODB File

Macro to Retrieve Displacement Data from ODB File

(OP)
Hi,

I have been trying to record the macro for retrieving displacementdata from ABAQUS ODB File.I have picked a single node and tried to retrieve the displacement data for that particular node.

odb = session.odbs['H:/MiniThessis/MaterialModelling/First_Test.odb']
session.xyDataListFromField(odb=odb, outputPosition=NODAL, variable=(('U',
NODAL, ((INVARIANT, 'Magnitude'), )), ), nodePick=(('PART-1-1', 1, (
'[#0:237 #8 ]', )), ), )
xy1 = session.xyDataObjects['U:Magnitude PI: PART-1-1 N: 7588']

In the recorded Macro above, I could not understand what exactly is "#0:237 #8" ??

I would be really glad,if someone can explain that

Thanks in advance!




RE: Macro to Retrieve Displacement Data from ODB File

Hello Sri Harsha,

#0:237 represents the node list on Part-1-1 where node #8 is picked from.

Hope this helps.

RE: Macro to Retrieve Displacement Data from ODB File

Hi
May be it is better to create set for node and history output for displacement of this node.

RE: Macro to Retrieve Displacement Data from ODB File

(OP)
Hello A.Jalal and Igor76,

Could you please explain,how can I retrieve net displacement of a node,if I know a node number
can you please write the macro for doing that?

Would be really helpful!

RE: Macro to Retrieve Displacement Data from ODB File

Hi
You have to read Abaqus-Scripting-Accessing an Output Database chapter of Help

RE: Macro to Retrieve Displacement Data from ODB File

There is a command called getNodeFromLabel() that can be used at odb part level or odb instance level. Just search for that command in the Scripting Reference Manual to get more infos.

RE: Macro to Retrieve Displacement Data from ODB File

(OP)
Hi Mustaine,

If I am writing these 3 lines to retrieve xy data object for displacement.

odb = session.odbs['H:/MiniThessis/MaterialModelling/First_Test.odb']
session.xyDataListFromField(odb=odb, outputPosition=NODAL, variable=(('U',
NODAL, ((INVARIANT, 'Magnitude'), )), ), nodePick=(('PART-1-1', 1, (
'[#0:237 #8 ]', )), ), )
xy1 = session.xyDataObjects['U:Magnitude PI: PART-1-1 N: 7588']

I want to define the node variable as 'N' , instead of the number '7588' and what do i write for "#0:237 #8 "?? How can I retrieve "#0:237 #8", from a given node label??

Thanks in Advance.

RE: Macro to Retrieve Displacement Data from ODB File

Two things make it quite simple to get what you want:
1. Access the result by using the node label instead the pick command.
2. Store the result of the command directly in a variable.


Example with my odb and node label 14:

CODE -->

odb = session.odbs['Job-1.odb']
xy1 = session.xyDataListFromField(odb=odb, outputPosition=NODAL, variable=(('U', 
    NODAL, ((INVARIANT, 'Magnitude'), )), ), nodeLabels=(('PART-1-1', ('14', 
    )), ))

    
# use print to test what you get
print xy1 

RE: Macro to Retrieve Displacement Data from ODB File

(OP)
Hi Mustaine,

I have tried the above Macro,which you have suggested with my ODB.
When I tried to print it:

its printing this: [xyDataObjects['U:Magnitude PI: PART-1-1 N: 1837']].

How do I retireve the displacement value from this xyObject. Please explain.I guess,we need to add one more macro line for that?

Waiting for your reply

RE: Macro to Retrieve Displacement Data from ODB File

(OP)
Hi Mustaine,

Thanks for your reply.
I could now retrieve the displacement value.

I have written the follwing macro lines and its working:

xy = session.xyDataListFromField(odb=o1, outputPosition=NODAL, variable=(('U',
NODAL, ((INVARIANT, 'Magnitude'), )), ), nodeLabels=(('PART-1-1', (str(Node),
)), ))
xy1 = session.xyDataObjects['U:Magnitude PI: PART-1-1 N: '+str(Node)]
print xy1[0][1]

RE: Macro to Retrieve Displacement Data from ODB File

The assignment to xy1 is imho not necessary. The variable xy has this information already. But it's in a list, so just use xy[0] to access it.

So in your example
print xy[0]
print xy1

would print out two identical lines.

RE: Macro to Retrieve Displacement Data from ODB File

(OP)
Hi Mustaine,

When I say,print xy[0], it prints out "[(1.0, 0.00329504604451358)]". How do I print out only the second value.
I tried out with xy[0][0} as well as xy[0][1],but I am not getting the value as "0.00329504604451358".

RE: Macro to Retrieve Displacement Data from ODB File

When xy[0] is [(1.0, 0.00329504604451358)]

then
xy[0][0] is (1.0, 0.00329504604451358)

and
xy[0][0][1] is 0.00329504604451358

RE: Macro to Retrieve Displacement Data from ODB File

(OP)
Hi Mustaine,

Thanks a lot for your reply.
I have written a similar script for retrieving VonMisses stress data

xy1 = session.xyDataListFromField(odb=o1, outputPosition=ELEMENT_NODAL, variable=((
Variable, INTEGRATION_POINT, ((INVARIANT, ParameterName), )), ), elementSets=(
SetName, ))
x0 = session.xyDataObjects[Variable+':'+ParameterName+ ' PI: PART-1-1 E: '+str(Element)+' N: '+str(Node)]
nodalVal = x0[0][1]
print(x0[0][1])
print(xy1[0][0][1])

But,after running the above script,I am getting different values when I print these two values.
Which one do u think is correct??

RE: Macro to Retrieve Displacement Data from ODB File

(OP)
Hi Mustaine,

I would be really glad,if you can reply to the above query.

Thanks in Advance

RE: Macro to Retrieve Displacement Data from ODB File

Using ELEMENT_NODAL with an element variable like stress returns you multiple results, because you get the unaveraged value from each element attached to that node. Use Unique Nodal to get one averaged value.

RE: Macro to Retrieve Displacement Data from ODB File

(OP)
Hi Mustaine,

Thanks a lot.So,Its better to use UNIQUE NODAL to get the required one in my case.

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