|
|
> **Note:** The following is an excerpt from the BASEMENT v3.0.2 User Manual. You can find the full version [here](http://people.ee.ethz.ch/~basement/baseweb/download/documentation/BMdoc_User_Manual_v3-0-2.pdf).
|
|
|
|
|
|
## 3.1 General
|
|
|
|
|
|
In order to provide a free and open source solution for the creation of computational meshes (Pre-Processing) and to visualize simulation results (Post-Processing) the plugin BASEmesh for the free and open source geographic information system (GIS) software [QGIS](https://qwww.qgis.org/) was developed.
|
|
|
|
|
|
BASEmesh is a QGIS plugin developed to generate triangulated computational grids for BASEMENT based on the advanced mesh generator [Triangle](https://www.cs.cmu.edu/~quake/triangle.html) by Jonathan R. Shewchuk (Shewchuk, 1996) as meshing algorithm. Currently, there are two versions of BASEmesh available. BASEmesh version 1.4.4 contains all the features including a workflow to generate large meshes for BASEMENT v3.x. This version of BASEmesh is supported up to QGIS version 2.18.28. BASEmesh 1.4.5 contains the same features as version 1.4.4 but is supported and tested for QGIS version 3.10 and newer.
|
|
|
|
|
|
The generation of a computational mesh compatible with BASEMENT version 3.0 is twofold and depends on the domain size and mesh resolution. For small meshes (< 10’000 - 50’000 cells), the procedure to create a computational mesh (2dm) using BASEmesh is the same as for 2D meshes in BASEMENT version 2.8 and the tutorials can be found either in Section 3.3.5 of BASEMENT User Manual version 2.8 or in the Tutorial 1 and 2 of the Pre-Processing section in the Tutorial Manual of version 2.8 available on <https://www.basement.ethz.ch/>. For larger meshes, the creation of shapefiles during the usual procedure strongly slows down the meshing process. Therefore, the pre-processing for large meshes follows a new procedure, which avoids the shapefiles generation of the quality mesh.
|
|
|
|
|
|
## 3.2 Installation
|
|
|
|
|
|
BASEmesh is at present available on a specific Plugin repository which has to be connected manually in the QGIS plugin manager. In contrast to other plugins, it is not available via the official QGIS plugin repository which is set as default in every QGIS installation.
|
|
|
|
|
|
To install BASEmesh, follow these steps:
|
|
|
|
|
|
1. Start QGIS
|
|
|
|
|
|
2. Load the QGIS plugin manager by choosing *Manage and Install Plugins...* in the menu *Plugins* in the QGIS main toolbar
|
|
|
|
|
|
3. Go to *Settings* (you should now see the connection to the official QGIS-plugin repository)
|
|
|
|
|
|
4. Click on *Add...* and give a name, e.g. ‘BASEmesh repository’
|
|
|
|
|
|
5. Enter the repository address: <https://people.ee.ethz.ch/~basement/qgis_plugins/qgis_plugins.xml> (do not copy paste this address, because it might include line breaks)
|
|
|
|
|
|
6. Press *OK*
|
|
|
|
|
|
7. The additional repository should now be visible (make sure that the *Status* is *connected*)
|
|
|
|
|
|
8. Go to *All* in the menu of the plugin manager and search for ‘BASEmesh’
|
|
|
|
|
|
9. Choose the BASEmesh plugin (if several are available, choose the one with the highest version number) and press *Install plugin*
|
|
|
|
|
|
## 3.3 Generation of small meshes
|
|
|
|
|
|
This section illustrates how a small computational mesh (<10’000-50’000 cells) can be generated for simulations in BASEMENT v3.0. The computational mesh is generated using the QGIS plugin BASEmesh in the exact same way as for BASEMENT version 2.8. The mesh generation process is described in detail in Section 3.3.5 of BASEMENT User Manual version 2.8 or in the Tutorial 1 and 2 of the Pre-Processing section in the Tutorial Manual of version 2.8 available on <https://www.basement.ethz.ch/>.
|
|
|
|
|
|
The computational mesh with the elevation information located at the mesh vertices is exported as a 2dm
|
|
|
file and a separate stringdefs list is generated during this process. In order to use the 2dm file for simulations with BASEMENT v3.0, the stringdefs list and name have to be added manually at the end of the computational mesh (2dm) and saved under a new name (Figure 3.1). The modified 2dm file is the one used in simulation with BASEMENT v3.0.
|
|
|
|
|
|
![figure_3-1](uploads/0e760bd734c90058c2326c56b8f60a40/figure_3-1.png)
|
|
|
|
|
|
The elevation information is saved on the mesh vertices and needs to be interpolated to obtain one uniformly distributed elevation information allocated to the corresponding cell. The interpolation method (mean, median, maximum, minimum or weighted) is selected inside the GEOMETRY block of the configuration file model.json.
|
|
|
|
|
|
```json
|
|
|
"GEOMETRY": {
|
|
|
"mesh_file": "Flaz_mesh.2dm",
|
|
|
"INTERPOLATION": {
|
|
|
"method": "weighted"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
More details concerning the elevation interpolation methods are given in the case example of the Migration Guide. Figure 3.2 shows the BASEmesh workflow for small meshes with the transformations required for numerical simulations with BASEMENT v3.0. The procedure for small meshes enables to use existing computational meshes of BASEMENT version 2.x (.2dm) into BASEMENT version 3.x following the two last steps of Figure 3.2.
|
|
|
|
|
|
![figure_3-2](uploads/2868f7c572b4d58424e4800653477fdf/figure_3-2.png)
|
|
|
|
|
|
## 3.4 Generation of large meshes
|
|
|
|
|
|
![figure_3-3](uploads/32ff8c4d8b088186b4961d33044012bd/figure_3-3.png)
|
|
|
|
|
|
During the quality meshing process, the BASEmesh plugin generates shape files that are significantly slowing down the procedure in case of large meshes. Therefore, a new procedure was developed to generate large computational meshes, which skips the generation of shape files. This new procedure for large mesh is available in BASEmesh versions 1.4.4 (up to QGIS version 2.18.28) and 1.4.5 (from QGIS version 3.10 and newer) under the button “XL Mesh” and combines the steps of quality meshing, elevation interpolation, nodestring definition and mesh export. The graphical user interface of the “XL Mesh” procedure is illustrated in Figure 3.3. The resulting meshes are directly compatible with BASEMENT version 3.x.
|
|
|
|
|
|
The general procedure to obtain the .2dm mesh file remains mostly the same. Be aware that all the attributes (elevation data, breaklines, points defining the regions, stringdefs,...) should be defined before starting the large mesh generation.
|
|
|
|
|
|
The computational mesh is generated with Jonathan Richard Shewchuk’s excellent unstructured 2D-mesh generator TRIANGLE (Shewchuk, 1996) and requires the specification of all geometric information about the computational domain:
|
|
|
|
|
|
- *Model boundary*: extent of the computational domain.
|
|
|
|
|
|
- *Breaklines*: distinct interruptions of the surface slope (dyke crest, river side walls, ... ) which shall be preserved in the computational mesh.
|
|
|
|
|
|
- *Regions*: distinct regions of the mesh surrounded by breaklines, which can be characterized by a material index (matID) and maximum triangle area, or can be specified as a hole in the mesh.
|
|
|
|
|
|
- *Holes*: parts within the mesh which are excluded from modelling (e.g. buildings).
|
|
|
These parts are defined by special points (layer region_points) surrounded by
|
|
|
breaklines.
|
|
|
|
|
|
- *Vertices*: enforced geometric points in the mesh (e.g. measurement points).
|
|
|
|
|
|
Further, the mesh quality can be influenced by the “TRIANGLE parameters”. It is important to keep in mind, that the quality of the computational mesh influences the results of your numerical analysis, e.g. stability, computation time, accuracy, etc. Parameters of major importance are:
|
|
|
|
|
|
- *Maximum area constraints*: definition of the mesh density using maximum area
|
|
|
constraints for the triangular mesh elements. The maximum area is defined as attribute in the layer region_points and holds for a specific Region surrounded by breaklines.
|
|
|
|
|
|
- *Dividing constraints*: With this attribute in the layer Breaklines one can enforce a certain number of mesh elements along a breakline. This is of major importance for the use of inner boundaries in BASEMENT, where an equal number of mesh elements at the upstream and downstream interface is required.
|
|
|
|
|
|
- *Minimum triangle angle*: no elements with angles smaller than the minimum angle specified are generated (smaller angles lead to less elements, while larger angles lead to more elements).
|
|
|
|
|
|
- *Relative snapping tolerance*: defines, how far two point coordinates may be located apart to still be considered at the same location. The default value is 10E-6. Increasing this tolerance can help to avoid problems due to improper snapping of vertices (line or polygon features) and points in OGIS.
|
|
|
|
|
|
In BASEMENT a list of node IDs is defined as *stringdef* or *nodestring*. They can be defined on the basis of breaklines with a *stringdef* attribute and can be used to define a boundary condition or an output along these nodes. The IDs correspond to the node IDs of the computational mesh. In comparison to the Stringdef tool, the defined stringdefs are added at the end of the .2dm mesh file with the tag “NS” for Nodestring and are **not** written in a separate file. Please Note: In BASEMENT version 3.x, the number of nodes per nodestring is limited to 40, i.e. larger nodestrings must be split up.
|
|
|
|
|
|
Finally, topographical information contained in the elevation model be be interpolated on the computational mesh, i.e. an elevation value is assigned to each node of the computational grid. As a result, the final computational mesh is obtained, which is then exported and can be used for simulations. The elevation data serving as input can be provided in two different elevation model types:
|
|
|
|
|
|
1. *Elevation mesh* triangulated from pointwise elevation data (TIN). The routine identifies the coordinates of each quality mesh node and determines any underlying elevation mesh element. Two methods are used for data interpolation:
|
|
|
|
|
|
- If an underlying elevation mesh element is found, the elevation of the quality mesh node is interpolated at its x-y-coordinates. This is the normal case, since the elevation mesh usually covers the whole computational domain. Nodes interpolated with this method are marked by a 1 in the element - field of the node attribute table. If the quality mesh node is located at the exact coordinates of an elevation mesh node, its height value is preserved exactly.
|
|
|
|
|
|
- If no underlying elevation mesh element is found, the quality node elevation is set to that of the nearest node of the elevation mesh. This is the case if quality mesh nodes lie outside the domain covered by the elevation mesh or when holes are present in the elevation mesh. It may lead to incorrect quality mesh node elevations. Hence, it is recommended to choose a bigger domain for elevation meshing than for quality meshing. Nodes interpolated this way are marked by a 0 in the element - field of the result attribute table and are named ‘with special treatment’ in the QGIS status messages.
|
|
|
|
|
|
2. Digital elevation map as raster data which contains the topography as DTM. The raster elevation data is directly mapped on the computational mesh nodes without interpolation. If no corresponding raster cell is found, the elevation is set to ‘-9999’.
|
|
|
|
|
|
Be aware that the interpolation process can be time consuming.
|
|
|
|
|
|
The mesh is automatically exported in the .2dm format in the specified directory. During the meshing process temporary files are generated. These can be automatically deleted by checking the box “Delete temporary files created by Triangle”. |