46 lines
1.3 KiB
Python
46 lines
1.3 KiB
Python
|
# This is a pre-processor script for 3D ALE corrosion analysis.
|
||
|
# Author: J. Grogan - BMEC, NUI Galway. Created: 19/09/2012
|
||
|
from abaqusConstants import *
|
||
|
from abaqus import *
|
||
|
#
|
||
|
aModel=mdb.models['Dream6']
|
||
|
aPart=aModel.parts['AMesh']
|
||
|
incFile=open('NodeData.inc','w')
|
||
|
#
|
||
|
numFaces=0
|
||
|
pstring=''
|
||
|
# Cycle through all element faces
|
||
|
for eachFace in aPart.elementFaces:
|
||
|
# Check if Face is on external Surface
|
||
|
if len(eachFace.getElements())==1:
|
||
|
numFaces=numFaces+1
|
||
|
faceNodes=eachFace.getNodes()
|
||
|
# Identify 'Fixed' Faces
|
||
|
fixed=1
|
||
|
try:
|
||
|
fSet=aPart.sets['Fixed']
|
||
|
for eachNode in faceNodes:
|
||
|
if eachNode not in fSet.nodes:
|
||
|
fixed=0
|
||
|
break
|
||
|
except:
|
||
|
fixed=0
|
||
|
pstring=pstring+str(fixed)+' '
|
||
|
# Write Element Nodes
|
||
|
eNodes=[]
|
||
|
for eachNode in eachFace.getElements()[0].getNodes():
|
||
|
pstring=pstring+str(eachNode.label)+' '
|
||
|
pstring=pstring+'\n'
|
||
|
# Write Each Face Nodes and Corresponding Connected Nodes
|
||
|
for eachNode in faceNodes:
|
||
|
pstring=pstring+str(eachNode.label)+' '
|
||
|
for eachEdge in eachNode.getElemEdges():
|
||
|
for eachENode in eachEdge.getNodes():
|
||
|
if eachENode.label != eachNode.label and eachENode in faceNodes:
|
||
|
pstring=pstring+str(eachENode.label)+' '
|
||
|
pstring=pstring+'\n'
|
||
|
#
|
||
|
incFile.write(str(numFaces)+'\n')
|
||
|
incFile.write(pstring)
|
||
|
incFile.close()
|