×
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

Python script to extract fieldOutput for 2 specific nodes

Python script to extract fieldOutput for 2 specific nodes

Python script to extract fieldOutput for 2 specific nodes

(OP)
Hello everyone!

I badly want your help!
I am required to extract the fieldOutput(Acoustic Pressure) for only 2 nodes(Eg, NodeLabel=32078 and NodeLabel=33789), which I am struggling to achieve. I have the Python script which extracts the Acoustic Pressure for all the nodes and it is working fine, but I need only 2 nodes with the Acoustic Pressure value and not all nodes!
The script for extracting Acoustic pressure for all nodes is :

from odbAccess import *
from abaqusConstants import *
import part

jobname = 'working-copy'
stepname = 'Acoustic Pressure'
resultfile_name = 'Pressure' # file to be written in


odb_file = jobname + '.odb'
inp_file = jobname + '.inp'

odb = openOdb(odb_file,readOnly=True)
number_freq = len(odb.steps[stepname].frames)
assembly = odb.rootAssembly


for i in xrange(number_freq): # for all frequencies calculated in step
f=odb.steps[stepname].frames[i].frequency
if f>0:
result_file = resultfile_name + '_' + str(f) + '.txt'
file_results = open(result_file,'w+')
number_nodes=len(odb.steps[stepname].frames[i].fieldOutputs['POR'].values)
data_i=odb.steps[stepname].frames[i].fieldOutputs['POR']
for ii in xrange(number_nodes): # for all nodes in model (nodes of different parts together in one list)
part=data_i.values[ii].instance.name
nodeID=data_i.values[ii].nodeLabel
u=data_i.values[ii].data
ui=data_i.values[ii].conjugateData
file_results.write('%10i %13E %13E\n' % (nodeID,u,ui))

# close file where it was written in
file_results.close()

# ***************************************************************************************************************************

Can you please help me to modify this script such that it extracts Acoustic Pressure for 2 specific nodes!

Thanks In Advance!!



RE: Python script to extract fieldOutput for 2 specific nodes

Put the nodes you want the data for in a node set, then you can use getSubset() to extract only the values in that set. I don't recall the exact syntax, but you should be able to figure it out from the scripting reference manual.

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