 # Calculate on variable depth scalar field

Hello everyone,

In order to solver a simple mildslope equation (in 2D), I’d like to make calculation over a bathymetry (variable depth). I have a grid with the coordinates x, y, z .

My problem is in the mildslope equation, I will have to use a function h(x,y) = z (the bathymetry) over all the domain. But I can’t find a way to define thise function. Do you have any idea ?

What I did tried for now :

I made a mesh Th on Freefem, and obtained Th.x and Th.y. I then made a nearest neighbour (with python) between Th.x,Th.y and x,y,z to make correspond the “z” of my grid to my mesh.
I thought I could then re-use my new grid on Freefem to solve my problem but did not succeed.

Best,

Hello again,

As I did not succeed to solve my problem, I come back here.

To make it simplier, let’s say I would like to solve a Helmholtz equation in 2D :

``````\Delta f(x,y) = -k^2 f(x,y)
``````

where k is a function of z, the depth.

(k is obtained via the dispersion relation, with variable depth).

My problem is that I don’t know how to take this third dimension into account while solving this problem using FreeFem.
Could any of you help me ?

Thank you,

Regards