MeshKernel is library for creating and editing meshes. It supports 1D & 2D unstructured meshes as well as curvilinear meshes.
The library is separated in an API namespace (MeshKernelApi), used for communication with the client and a backend namespace (MeshKernel), where the algorithms are implemented. The API namespace contains several structures used as parameters for the API methods (see API usage section). These structures must be mirrored in the client application and filled with appropriate values.
The requirements are:
- CMake 3.14 or higher
- A C++17 compatible compiler
- The Boost libraries
- Git
- Doxygen (optional)
On windows precompiled boost binaries (with MSVC compiler) can be downloaded here:
https://sourceforge.net/projects/boost/files/boost-binaries/
Once installed, modify boost environmental variables accordingly. For example:
BOOST_INCLUDEDIR=C:\Apps\boost_1_70_0
BOOST_LIBRARYDIR=C:\Apps\boost_1_70_0\lib64-msvc-14.1
To use an IDE, such as Visual Studio:
cmake -S . -B xbuild -G"Visual Studio 16 2019"
cmake --open xbuild
To configure:
cmake -S . -B build
To build:
cmake --build build
To build docs (requires Doxygen, output in build/docs/html
):
cmake --build build --target docs
- Creating a triangular mesh inside a polygon
In this example a mesh is created by discretizing the polygon perimeter with the desired edge length
- Mesh orthogonalization
Finite volume staggered flow solvers require the mesh to be as much orthogonal as possible. MeshKernel provides an algorithm to adapt the mesh and achieve a good balance between mesh orthogonality and smothness.
- Curvilinear mesh generation
Curvilinear meshes for rivers can be generated using splines.
- Mesh refinement
A mesh can be refined in areas based on samples or polygon selections