1 | #Test Name: SquareSheetShelfTranSSA3dAggressiveRegionalOutput
|
---|
2 | import numpy as np
|
---|
3 | from model import *
|
---|
4 | from socket import gethostname
|
---|
5 |
|
---|
6 | from triangle import *
|
---|
7 | from setmask import *
|
---|
8 | from parameterize import *
|
---|
9 | from setflowequation import *
|
---|
10 | from solve import *
|
---|
11 | from frictioncoulomb import frictioncoulomb
|
---|
12 | from ContourToMesh import ContourToMesh
|
---|
13 | from regionaloutput import regionaloutput
|
---|
14 |
|
---|
15 | md=triangle(model(),'../Exp/Square.exp',150000.)
|
---|
16 | md=setmask(md,'../Exp/SquareShelf.exp','')
|
---|
17 | md=parameterize(md,'../Par/SquareSheetShelf.py')
|
---|
18 | md.geometry.bed=copy.deepcopy(md.geometry.base)
|
---|
19 | pos=np.nonzero(md.mask.groundedice_levelset<0.)
|
---|
20 | md.geometry.bed[pos]=md.geometry.bed[pos]-10
|
---|
21 | md.friction=frictioncoulomb()
|
---|
22 | md.friction.coefficient=20*np.ones(md.mesh.numberofvertices)
|
---|
23 | md.friction.p=1*np.ones(md.mesh.numberofelements)
|
---|
24 | md.friction.q=1*np.ones(md.mesh.numberofelements)
|
---|
25 | md.friction.coefficientcoulomb=0.02*np.ones(md.mesh.numberofvertices)
|
---|
26 | md.transient.isthermal=False
|
---|
27 | md.transient.isgroundingline=True
|
---|
28 | md.groundingline.migration='AggressiveMigration';
|
---|
29 | md.mesh.scale_factor=1.1*np.ones((md.mesh.numberofvertices))
|
---|
30 |
|
---|
31 | md.settings.output_frequency=2
|
---|
32 | md=setflowequation(md,'SSA','all')
|
---|
33 | md.cluster=generic('name',gethostname(),'np',3)
|
---|
34 |
|
---|
35 | regionalmask=np.zeros((md.mesh.numberofvertices))
|
---|
36 | inflag=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,'../Exp/SquareHalfRight.exp','node',1)
|
---|
37 | regionalmask[np.nonzero(inflag)[0]] = 1.
|
---|
38 | md.transient.requested_outputs=['default','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1','IceMass1','IceVolume1','IceVolumeAboveFloatation1','IceVolumeAboveFloatation2','IceVolumeAboveFloatation','IceMassScaled1','IceVolumeScaled1','IceVolumeAboveFloatationScaled1','IceVolumeAboveFloatationScaled2']
|
---|
39 |
|
---|
40 | md.outputdefinition.definitions=[regionaloutput('name','GroundedArea1','outputnamestring','GroundedArea','mask',regionalmask,'definitionstring','Outputdefinition1'),
|
---|
41 | regionaloutput('name','FloatingArea1','outputnamestring','FloatingArea','mask',regionalmask,'definitionstring','Outputdefinition2'),
|
---|
42 | regionaloutput('name','TotalFloatingBmb1','outputnamestring','TotalFloatingBmb','mask',regionalmask,'definitionstring','Outputdefinition3'),
|
---|
43 | regionaloutput('name','TotalGroundedBmb1','outputnamestring','TotalGroundedBmb','mask',regionalmask,'definitionstring','Outputdefinition4'),
|
---|
44 | regionaloutput('name','IceMass1','outputnamestring','IceMass','mask',regionalmask,'definitionstring','Outputdefinition5'),
|
---|
45 | regionaloutput('name','IceVolume1','outputnamestring','IceVolume','mask',regionalmask,'definitionstring','Outputdefinition6'),
|
---|
46 | regionaloutput('name','IceVolumeAboveFloatation1','outputnamestring','IceVolumeAboveFloatation','mask',regionalmask,'definitionstring','Outputdefinition7'),
|
---|
47 | regionaloutput('name','TotalSmb1','outputnamestring','TotalSmb','mask',regionalmask,'definitionstring','Outputdefinition8'),
|
---|
48 | regionaloutput('name','IceVolumeAboveFloatation2','outputnamestring','IceVolumeAboveFloatation','maskexpstring','../Exp/SquareHalfRight.exp','definitionstring','Outputdefinition9','model',md),
|
---|
49 | regionaloutput('name','IceMassScaled1','outputnamestring','IceMassScaled','mask',regionalmask,'definitionstring','Outputdefinition10'),
|
---|
50 | regionaloutput('name','IceVolumeScaled1','outputnamestring','IceVolumeScaled','mask',regionalmask,'definitionstring','Outputdefinition11'),
|
---|
51 | regionaloutput('name','IceVolumeAboveFloatationScaled1','outputnamestring','IceVolumeAboveFloatationScaled','mask',regionalmask,'definitionstring','Outputdefinition12'),
|
---|
52 | regionaloutput('name','IceVolumeAboveFloatationScaled2','outputnamestring','IceVolumeAboveFloatationScaled','maskexpstring','../Exp/SquareHalfRight.exp','definitionstring','Outputdefinition13','model',md)]
|
---|
53 |
|
---|
54 | md.extrude(3,1.)
|
---|
55 | md2=copy.deepcopy(md)
|
---|
56 | md2.collapse()
|
---|
57 | md=solve(md,'Transient')
|
---|
58 |
|
---|
59 | #Fields and tolerances to track changes
|
---|
60 | field_names =['IceMass1','IceVolume1','IceVolumeAboveFloatation1','IceVolumeAboveFloatation21','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1','IceMassScaled1','IceVolumeScaled1','IceVolumeAboveFloatationScaled1','IceVolumeAboveFloatationScaled21','IceMass3','IceVolume3','IceVolumeAboveFloatation3','IceVolumeAboveFloatation23','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3','IceMassScaled3','IceVolumeScaled3','IceVolumeAboveFloatationScaled3','IceVolumeAboveFloatationScaled23','ExtrudedMask','CollapsedMask']
|
---|
61 | field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
|
---|
62 | field_values=[\
|
---|
63 | md.results.TransientSolution[0].IceMass1,\
|
---|
64 | md.results.TransientSolution[0].IceVolume1,\
|
---|
65 | md.results.TransientSolution[0].IceVolumeAboveFloatation1,\
|
---|
66 | md.results.TransientSolution[0].IceVolumeAboveFloatation2,\
|
---|
67 | md.results.TransientSolution[0].Thickness,\
|
---|
68 | md.results.TransientSolution[0].GroundedArea1,\
|
---|
69 | md.results.TransientSolution[0].FloatingArea1,\
|
---|
70 | md.results.TransientSolution[0].TotalFloatingBmb1,\
|
---|
71 | md.results.TransientSolution[0].TotalGroundedBmb1,\
|
---|
72 | md.results.TransientSolution[0].TotalSmb1,\
|
---|
73 | md.results.TransientSolution[0].IceMassScaled1,\
|
---|
74 | md.results.TransientSolution[0].IceVolumeScaled1,\
|
---|
75 | md.results.TransientSolution[0].IceVolumeAboveFloatationScaled1,\
|
---|
76 | md.results.TransientSolution[0].IceVolumeAboveFloatationScaled2,\
|
---|
77 | md.results.TransientSolution[2].IceMass1,\
|
---|
78 | md.results.TransientSolution[2].IceVolume1,\
|
---|
79 | md.results.TransientSolution[2].IceVolumeAboveFloatation1,\
|
---|
80 | md.results.TransientSolution[2].IceVolumeAboveFloatation2,\
|
---|
81 | md.results.TransientSolution[2].Thickness,\
|
---|
82 | md.results.TransientSolution[2].GroundedArea1,\
|
---|
83 | md.results.TransientSolution[2].FloatingArea1,\
|
---|
84 | md.results.TransientSolution[2].TotalFloatingBmb1,\
|
---|
85 | md.results.TransientSolution[2].TotalGroundedBmb1,\
|
---|
86 | md.results.TransientSolution[2].TotalSmb1,\
|
---|
87 | md.results.TransientSolution[2].IceMassScaled1,\
|
---|
88 | md.results.TransientSolution[2].IceVolumeScaled1,\
|
---|
89 | md.results.TransientSolution[2].IceVolumeAboveFloatationScaled1,\
|
---|
90 | md.results.TransientSolution[2].IceVolumeAboveFloatationScaled2,\
|
---|
91 | len(md.outputdefinition.definitions[0].mask),\
|
---|
92 | len(md2.outputdefinition.definitions[0].mask),\
|
---|
93 | ]
|
---|