... | ... | @@ -74,23 +74,27 @@ Get bathymetry data |
|
|
|
|
|
Define a mesh size field.
|
|
|
|
|
|
Here the resolution ranges from 1 to 10 km, linearly increasing with the distance to the coast. The mesh size should also depend on the bathymetry.
|
|
|
Here the resolution ranges from 1 to 10 km, linearly increasing with the distance to the coast. The mesh size should also depend on the bathymetry (here on the square root of the bathymetry).
|
|
|
|
|
|
```python
|
|
|
def fsize(x, y, z) :
|
|
|
d = distCoast.evaluate_geocentric(x,y,z)
|
|
|
l0 = 1000
|
|
|
l1 = 10000
|
|
|
d0 = 8000
|
|
|
d1 = 50000
|
|
|
if d < d0 :
|
|
|
s1 = l0
|
|
|
elif d < d1 :
|
|
|
f = (d-d0)/(d1-d0)
|
|
|
s1 = l0*(1-f) + l1 * f
|
|
|
else :
|
|
|
s1 = l1
|
|
|
return s1/R
|
|
|
def fsize(x, y, z) :
|
|
|
h = bath.evaluate_geocentric(x,y,z)
|
|
|
h2 = min(1000,max(5, -h))
|
|
|
s0 = 750* h2**.5
|
|
|
|
|
|
d = distCoast.evaluate_geocentric(x,y,z)
|
|
|
l0 = 1000
|
|
|
l1 = 10000
|
|
|
d0 = 8000
|
|
|
d1 = 50000
|
|
|
if d < d0 :
|
|
|
s1 = l0
|
|
|
elif d < d1 :
|
|
|
f = (d-d0)/(d1-d0)
|
|
|
s1 = l0*(1-f) + l1 * f
|
|
|
else :
|
|
|
s1 = l1
|
|
|
return min(s0, s1)/R
|
|
|
```
|
|
|
|
|
|
Use a python dictionary to associate the entity tags defined in QGIS with names.
|
... | ... | |