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/test217.py

    r21060 r21408  
    11#Test Name: SquareShelfConstrained
    2 from MatlabFuncs import *
     2
    33from model import *
    4 from numpy import *
     4from socket import gethostname
     5import numpy as np
    56from triangle import *
    67from setmask import *
     
    1516md=parameterize(md,'../Par/SquareShelf.py')
    1617md=setflowequation(md,'SSA','all')
    17 md.cluster=generic('name',oshostname(),'np',3)
     18md.cluster=generic('name',gethostname(),'np',3)
    1819
    1920# redo the parameter file for this special shelf.
     
    3334
    3435h=1000.
    35 md.geometry.thickness=h*ones((md.mesh.numberofvertices,1))
     36md.geometry.thickness=h*ones((md.mesh.numberofvertices))
    3637md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
    3738md.geometry.surface=md.geometry.base+md.geometry.thickness
    3839
    3940# Initial velocity and pressure
    40 md.initialization.vx=zeros((md.mesh.numberofvertices,1))
    41 md.initialization.vy=zeros((md.mesh.numberofvertices,1))
    42 md.initialization.vz=zeros((md.mesh.numberofvertices,1))
    43 md.initialization.pressure=zeros((md.mesh.numberofvertices,1))
     41md.initialization.vx=zeros((md.mesh.numberofvertices))
     42md.initialization.vy=zeros((md.mesh.numberofvertices))
     43md.initialization.vz=zeros((md.mesh.numberofvertices))
     44md.initialization.pressure=zeros((md.mesh.numberofvertices))
    4445
    4546# Materials
    46 md.initialization.temperature=(273.-20.)*ones((md.mesh.numberofvertices,1))
     47md.initialization.temperature=(273.-20.)*ones((md.mesh.numberofvertices))
    4748md.materials.rheology_B=paterson(md.initialization.temperature)
    48 md.materials.rheology_n=3.*ones((md.mesh.numberofelements,1))
     49md.materials.rheology_n=3.*ones((md.mesh.numberofelements))
    4950
    5051# Boundary conditions:
    51 md.stressbalance.spcvx=float(nan)*ones((md.mesh.numberofvertices,1))
    52 md.stressbalance.spcvy=float(nan)*ones((md.mesh.numberofvertices,1))
    53 md.stressbalance.spcvz=float(nan)*ones((md.mesh.numberofvertices,1))
     52md.stressbalance.spcvx=float(nan)*ones((md.mesh.numberofvertices))
     53md.stressbalance.spcvy=float(nan)*ones((md.mesh.numberofvertices))
     54md.stressbalance.spcvz=float(nan)*ones((md.mesh.numberofvertices))
    5455
    5556# constrain flanks to 0 normal velocity
    56 pos=numpy.nonzero(numpy.logical_or(md.mesh.x==xmin,md.mesh.x==xmax))
     57pos=np.nonzero(np.logical_or.reduce(md.mesh.x==xmin,md.mesh.x==xmax))
    5758md.stressbalance.spcvx[pos]=0
    5859md.stressbalance.spcvz[pos]=float(nan)
    5960
    6061# constrain grounding line to 0 velocity
    61 pos=numpy.nonzero(md.mesh.y==ymin)
     62pos=np.nonzero(md.mesh.y==ymin)
    6263md.stressbalance.spcvx[pos]=0
    6364md.stressbalance.spcvy[pos]=0
     
    6566# icefront
    6667nodeonicefront=zeros(md.mesh.numberofvertices)
    67 pos=numpy.nonzero(md.mesh.y==ymax)
     68pos=np.nonzero(md.mesh.y==ymax)
    6869nodeonicefront[pos]=1
    6970md.mask.ice_levelset=-1+nodeonicefront
     
    7273
    7374# create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292.
    74 # ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3;
    75 # vy_c=ey_c.*md.mesh.y*md.constants.yts;
     75# ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3
     76# vy_c=ey_c.*md.mesh.y*md.constants.yts
    7677
    7778# Fields and tolerances to track changes
Note: See TracChangeset for help on using the changeset viewer.