[21827] | 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 |
|
---|
| 30 | md.settings.output_frequency=2
|
---|
| 31 | md=setflowequation(md,'SSA','all')
|
---|
| 32 | md.cluster=generic('name',gethostname(),'np',3)
|
---|
| 33 |
|
---|
| 34 | regionalmask=np.zeros((md.mesh.numberofvertices))
|
---|
| 35 | inflag=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,'../Exp/SquareHalfRight.exp','node',1)
|
---|
| 36 | regionalmask[np.nonzero(inflag)[0]] = 1.
|
---|
| 37 | md.transient.requested_outputs=['default','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1','IceMass1','IceVolume1','IceVolumeAboveFloatation1','IceVolumeAboveFloatation2','IceVolumeAboveFloatation']
|
---|
| 38 |
|
---|
| 39 | md.outputdefinition.definitions=[regionaloutput('name','GroundedArea1','outputnamestring','GroundedArea','mask',regionalmask,'definitionstring','Outputdefinition1'),
|
---|
| 40 | regionaloutput('name','FloatingArea1','outputnamestring','FloatingArea','mask',regionalmask,'definitionstring','Outputdefinition2'),
|
---|
| 41 | regionaloutput('name','TotalFloatingBmb1','outputnamestring','TotalFloatingBmb','mask',regionalmask,'definitionstring','Outputdefinition3'),
|
---|
| 42 | regionaloutput('name','TotalGroundedBmb1','outputnamestring','TotalGroundedBmb','mask',regionalmask,'definitionstring','Outputdefinition4'),
|
---|
| 43 | regionaloutput('name','IceMass1','outputnamestring','IceMass','mask',regionalmask,'definitionstring','Outputdefinition5'),
|
---|
| 44 | regionaloutput('name','IceVolume1','outputnamestring','IceVolume','mask',regionalmask,'definitionstring','Outputdefinition6'),
|
---|
| 45 | regionaloutput('name','IceVolumeAboveFloatation1','outputnamestring','IceVolumeAboveFloatation','mask',regionalmask,'definitionstring','Outputdefinition7'),
|
---|
| 46 | regionaloutput('name','TotalSmb1','outputnamestring','TotalSmb','mask',regionalmask,'definitionstring','Outputdefinition8'),
|
---|
| 47 | regionaloutput('name','IceVolumeAboveFloatation2','outputnamestring','IceVolumeAboveFloatation','maskexpstring','../Exp/SquareHalfRight.exp','definitionstring','Outputdefinition9','model',md)]
|
---|
| 48 |
|
---|
| 49 | md.extrude(3,1.)
|
---|
| 50 | md2=copy.deepcopy(md)
|
---|
| 51 | md2.collapse()
|
---|
| 52 | md=solve(md,'Transient')
|
---|
| 53 |
|
---|
| 54 | #Fields and tolerances to track changes
|
---|
| 55 | field_names =['IceMass1','IceVolume1','IceVolumeAboveFloatation1','IceVolumeAboveFloatation21','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1','IceMass3','IceVolume3','IceVolumeAboveFloatation3','IceVolumeAboveFloatation23','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3','ExtrudedMask','CollapsedMask']
|
---|
| 56 | 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]
|
---|
| 57 | field_values=[\
|
---|
| 58 | md.results.TransientSolution[0].IceMass1,\
|
---|
| 59 | md.results.TransientSolution[0].IceVolume1,\
|
---|
| 60 | md.results.TransientSolution[0].IceVolumeAboveFloatation1,\
|
---|
| 61 | md.results.TransientSolution[0].IceVolumeAboveFloatation2,\
|
---|
| 62 | md.results.TransientSolution[0].Thickness,\
|
---|
| 63 | md.results.TransientSolution[0].GroundedArea1,\
|
---|
| 64 | md.results.TransientSolution[0].FloatingArea1,\
|
---|
| 65 | md.results.TransientSolution[0].TotalFloatingBmb1,\
|
---|
| 66 | md.results.TransientSolution[0].TotalGroundedBmb1,\
|
---|
| 67 | md.results.TransientSolution[0].TotalSmb1,\
|
---|
| 68 | md.results.TransientSolution[2].IceMass1,\
|
---|
| 69 | md.results.TransientSolution[2].IceVolume1,\
|
---|
| 70 | md.results.TransientSolution[2].IceVolumeAboveFloatation1,\
|
---|
| 71 | md.results.TransientSolution[2].IceVolumeAboveFloatation2,\
|
---|
| 72 | md.results.TransientSolution[2].Thickness,\
|
---|
| 73 | md.results.TransientSolution[2].GroundedArea1,\
|
---|
| 74 | md.results.TransientSolution[2].FloatingArea1,\
|
---|
| 75 | md.results.TransientSolution[2].TotalFloatingBmb1,\
|
---|
| 76 | md.results.TransientSolution[2].TotalGroundedBmb1,\
|
---|
| 77 | md.results.TransientSolution[2].TotalSmb1,\
|
---|
| 78 | len(md.outputdefinition.definitions[0].mask),\
|
---|
| 79 | len(md2.outputdefinition.definitions[0].mask),\
|
---|
| 80 | ]
|
---|