source: issm/trunk/test/NightlyRun/test413.py@ 25836

Last change on this file since 25836 was 25836, checked in by Mathieu Morlighem, 4 years ago

merged trunk-jpl and trunk for revision 25834

File size: 2.1 KB
Line 
1#Test Name: SquareSheetShelfDiadSSA3dDakotaPart
2from model import *
3from socket import gethostname
4from triangle import *
5from setmask import *
6from parameterize import *
7from setflowequation import *
8from solve import *
9from partitioner import *
10from importancefactors import *
11
12md = triangle(model(), '../Exp/Square.exp', 150000.)
13md = setmask(md, '../Exp/SquareShelf.exp', '')
14md = parameterize(md, '../Par/SquareSheetShelf.py')
15md = setflowequation(md, 'SSA', 'all')
16md.cluster = generic('name', gethostname(), 'np', 3)
17
18#Dakota options
19
20#dakota version
21version = IssmConfig('_DAKOTA_VERSION_')
22version = float(version[0])
23
24#partitioning
25npart = 20
26partition = partitioner(md, 'package', 'chaco', 'npart', npart, 'weighting', 'on')[0] - 1
27
28#variables
29md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain(
30 'descriptor', 'MaterialsRhoIce',
31 'mean', md.materials.rho_ice,
32 'stddev', .01
33 )
34md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain(
35 'descriptor', 'scaled_FrictionCoefficient',
36 'mean', np.ones((npart, 1)),
37 'stddev', .01 * np.ones((npart, 1)),
38 'partition', partition
39 )
40
41#responses
42md.qmu.responses.MaxVel = response_function.response_function('descriptor','MaxVel')
43
44#method
45md.qmu.method = dakota_method.dakota_method('nond_l')
46
47#parameters
48md.qmu.params.direct = True
49md.qmu.params.interval_type = 'forward'
50
51if version >= 6:
52 md.qmu.params.analysis_driver = 'matlab'
53 md.qmu.params.evaluation_scheduling = 'master'
54 md.qmu.params.processors_per_evaluation = 2
55else:
56 md.qmu.params.analysis_driver = 'stressbalance'
57 md.qmu.params.evaluation_concurrency = 1
58
59
60#imperative!
61md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
62md.qmu.isdakota = 1
63
64#solve
65md.verbose = verbose('000000000') # this line is recommended
66md = solve(md, 'Stressbalance', 'overwrite', 'y')
67
68#Fields and tolerances to track changes
69md.qmu.results = md.results.dakota
70md.results.dakota.importancefactors = importancefactors(md, 'scaled_FrictionCoefficient', 'MaxVel', partition).T
71field_names = ['importancefactors']
72field_tolerances = [1e-10]
73field_values = [md.results.dakota.importancefactors]
Note: See TracBrowser for help on using the repository browser.