Skip to content

Commit

Permalink
add levelset, need to compare with ISSM matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
enigne committed Apr 8, 2024
1 parent 4dbf2bf commit 0f7778d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/core/analyses/levelsetanalysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function CreateConstraints(analysis::LevelsetAnalysis,constraints::Vector{Constr
end#}}}
function CreateNodes(analysis::LevelsetAnalysis,nodes::Vector{Node},md::model) #{{{

numdof = 2
numdof = 1
for i in 1:md.mesh.numberofvertices
push!(nodes,Node(i,i,true,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
end
Expand Down Expand Up @@ -87,6 +87,9 @@ function Core(analysis::LevelsetAnalysis,femmodel::FemModel)# {{{
println(" call computational core:");
solutionsequence_linear(femmodel,analysis)

# TODO: add reinitialization
# save
RequestedOutputsx(femmodel, [MaskIceLevelsetEnum])
return nothing
end #}}}
function CreateKMatrix(analysis::LevelsetAnalysis,element::Tria)# {{{
Expand Down
2 changes: 1 addition & 1 deletion src/core/elements.jl
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function InputUpdateFromSolutionOneDof(element::Tria, ug::Vector{Float64},enum::
for i in 1:numdof values[i]=ug[doflist[i]] end

#Add back to Mask
AddInput(element, enum, value, P1Enum)
AddInput(element, enum, values, P1Enum)

return nothing

Expand Down
4 changes: 2 additions & 2 deletions test/test807.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using dJUICE

md = model()
md = triangle(md,issmdir()*"/test/Exp/Square.exp",50000.)
md = triangle(md,issmdir()*"/test/Exp/Square.exp",200000.)
md = setmask(md,"all","")

#Geometry
Expand Down Expand Up @@ -52,7 +52,7 @@ md.basalforcings.groundedice_melting_rate=5*ones(md.mesh.numberofvertices)
# mask
Lx = xmax - xmin
alpha = 2.0/3.0
md.mask.ice_levelset = ((x .- alpha*Lx).>0) .- ((x .- alpha*Lx).<0)
md.mask.ice_levelset = ((md.mesh.x .- alpha*Lx).>0) .- ((md.mesh.x .- alpha*Lx).<0)

md.levelset.kill_icebergs = 0
# time stepping
Expand Down

0 comments on commit 0f7778d

Please sign in to comment.