Ignore:
Timestamp:
12/17/21 12:21:15 (3 years ago)
Author:
Mathieu Morlighem
Message:

CHG: account for passive elements now if the ice levelset crosses the domain

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/jl/core/elements.jl

    r26736 r26738  
    4646        end
    4747end #}}}
     48function InputUpdateFromVector(element::Tria, vector::Vector{Float64}, enum::IssmEnum, layout::IssmEnum) #{{{
     49
     50        lidlist = element.vertexids
     51        data = Vector{Float64}(undef, 3)
     52
     53        if(layout==VertexSIdEnum)
     54                for i in 1:3
     55                        data[i] = vector[element.vertices[i].sid]
     56                        @assert isfinite(data[i])
     57                end
     58                SetTriaInput(element.inputs, enum, P1Enum, lidlist, data)
     59        else
     60                error("layout ", layout, " not supported yet");
     61        end
     62end #}}}
    4863function Update(element::Tria, inputs::Inputs, index::Int64, md::model, finiteelement::IssmEnum) #{{{
    4964
     
    108123        InputServe!(element,input)
    109124        return input
     125
     126end # }}}
     127function GetInputListOnNodes!(element::Tria, vector::Vector{Float64}, enum::IssmEnum) # {{{
     128
     129        #Get Input first
     130        input = GetInput(element, enum)
     131
     132        #Get value at each vertex (i.e. P1 Nodes)
     133        gauss=GaussTria(P1Enum)
     134        for i in 1:gauss.numgauss
     135                vector[i] = GetInputValue(input, gauss, i)
     136        end
    110137
    111138end # }}}
     
    197224        end
    198225end#}}}
     226function IsIceInElement(element::Tria) #{{{
     227        #We consider that an element has ice if at least one of its nodes has a negative level set
     228
     229        input=GetInput(element, MaskIceLevelsetEnum)
     230
     231        if GetInputMin(input)<0
     232                return true
     233        else
     234                return false
     235        end
     236
     237end#}}}
    199238function GetIcefrontCoordinates!(element::Tria, xyz_front::Matrix{Float64}, xyz_list::Matrix{Float64}, levelsetenum::IssmEnum) #{{{
    200239
Note: See TracChangeset for help on using the changeset viewer.