Changeset 24384


Ignore:
Timestamp:
11/22/19 02:48:36 (5 years ago)
Author:
bdef
Message:

CHG: syntax fix

Location:
issm/trunk-jpl/test/NightlyRun
Files:
21 edited

Legend:

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

    r24261 r24384  
    4141    md.stressbalance.spcvy[pos] = 0.
    4242
    43 #Create MPCs to have periodic boundary conditions
     43#Create MPCs to have periodic boundary conditions this is done on matlab indexing
    4444    posx = np.where(md.mesh.x == 0.)[0]
    4545    posx2 = np.where(md.mesh.x == np.max(md.mesh.x))[0]
  • issm/trunk-jpl/test/NightlyRun/test1104.py

    r24214 r24384  
    4444
    4545    md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
    46     print(np.shape(md.stressbalance.vertex_pairing))
     46
    4747#Compute the stressbalance
    4848    md.stressbalance.abstol = np.nan
     
    6262    results.append(md.results.StressbalanceSolution)
    6363
    64 #       plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer  #all', md.mesh.numberoflayers)
     64#       plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer#all', md.mesh.numberoflayers)
    6565
    6666#Fields and tolerances to track changes
  • issm/trunk-jpl/test/NightlyRun/test1110.m

    r21056 r24384  
    11%Test Name: ISMIPF
    22%This test is a test from the ISMP-HOM Intercomparison project.
    3 %TestF 
     3%TestF
    44printingflag=false;
    55results={};
    66
    7 for i=1:4,
     7for i=3,  %1:4,
    88        L=100000.; %in m
    99        nx=30; %numberof nodes in x direction
     
    5555        md.masstransport.stabilization=1;
    5656        md.stressbalance.maxiter=1;
    57        
     57
    5858        %Compute the stressbalance
    5959        md.cluster=generic('name',oshostname(),'np',8);
     
    6363        %save the results
    6464        results{i}=md.results.TransientSolution(end);
    65        
    66         %Now plot vx and delta surface 
     65
     66        %Now plot vx and delta surface
    6767        if (i==1 | i==3),
    6868                plotmodel(md,'data',(md.results.TransientSolution(end).Vx),'layer',md.mesh.numberoflayers,'sectionvalue','../Exp/ISMIP100000.exp','title','','xlabel','','ylabel','Velocity (m/yr)','linewidth',3,'grid','on','unit','km','ylim',[91 100])
  • issm/trunk-jpl/test/NightlyRun/test1110.py

    r24214 r24384  
    44from socket import gethostname
    55from bamg import *
    6 from setmask import *
    7 from parameterize import *
    8 from setflowequation import *
    9 from solve import *
    10 from squaremesh import *
     6from setmask import setmask
     7from parameterize import parameterize
     8from setflowequation import setflowequation
     9from solve import solve
     10from squaremesh import squaremesh
    1111
    1212#This test is a test from the ISMP - HOM Intercomparison project.
     
    1515results = []
    1616
    17 for i in range(4):
     17for i in [1]:  #range(4):
    1818    L = 100000.  #in m
    1919    nx = 30  #numberof nodes in x direction
     
    2525    md = parameterize(md, '../Par/ISMIPF.py')
    2626    md = md.extrude(4, 1.)
    27 
    2827    if (i == 0 or i == 1):
    2928        md = setflowequation(md, 'HO', 'all')
     
    4241    else:
    4342        posA = np.where(md.mesh.vertexonbase)
    44         posB = np.unique(np.concatenate(np.where(md.mesh.x == 0.), np.where(md.mesh.x == max(md.mesh.x))))
    45         posC = np.unique(np.concatenate(np.where(md.mesh.y == 0.), np.where(md.mesh.y == max(md.mesh.y))))
     43        posB = np.unique(np.hstack((np.where(md.mesh.x == 0.), np.where(md.mesh.x == np.nanmax(md.mesh.x)))))
     44        posC = np.unique(np.hstack((np.where(md.mesh.y == 0.), np.where(md.mesh.y == np.nanmax(md.mesh.y)))))
    4645        pos = np.intersect1d(np.intersect1d(posA, posB), posC)
    4746        md.stressbalance.spcvx[pos] = 100.  #because we need a dirichlet somewhere
     
    5352
    5453    #Create MPCs to have periodic boundary conditions
    55     posx = np.where(md.mesh.x == 0.)
    56     posx2 = np.where(md.mesh.x == max(md.mesh.x))
     54    posx = np.where(md.mesh.x == 0.)[0]
     55    posx2 = np.where(md.mesh.x == max(md.mesh.x))[0]
     56    # posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]  #Don't take the same nodes two times
     57    # posy2 = np.where(np.logical_and.reduce((md.mesh.y == np.max(md.mesh.y), md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]
     58    posy = np.where(md.mesh.y == 0)[0]
     59    posy2 = np.where(md.mesh.y == np.max(md.mesh.y))[0]
    5760
    58     posy = np.where(md.mesh.y == 0.)
    59     posy2 = np.where(md.mesh.y == max(md.mesh.y))
    60 
    61     md.stressbalance.vertex_pairing = np.column_stack((posx, posx2, posy, posy2))
    62     md.masstransport.vertex_pairing = np.column_stack((posx, posx2, posy, posy2))
     61    md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
     62    md.masstransport.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
    6363
    6464    md.timestepping.time_step = 3.
    65     md.timestepping.final_time = 300.
    66     md.settings.output_frequency = 50
     65    md.timestepping.final_time = 30.  #300.
     66    md.settings.output_frequency = 5  #50
    6767    md.masstransport.stabilization = 1
    6868    md.stressbalance.maxiter = 1
     
    7474
    7575    #save the results
    76     results[i] = md.results.TransientSolution()
     76    results = np.append(results, md.results.TransientSolution[-1])
    7777
    7878    #Now plot vx and delta surface
    7979    if (i == 0 or i == 2):
    80         plotmodel(md, 'data', (md.results.TransientSolution().Vx),
     80        plotmodel(md, 'data', np.squeeze(md.results.TransientSolution[-1].Vx),
    8181                  'layer', md.mesh.numberoflayers,
    8282                  'sectionvalue', '../Exp/ISMIP100000.exp',
     
    8989                  'ylim', [91, 100])
    9090    elif (i == 1 or i == 3):
    91         plotmodel(md, 'data', (md.results.TransientSolution().Vx),
     91        plotmodel(md, 'data', np.squeeze(md.results.TransientSolution[-1].Vx),
    9292                  'layer', md.mesh.numberoflayers,
    9393                  'sectionvalue', '../Exp/ISMIP100000.exp',
     
    115115            #system(['mv ismipfFSvxsliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
    116116
    117     plotmodel(md, 'data', (md.results.TransientSolution().Surface) - md.geometry.surface,
     117    plotmodel(md, 'data', np.squeeze(md.results.TransientSolution[-1].Surface) - md.geometry.surface,
    118118              'layer', md.mesh.numberoflayers,
    119119              'sectionvalue', '../Exp/ISMIP100000.exp',
  • issm/trunk-jpl/test/NightlyRun/test228.py

    r24214 r24384  
    2222#Set up transient
    2323smb = np.ones((md.mesh.numberofvertices)) * 3.6
    24 smb = np.vstack((smb, smb * - 1.)).T
     24smb = np.vstack((smb, smb * -1.)).T
    2525
    2626md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
  • issm/trunk-jpl/test/NightlyRun/test230.py

    r24214 r24384  
    2323#Set up transient
    2424smb = np.ones((md.mesh.numberofvertices)) * 3.6
    25 smb = np.vstack((smb, smb * - 1.)).T
     25smb = np.vstack((smb, smb * -1.)).T
    2626
    2727md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
  • issm/trunk-jpl/test/NightlyRun/test234.py

    r24261 r24384  
    2525
    2626smb = np.ones((md.mesh.numberofvertices, )) * 3.6
    27 smb = np.array([smb, smb * - 1]).T
     27smb = np.array([smb, smb * -1]).T
    2828
    2929md.smb.mass_balance = smb
  • issm/trunk-jpl/test/NightlyRun/test235.py

    r24261 r24384  
    2525
    2626smb = np.ones((md.mesh.numberofvertices, )) * 3.6
    27 smb = np.array([smb, smb * - 1]).T
     27smb = np.array([smb, smb * -1]).T
    2828
    2929md.smb.mass_balance = smb
  • issm/trunk-jpl/test/NightlyRun/test241.py

    r24214 r24384  
    2323#Set up transient
    2424smb = np.ones((md.mesh.numberofvertices)) * 3.6
    25 smb = np.vstack((smb, smb * - 1.)).T
     25smb = np.vstack((smb, smb * -1.)).T
    2626
    2727md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
  • issm/trunk-jpl/test/NightlyRun/test242.py

    r24214 r24384  
    2424#Set up transient
    2525smb = np.ones((md.mesh.numberofvertices)) * 3.6
    26 smb = np.vstack((smb, smb * - 1.)).T
     26smb = np.vstack((smb, smb * -1.)).T
    2727
    2828md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
  • issm/trunk-jpl/test/NightlyRun/test2424.py

    r24261 r24384  
    4545#time is off by the year constant
    4646for i in range(nsteps):
    47     field_names.append('Time-' + str(md.results.TransientSolution[i].time) + ' - yr - ice_levelset - S - sl - (1 - di) * H')
     47    field_names.append('Time-' + str(md.results.TransientSolution[i].time) + '-yr-ice_levelset-S-sl-(1-di) * H')
    4848    field_tolerances.append(1e-12)
    4949    field_values.append(md.results.TransientSolution[i].MaskGroundediceLevelset.reshape(-1, ) - (md.geometry.surface - md.results.TransientSolution[i].Sealevel.reshape(-1, ) - (1 - md.materials.rho_ice / md.materials.rho_water) * md.geometry.thickness))
  • issm/trunk-jpl/test/NightlyRun/test250.py

    r24261 r24384  
    2424
    2525smb = np.ones((md.mesh.numberofvertices, )) * 3.6
    26 smb = np.array([smb, smb * - 1]).T
     26smb = np.array([smb, smb * -1]).T
    2727
    2828md.smb.mass_balance = smb
  • issm/trunk-jpl/test/NightlyRun/test251.py

    r24261 r24384  
    2424
    2525smb = np.ones((md.mesh.numberofvertices, )) * 3.6
    26 smb = np.array([smb, smb * - 1]).T
     26smb = np.array([smb, smb * -1]).T
    2727
    2828md.smb.mass_balance = smb
  • issm/trunk-jpl/test/NightlyRun/test333.py

    r24240 r24384  
    4949md.timestepping.final_time = 2.0
    5050
    51 #md.debug.valgrind = True
     51md.debug.valgrind = True
    5252md = solve(md, 'Transient')
    5353
  • issm/trunk-jpl/test/NightlyRun/test336.py

    r24214 r24384  
    2222#Set up transient
    2323smb = np.ones((md.mesh.numberofvertices)) * 3.6
    24 smb = np.vstack((smb, smb * - 1.)).T
     24smb = np.vstack((smb, smb * -1.)).T
    2525
    2626md.smb = SMBcomponents()
  • issm/trunk-jpl/test/NightlyRun/test337.py

    r24214 r24384  
    2323#Set up transient
    2424smb = np.ones((md.mesh.numberofvertices)) * 3.6
    25 smb = np.vstack((smb, smb * - 1.)).T
     25smb = np.vstack((smb, smb * -1.)).T
    2626
    2727md.smb = SMBcomponents()
  • issm/trunk-jpl/test/NightlyRun/test338.py

    r24214 r24384  
    2222#Set up transient
    2323smb = np.ones((md.mesh.numberofvertices)) * 3.6
    24 smb = np.vstack((smb, smb * - 1.)).T
     24smb = np.vstack((smb, smb * -1.)).T
    2525
    2626md.smb = SMBmeltcomponents()
  • issm/trunk-jpl/test/NightlyRun/test339.py

    r23793 r24384  
    2323#Set up transient
    2424smb = np.ones((md.mesh.numberofvertices)) * 3.6
    25 smb = np.vstack((smb, smb * - 1.)).T
     25smb = np.vstack((smb, smb * -1.)).T
    2626
    2727md.smb = SMBmeltcomponents()
  • issm/trunk-jpl/test/NightlyRun/test352.py

    r24214 r24384  
    2222#Set up transient
    2323smb = np.ones((md.mesh.numberofvertices)) * 3.6
    24 smb = np.vstack((smb, smb * - 1.)).T
     24smb = np.vstack((smb, smb * -1.)).T
    2525md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
    2626md.transient.isthermal = False
  • issm/trunk-jpl/test/NightlyRun/test353.py

    r24214 r24384  
    2222#Set up transient
    2323smb = np.ones((md.mesh.numberofvertices)) * 3.6
    24 smb = np.vstack((smb, smb * - 1.)).T
     24smb = np.vstack((smb, smb * -1.)).T
    2525
    2626md.smb = SMBcomponents()
  • issm/trunk-jpl/test/NightlyRun/test354.py

    r24214 r24384  
    2222#Set up transient
    2323smb = np.ones((md.mesh.numberofvertices)) * 3.6
    24 smb = np.vstack((smb, smb * - 1.)).T
     24smb = np.vstack((smb, smb * -1.)).T
    2525
    2626md.smb = SMBmeltcomponents()
Note: See TracChangeset for help on using the changeset viewer.