Ignore:
Timestamp:
02/25/22 00:34:01 (3 years ago)
Author:
bdef
Message:

CHG: id indexing change in autoregression to be consistent with matlab

File:
1 edited

Legend:

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

    r26679 r26907  
    1212
    1313md = triangle(model(), '../Exp/79North.exp', 6000)
    14 md = setmask(md, '../Exp/79NorthShelf.exp','')
     14md = setmask(md, '../Exp/79NorthShelf.exp', '')
    1515md = parameterize(md, '../Par/79North.py')
    1616md = setflowequation(md, 'SSA', 'all')
    1717
    1818#Default friction
    19 md.friction         = friction()
    20 md.friction.coefficient = 30*np.ones(md.mesh.numberofvertices)
    21 md.friction.p           = 1*np.ones((md.mesh.numberofelements))
    22 md.friction.q           = 1*np.ones((md.mesh.numberofelements))
     19md.friction = friction()
     20md.friction.coefficient = 30 * np.ones(md.mesh.numberofvertices)
     21md.friction.p = np.ones((md.mesh.numberofelements))
     22md.friction.q = np.ones((md.mesh.numberofelements))
    2323
    2424# Basin separation default
    25 idb_df = np.zeros((md.mesh.numberofelements,))
    26 iid1 = np.where(md.mesh.y<=-1.08e6)[0]
     25idb_df = np.zeros((md.mesh.numberofelements))
     26iid1 = np.where(md.mesh.y <= -1.08e6)[0]
    2727for ii in range(md.mesh.numberofelements):
    2828    for vertex in range(3):
     
    3333            idb_df[ii] = 2
    3434#Covariance matrix
    35 covPw = np.array([[0.75e10,0.0],[0.0,0.5e10]])
     35covPw = np.array([[0.75e10, 0.0], [0.0, 0.5e10]])
    3636
    3737# Stochastic forcing
    3838md.stochasticforcing.isstochasticforcing = 1
    39 md.stochasticforcing.fields              = ['FrictionWaterPressure']
    40 md.stochasticforcing.defaultdimension    = 2
    41 md.stochasticforcing.default_id          = idb_df-1 #NOTE: offset because of 1-based vertex indexing
    42 md.stochasticforcing.covariance          = covPw # global covariance
    43 md.stochasticforcing.randomflag          = 0 # determines true/false randomness
     39md.stochasticforcing.fields = ['FrictionWaterPressure']
     40md.stochasticforcing.defaultdimension = 2
     41md.stochasticforcing.default_id = idb_df
     42md.stochasticforcing.covariance = covPw # global covariance
     43md.stochasticforcing.randomflag = 0 # determines true/false randomness
    4444
    45 md.transient.issmb              = 0;
    46 md.transient.ismasstransport    = 1;
    47 md.transient.isstressbalance    = 1;
    48 md.transient.isthermal          = 0;
    49 md.transient.isgroundingline    = 0;
     45md.transient.issmb = 0
     46md.transient.ismasstransport = 1
     47md.transient.isstressbalance = 1
     48md.transient.isthermal = 0
     49md.transient.isgroundingline = 0
    5050
    5151md.transient.requested_outputs = ['default', 'FrictionWaterPressure']
    5252md.timestepping.start_time = 0
    53 md.timestepping.time_step  = 1
     53md.timestepping.time_step = 1
    5454md.timestepping.final_time = 5
    55 md.cluster = generic('name',gethostname(),'np',3)
     55md.cluster = generic('name', gethostname(), 'np', 3)
    5656md = solve(md, 'Transient')
    5757
    5858# Fields and tolerances to track changes
    59 field_names = [
    60     'Vx1','Vy1','Vel1','Thickness1','FrictionWaterPressure1',
    61     'Vx2','Vy2','Vel2','Thickness2','FrictionWaterPressure2',
    62     'Vx10','Vy10','Vel10','Thickness10','FrictionWaterPressure10'
    63     ]
     59field_names = ['Vx1', 'Vy1', 'Vel1', 'Thickness1', 'FrictionWaterPressure1',
     60               'Vx2', 'Vy2', 'Vel2', 'Thickness2', 'FrictionWaterPressure2',
     61               'Vx10', 'Vy10', 'Vel10', 'Thickness10', 'FrictionWaterPressure10']
    6462
    65 field_tolerances = [
    66     2e-10,2e-10,2e-10,2e-10,2e-10,
    67     4e-10,4e-10,4e-10,4e-10,4e-10,
    68     8e-10,8e-10,8e-10,8e-10,8e-10
    69     ]
     63field_tolerances = [2e-10, 2e-10, 2e-10, 2e-10, 2e-10,
     64                    4e-10, 4e-10, 4e-10, 4e-10, 4e-10,
     65                    8e-10, 8e-10, 8e-10, 8e-10, 8e-10]
    7066
    71 field_values = [
    72     md.results.TransientSolution[0].Vx,
    73     md.results.TransientSolution[0].Vy,
    74     md.results.TransientSolution[0].Vel,
    75     md.results.TransientSolution[0].Thickness,
    76     md.results.TransientSolution[0].FrictionWaterPressure,
    77     md.results.TransientSolution[1].Vx,
    78     md.results.TransientSolution[1].Vy,
    79     md.results.TransientSolution[1].Vel,
    80     md.results.TransientSolution[1].Thickness,
    81     md.results.TransientSolution[1].FrictionWaterPressure,
    82     md.results.TransientSolution[4].Vx,
    83     md.results.TransientSolution[4].Vy,
    84     md.results.TransientSolution[4].Vel,
    85     md.results.TransientSolution[4].Thickness,
    86     md.results.TransientSolution[4].FrictionWaterPressure
    87     ]
    88    
    89 
    90 
    91 
     67field_values = [md.results.TransientSolution[0].Vx,
     68                md.results.TransientSolution[0].Vy,
     69                md.results.TransientSolution[0].Vel,
     70                md.results.TransientSolution[0].Thickness,
     71                md.results.TransientSolution[0].FrictionWaterPressure,
     72                md.results.TransientSolution[1].Vx,
     73                md.results.TransientSolution[1].Vy,
     74                md.results.TransientSolution[1].Vel,
     75                md.results.TransientSolution[1].Thickness,
     76                md.results.TransientSolution[1].FrictionWaterPressure,
     77                md.results.TransientSolution[4].Vx,
     78                md.results.TransientSolution[4].Vy,
     79                md.results.TransientSolution[4].Vel,
     80                md.results.TransientSolution[4].Thickness,
     81                md.results.TransientSolution[4].FrictionWaterPressure]
Note: See TracChangeset for help on using the changeset viewer.