import odbAccess
odb = session.openOdb('case14.odb')
Moment = 'SM'
Stress ='S'
elemset = odb.rootAssembly.instances['PART-1-1'].elementSets['BEAMELEM']
maxMises = -0.1
maxSM1 = 0.0
maxSM2 = 0.0
maxSM3 = 0.0
maxStep1 = "_None_"
maxStep2 = "_None_"
maxStep3 = "_None_"
maxStep4 = "_None_"
maxFrame1 = -1
maxFrame2 = -1
maxFrame3 = -1
maxFrame4 = -1
i = 1
for step in odb.steps.values():
# print 'Processing Step:', step.name
for frame in step.frames:
# print 'frame inc:', frame.incrementNumber
# print 'frame no:', i
allFields = frame.fieldOutputs
stressSet = allFields[Stress]
momentSet = allFields[Moment]
stressSet = stressSet.getSubset(region=elemset)
momentSet = momentSet.getSubset(region=elemset)
for stressValue in stressSet.values:
if (stressValue.mises > maxMises):
maxMises = stressValue.mises
maxElem1 = stressValue.elementLabel
maxStep1 = step.name
maxFrame1 = i
for momentValue in momentSet.values:
if (abs(momentValue.data[0]) > abs(maxSM1)):
maxSM1 = momentValue.data[0]
maxElem2 = stressValue.elementLabel
maxStep2 = step.name
maxFrame2 = i
if (abs(momentValue.data[1]) > abs(maxSM2)):
maxSM2 = momentValue.data[1]
maxElem3 = stressValue.elementLabel
maxStep3 = step.name
maxFrame3 = i
if (abs(momentValue.data[2]) > abs(maxSM3)):
maxSM3 = momentValue.data[2]
maxElem4 = stressValue.elementLabel
maxStep4 = step.name
maxFrame4 = i
i = i + 1
OutStressMomentfile = open('stressmoment.txt','w+')
print 'Maximun Mises %f in elem %d frame # %d Step: %s'%(maxMises,maxElem1, maxFrame1,maxStep1)
OutStressMomentfile.write(' Max Mises: ')
OutStressMomentfile.write(str(maxMises))
OutStressMomentfile.write(' in elem: ')
OutStressMomentfile.write(str(maxElem1))
OutStressMomentfile.write(' at frame: ')
OutStressMomentfile.write(str(maxFrame1))
OutStressMomentfile.write(' at step: ')
OutStressMomentfile.write(maxStep1)
OutStressMomentfile.write('\n')
print 'Maximun SM1 %f in elem %d frame # %d Step: %s'%(maxSM1,maxElem2, maxFrame2,maxStep2)
OutStressMomentfile.write(' MaxSM1: ')
OutStressMomentfile.write(str(maxSM1))
OutStressMomentfile.write(' in elem: ')
OutStressMomentfile.write(str(maxElem2))
OutStressMomentfile.write(' at frame: ')
OutStressMomentfile.write(str(maxFrame2))
OutStressMomentfile.write(' at step: ')
OutStressMomentfile.write(maxStep2)
OutStressMomentfile.write('\n')
print 'Maximun SM2 %f in elem %d frame # %d Step: %s'%(maxSM2,maxElem3, maxFrame3,maxStep3)
OutStressMomentfile.write(' MaxSM2: ')
OutStressMomentfile.write(str(maxSM2))
OutStressMomentfile.write(' in elem: ')
OutStressMomentfile.write(str(maxElem3))
OutStressMomentfile.write(' at frame: ')
OutStressMomentfile.write(str(maxFrame3))
OutStressMomentfile.write(' at step: ')
OutStressMomentfile.write(maxStep3)
OutStressMomentfile.write('\n')
print 'Maximun SM3 %f in elem %d frame # %d Step: %s'%(maxSM3,maxElem4, maxFrame4,maxStep4)
OutStressMomentfile.write(' MaxSM3: ')
OutStressMomentfile.write(str(maxSM3))
OutStressMomentfile.write(' in elem: ')
OutStressMomentfile.write(str(maxElem4))
OutStressMomentfile.write(' at frame: ')
OutStressMomentfile.write(str(maxFrame4))
OutStressMomentfile.write(' at step: ')
OutStressMomentfile.write(maxStep4)
OutStressMomentfile.write('\n')
OutStressMomentfile.close()
timeFrame = odb.steps['Step-2'].frames[2002]
displacement = timeFrame.fieldOutputs['U']
Pipenode = odb.rootAssembly.instances['PART-1-1'].nodeSets['PIPENODE']
PipenodeDisp = displacement.getSubset(region=Pipenode)
OutDispfile = open('Disp.txt','w+')
OutDispfile.write("Node ")
OutDispfile.write("x disp ")
OutDispfile.write("y disp ")
OutDispfile.write("z disp\n")
for v in PipenodeDisp.values:
print 'Node label =', v.nodeLabel
OutDispfile.write(str(v.nodeLabel))
OutDispfile.write(" ")
print 'x disp =', v.data[0]
OutDispfile.write(str(v.data[0]))
OutDispfile.write(" ")
print 'x disp =', v.data[1]
OutDispfile.write(str(v.data[1]))
OutDispfile.write(" ")
print 'x disp =', v.data[2]
OutDispfile.write(str(v.data[2]))
OutDispfile.write("\n")
OutDispfile.close()
SMoment = timeFrame.fieldOutputs['SM']
SMoment = SMoment.getSubset(region=elemset)
OutMomentfile = open('Moment.txt','w+')
OutMomentfile.write("Element ")
OutMomentfile.write("SM1 ")
OutMomentfile.write("SM2 ")
OutMomentfile.write("SM3 \n")
for m in SMoment.values:
print 'Elem label =', m.elementLabel
OutMomentfile.write(str(m.elementLabel))
OutMomentfile.write(" ")
print 'SM1 =', m.data[0]
OutMomentfile.write(str(m.data[0]))
OutMomentfile.write(" ")
print 'SM2 =', m.data[1]
OutMomentfile.write(str(m.data[1]))
OutMomentfile.write(" ")
print 'SM3 =', m.data[2]
OutMomentfile.write(str(m.data[2]))
OutMomentfile.write("\n")
OutMomentfile.close()
odb.close()
13.11.08
10.11.08
Show IP & address - <<-((
(div align="center")(img border="0" src="http://ip.chinaz.com/ipshow.asp"/)(/div)
code of visitor's map
[script src="http://widgets.amung.us/map.js" type="text/javascript">WAU_map('0u0njbpowxk6', 420, 210, 'neosat', 'default-pink')
Python script in ABAQUS to read displacement and write to a file
import odbAccess
odb = session.openOdb('case3.odb')
timeFrame = odb.steps['Step-2'].frames[99]
displacement = timeFrame.fieldOutputs['U']
Pipenode = odb.rootAssembly.instances['PART-1-1'].nodeSets['PIPENODE']
PipenodeDisp = displacement.getSubset(region=Pipenode)
myoutfile = open('tryout.txt','w+')
myoutfile.write("Node ")
myoutfile.write("x disp ")
myoutfile.write("y disp ")
myoutfile.write("z disp\n")
for v in PipenodeDisp.values:
print 'Node label =', v.nodeLabel
myoutfile.write(str(v.nodeLabel))
myoutfile.write(" ")
print 'x disp =', v.data[0]
myoutfile.write(str(v.data[0]))
myoutfile.write(" ")
print 'x disp =', v.data[1]
myoutfile.write(str(v.data[1]))
myoutfile.write(" ")
print 'x disp =', v.data[2]
myoutfile.write(str(v.data[2]))
myoutfile.write("\n")
myoutfile.close()
odb.close()
odb = session.openOdb('case3.odb')
timeFrame = odb.steps['Step-2'].frames[99]
displacement = timeFrame.fieldOutputs['U']
Pipenode = odb.rootAssembly.instances['PART-1-1'].nodeSets['PIPENODE']
PipenodeDisp = displacement.getSubset(region=Pipenode)
myoutfile = open('tryout.txt','w+')
myoutfile.write("Node ")
myoutfile.write("x disp ")
myoutfile.write("y disp ")
myoutfile.write("z disp\n")
for v in PipenodeDisp.values:
print 'Node label =', v.nodeLabel
myoutfile.write(str(v.nodeLabel))
myoutfile.write(" ")
print 'x disp =', v.data[0]
myoutfile.write(str(v.data[0]))
myoutfile.write(" ")
print 'x disp =', v.data[1]
myoutfile.write(str(v.data[1]))
myoutfile.write(" ")
print 'x disp =', v.data[2]
myoutfile.write(str(v.data[2]))
myoutfile.write("\n")
myoutfile.close()
odb.close()
6.11.08
Guass-Jordan解线性方程组


subroutine UWAPIPE_GuassJordan(n,K,dF,du)
!
!! solve linear equations using Guass-Jordan method
use UWAPIPE_module
implicit none
integer, intent(in) :: n
real(kind=gp), dimension(n,n), intent(in) :: K
real(kind=gp), dimension(n), intent(in) :: dF
real(kind=gp), dimension(n), intent(out) :: du
integer :: i, j
real(kind=gp), dimension(n,n+1) :: Mat
real(kind=gp), dimension(n+1) :: temp
Mat(:,1:n) = K(:,:)
Mat(:,n+1) = dF(:)
du = 0.0_gp
do i = 1, n
do j = i+1, n
if (abs(Mat(j,i))>abs(Mat(i,i))) then
temp(i:n+1) = Mat(i,i:n+1)
Mat(i,i:n+1) = Mat(j,i:n+1)
Mat(j,i:n+1) = temp(i:n+1)
end if
end do
Mat(i,i:n+1) = Mat(i,i:n+1)/Mat(i,i)
do j = 1, n
if (j /= i) then
Mat(j,i:n+1) = Mat(j,i:n+1) - Mat(j,i)/Mat(i,i)*Mat(i,i:n+1)
end if
end do
end do
du = Mat(:,n+1)
end subroutine UWAPIPE_GuassJordan
5.11.08
三家店
3.11.08
订阅:
评论 (Atom)
