[23390] | 1 | Index: ../trunk-jpl/test/NightlyRun/test420.py
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/test/NightlyRun/test420.py (nonexistent)
|
---|
| 4 | +++ ../trunk-jpl/test/NightlyRun/test420.py (revision 23257)
|
---|
| 5 | @@ -0,0 +1,71 @@
|
---|
| 6 | +#Test Name: SquareSheetShelfDakotaScaledResponse
|
---|
| 7 | +
|
---|
| 8 | +import numpy as np
|
---|
| 9 | +from model import *
|
---|
| 10 | +from socket import gethostname
|
---|
| 11 | +from triangle import *
|
---|
| 12 | +from setmask import *
|
---|
| 13 | +from parameterize import *
|
---|
| 14 | +from setflowequation import *
|
---|
| 15 | +from solve import *
|
---|
| 16 | +from partitioner import *
|
---|
| 17 | +
|
---|
| 18 | +md = triangle(model(),'../Exp/Square.exp',200000.)
|
---|
| 19 | +md = setmask(md,'../Exp/SquareShelf.exp','')
|
---|
| 20 | +md = parameterize(md,'../Par/SquareSheetShelf.py')
|
---|
| 21 | +md = setflowequation(md,'SSA','all')
|
---|
| 22 | +md.cluster = generic('name',gethostname(),'np',3)
|
---|
| 23 | +
|
---|
| 24 | +#partitioning
|
---|
| 25 | +md.qmu.numberofpartitions = 10
|
---|
| 26 | +md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions)
|
---|
| 27 | +md.qmu.partition = md.qmu.partition-1
|
---|
| 28 | +md.qmu.isdakota = 1
|
---|
| 29 | +
|
---|
| 30 | +#Dakota options
|
---|
| 31 | +
|
---|
| 32 | +#dakota version
|
---|
| 33 | +version = IssmConfig('_DAKOTA_VERSION_')
|
---|
| 34 | +version = float(version[0])
|
---|
| 35 | +
|
---|
| 36 | +#variables
|
---|
| 37 | +md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01)
|
---|
| 38 | +
|
---|
| 39 | +#responses
|
---|
| 40 | +md.qmu.responses.MaxVel = response_function.response_function('scaled_Thickness',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
|
---|
| 41 | +
|
---|
| 42 | +#method
|
---|
| 43 | +md.qmu.method = dakota_method.dakota_method('nond_l')
|
---|
| 44 | +
|
---|
| 45 | +#parameters
|
---|
| 46 | +md.qmu.params.direct = True
|
---|
| 47 | +md.qmu.params.interval_type = 'forward'
|
---|
| 48 | +
|
---|
| 49 | +if version >= 6:
|
---|
| 50 | + md.qmu.params.analysis_driver = 'matlab'
|
---|
| 51 | + md.qmu.params.evaluation_scheduling = 'master'
|
---|
| 52 | + md.qmu.params.processors_per_evaluation = 2
|
---|
| 53 | +else:
|
---|
| 54 | + md.qmu.params.analysis_driver = 'stressbalance'
|
---|
| 55 | + md.qmu.params.evaluation_concurrency = 1
|
---|
| 56 | +
|
---|
| 57 | +#imperative!
|
---|
| 58 | +md.stressbalance.reltol = 10**-5 #tighten for qmu analysese
|
---|
| 59 | +
|
---|
| 60 | +#solve
|
---|
| 61 | +md.verbose = verbose('000000000') # this line is recommended
|
---|
| 62 | +md = solve(md,'Stressbalance','overwrite','y')
|
---|
| 63 | +md.qmu.results = md.results.dakota
|
---|
| 64 | +
|
---|
| 65 | +#test on thickness
|
---|
| 66 | +h = np.zeros((md.qmu.numberofpartitions,))
|
---|
| 67 | +for i in range(md.qmu.numberofpartitions):
|
---|
| 68 | + h[i] = md.qmu.results.dresp_out[i].mean
|
---|
| 69 | +
|
---|
| 70 | +#project onto grid
|
---|
| 71 | +thickness = h[(md.qmu.partition).flatten()]
|
---|
| 72 | +
|
---|
| 73 | +#Fields and tolerances to track changes
|
---|
| 74 | +field_names = ['Thickness']
|
---|
| 75 | +field_tolerances = [1e-10]
|
---|
| 76 | +field_values = [thickness]
|
---|