×
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

Node and Element output using Python

Node and Element output using Python

Node and Element output using Python

(OP)
I have written a large Python application for Abaqus. The only issue that I have is how to output certain components to the .dat file using Python without having to alter my input files.

The part that I want my input file to contain is

*Output, field, variable=PRESELECT
*Node Output
CF,... (other output)

AND

** HISTORY OUTPUT: H-Output-1
**
*Output, history, variable=PRESELECT
*El Print, freq=1, POSITION=CENTROIDAL, ELSET=mySet1
VARIABLE NAME

I have been doing this by manually inserting this into the input file. What is the Python function that will simply allow me to output that data to the .dat file? (I'm assuming there is some "node print" or "element print")

Thanks

RE: Node and Element output using Python

Well I guess an easy way in Python would be:

fi = open('inputfile.inp','w')
fd = open('datfile.inp','r')

for line in fd:

if line.startswith('*Output, field, variable=PRESELECT'):

print, write, append etc.
(good idea to write yourself the fields that you know never change)

elif line.startswith('CF,... (other output)'):

print, write, append again.

........................................................

..................

else:
pass

fi.close()
fd.close()

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