[26711] | 1 | #!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
|
---|
| 2 | include("issm.jl")
|
---|
| 3 | using .ISSM
|
---|
| 4 |
|
---|
| 5 | md = ISSM.model()
|
---|
| 6 | md = ISSM.triangle(md,"../../test/Exp/Pig.exp",10000.)
|
---|
| 7 | md = ISSM.setmask(md,"../../test/Exp/PigShelves.exp","../../test/Exp/PigIslands.exp")
|
---|
| 8 |
|
---|
[26713] | 9 | #Initial velocity and geometry
|
---|
| 10 | x = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","x")
|
---|
| 11 | y = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","y")
|
---|
| 12 | vx_obs = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","vx_obs")
|
---|
| 13 | vy_obs = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","vy_obs")
|
---|
| 14 | index = Int.(ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","index"))
|
---|
| 15 | surface = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","surface")
|
---|
| 16 | thickness = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","thickness")
|
---|
| 17 | bed = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","bed")
|
---|
| 18 | md.initialization.vx=ISSM.InterpFromMeshToMesh2d(index, x, y, vx_obs, md.mesh.x, md.mesh.y, 0.0)
|
---|
| 19 | md.initialization.vy=ISSM.InterpFromMeshToMesh2d(index, x, y, vy_obs, md.mesh.x, md.mesh.y, 0.0)
|
---|
| 20 | md.geometry.surface = ISSM.InterpFromMeshToMesh2d(index, x, y, surface, md.mesh.x, md.mesh.y, 0.0)
|
---|
| 21 | md.geometry.thickness = ISSM.InterpFromMeshToMesh2d(index, x, y, thickness, md.mesh.x, md.mesh.y, 0.0)
|
---|
| 22 | md.geometry.base=md.geometry.surface .- md.geometry.thickness
|
---|
| 23 | md.geometry.bed =md.geometry.base
|
---|
| 24 | pos = findall(md.mask.ocean_levelset.<0)
|
---|
| 25 | md.geometry.bed[pos] = ISSM.InterpFromMeshToMesh2d(index, x, y, bed, md.mesh.x[pos], md.mesh.y[pos])
|
---|
[26711] | 26 |
|
---|
| 27 | md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
|
---|
| 28 | md.materials.rheology_n=3*ones(md.mesh.numberofelements)
|
---|
[26713] | 29 | md.friction.coefficient=50*ones(md.mesh.numberofvertices)
|
---|
[26711] | 30 |
|
---|
| 31 | md.stressbalance.restol=0.05
|
---|
[26713] | 32 | md.stressbalance.reltol=1.0
|
---|
[26711] | 33 | md.stressbalance.abstol=NaN
|
---|
| 34 |
|
---|
| 35 | #Boundary conditions
|
---|
| 36 | md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
|
---|
| 37 | md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
|
---|
| 38 | pos = findall(md.mesh.vertexonboundary)
|
---|
| 39 | md.stressbalance.spcvx[pos] .= 0.0
|
---|
| 40 | md.stressbalance.spcvy[pos] .= 0.0
|
---|
| 41 |
|
---|
| 42 | md=ISSM.solve(md,"Stressbalance")
|
---|