# ndup.append(nx2) # for n in ndup: # mesh.Nodes.append(n) # mesh.Nnod += 1 mesh.generateID() return mesh mesh = create_mesh_x() #mesh = create_simple_mesh() #mesh = create_test_mesh() mesh.generateID() output = FO.StandardFileOutput('/home/haiau/Documents/result_BI_Linear.dat') #alg = NR.LoadControlledNewtonRaphson(mesh,output,sv.numpySolver(),numberSteps) #alg = NR.LinearStabilityProblem(mesh,output,sv.numpySolver()) alg = NR.ArcLengthControlledNewtonRaphson(mesh,output,sv.numpySolver(),numberSteps,\ arcl=1.0,max_iter=200) #alg.enableVariableConstraint() #alg.calculate(True) alg.calculate(False) #alg.calculate() #_,inod = mesh.findNodeNear(np.array([0.05,-0.005])) #testout,tout = output.readOutput('/home/haiau/Documents/result.dat',list(range(10)),inod,'u') #testout = [t[0][1] for t in testout] #output.updateToMesh(mesh,9) #X,Y,Z = mesh.meshgridValue([0.0,1.0,-0.05,0.05],0.01,1.0e-8)
if self.timeOrder > 0: np.dot(self.D,self.V,self.__tempR__) self.Ri -= self.__tempR__ if self.timeOrder == 2: np.dot(self.M,self.A,self.__tempR__) self.Ri -= self.__tempR__ # Algorithm Nstep = 100 time = 2.0e-2 #output = plotOutput(Nstep,mesh.getNeq(),1) output = plotOutput(Nstep,mesh.getNeq(),0) #static = FA.LinearStaticAlgorithm(mesh,output,sv.numpySolver()) #static.calculate() #mesh.plot() #mesh.updateValues(output.getU(),None,None) #mesh.plot(init=False,col='r') #alg = NM.LinearNewmarkAlgorithm(mesh,2,output,sv.numpySolver(),time,Nstep,1.0) #alg = NR.LoadControlledNewtonRaphson(mesh,output,sv.numpySolver(),100) alg = NR.ArcLengthControlledNewtonRaphson(mesh,output,sv.numpySolver(),Nstep,\ arcl=2.0) #alg.enableVariableConstraint() #alg = StructureNonlinearNewmark(mesh,2,output,sv.numpySolver(),time,Nstep,1.0) alg.calculate(False) #tarr = np.array(list(range(0,200)))*2.0e-2/200 #pl.plot(tarr,output.U[0,:],'b',tarr,output.U[1,:],'r') #tarr = np.array(list(range(0,100)))*0.6/100 #pl.plot(output.U[1,:],tarr) pl.plot(output.U[0,:],output.load)
mesh = FM.MeshWithBoundaryElement() mesh.addNodes(nodesx) mesh.addElements(elements) return mesh mesh = create_mesh() mesh.generateID() output = FO.StandardFileOutput('/home/haiau/Documents/result.dat') #alg = NR.LoadControlledNewtonRaphson(mesh,output,sv.numpySolver(),numberSteps) #alg = NR.LinearStabilityProblem(mesh,output,sv.numpySolver()) #alg = NR.ArcLengthControlledNewtonRaphson(mesh,output,sv.numpySolver(),numberSteps,\ # arcl=10.0,max_iter=200) alg = NR.VariableControlledNewtonRaphson(mesh, output, sv.numpySolver(), numberSteps) #alg.enableVariableConstraint() alg.calculate(True) #alg.calculate(False) #alg.calculate() #_,inod = mesh.findNodeNear(np.array([0.05,-0.005])) #testout,tout = output.readOutput('/home/haiau/Documents/result.dat',list(range(10)),inod,'u') #testout = [t[0][1] for t in testout] #output.updateToMesh(mesh,9) #X,Y,Z = mesh.meshgridValue([0.0,1.0,-0.05,0.05],0.01,1.0e-8)
mesh = create_simple_mesh() #cnt = 0 #for e in mesh.Elements: # if e.bodyLoad is not None: # cnt += 1 #mesh.plot(fill_mat = True) mesh.generateID() output = FO.StandardFileOutput('/home/haiau/Documents/result.dat') #alg = NM.NonlinearNewmarkAlgorithm(mesh,tOrder,output,sv.numpySolver(),\ #totalTime, numberTimeSteps,rho_inf,tol=1.0e-8) alg = NR.LoadControlledNewtonRaphson(mesh, output, sv.numpySolver(), 1) alg.calculate() #output.updateToMesh(mesh,10) #X,Y,Z = mesh.meshgridValue([0.0,0.2,-0.2,0.2],0.01,1.0e-8) # #cProfile.run('alg.calculate()','calculate.profile') #stats = pstats.Stats('calculate.profile') #stats.strip_dirs().sort_stats('time').print_stats() # # #_,inod = mesh.findNodeNear(np.array([0.015,0.0])) #testout,tout = output.readOutput('/home/haiau/Documents/result.dat',list(range(50)),inod,'v') #testout = [t[0][0] for t in testout]