Changeset 23716 for issm/trunk-jpl/src/m/contrib/morlighem/bamg/YamsCall.py
- Timestamp:
- 02/12/19 06:10:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/contrib/morlighem/bamg/YamsCall.py
r21303 r23716 29 29 #Compute Hessian 30 30 t1=time.time() 31 print "%s" % ' computing Hessian...'31 print(("%s" % ' computing Hessian...')) 32 32 hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node') 33 33 t2=time.time() 34 print "%s%d%s\n" % (' done (',t2-t1,' seconds)')34 print(("%s%d%s\n" % (' done (',t2-t1,' seconds)'))) 35 35 36 36 #Compute metric 37 37 t1=time.time() 38 print "%s" % ' computing metric...'38 print(("%s" % ' computing metric...')) 39 39 metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,np.empty(0,int)) 40 40 t2=time.time() 41 print "%s%d%s\n" % (' done (',t2-t1,' seconds)')41 print(("%s%d%s\n" % (' done (',t2-t1,' seconds)'))) 42 42 43 43 #write files 44 44 t1=time.time() 45 print "%s" % ' writing initial mesh files...'45 print(("%s" % ' writing initial mesh files...')) 46 46 np.savetxt('carre0.met',metric) 47 47 … … 56 56 #Vertices 57 57 f.write("\n%s\n%i\n\n" % ('Vertices',md.mesh.numberofvertices)) 58 for i in xrange(0,md.mesh.numberofvertices):58 for i in range(0,md.mesh.numberofvertices): 59 59 f.write("%8g %8g %i\n" % (md.mesh.x[i],md.mesh.y[i],0)) 60 60 61 61 #Triangles 62 62 f.write("\n\n%s\n%i\n\n" % ('Triangles',md.mesh.numberofelements)) 63 for i in xrange(0,md.mesh.numberofelements):63 for i in range(0,md.mesh.numberofelements): 64 64 f.write("%i %i %i %i\n" % (md.mesh.elements[i,0],md.mesh.elements[i,1],md.mesh.elements[i,2],0)) 65 65 numberofelements1=md.mesh.numberofelements … … 80 80 f.close() 81 81 t2=time.time() 82 print "%s%d%s\n" % (' done (',t2-t1,' seconds)')82 print(("%s%d%s\n" % (' done (',t2-t1,' seconds)'))) 83 83 84 84 #call yams 85 print "%s\n" % ' call Yams...'85 print(("%s\n" % ' call Yams...')) 86 86 if m.ispc(): 87 87 #windows … … 96 96 #plug new mesh 97 97 t1=time.time() 98 print "\n%s" % ' reading final mesh files...'98 print(("\n%s" % ' reading final mesh files...')) 99 99 Tria=np.loadtxt('carre1.tria',int) 100 100 Coor=np.loadtxt('carre1.coor',float) … … 107 107 numberofelements2=md.mesh.numberofelements 108 108 t2=time.time() 109 print "%s%d%s\n\n" % (' done (',t2-t1,' seconds)')109 print(("%s%d%s\n\n" % (' done (',t2-t1,' seconds)'))) 110 110 111 111 #display number of elements 112 print "\n%s %i" % (' inital number of elements:',numberofelements1)113 print "\n%s %i\n\n" % (' new number of elements:',numberofelements2)112 print(("\n%s %i" % (' inital number of elements:',numberofelements1))) 113 print(("\n%s %i\n\n" % (' new number of elements:',numberofelements2))) 114 114 115 115 #clean up:
Note:
See TracChangeset
for help on using the changeset viewer.