Changeset 21408 for issm/trunk-jpl/test/NightlyRun/test1201.py
- Timestamp:
- 11/22/16 02:31:19 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/test1201.py
r21060 r21408 1 1 #Test Name: EISMINTMassConservation 2 import numpy 2 import numpy as np 3 3 from model import * 4 from socket import gethostname 4 5 from bamg import * 5 6 from setmask import * … … 7 8 from setflowequation import * 8 9 from solve import * 9 from MatlabFuncs import * 10 10 11 11 12 """ … … 14 15 15 16 printingflag=False 16 17 17 results=[] 18 18 … … 24 24 md.smb.mass_balance[:]=0. 25 25 md=setflowequation(md,'SSA','all') 26 md.cluster=generic('name', oshostname(),'np',8)26 md.cluster=generic('name',gethostname(),'np',8) 27 27 28 28 print " initial velocity" 29 md.initialization.vx=n umpy.zeros((md.mesh.numberofvertices,1))30 md.initialization.vy=-400.*n umpy.ones((md.mesh.numberofvertices,1))29 md.initialization.vx=np.zeros((md.mesh.numberofvertices)) 30 md.initialization.vy=-400.*np.ones((md.mesh.numberofvertices)) 31 31 32 32 #Stabilization … … 37 37 38 38 #spc thickness 39 pos=n umpy.nonzero(md.mesh.y>199999.9)[0]40 times=n umpy.arange(0,501)41 md.masstransport.spcthickness=float('NaN')*n umpy.ones((md.mesh.numberofvertices+1,numpy.size(times)))39 pos=np.where(md.mesh.y>199999.9)[0] 40 times=np.arange(0,501) 41 md.masstransport.spcthickness=float('NaN')*np.ones((md.mesh.numberofvertices+1,np.size(times))) 42 42 md.masstransport.spcthickness[-1,:]=times 43 md.masstransport.spcthickness[pos,:]= numpy.tile(500.+100.*numpy.sin(2.*numpy.pi*times/200.),(numpy.size(pos),1))43 md.masstransport.spcthickness[pos,:]=500.+100.*np.sin(2.*np.pi*times/200.) 44 44 if stabilization==3: 45 pos=n umpy.nonzero(numpy.isnan(md.masstransport.spcthickness))45 pos=np.nonzero(np.isnan(md.masstransport.spcthickness)) 46 46 md.masstransport.spcthickness[pos]=500. #No NaN for DG 47 47 … … 54 54 55 55 #plot results 56 #[elements,x,y,z,s,h1]=SectionValues(md,results[0],'../Exp/CrossLineEISMINT.exp',100.) ;57 #[elements,x,y,z,s,h2]=SectionValues(md,results[1],'../Exp/CrossLineEISMINT.exp',100.) ;58 #[elements,x,y,z,s,h3]=SectionValues(md,results[2],'../Exp/CrossLineEISMINT.exp',100.) ;59 #[elements,x,y,z,s,hth]=SectionValues(md, 500+100*sin(2*pi/200*(500-md.mesh.y/400)),'../Exp/CrossLineEISMINT.exp',100.) ;56 #[elements,x,y,z,s,h1]=SectionValues(md,results[0],'../Exp/CrossLineEISMINT.exp',100.) 57 #[elements,x,y,z,s,h2]=SectionValues(md,results[1],'../Exp/CrossLineEISMINT.exp',100.) 58 #[elements,x,y,z,s,h3]=SectionValues(md,results[2],'../Exp/CrossLineEISMINT.exp',100.) 59 #[elements,x,y,z,s,hth]=SectionValues(md, 500+100*sin(2*pi/200*(500-md.mesh.y/400)),'../Exp/CrossLineEISMINT.exp',100.) 60 60 #plot(s,h1,'r',s,h2,'b',s,h3,'g',s,hth,'k') 61 61 #legend('Art. diff.','No Art. diff.','D.G.','Theoretical') … … 63 63 pass 64 64 # set(gcf,'Color','w') 65 # export_fig([issmdir() '/website/doc_pdf/validation/Images/EISMINT/IceShelf/eismintmasscthickness.pdf']) ;65 # export_fig([issmdir() '/website/doc_pdf/validation/Images/EISMINT/IceShelf/eismintmasscthickness.pdf']) 66 66 67 67 #Fields and tolerances to track changes 68 field_names =[ \ 69 'ThicknessArtDiff','ThicknessNoArtDiff','ThicknessDG' \ 70 ] 71 field_tolerances=[\ 72 1e-13, 1e-13, 1e-13\ 73 ] 74 field_values=[ 75 results[0], \ 76 results[1], \ 77 results[2], \ 78 ] 68 field_names =['ThicknessArtDiff','ThicknessNoArtDiff','ThicknessDG'] 69 field_tolerances=[1e-13, 1e-13, 1e-13] 70 field_values=[results[0],results[1],results[2]]
Note:
See TracChangeset
for help on using the changeset viewer.