×
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

using Python script: problem about extracting no value in nodal stress

using Python script: problem about extracting no value in nodal stress

using Python script: problem about extracting no value in nodal stress

(OP)
hi everyone,

i was writing a python script to extract nodal customised shear stress from odb file over each frame. i first tried to extract shear stress from each frame as a practice.
i successfully obtained all the nodes in the part of interests, i.e. the total number is correct.
however, i did not get any values as it generates "0" value.
i really dont know where my problem is. how can i deal with that problems?

here is my code:

ForceFile = open('Results.dat','w')
odbPath = "C:/Temp/123.odb"
odb = session.openOdb(name=odbPath,readOnly=FALSE)
allSteps = session.odbData[odbPath].steps.keys()
for i in range(len(allSteps)):
step = odb.steps[allSteps[i]]
allFrames = session.odbData[odbPath].steps[allSteps[i]].frames.keys()
for j in range(len(allFrames)):
frame = step.frames[j] #get the current frame in step[i]
myInstance = odb.rootAssembly.instances["BOTTOM-1"] #get the instance of interest
numNodes = len(myInstance.nodes) #get the number of nodes
ReactionForce = frame.fieldOutputs['S']
for el in range(0,numNodes):
ReactionForceInterest = ReactionForce.getSubset(region=myInstance.nodes[el]).values # get the node inside the instance
ForceFile.write( + " ") ####! PLOBLEMS need help; i have tried to use ReactionForceInterest.data[3]...
ForceFile.write("\n")
ForceFile.close()
odb.close()


thanks in advance.

RE: using Python script: problem about extracting no value in nodal stress

Think about these questions and you may find the solution.

Are stresses node or element result? So where are they calculated and stored? And what keyword is used to request that output? Is it possible to change that behavior with that keyword?

RE: using Python script: problem about extracting no value in nodal stress

(OP)
Thanks for your hint!
stress are element results. i found i need to request the nodal stress output by having "*element output, POSITION=NODES" in the inp file. In the CAE, i first tried to define a set of nodes in the instance of interest. and then added a Field Output Requests for each step in the domain of that set of nodes. but i did not get the same output request command as suggested.

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