Ignore:
Timestamp:
11/22/16 02:31:19 (8 years ago)
Author:
bdef
Message:

CHG: uniformization fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/test/NightlyRun/test1201.py

    r21060 r21408  
    11#Test Name: EISMINTMassConservation
    2 import numpy
     2import numpy as np
    33from model import *
     4from socket import gethostname
    45from bamg import *
    56from setmask import *
     
    78from setflowequation import *
    89from solve import *
    9 from MatlabFuncs import *
     10
    1011
    1112"""
     
    1415
    1516printingflag=False
    16 
    1717results=[]
    1818
     
    2424        md.smb.mass_balance[:]=0.
    2525        md=setflowequation(md,'SSA','all')
    26         md.cluster=generic('name',oshostname(),'np',8)
     26        md.cluster=generic('name',gethostname(),'np',8)
    2727
    2828        print "      initial velocity"
    29         md.initialization.vx=numpy.zeros((md.mesh.numberofvertices,1))
    30         md.initialization.vy=-400.*numpy.ones((md.mesh.numberofvertices,1))
     29        md.initialization.vx=np.zeros((md.mesh.numberofvertices))
     30        md.initialization.vy=-400.*np.ones((md.mesh.numberofvertices))
    3131
    3232        #Stabilization
     
    3737
    3838        #spc thickness
    39         pos=numpy.nonzero(md.mesh.y>199999.9)[0]
    40         times=numpy.arange(0,501)
    41         md.masstransport.spcthickness=float('NaN')*numpy.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)))
    4242        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.)
    4444        if stabilization==3:
    45                 pos=numpy.nonzero(numpy.isnan(md.masstransport.spcthickness))
     45                pos=np.nonzero(np.isnan(md.masstransport.spcthickness))
    4646                md.masstransport.spcthickness[pos]=500.    #No NaN for DG
    4747
     
    5454
    5555#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.)
    6060#plot(s,h1,'r',s,h2,'b',s,h3,'g',s,hth,'k')
    6161#legend('Art. diff.','No Art. diff.','D.G.','Theoretical')
     
    6363        pass
    6464#       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'])
    6666
    6767#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 ]
     68field_names     =['ThicknessArtDiff','ThicknessNoArtDiff','ThicknessDG']
     69field_tolerances=[1e-13, 1e-13, 1e-13]
     70field_values=[results[0],results[1],results[2]]
Note: See TracChangeset for help on using the changeset viewer.