error = dofs.norm(fext - fint) #Increment the Newton-Raphson iteration counter iiter += 1 print ' Iter', iiter, ':', error if iiter == iterMax: raise RuntimeError('Newton-Raphson iterations did not converge!') #Update the state vector Da[:] = zeros(len(dofs)) #Commit history values elements.commitHistory() #Store the output output.append([a[loadDof], fint[loadDof]]) print '=================================' ############################### # Post-processing # ############################### from pylab import plot, show, xlabel, ylabel plot([-x[0] for x in output], [-0.5 * x[1] for x in output], 'ro') #Exact solution
error = dofs.norm( fext-fint ) #Increment the Newton-Raphson iteration counter iiter += 1 print ' Iter', iiter, ':', error if iiter == iterMax: raise RuntimeError('Newton-Raphson iterations did not converge!') #Update the state vector Da[:] = zeros( len(dofs) ) #Commit history values elements.commitHistory() #Store the output output.append( [ a[loadDof], fint[loadDof] ] ) print '=================================' ############################### # Post-processing # ############################### from pylab import plot, show, xlabel, ylabel plot( [-x[0] for x in output], [-0.5*x[1] for x in output], 'ro' )