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
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
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()