source: issm/trunk-jpl/test/NightlyRun/test420.py@ 25107

Last change on this file since 25107 was 25107, checked in by jdquinn, 5 years ago

BUG: Typo and missed removal of reference to vpartition

File size: 1.9 KB
Line 
1#Test Name: SquareSheetShelfDakotaScaledResponse
2import numpy as np
3from model import *
4from socket import gethostname
5from triangle import *
6from setmask import *
7from parameterize import *
8from setflowequation import *
9from solve import *
10from partitioner import *
11
12md = triangle(model(), '../Exp/Square.exp', 200000.)
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#partitioning
19npart = 10
20partition = partitioner(md, 'package', 'chaco', 'npart', npart) - 1
21md.qmu.isdakota = 1
22
23#Dakota options
24
25#dakota version
26version = IssmConfig('_DAKOTA_VERSION_')
27version = float(version[0])
28
29#variables
30md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain(
31 'descriptor', 'MaterialsRhoIce',
32 'mean', 1,
33 'stddev', .01
34 )
35
36#responses
37md.qmu.responses.MaxVel = response_function.response_function(
38 'descriptor', 'scaled_Thickness',
39 'partition', partition
40 )
41
42#method
43md.qmu.method = dakota_method.dakota_method('nond_l')
44
45#parameters
46md.qmu.params.direct = True
47md.qmu.params.interval_type = 'forward'
48
49if version >= 6:
50 md.qmu.params.analysis_driver = 'matlab'
51 md.qmu.params.evaluation_scheduling = 'master'
52 md.qmu.params.processors_per_evaluation = 2
53else:
54 md.qmu.params.analysis_driver = 'stressbalance'
55 md.qmu.params.evaluation_concurrency = 1
56
57#imperative!
58md.stressbalance.reltol = 10**-5 #tighten for qmu analysese
59
60#solve
61md.verbose = verbose('000000000') # this line is recommended
62md = solve(md, 'Stressbalance', 'overwrite', 'y')
63md.qmu.results = md.results.dakota
64
65#test on thickness
66h = np.zeros(npart)
67for i in range(npart):
68 h[i] = md.qmu.results.dresp_out[i].mean
69
70#project onto grid
71thickness = h[(partition + 1).flatten()]
72
73#Fields and tolerances to track changes
74field_names = ['Thickness']
75field_tolerances = [1e-10]
76field_values = [thickness]
Note: See TracBrowser for help on using the repository browser.