Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smoothing function applied to initial glacier geometry #101

Open
facusapienza21 opened this issue Feb 7, 2023 · 1 comment
Open

Smoothing function applied to initial glacier geometry #101

facusapienza21 opened this issue Feb 7, 2023 · 1 comment
Assignees
Labels

Comments

@facusapienza21
Copy link
Member

We are using the smooth!() function defined in utils.jl to smooth the initial ice thickness of all the glaciers following what it seems to be one step in a diffusivity equation solver.

"""
    smooth!(A)
Smooth data contained in a matrix with one time step (CFL) of diffusion.
"""
@views function smooth!(A)
    A[2:end-1,2:end-1] .= A[2:end-1,2:end-1] .+ 1.0f0./4.1f0.*(diff(diff(A[:,2:end-1], dims=1), dims=1) .+ diff(diff(A[2:end-1,:], dims=2), dims=2))
    A[1,:]=A[2,:]; A[end,:]=A[end-1,:]; A[:,1]=A[:,2]; A[:,end]=A[:,end-1]
    return
end

function smooth(A)
    A_smooth = A[2:end-1,2:end-1] .+ 1.0f0./4.1f0.*(diff(diff(A[:,2:end-1], dims=1), dims=1) .+ diff(diff(A[2:end-1,:], dims=2), dims=2))
    @tullio A_smooth_pad[i,j] := A_smooth[pad(i-1,1,1),pad(j-1,1,1)] # Fill borders 
    return A_smooth_pad
end

This is currently just been used in get_initial_geometries(), which in principle shouldn't have effects in the UDE behavior. However, this could induce instabilities and it is not clear this transformation is mathematically correct.

@facusapienza21 facusapienza21 self-assigned this Feb 7, 2023
@mauro3
Copy link

mauro3 commented Apr 30, 2023

What is the purpose of the smoothing? If it is physics related, it should probably be formulated in terms of a multiple of local ice thickness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants