Changeset 21409


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)

Location:
issm/trunk-jpl/test/Par
Files:
19 edited

Legend:

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

    r21176 r21409  
    2626
    2727#Materials
    28 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
     28md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
    2929md.materials.rheology_B=paterson(md.initialization.temperature)
    30 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     30md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    3131md.initialization.temperature=md.initialization.temperature
    3232
    3333#Friction
    34 md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices,1))
     34md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices))
    3535md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    36 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    37 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     36md.friction.p=numpy.ones((md.mesh.numberofelements))
     37md.friction.q=numpy.ones((md.mesh.numberofelements))
    3838
    3939#Ice shelf melting and surface mass balance
    40 md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
     40md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
    4141md.basalforcings.floatingice_melting_rate[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    42 md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
    43 md.smb.mass_balance=15*numpy.ones((md.mesh.numberofvertices,1))
     42md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
     43md.smb.mass_balance=15*numpy.ones((md.mesh.numberofvertices))
    4444
    4545#Numerical parameters
  • issm/trunk-jpl/test/Par/ISMIPA.py

    r17769 r21409  
    55
    66print "      creating thickness"
    7 md.geometry.surface=-md.mesh.x.reshape(-1,1)*numpy.tan(0.5*numpy.pi/180.)
    8 md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x.reshape(-1,1)*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y.reshape(-1,1)*2.*numpy.pi/numpy.max(md.mesh.x))
     7md.geometry.surface=-md.mesh.x*numpy.tan(0.5*numpy.pi/180.)
     8md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y*2.*numpy.pi/numpy.max(md.mesh.x))
    99md.geometry.thickness=md.geometry.surface-md.geometry.base
    1010
    1111print "      creating drag"
    12 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices,1))
     12md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices))
    1313md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    14 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    15 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     14md.friction.p=numpy.ones((md.mesh.numberofelements))
     15md.friction.q=numpy.ones((md.mesh.numberofelements))
    1616
    1717print "      creating flow law parameter"
    18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices,1))
    19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     18md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
     19md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    2020
    2121print "      boundary conditions for stressbalance model"
  • issm/trunk-jpl/test/Par/ISMIPB.py

    r17769 r21409  
    55
    66print "      creating thickness"
    7 md.geometry.surface=-md.mesh.x.reshape(-1,1)*numpy.tan(0.5*numpy.pi/180.)
    8 md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x.reshape(-1,1)*2.*numpy.pi/numpy.max(md.mesh.x))
     7md.geometry.surface=-md.mesh.x*numpy.tan(0.5*numpy.pi/180.)
     8md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))
    99md.geometry.thickness=md.geometry.surface-md.geometry.base
    1010
    1111print "      creating drag"
    12 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices,1))
     12md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices))
    1313md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    14 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    15 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     14md.friction.p=numpy.ones((md.mesh.numberofelements))
     15md.friction.q=numpy.ones((md.mesh.numberofelements))
    1616
    1717print "      creating flow law parameter"
    18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices,1))
    19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     18md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
     19md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    2020
    2121print "      boundary conditions for stressbalance model"
  • issm/trunk-jpl/test/Par/ISMIPC.py

    r17769 r21409  
    55
    66print "      creating thickness"
    7 md.geometry.surface=2000.-md.mesh.x.reshape(-1,1)*numpy.tan(0.1*numpy.pi/180.)    #to have z>0
     7md.geometry.surface=2000.-md.mesh.x*numpy.tan(0.1*numpy.pi/180.)    #to have z>0
    88md.geometry.base=md.geometry.surface-1000.
    99md.geometry.thickness=md.geometry.surface-md.geometry.base
     
    1111print "      creating drag"
    1212#md.friction.coefficient=sqrt(md.constants.yts.*(1000.+1000.*sin(md.mesh.x*2.*pi/max(md.mesh.x/2.)).*sin(md.mesh.y*2.*pi/max(md.mesh.x/2.)))./(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.base)));
    13 md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x.reshape(-1,1)*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y.reshape(-1,1)*2.*numpy.pi/numpy.max(md.mesh.x))))
     13md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y*2.*numpy.pi/numpy.max(md.mesh.x))))
    1414md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    15 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    16 md.friction.q=numpy.zeros((md.mesh.numberofelements,1))
     15md.friction.p=numpy.ones((md.mesh.numberofelements))
     16md.friction.q=numpy.zeros((md.mesh.numberofelements))
    1717
    1818print "      creating flow law parameter"
    19 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices,1))
    20 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     19md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
     20md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    2121
    2222print "      boundary conditions for stressbalance model:"
  • issm/trunk-jpl/test/Par/ISMIPD.py

    r17769 r21409  
    55
    66print "      creating thickness"
    7 md.geometry.surface=2000.-md.mesh.x.reshape(-1,1)*numpy.tan(0.1*numpy.pi/180.)    #to have z>0
     7md.geometry.surface=2000.-md.mesh.x*numpy.tan(0.1*numpy.pi/180.)    #to have z>0
    88md.geometry.base=md.geometry.surface-1000.
    99md.geometry.thickness=md.geometry.surface-md.geometry.base
    1010
    1111print "      creating drag"
    12 md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x.reshape(-1,1)*2.*numpy.pi/numpy.max(md.mesh.x))))
     12md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))))
    1313md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    14 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    15 md.friction.q=numpy.zeros((md.mesh.numberofelements,1))
     14md.friction.p=numpy.ones((md.mesh.numberofelements))
     15md.friction.q=numpy.zeros((md.mesh.numberofelements))
    1616
    1717print "      creating flow law parameter"
    18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices,1))
    19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     18md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
     19md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    2020
    2121print "      boundary conditions for stressbalance model:"
  • issm/trunk-jpl/test/Par/ISMIPE.py

    r21170 r21409  
    77print "      creating thickness"
    88data = numpy.array(archread('../Data/ISMIPE.arch','data'));
    9 md.geometry.surface=numpy.zeros((md.mesh.numberofvertices,1))
    10 md.geometry.base=numpy.zeros((md.mesh.numberofvertices,1))
     9md.geometry.surface=numpy.zeros((md.mesh.numberofvertices))
     10md.geometry.base=numpy.zeros((md.mesh.numberofvertices))
    1111for i in xrange(0,md.mesh.numberofvertices):
    1212        y=md.mesh.y[i]
     
    2121
    2222print "      creating drag"
    23 md.friction.coefficient=numpy.zeros((md.mesh.numberofvertices,1))
    24 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    25 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     23md.friction.coefficient=numpy.zeros((md.mesh.numberofvertices))
     24md.friction.p=numpy.ones((md.mesh.numberofelements))
     25md.friction.q=numpy.ones((md.mesh.numberofelements))
    2626
    2727print "      creating flow law parameter"
    28 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices,1))
    29 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     28md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
     29md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    3030
    3131print "      boundary conditions for stressbalance model:"
  • issm/trunk-jpl/test/Par/ISMIPF.py

    r17769 r21409  
    66
    77print "      creating thickness"
    8 md.geometry.surface=-md.mesh.x.reshape(-1,1)*numpy.tan(3.*numpy.pi/180.)
     8md.geometry.surface=-md.mesh.x*numpy.tan(3.*numpy.pi/180.)
    99#md.geometry.base=md.geometry.surface-1000.
    10 md.geometry.base=md.geometry.surface-1000.+100.*numpy.exp(-((md.mesh.x.reshape(-1,1)-numpy.max(md.mesh.x)/2.)**2+(md.mesh.y.reshape(-1,1)-numpy.max(md.mesh.y)/2.)**2)/(10000.**2))
     10md.geometry.base=md.geometry.surface-1000.+100.*numpy.exp(-((md.mesh.x-numpy.max(md.mesh.x)/2.)**2+(md.mesh.y-numpy.max(md.mesh.y)/2.)**2)/(10000.**2))
    1111md.geometry.thickness=md.geometry.surface-md.geometry.base
    1212
    1313print "      creating drag"
    14 md.friction.coefficient=numpy.sqrt(md.constants.yts/(2.140373*10**-7*1000.))*numpy.ones((md.mesh.numberofvertices,1))
    15 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    16 md.friction.q=numpy.zeros((md.mesh.numberofelements,1))
     14md.friction.coefficient=numpy.sqrt(md.constants.yts/(2.140373*10**-7*1000.))*numpy.ones((md.mesh.numberofvertices))
     15md.friction.p=numpy.ones((md.mesh.numberofelements))
     16md.friction.q=numpy.zeros((md.mesh.numberofelements))
    1717
    1818print "      creating flow law parameter"
    19 md.materials.rheology_B=1.4734*10**14*numpy.ones((md.mesh.numberofvertices,1))
    20 md.materials.rheology_n=1.*numpy.ones((md.mesh.numberofelements,1))
     19md.materials.rheology_B=1.4734*10**14*numpy.ones((md.mesh.numberofvertices))
     20md.materials.rheology_n=1.*numpy.ones((md.mesh.numberofelements))
    2121md.materials.rheology_law='None'
    2222
     
    2424#Create node on boundary first (because we cannot use mesh)
    2525md=SetIceSheetBC(md)
    26 md.stressbalance.spcvx=100.*numpy.ones((md.mesh.numberofvertices,1))
    27 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices,1))
    28 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices,1))
    29 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
    30 md.initialization.vel=numpy.zeros((md.mesh.numberofvertices,1))
    31 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
    32 md.initialization.temperature=255.*numpy.ones((md.mesh.numberofvertices,1))
     26md.stressbalance.spcvx=100.*numpy.ones((md.mesh.numberofvertices))
     27md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
     28md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
     29md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
     30md.initialization.vel=numpy.zeros((md.mesh.numberofvertices))
     31md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
     32md.initialization.temperature=255.*numpy.ones((md.mesh.numberofvertices))
    3333pos=numpy.nonzero(numpy.logical_or(numpy.logical_or(md.mesh.x==numpy.min(md.mesh.x),md.mesh.x==numpy.max(md.mesh.x)),numpy.logical_or(md.mesh.y==numpy.min(md.mesh.y),md.mesh.y==numpy.max(md.mesh.y))))
    34 md.balancethickness.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     34md.balancethickness.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices))
    3535md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
    36 md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     36md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices))
    3737md.masstransport.spcthickness[pos]=md.geometry.thickness[pos]
    38 md.thermal.spctemperature=255.*numpy.ones((md.mesh.numberofvertices,1))
    39 md.basalforcings.geothermalflux=0.4*numpy.ones((md.mesh.numberofvertices,1))
     38md.thermal.spctemperature=255.*numpy.ones((md.mesh.numberofvertices))
     39md.basalforcings.geothermalflux=0.4*numpy.ones((md.mesh.numberofvertices))
    4040
    4141#Parallel options
  • issm/trunk-jpl/test/Par/Pig.py

    r21176 r21409  
    2626md.initialization.vx=md.inversion.vx_obs
    2727md.initialization.vy=md.inversion.vy_obs
    28 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
    29 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
     28md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
     29md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
    3030
    3131#Materials
    32 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
     32md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
    3333md.materials.rheology_B=paterson(md.initialization.temperature)
    34 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     34md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    3535md.initialization.temperature=md.initialization.temperature
    3636
    3737#Friction
    38 md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices,1))
     38md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices))
    3939md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    40 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    41 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     40md.friction.p=numpy.ones((md.mesh.numberofelements))
     41md.friction.q=numpy.ones((md.mesh.numberofelements))
    4242
    4343#Numerical parameters
  • issm/trunk-jpl/test/Par/RoundSheetEISMINT.py

    r19527 r21409  
    44#Ok, start defining model parameters here
    55print "      creating thickness"
    6 md.geometry.thickness=10.*numpy.ones((md.mesh.numberofvertices,1))
    7 md.geometry.base=numpy.zeros((md.mesh.numberofvertices,1))
     6md.geometry.thickness=10.*numpy.ones((md.mesh.numberofvertices))
     7md.geometry.base=numpy.zeros((md.mesh.numberofvertices))
    88md.geometry.surface=md.geometry.base+md.geometry.thickness
    99
    1010print "      creating drag"
    11 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
    12 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    13 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     11md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
     12md.friction.p=numpy.ones((md.mesh.numberofelements))
     13md.friction.q=numpy.ones((md.mesh.numberofelements))
    1414
    1515print "      creating temperatures"
    1616tmin=238.15    #K
    1717st=1.67*10**-2/1000.    #k/m
    18 radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2).reshape(-1,1)
     18radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2)
    1919md.initialization.temperature=tmin+st*radius
    20 md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices,1))
     20md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices))
    2121
    2222print "      creating flow law parameter"
    23 md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices,1))    #to have the same B as the analytical solution
    24 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     23md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices))    #to have the same B as the analytical solution
     24md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    2525
    2626print "      creating surface mass balance"
     
    3232print "      creating velocities"
    3333constant=0.3
    34 md.inversion.vx_obs=constant/2.*md.mesh.x.reshape(-1,1)*(md.geometry.thickness)**-1
    35 md.inversion.vy_obs=constant/2.*md.mesh.y.reshape(-1,1)*(md.geometry.thickness)**-1
     34md.inversion.vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1
     35md.inversion.vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1
    3636md.inversion.vel_obs=numpy.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
    37 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices,1))
    38 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices,1))
    39 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
    40 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
     37md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
     38md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
     39md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
     40md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
    4141
    4242#Deal with boundary conditions:
  • 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
  • issm/trunk-jpl/test/Par/RoundSheetStaticEISMINT.py

    r19527 r21409  
    55hmin=0.01
    66hmax=2756.7
    7 radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2).reshape(-1,1)
     7radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2)
    88radiusmax=numpy.max(radius)
    99radius[numpy.nonzero(radius>(1.-10**-9)*radiusmax)]=radiusmax    #eliminate roundoff issues in next statement
    10 md.geometry.thickness=hmin*numpy.ones((numpy.size(md.mesh.x),1))+hmax*(4.*((1./2.)**(4./3.)*numpy.ones((numpy.size(md.mesh.x),1))-((radius)/(2.*radiusmax))**(4./3.)))**(3./8.)
     10md.geometry.thickness=hmin*numpy.ones((numpy.size(md.mesh.x)))+hmax*(4.*((1./2.)**(4./3.)*numpy.ones((numpy.size(md.mesh.x)))-((radius)/(2.*radiusmax))**(4./3.)))**(3./8.)
    1111md.geometry.base=0.*md.geometry.thickness
    1212md.geometry.surface=md.geometry.base+md.geometry.thickness
    1313
    1414print "      creating drag"
    15 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
     15md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
    1616md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    17 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    18 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     17md.friction.p=numpy.ones((md.mesh.numberofelements))
     18md.friction.q=numpy.ones((md.mesh.numberofelements))
    1919
    2020print "      creating temperatures"
     
    2222st=1.67*10**-2/1000.    #k/m
    2323md.initialization.temperature=tmin+st*radius
    24 md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices,1))
     24md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices))
    2525
    2626print "      creating flow law parameter"
    27 md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices,1))    #to have the same B as the analytical solution
    28 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     27md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices))    #to have the same B as the analytical solution
     28md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    2929
    3030print "      creating surface mass balance"
     
    3636print "      creating velocities"
    3737constant=0.3
    38 md.inversion.vx_obs=constant/2.*md.mesh.x.reshape(-1,1)*(md.geometry.thickness)**-1
    39 md.inversion.vy_obs=constant/2.*md.mesh.y.reshape(-1,1)*(md.geometry.thickness)**-1
     38md.inversion.vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1
     39md.inversion.vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1
    4040md.inversion.vel_obs=numpy.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
    41 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices,1))
    42 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices,1))
    43 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
    44 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
     41md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
     42md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
     43md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
     44md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
    4545
    4646#Deal with boundary conditions:
  • issm/trunk-jpl/test/Par/SquareEISMINT.py

    r19527 r21409  
    77ymin=numpy.min(md.mesh.y)
    88ymax=numpy.max(md.mesh.y)
    9 md.geometry.thickness=500.*numpy.ones((md.mesh.numberofvertices,1))
     9md.geometry.thickness=500.*numpy.ones((md.mesh.numberofvertices))
    1010md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    1111md.geometry.surface=md.geometry.base+md.geometry.thickness
    1212
    1313print "      creating drag"
    14 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices,1))
     14md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices))
    1515md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    16 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    17 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     16md.friction.p=numpy.ones((md.mesh.numberofelements))
     17md.friction.q=numpy.ones((md.mesh.numberofelements))
    1818
    1919print "      creating initial values"
    20 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
    21 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices,1))
    22 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices,1))
    23 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
    24 md.initialization.vel=numpy.zeros((md.mesh.numberofvertices,1))
    25 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
     20md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
     21md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
     22md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
     23md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
     24md.initialization.vel=numpy.zeros((md.mesh.numberofvertices))
     25md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
    2626
    2727print "      creating flow law parameter"
    28 md.materials.rheology_B=1.7687*10**8*numpy.ones((md.mesh.numberofvertices,1))
    29 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     28md.materials.rheology_B=1.7687*10**8*numpy.ones((md.mesh.numberofvertices))
     29md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    3030
    3131print "      creating surface mass balance"
    32 md.smb.mass_balance=0.2*numpy.ones((md.mesh.numberofvertices,1))    #0m/a
    33 md.basalforcings.floatingice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices,1))    #0m/a
    34 md.basalforcings.groundedice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices,1))    #0m/a
     32md.smb.mass_balance=0.2*numpy.ones((md.mesh.numberofvertices))    #0m/a
     33md.basalforcings.floatingice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices))    #0m/a
     34md.basalforcings.groundedice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices))    #0m/a
    3535
    3636print "      boundary conditions"
     
    3939#Evolution of the ice shelf
    4040pos=numpy.nonzero(md.mesh.y==200000.)    #nodes on the upper boundary condition
    41 md.balancethickness.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     41md.balancethickness.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices))
    4242md.balancethickness.spcthickness[pos]=500.
    43 md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     43md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices))
    4444md.masstransport.spcthickness[pos]=500.
    4545md.masstransport.stabilization=0    #Better result with no artificial diffusivity
  • issm/trunk-jpl/test/Par/SquareSheetConstrained.py

    r21170 r21409  
    1717xmin=min(md.mesh.x)
    1818xmax=max(md.mesh.x)
    19 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y.reshape(-1,1)-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x.reshape(-1,1)-xmin)/(xmax-xmin)
     19md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin)
    2020md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness+20.
    2121md.geometry.surface=md.geometry.base+md.geometry.thickness
     
    3030[md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
    3131[md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
    32 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
    33 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
     32md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
     33md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
    3434
    3535#Materials
    36 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
     36md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
    3737md.materials.rheology_B=paterson(md.initialization.temperature)
    38 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     38md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    3939
    4040#Calving
    41 md.calving.calvingrate=0.*numpy.ones((md.mesh.numberofvertices,1))
    42 md.levelset.spclevelset=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     41md.calving.calvingrate=0.*numpy.ones((md.mesh.numberofvertices))
     42md.levelset.spclevelset=float('NaN')*numpy.ones((md.mesh.numberofvertices))
    4343
    4444#Friction
    45 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
     45md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
    4646md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    47 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    48 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     47md.friction.p=numpy.ones((md.mesh.numberofelements))
     48md.friction.q=numpy.ones((md.mesh.numberofelements))
    4949
    5050#Numerical parameters
     
    6262
    6363#GIA:
    64 md.gia.lithosphere_thickness=100.*numpy.ones((md.mesh.numberofvertices,1)); # in km
    65 md.gia.mantle_viscosity=1.*10**21*numpy.ones((md.mesh.numberofvertices,1)); # in Pa.s
     64md.gia.lithosphere_thickness=100.*numpy.ones((md.mesh.numberofvertices)); # in km
     65md.gia.mantle_viscosity=1.*10**21*numpy.ones((md.mesh.numberofvertices)); # in Pa.s
    6666md.materials.lithosphere_shear_modulus=6.7*10**10;                          # in Pa
    6767md.materials.lithosphere_density=3.32;                                      # in g/cm^-3
  • issm/trunk-jpl/test/Par/SquareSheetShelf.py

    r21176 r21409  
    1717xmin=min(md.mesh.x)
    1818xmax=max(md.mesh.x)
    19 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y.reshape(-1,1)-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x.reshape(-1,1)-xmin)/(xmax-xmin)
     19md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin)
    2020md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    2121bed_sheet=-md.materials.rho_ice/md.materials.rho_water*(hmax+(hmin-hmax)*(ymax/2-ymin)/(ymax-ymin))
     
    3333[md.initialization.vx]  = InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
    3434[md.initialization.vy]  = InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
    35 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
    36 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
     35md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
     36md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
    3737
    3838#Materials
    39 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
     39md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
    4040md.materials.rheology_B=paterson(md.initialization.temperature)
    41 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     41md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    4242
    4343#Accumulation and melting
    44 md.smb.mass_balance=10.*numpy.ones((md.mesh.numberofvertices,1))
    45 md.basalforcings.groundedice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices,1))
    46 md.basalforcings.floatingice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices,1))
     44md.smb.mass_balance=10.*numpy.ones((md.mesh.numberofvertices))
     45md.basalforcings.groundedice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices))
     46md.basalforcings.floatingice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices))
    4747
    4848#Friction
    49 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
     49md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
    5050md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    51 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    52 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     51md.friction.p=numpy.ones((md.mesh.numberofelements))
     52md.friction.q=numpy.ones((md.mesh.numberofelements))
    5353
    5454#Numerical parameters
  • issm/trunk-jpl/test/Par/SquareShelf.py

    r21170 r21409  
    1616xmin=min(md.mesh.x)
    1717xmax=max(md.mesh.x)
    18 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y.reshape(-1,1)-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x.reshape(-1,1)-xmin)/(xmax-xmin)
     18md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin)
    1919md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    2020md.geometry.surface=md.geometry.base+md.geometry.thickness
     
    3535[md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
    3636[md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
    37 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
    38 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
     37md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
     38md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
    3939
    4040#dbg - begin
     
    5151
    5252#Materials
    53 md.initialization.temperature = (273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
     53md.initialization.temperature = (273.-20.)*numpy.ones((md.mesh.numberofvertices))
    5454md.materials.rheology_B = paterson(md.initialization.temperature)
    55 md.materials.rheology_n = 3.*numpy.ones((md.mesh.numberofelements,1))
     55md.materials.rheology_n = 3.*numpy.ones((md.mesh.numberofelements))
    5656
    5757#Friction
    58 md.friction.coefficient = 20.*numpy.ones((md.mesh.numberofvertices,1))
     58md.friction.coefficient = 20.*numpy.ones((md.mesh.numberofvertices))
    5959md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    60 md.friction.p = numpy.ones((md.mesh.numberofelements,1))
    61 md.friction.q = numpy.ones((md.mesh.numberofelements,1))
     60md.friction.p = numpy.ones((md.mesh.numberofelements))
     61md.friction.q = numpy.ones((md.mesh.numberofelements))
    6262
    6363#Numerical parameters
  • issm/trunk-jpl/test/Par/SquareShelf2.py

    r21170 r21409  
    1616xmin=min(md.mesh.x)
    1717xmax=max(md.mesh.x)
    18 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y.reshape(-1,1)-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x.reshape(-1,1)-xmin)/(xmax-xmin)
     18md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin)
    1919md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    2020md.geometry.surface=md.geometry.base+md.geometry.thickness
     
    3434[md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
    3535[md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
    36 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
    37 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
     36md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
     37md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
    3838
    3939#dbg - begin
     
    5050
    5151#Materials
    52 md.initialization.temperature = (273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
     52md.initialization.temperature = (273.-20.)*numpy.ones((md.mesh.numberofvertices))
    5353md.materials.rheology_B = paterson(md.initialization.temperature)
    54 md.materials.rheology_n = 3.*numpy.ones((md.mesh.numberofelements,1))
     54md.materials.rheology_n = 3.*numpy.ones((md.mesh.numberofelements))
    5555
    5656#Friction
    57 md.friction.coefficient = 20.*numpy.ones((md.mesh.numberofvertices,1))
     57md.friction.coefficient = 20.*numpy.ones((md.mesh.numberofvertices))
    5858md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    59 md.friction.p = numpy.ones((md.mesh.numberofelements,1))
    60 md.friction.q = numpy.ones((md.mesh.numberofelements,1))
     59md.friction.p = numpy.ones((md.mesh.numberofelements))
     60md.friction.q = numpy.ones((md.mesh.numberofelements))
    6161
    6262#Numerical parameters
  • issm/trunk-jpl/test/Par/SquareShelfConstrained.py

    r21170 r21409  
    11import os.path
    22from arch import *
    3 import numpy
     3import numpy as np
    44import inspect
    55from verbose import verbose
     
    1212hmin=300.
    1313hmax=1000.
    14 ymin=numpy.min(md.mesh.y)
    15 ymax=numpy.max(md.mesh.y)
     14ymin=np.min(md.mesh.y)
     15ymax=np.max(md.mesh.y)
    1616xmin=min(md.mesh.x)
    1717xmax=max(md.mesh.x)
    18 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y.reshape(-1,1)-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x.reshape(-1,1)-xmin)/(xmax-xmin)
     18md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin)
    1919md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    2020md.geometry.surface=md.geometry.base+md.geometry.thickness
     
    2222
    2323#Initial velocity
    24 #x         = numpy.reshape(numpy.array(archread('../Data/SquareShelfConstrained.arch','x')),(-1))
    25 #y         = numpy.reshape(numpy.array(archread('../Data/SquareShelfConstrained.arch','y')),(-1))
    26 x         = numpy.array(archread('../Data/SquareShelfConstrained.arch','x'))
    27 y         = numpy.array(archread('../Data/SquareShelfConstrained.arch','y'))
    28 vx        = numpy.array(archread('../Data/SquareShelfConstrained.arch','vx'))
    29 vy        = numpy.array(archread('../Data/SquareShelfConstrained.arch','vy'))
    30 index     = numpy.array(archread('../Data/SquareShelfConstrained.arch','index').astype(int))
     24#x         = np.reshape(np.array(archread('../Data/SquareShelfConstrained.arch','x')),(-1))
     25#y         = np.reshape(np.array(archread('../Data/SquareShelfConstrained.arch','y')),(-1))
     26x         = np.array(archread('../Data/SquareShelfConstrained.arch','x'))
     27y         = np.array(archread('../Data/SquareShelfConstrained.arch','y'))
     28vx        = np.array(archread('../Data/SquareShelfConstrained.arch','vx'))
     29vy        = np.array(archread('../Data/SquareShelfConstrained.arch','vy'))
     30index     = np.array(archread('../Data/SquareShelfConstrained.arch','index').astype(int))
    3131
    3232[md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
    3333[md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
    34 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
    35 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
     34md.initialization.vz=np.zeros((md.mesh.numberofvertices))
     35md.initialization.pressure=np.zeros((md.mesh.numberofvertices))
    3636
    3737#Materials
    38 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
     38md.initialization.temperature=(273.-20.)*np.ones((md.mesh.numberofvertices))
    3939md.materials.rheology_B=paterson(md.initialization.temperature)
    40 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     40md.materials.rheology_n=3.*np.ones((md.mesh.numberofelements))
    4141
    4242#Surface mass balance and basal melting
    43 md.smb.mass_balance=10.*numpy.ones((md.mesh.numberofvertices,1))
    44 md.basalforcings.groundedice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices,1))
    45 md.basalforcings.floatingice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices,1))
     43md.smb.mass_balance=10.*np.ones((md.mesh.numberofvertices))
     44md.basalforcings.groundedice_melting_rate=5.*np.ones((md.mesh.numberofvertices))
     45md.basalforcings.floatingice_melting_rate=5.*np.ones((md.mesh.numberofvertices))
    4646
    4747#Friction
    48 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
    49 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    50 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    51 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     48md.friction.coefficient=20.*np.ones((md.mesh.numberofvertices))
     49md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
     50md.friction.p=np.ones((md.mesh.numberofelements))
     51md.friction.q=np.ones((md.mesh.numberofelements))
    5252
    5353#Numerical parameters
  • issm/trunk-jpl/test/Par/SquareThermal.py

    r19527 r21409  
    99print "      creating thickness"
    1010h=1000.
    11 md.geometry.thickness=h*numpy.ones((md.mesh.numberofvertices,1))
    12 md.geometry.base=-1000.*numpy.ones((md.mesh.numberofvertices,1))
     11md.geometry.thickness=h*numpy.ones((md.mesh.numberofvertices))
     12md.geometry.base=-1000.*numpy.ones((md.mesh.numberofvertices))
    1313md.geometry.surface=md.geometry.base+md.geometry.thickness;
    1414
    1515print "      creating velocities"
    16 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices,1))
    17 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices,1))
    18 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
     16md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
     17md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
     18md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
    1919
    2020print "      creating drag"
    21 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices,1))
     21md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices))
    2222md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    23 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    24 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     23md.friction.p=numpy.ones((md.mesh.numberofelements))
     24md.friction.q=numpy.ones((md.mesh.numberofelements))
    2525
    2626print "      creating temperatures"
    27 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
     27md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
    2828
    2929print "      creating flow law parameter"
    3030md.materials.rheology_B=paterson(md.initialization.temperature)
    31 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     31md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    3232
    3333print "      creating surface mass balance"
    34 md.smb.mass_balance=numpy.ones((md.mesh.numberofvertices,1))/md.constants.yts    #1m/a
    35 md.basalforcings.melting_rate=0.*numpy.ones((md.mesh.numberofvertices,1))/md.constants.yts    #1m/a
     34md.smb.mass_balance=numpy.ones((md.mesh.numberofvertices))/md.constants.yts    #1m/a
     35md.basalforcings.melting_rate=0.*numpy.ones((md.mesh.numberofvertices))/md.constants.yts    #1m/a
    3636
    3737#Deal with boundary conditions:
     
    4141
    4242print "      boundary conditions for thermal model"
    43 md.thermal.spctemperature[:]=md.initialization.temperature
    44 md.basalforcings.geothermalflux=numpy.zeros((md.mesh.numberofvertices,1))
     43md.thermal.spctemperature=md.initialization.temperature
     44md.basalforcings.geothermalflux=numpy.zeros((md.mesh.numberofvertices))
    4545md.basalforcings.geothermalflux[numpy.nonzero(md.mask.groundedice_levelset>0.)[0]]=1.*10**-3    #1 mW/m^2
  • issm/trunk-jpl/test/Par/ValleyGlacierShelf.py

    r21170 r21409  
    1010
    1111#Start defining model parameters here
    12 x=md.mesh.x.reshape(-1,1)
    13 y=md.mesh.y.reshape(-1,1)
     12x=md.mesh.x
     13y=md.mesh.y
    1414xmin, xmax = min(x), max(x)
    1515ymin, ymax = min(y), max(y)
     
    3333#Mask
    3434md.mask.ice_levelset=x - alpha*Lx
    35 md.mask.groundedice_levelset= numpy.ones((md.mesh.numberofvertices,1))
     35md.mask.groundedice_levelset= numpy.ones((md.mesh.numberofvertices))
    3636
    3737#Initial velocity
    38 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices,1))
    39 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices,1))
    40 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
    41 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
     38md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
     39md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
     40md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
     41md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
    4242
    4343#Materials
    44 md.initialization.temperature=(273.15-5.)*numpy.ones((md.mesh.numberofvertices,1))
    45 md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices,1))
    46 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices,1))
     44md.initialization.temperature=(273.15-5.)*numpy.ones((md.mesh.numberofvertices))
     45md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices))
     46md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices))
    4747md.materials.rheology_B=paterson(md.initialization.temperature)
    48 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
     48md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
    4949
    5050#Thermal
    5151md.thermal.isenthalpy=False
    52 md.thermal.spctemperature=float('nan')*numpy.ones((md.mesh.numberofvertices,1))
     52md.thermal.spctemperature=float('nan')*numpy.ones((md.mesh.numberofvertices))
    5353
    5454#Groundingline
     
    5656
    5757#Surface mass balance and basal melting
    58 md.smb.mass_balance=0.3*numpy.ones((md.mesh.numberofvertices,1))
     58md.smb.mass_balance=0.3*numpy.ones((md.mesh.numberofvertices))
    5959md.basalforcings.groundedice_melting_rate=md.smb.mass_balance
    6060md.basalforcings.floatingice_melting_rate=md.smb.mass_balance
    6161
    6262#Friction
    63 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
     63md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
    6464md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
    65 md.friction.p=numpy.ones((md.mesh.numberofelements,1))
    66 md.friction.q=numpy.ones((md.mesh.numberofelements,1))
     65md.friction.p=numpy.ones((md.mesh.numberofelements))
     66md.friction.q=numpy.ones((md.mesh.numberofelements))
    6767
    6868#Transient
     
    8282
    8383#Masstransport
    84 md.calving.calvingrate=0.*numpy.ones((md.mesh.numberofvertices,1))
    85 md.calving.meltingrate=0.*numpy.ones((md.mesh.numberofvertices,1))
    86 md.levelset.spclevelset=float('NaN')*numpy.ones((md.mesh.numberofvertices,1))
     84md.calving.calvingrate=0.*numpy.ones((md.mesh.numberofvertices))
     85md.calving.meltingrate=0.*numpy.ones((md.mesh.numberofvertices))
     86md.levelset.spclevelset=float('NaN')*numpy.ones((md.mesh.numberofvertices))
    8787md.masstransport.stabilization=1.
    8888
Note: See TracChangeset for help on using the changeset viewer.