source: issm/trunk/test/NightlyRun/test218.js@ 21341

Last change on this file since 21341 was 21341, checked in by Mathieu Morlighem, 8 years ago

merged trunk-jpl and trunk for revision 21337

File size: 3.4 KB
Line 
1//Test Name: SquareShelfConstrainedDakotaB
2var md = new model();
3function zeros(...args) {
4 var array = [];
5 for (var i = 0; i < args[0]; ++i) {
6 array.push(args.length == 1 ? 0 : zeros(args.slice(1)));
7 }
8 return array;
9}
10var md = new model();
11squaremesh(model(),1000000,1000000,5,5);
12setmask(md,'all','');
13parameterize(md);
14setflowequation(md,'SSA','all');
15//md.cluster=generic('name',oshostname(),'np',3);
16
17//redo the parameter file for this special shelf.
18//constant thickness, constrained (vy=0) flow into an icefront,
19//from 0 m/yr at the grounding line.
20
21//needed later
22ymin=Math.min.apply(null, md.mesh.y);
23ymax=Math.max.apply(null, md.mesh.y);
24xmin=Math.min.apply(null, md.mesh.x);
25xmax=Math.max.apply(null, md.mesh.x);
26
27di=md.materials.rho_ice/md.materials.rho_water;
28
29h=1000;
30md.geometry.thickness=h*ones(md.mesh.numberofvertices,1);
31md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
32md.geometry.surface=md.geometry.base+md.geometry.thickness;
33
34//Initial velocity and pressure
35md.initialization.vx=zeros(md.mesh.numberofvertices,1);
36md.initialization.vy=zeros(md.mesh.numberofvertices,1);
37md.initialization.vz=zeros(md.mesh.numberofvertices,1);
38md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
39
40//Materials
41md.initialization.temperature=(273-20)*ones(md.mesh.numberofvertices,1);
42md.materials.rheology_B=paterson(md.initialization.temperature);
43md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
44
45//Boundary conditions:
46md.stressbalance.spcvx=null*ones(md.mesh.numberofvertices,1);
47md.stressbalance.spcvy=null*ones(md.mesh.numberofvertices,1);
48md.stressbalance.spcvz=null*ones(md.mesh.numberofvertices,1);
49
50//constrain flanks to 0 normal velocity
51pos=[];
52for (var i = 0; i < md.mesh.x==xmin | md.mesh.x==xmax.length; ++i) {
53if ((md.mesh.x==xmin | md.mesh.x==xmax[i] !== 0)) {
54 pos.push(i);
55};
56md.stressbalance.spcvx(pos)=0;
57md.stressbalance.spcvz(pos)=null;
58
59//constrain grounding line to 0 velocity
60pos=[];
61for (var i = 0; i < md.mesh.y==ymin.length; ++i) {
62if ((md.mesh.y==ymin[i] !== 0)) {
63 pos.push(i);
64};
65md.stressbalance.spcvx(pos)=0;
66md.stressbalance.spcvy(pos)=0;
67
68//partitioning
69md.qmu.numberofpartitions=md.mesh.numberofvertices;
70partitioner(md,'package','linear','npart',md.qmu.numberofpartitions);
71md.qmu.partition=md.qmu.partition-1;
72
73//Dakota options
74
75//dakota version
76version=IssmConfig('_DAKOTA_VERSION_'); version=version.slice(0,2); version=str2num(version);
77
78//variables
79md.qmu.variables.rheology_B=normal_uncertain('scaled_MaterialsRheologyB',1,.05);
80
81//responses
82md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
83
84//method
85md.qmu.method =dakota_method('nond_l');
86
87//parameters
88md.qmu.params.direct=true;
89md.qmu.params.interval_type='forward';
90
91if (version>=6,) {
92 md.qmu.params.analysis_driver='matlab';
93 md.qmu.params.evaluation_scheduling='master';
94 md.qmu.params.processors_per_evaluation=2;
95} else {
96 md.qmu.params.analysis_driver='stressbalance';
97 md.qmu.params.evaluation_concurrency=1;
98}
99
100//imperative!
101md.stressbalance.reltol=10^-10; //tighten for qmu analysese
102md.qmu.isdakota=1;
103
104//solve
105md=solve(md,'Stressbalance','overwrite','y');
106
107//Fields and tolerances to track changes
108md.qmu.results=md.results.dakota;
109md.results.dakota.importancefactors=importancefactors(md,'scaled_MaterialsRheologyB','MaxVel')';
110field_names =['importancefactors'];
111field_tolerances=[1e-10];
112field_values=[
113 md.results.dakota.importancefactors,
114 ];
Note: See TracBrowser for help on using the repository browser.