|
|
# Mesh Generation
|
|
|
|
|
|
In order to generate the mesh, it is advised to use QGIS, a geographic information system, to easily handle with multiple geographic data sources. A python script then generates the desired mesh.
|
|
|
|
|
|
## Download
|
|
|
|
|
|
First, you need to download QGIS and topographic (and bathymetry) data to define the domain boundaries. Open Street map is a good choice for coastlines, and ETOPO will serve at a first stage, even though more accurate region-specific data may be needed.
|
|
|
|
|
|
- QGIS :
|
|
|
- https://www.qgis.org/fr/site/forusers/download.html
|
|
|
- topography (Open Street map) :
|
... | ... | @@ -12,34 +17,25 @@ |
|
|
|
|
|
## QGIS
|
|
|
|
|
|
Open QGIS
|
|
|
|
|
|
Save new project
|
|
|
Here are the steps to define the domain boundaries.
|
|
|
|
|
|
Import topography (and bathymetry) data (click and drag)
|
|
|
|
|
|
Select entity with a rectangle ![rect-select](/uploads/8c06c33278e317a7e745366a8fd42edd/rect-select.png) + "Ctrl+C"
|
|
|
|
|
|
Create new shapefile layer ![shape-layer](/uploads/d8716ff5f35a04247f607c47b1711988/shape-layer.png) (with type 'line')
|
|
|
- Open QGIS
|
|
|
- Save new project
|
|
|
- Import topography (and bathymetry) data (click and drag)
|
|
|
- Select entity with a rectangle ![rect-select](/uploads/8c06c33278e317a7e745366a8fd42edd/rect-select.png) + "Ctrl+C"
|
|
|
- Create new shapefile layer ![shape-layer](/uploads/d8716ff5f35a04247f607c47b1711988/shape-layer.png) (with type 'line')
|
|
|
- layer -> create new Shapefile layer
|
|
|
|
|
|
Select new layer
|
|
|
|
|
|
Open the "edit mode" ![edit](/uploads/8812573e53ef13f95dc3bee0824cdb6a/edit.png) + "Ctrl+V"
|
|
|
|
|
|
Add one (or more) entity ![entity](/uploads/da2647c08fc1eb25ba052f2c8c7ff28d/entity.png) in order to close the domain
|
|
|
- Select new layer
|
|
|
- Open the "edit mode" ![edit](/uploads/8812573e53ef13f95dc3bee0824cdb6a/edit.png) + "Ctrl+V"
|
|
|
- Add one (or more) entity ![entity](/uploads/da2647c08fc1eb25ba052f2c8c7ff28d/entity.png) in order to close the domain
|
|
|
- Click left to add lines, click right to stop (choose an ID)
|
|
|
|
|
|
(Save your changes !)
|
|
|
|
|
|
In edit mode, open table of attributes ![image](/uploads/accc84d339bf26eb1855ec1c757963d5/attr-field.png)
|
|
|
|
|
|
Add a column ![new-column](/uploads/2c28abb33ca2fe51ea97c3f1017b6293/new-column.png), name it "entity" of type "integer"
|
|
|
- (Save your changes !)
|
|
|
- In edit mode, open table of attributes ![image](/uploads/accc84d339bf26eb1855ec1c757963d5/attr-field.png)
|
|
|
- Add a column ![new-column](/uploads/2c28abb33ca2fe51ea97c3f1017b6293/new-column.png), name it "entity" of type "integer"
|
|
|
- Give value "1" by default
|
|
|
- Select line(s) ![select](/uploads/b95d581d39ba6b59289abe757b32be22/select.png) and change entity. Give as many different integers as necessary to produce the mesh and run the model (but not too many).
|
|
|
- Hint : write the numbers on a paper sheet with their meaning (1 : coast).
|
|
|
|
|
|
Save all and close QGIS
|
|
|
- Save all and close QGIS
|
|
|
|
|
|
## Python script
|
|
|
|
... | ... | @@ -103,7 +99,7 @@ Generate the mesh with the following arguments : |
|
|
- minimum of the mesh size
|
|
|
- name of the output mesh
|
|
|
- projection system
|
|
|
- name of the dictionariy with the "tags map"
|
|
|
- name of the dictionary with the "tags map"
|
|
|
|
|
|
```python
|
|
|
slimPre.mesh_shp(["./coast.shp"], -78 , 23, fsize, 1000/R,
|
... | ... | |