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
RevLine 
[23257]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
[23793]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)
[23257]17
18#partitioning
[25010]19npart = 10
20partition = partitioner(md, 'package', 'chaco', 'npart', npart) - 1
[23257]21md.qmu.isdakota = 1
22
23#Dakota options
24
25#dakota version
26version = IssmConfig('_DAKOTA_VERSION_')
27version = float(version[0])
28
29#variables
[24870]30md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain(
31 'descriptor', 'MaterialsRhoIce',
32 'mean', 1,
33 'stddev', .01
34 )
[23257]35
36#responses
[24870]37md.qmu.responses.MaxVel = response_function.response_function(
38 'descriptor', 'scaled_Thickness',
[25010]39 'partition', partition
[24870]40 )
[23257]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:
[23793]50 md.qmu.params.analysis_driver = 'matlab'
51 md.qmu.params.evaluation_scheduling = 'master'
52 md.qmu.params.processors_per_evaluation = 2
[23257]53else:
[23793]54 md.qmu.params.analysis_driver = 'stressbalance'
55 md.qmu.params.evaluation_concurrency = 1
[23257]56
[23793]57#imperative!
[24261]58md.stressbalance.reltol = 10**-5 #tighten for qmu analysese
[23257]59
60#solve
[24214]61md.verbose = verbose('000000000') # this line is recommended
[23793]62md = solve(md, 'Stressbalance', 'overwrite', 'y')
[23257]63md.qmu.results = md.results.dakota
64
65#test on thickness
[25010]66h = np.zeros(npart)
67for i in range(npart):
[23793]68 h[i] = md.qmu.results.dresp_out[i].mean
[23257]69
70#project onto grid
[25107]71thickness = h[(partition + 1).flatten()]
[23257]72
73#Fields and tolerances to track changes
[23793]74field_names = ['Thickness']
[23257]75field_tolerances = [1e-10]
[23793]76field_values = [thickness]
Note: See TracBrowser for help on using the repository browser.