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

CHG: mooving to real vector initialisation (N) in place of (N,1)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/test/Par/RoundSheetShelf.py

    r20992 r21409  
    1414hmin=300.
    1515hmax=1000.
    16 radius=numpy.sqrt(md.mesh.x.reshape(-1,1)*md.mesh.x.reshape(-1,1)+md.mesh.y.reshape(-1,1)*md.mesh.y.reshape(-1,1))
     16radius=numpy.sqrt(md.mesh.x*md.mesh.x+md.mesh.y*md.mesh.y.reshape(-1))
    1717ymin=numpy.min(radius)
    1818ymax=numpy.max(radius)
     
    5858
    5959#Initial velocity
    60 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices,1))
    61 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices,1))
    62 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
    63 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
     60md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
     61md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
     62md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
     63md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
    6464
    6565#Materials
    66 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
     66md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
    6767md.materials.rheology_B=paterson(md.initialization.temperature)
    68 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     68md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    6969
    7070#Surface mass balance and basal melting
    71 md.smb.mass_balance=-10.*numpy.ones((md.mesh.numberofvertices,1))
    72 md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
     71md.smb.mass_balance=-10.*numpy.ones((md.mesh.numberofvertices))
     72md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
    7373pos=numpy.nonzero(md.mask.groundedice_levelset>0.)[0]
    7474md.basalforcings.groundedice_melting_rate[pos]=10.
    75 md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
    76 md.basalforcings.geothermalflux=numpy.ones((md.mesh.numberofvertices,1))
     75md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
     76md.basalforcings.geothermalflux=numpy.ones((md.mesh.numberofvertices))
    7777
    7878#Friction
    7979radius=1.e6
    8080shelfextent=2.e5
    81 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
     81md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
    8282xelem=numpy.mean(md.mesh.x[md.mesh.elements.astype(int)-1],axis=1)
    8383yelem=numpy.mean(md.mesh.y[md.mesh.elements.astype(int)-1],axis=1)
     
    8686pos=numpy.nonzero(rad>=(radius-shelfextent))
    8787md.friction.coefficient[md.mesh.elements[pos,:]-1]=0.
    88 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    89 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     88md.friction.p=numpy.ones((md.mesh.numberofelements))
     89md.friction.q=numpy.ones((md.mesh.numberofelements))
    9090
    9191#Numerical parameters
     
    109109
    110110#Deal with boundary conditions:
    111 md.stressbalance.spcvx=float('nan')*numpy.ones((md.mesh.numberofvertices,1))
    112 md.stressbalance.spcvy=float('nan')*numpy.ones((md.mesh.numberofvertices,1))
    113 md.stressbalance.spcvz=float('nan')*numpy.ones((md.mesh.numberofvertices,1))
     111md.stressbalance.spcvx=float('nan')*numpy.ones((md.mesh.numberofvertices))
     112md.stressbalance.spcvy=float('nan')*numpy.ones((md.mesh.numberofvertices))
     113md.stressbalance.spcvz=float('nan')*numpy.ones((md.mesh.numberofvertices))
    114114
    115115pos=numpy.nonzero(numpy.logical_and(md.mesh.x==0,md.mesh.y==0))
     
    119119pos=numpy.nonzero(md.mesh.vertexonboundary)
    120120md.mask.ice_levelset[pos]=0
    121 md.balancethickness.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices,1))
    122 md.masstransport.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices,1))
     121md.balancethickness.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices))
     122md.masstransport.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices))
    123123md.stressbalance.referential=float('nan')*numpy.ones((md.mesh.numberofvertices,6))
    124124md.stressbalance.loadingforce=0*numpy.ones((md.mesh.numberofvertices,3))
    125 md.thermal.spctemperature=737.*numpy.ones((md.mesh.numberofvertices,1))
     125md.thermal.spctemperature=737.*numpy.ones((md.mesh.numberofvertices))
    126126
    127127#Change name so that no test have the same name
Note: See TracChangeset for help on using the changeset viewer.