[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 |
|
---|
[23793] | 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))
|
---|
[21827] | 30 |
|
---|
[23793] | 31 | md.settings.output_frequency = 2
|
---|
| 32 | md = setflowequation(md, 'SSA', 'all')
|
---|
| 33 | md.cluster = generic('name', gethostname(), 'np', 3)
|
---|
[21827] | 34 |
|
---|
[23793] | 35 | regionalmask = np.zeros((md.mesh.numberofvertices))
|
---|
| 36 | inflag = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, '../Exp/SquareHalfRight.exp', 'node', 1)
|
---|
[21827] | 37 | regionalmask[np.nonzero(inflag)[0]] = 1.
|
---|
[23793] | 38 | md.transient.requested_outputs = ['default', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 'IceMass1', 'IceVolume1', 'IceVolumeAboveFloatation1', 'IceVolumeAboveFloatation2', 'IceVolumeAboveFloatation', 'IceMassScaled1', 'IceVolumeScaled1', 'IceVolumeAboveFloatationScaled1', 'IceVolumeAboveFloatationScaled2']
|
---|
[21827] | 39 |
|
---|
[23793] | 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)]
|
---|
[21827] | 53 |
|
---|
[23793] | 54 | md.extrude(3, 1.)
|
---|
| 55 | md2 = copy.deepcopy(md)
|
---|
[21827] | 56 | md2.collapse()
|
---|
[23793] | 57 | md = solve(md, 'Transient')
|
---|
[21827] | 58 |
|
---|
| 59 | #Fields and tolerances to track changes
|
---|
[23793] | 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 = [md.results.TransientSolution[0].IceMass1,
|
---|
| 63 | md.results.TransientSolution[0].IceVolume1,
|
---|
| 64 | md.results.TransientSolution[0].IceVolumeAboveFloatation1,
|
---|
| 65 | md.results.TransientSolution[0].IceVolumeAboveFloatation2,
|
---|
| 66 | md.results.TransientSolution[0].Thickness,
|
---|
| 67 | md.results.TransientSolution[0].GroundedArea1,
|
---|
| 68 | md.results.TransientSolution[0].FloatingArea1,
|
---|
| 69 | md.results.TransientSolution[0].TotalFloatingBmb1,
|
---|
| 70 | md.results.TransientSolution[0].TotalGroundedBmb1,
|
---|
| 71 | md.results.TransientSolution[0].TotalSmb1,
|
---|
| 72 | md.results.TransientSolution[0].IceMassScaled1,
|
---|
| 73 | md.results.TransientSolution[0].IceVolumeScaled1,
|
---|
| 74 | md.results.TransientSolution[0].IceVolumeAboveFloatationScaled1,
|
---|
| 75 | md.results.TransientSolution[0].IceVolumeAboveFloatationScaled2,
|
---|
| 76 | md.results.TransientSolution[2].IceMass1,
|
---|
| 77 | md.results.TransientSolution[2].IceVolume1,
|
---|
| 78 | md.results.TransientSolution[2].IceVolumeAboveFloatation1,
|
---|
| 79 | md.results.TransientSolution[2].IceVolumeAboveFloatation2,
|
---|
| 80 | md.results.TransientSolution[2].Thickness,
|
---|
| 81 | md.results.TransientSolution[2].GroundedArea1,
|
---|
| 82 | md.results.TransientSolution[2].FloatingArea1,
|
---|
| 83 | md.results.TransientSolution[2].TotalFloatingBmb1,
|
---|
| 84 | md.results.TransientSolution[2].TotalGroundedBmb1,
|
---|
| 85 | md.results.TransientSolution[2].TotalSmb1,
|
---|
| 86 | md.results.TransientSolution[2].IceMassScaled1,
|
---|
| 87 | md.results.TransientSolution[2].IceVolumeScaled1,
|
---|
| 88 | md.results.TransientSolution[2].IceVolumeAboveFloatationScaled1,
|
---|
| 89 | md.results.TransientSolution[2].IceVolumeAboveFloatationScaled2,
|
---|
| 90 | len(md.outputdefinition.definitions[0].mask),
|
---|
| 91 | len(md2.outputdefinition.definitions[0].mask)]
|
---|