Computational models are increasingly used to study complex geophysical fluid dynamics and its interaction with biological and geochemical processes [24]. The potential insight from simulations has made such models a valuable tool in scientific research as well as engineering. Simulations are used to assess the impact of anthropogenic changes, the vulnerability of infrastructure to natural hazards [25][18] and in hydrocarbon exploration and sequestration research [16][17][22]. qmesh was built to facilitate one of the first stages in computational geophysical modelling: the specification of the simulation domain and its tessellation into discrete elements, commonly referred to as mesh generation. The predictive accuracy of simulations can be significantly affected by the mesh resolution, gradation and shape of mesh elements, collectively identified as “mesh quality”. Therefore, generation of high-quality meshes is fundamental to ocean and coastal modelling.

The paradigm of mesh generation in large-scale geophysical modelling can be broadly described as a two–step procedure. In the first step, the domain is defined in a topologically two-dimensional space, bounded by geophysical contours such as shorelines and open boundaries [1]. A finite, two-dimensional reference surface is thus defined, often on a geodetic datum, and a mesh is generated over this reference surface. If a two-dimensional approximation, such as the depth-averaged shallow water equations is sufficient, mesh-generation is complete. When a three-dimensional approximation is required, the second step is the projection of the surface mesh vertices at successive levels towards the domain floor, thus creating three-dimensional elements [1]. The second step requires little user intervention, so the first step has become a synonym for mesh generation, in the large–scale geophysical modelling context.

Despite the reduction of the relevant dimensions to just two, the production of quality meshes for geophysical domains can be an elaborate procedure [1][10][7][26][8]. A significant number of data sources must be combined to compose a geometrically complex domain, and the geometry of geophysical domains is one of the most widely known examples of fractal geometry in nature [27]. Geometrical length–scales across four orders of magnitude is typical in ocean modelling: For example in ocean modelling, the simulation domain size can span hundreds of kilometres, while the smallest bays can be tens of metres long. An even smaller scale may be relevant when the domain must accurately represent coastal infrastructure such as piers, pylons or embankments [28][20]. In addition to domain geometry, the flow typically exhibits a large range of scales, with many transient flow features, such as internal waves or jets, appearing due to the geometric complexity of the domain [29]. Therefore, a mesh must represent very complex domains with element sizes across a broad range of scales, with smaller elements in areas that require a higher fidelity, while gradation across element sizes must be smooth. Unstructured meshes are increasingly favoured in many models as they tend to satisfy the above requirements with relative ease [30].

High–quality generic unstructured mesh generation packages are available, enabling routine generation of meshes. However, the interface of most mesh generators is based on Computer Aided Design and Manufacture (CAD–CAM). Such interfaces have been developed for describing geometries produced by manufacturing and construction processes and do not facilitate use or manipulation of geographical data [31]. In particular, the fractal nature of ocean and coastal domains, as well as the various conventions used in geodetic coordinate reference systems are not natively expressed in CAD–CAM systems [31][20]. Combining shoreline or bathymetry data is a typical example; one may have to combine several global, national and regional data sets as well as data from very high–resolution surveys over relatively small regions. Each data–set can also differ at least in terms of extents, resolution, coordinate reference system and vertical zero–datums. Unlike CAD–CAM, Geographical Information Systems (GIS) have been developed specifically for storing and analysing geographical information. GIS packages are robust and widely used in research as well as in operational and strategic planning contexts, where resource management, hazard mitigation and infrastructure development are a few examples. Therefore, GIS packages are ideal for supplying mesh generators with the geospatial data they require.

Another important feature of GIS systems is their capability to interact with databases, allowing concurrent data analysis and manipulation. Databases can also be used to record data origin and evolution, termed data provenance [5]. However, databases in GIS systems are typically not maintained in a manner pertinent to scientific research, where the primary aim of data provenance is to show reproducibility [5]. The practice of Research Data Management (RDM) is aimed at addressing data provenance, attribution and reproducibility. A record of data and software depended upon is usually required as evidence of reproducibility, including scientific data and software used in preparation of simulations. Therefore, the reproducibility of numerical simulations relies, at least in part, on the ability to exactly reproduce the underlying mesh. The integration of RDM and mesh generation was motivated by the increased attention on the reproducibility of scientific computation [32], perhaps as much as open–source software. Also, public research bodies are adopting policies on data and software output from publicly–funded research to be made readily available, and provenance to be clearly identified [33][34][35]. In the industrial sector reproducibility, data archiving and data provenance are viewed as efficient modelling practices. Industry and governing bodies are also bound by regulatory frameworks which require public accesibility to data during the planning phase [36][37][38][39], as well as after commisioning [40][41], especially when data pertains to environmental impact of infrastructure.

Here we present the qmesh package, interfacing GIS with a mesh–generator and online data repositories. We link the abstractions offered by mesh generators and GIS packages and build tools that facilitate mesh–generation for coastal flow modelling. Unlike existing integrations of GIS and mesh generators, qmesh was principally developed as an object–oriented software library, accessible through an Application Programming Interface (API). In qmesh GIS capability is implemented through the use of existing and robust GIS implementations as generic libraries, rather than building extensions to a particular GIS implementation, such as is described in [42][10][7][26][8][15]. qmesh is thus a library with which command line utilities and a graphical interface have also been developed. The broader aim of qmesh development is the creation of robust, efficient, operational and user–friendly tools for mesh generation over geophysical domains. The qmesh design was centred around providing the following requirements:

  • Facilitation of domain geometry and mesh element size definitions;
  • An intuitive way of specifying boundary conditions and parameterizations;
  • The ability to use various geodetic coordinate reference systems;
  • Promotion of the reproducibility of output and citation of data provenance
  • Provision of an open–source and tested package.

[1](1, 2, 3) G J Gorman, M D Piggott, C C Pain, C R E de Oliveira, A P Umpleby, and A J H Goddard. Optimisation based bathymetry approximation through constrained unstructured mesh adaptivity. Ocean Model., 12(3–4):436–452, 2006.
[2]QGIS Development Team. QGIS Geographic Information System. Open Source Geospatial Foundation, 2009. URL:
[3]Christophe Geuzaine and Jean-François Remacle. Gmsh: A 3–D finite element mesh generator with built-in pre- and post-processing facilities. International Journal of Numerical Methods in Engineering, 79(11):1309–1331, 2009. doi:10.1002/nme.2579.
[4]Christian T Jacobs, Alexandros Avdis, Gerard J Gorman, and Matthew D Piggott. PyRDM: A Python-based library for automating the management and online publication of scientific software and data. Journal of Open Research Software, 2(1):e28, 2014. doi:10.5334/
[5](1, 2) C. T. Jacobs, A. Avdis, S. L. Mouradian, and M. D. Piggott. Integrating Research Data Management into Geographical Information Systems. In Proceedings of the 5th International Workshop on Semantic Digital Archives. 2015. URL:
[6]Jonathan Lambrechts, Richard Comblen, Vincent Legat, Christophe Geuzaine, and Jean-François Remacle. Multiscale mesh generation on the sphere. Ocean Dynamics, 58(5-6):461–473, 8~October 2008.
[7](1, 2) Thomas J Heinzer, M Diane Williams, Emin C Dogrul, Tariq N Kadir, Charles F Brush, and Francis I Chung. Implementation of a feature-constraint mesh generation algorithm within a GIS. Comput. Geosci., 49:46–52, December 2012.
[8](1, 2) Pat Prodanovic. QGIS as a pre-and post-processor for TELEMAC: mesh generation and output visualization. In 22nd TELEMAC-MASCARET User Conference. 15~October 2015.
[9]Fernando Pérez and Brian E. Granger. IPython: a system for interactive scientific computing. Computing in Science and Engineering, 9(3):21–29, May 2007. URL:, doi:10.1109/MCSE.2007.53.
[10](1, 2) G J Gorman, M Piggott, M R Wells, C C Pain, and P A Allison. A systematic approach to unstructured mesh generation for ocean modelling using GMT and terreno. Computers and Geosciences, 34(12):1721–1731, December 2008.
[11]Paul Wessel and Walter H F Smith. Free software helps map and display data. Eos Transactions AGU, 72(41):441–446, 1991.
[12]ESRI. ESRI shapefile technical description. Technical Report J-7855, Environmental Systems Research Institute, July 1998.
[13]S Legrand, V Legat, and E Deleersnijder. Delaunay mesh generation for an unstructured–grid ocean general circulation model. Ocean Modelling, 2(1–2):17–28, 2000.
[14]Sébastien Legrand, Eric Deleersnijder, Eric Delhez, and Vincent Legat. Unstructured, anisotropic mesh generation for the northwestern european continental shelf, the continental slope and the neighbouring ocean. Continental Shelf Research, 27(9):1344–1356, 15~May 2007.
[15]Jean-François Remacle and Jonathan Lambrechts. Fast and Robust Mesh Generation on the Sphere–Application to Coastal Domains. Procedia Engineering, 163:20–32, 2016.
[16]Matrin R Wells, Peter A Allison, Matthew D Piggott, Gary J Hampson, Christopher C Pain, and Gerard J Gorman. Tidal modelling of an ancient tide-dominated seaway, Part 1: Model validation and application to global Cretaceous (Aptian) tides. Journal of Sedimentary Research, 80:393–410, 2010. doi:10.2110/jsr.2010.044.
[17]Andrew J Mitchell, Peter A Allison, Gerald J Gorman, Matthew D Piggott, and Christopher C Pain. Tidal calculation in an ancient epicontinental sea: The Early Jurassic Laurasian Seaway. Geology, 39(3):207–210, 2011. doi:10.1130/G31496.1.
[18]Jon Hill, Gareth S Collins, Alexandros Avdis, Stephan C Kramer, and Matthew D Piggott. How does multiscale modelling and inclusion of realistic palaeobathymetry affect numerical simulation of the Storegga Slide tsunami? Ocean Modelling, 83:11–25, 2014. doi:10.1016/j.ocemod.2014.08.007.
[19]Technical Committee ISO/TC 46 (Information and documentation), Subcommittee SC 9 (Identification and description). ISO 26324:2012 Information and documentation – Digital object identifier system. Technical Report, International Organisation for Standardization, 2012.
[20](1, 2) Alexandros Avdis, T Christian Jacobs, Leo Simon Mouradian, Jon Hill, and D Matthew Piggott. Meshing ocean domains for coastal engineering applications. In M Papadrakakis, V Papadopoulos, G Stefanou, and V Plevris, editors, The European Community on Computational Methods in Applied Sciences and Engineering (ECCOMAS) VII Congress Proceedings, Crete, Greece, June 5–10. 2016. doi:10.6084/m9.figshare.4524629.
[21]A Pèrez-Ortiz, AGL Borthwick, J McNaughton, and A Avdis. Characterization of the tidal resource in rathlin sound. Renewable Energy, 2017. doi:10.1016/j.renene.2017.04.026.
[22]Daniel S Collins, Alexandros Avdis, Peter A Allison, H D Johnson, Jon Hill, Matthew D Piggott, M H A Hassan, and A R Damit. Tidal dynamics and mangrove carbon sequestration during the Oligo–Miocene in the south china sea. Nature communications, 2017. doi:10.1038/ncomms15698.
[23]Alexandros Avdis, Adam S Candy, Jon Hill, Stephan C Kramer, and Matthew D Piggott. Efficient unstructured mesh generation for marine renewable energy applications. Renewable Energy, 116:842–856, 2018. doi:10.1016/j.renene.2017.09.058.
[24]L Luo, J Wang, DJ Schwab, H Vanderploeg, G Leshkevich, X Bai, H Hu, and D Wang. Simulating the 1998 spring bloom in Lake Michigan using a coupled physical-biological model. Journal of Geophysical Research C: Oceans, 2012. doi:10.1029/2012JC008216.
[25]N M Hunter, P D Bates, S Neelz, G Pender, I Villanueva, N G Wright, D Liang, R A Falconer, B Lin, S Waller, A J Crossley, and D Mason. Benchmarking 2D hydraulic models for urban flood simulations. Proceedings of the Institution of Civil Engineers: Water Management, 161(1):13–30, February 2008.
[26](1, 2) P Berry, S Bonduá, V Bortolotti, C Cormio, and E M Vasini. A GIS-based open source pre-processor for georesources numerical modeling. Environmental Modelling & Software, 62:52–64, 2014.
[27]Benoit B Mandelbrot and John A Wheeler. The fractal geometry of nature. American Journal of Physics, 51(3):286–287, 1~March 1983.
[28]Junqiang Xia, Roger A Falconer, and Binliang Lin. Impact of different tidal renewable energy projects on the hydrodynamic processes in the Severn Estuary, UK. Ocean Modelling, 32(1–2):86–104, 2010.
[29]Olivia Bentley, L, Matthew D Piggott, Alexandros Avdis, and Peter Allison, A. Simulating mixing due to internal wave generation, propagation and breaking with adaptive mesh methods. Ocean Modelling, submitted, 2016.
[30]S Danilov. Ocean modeling on unstructured meshes. Ocean Modelling, 69:195–210, 2013. doi:10.1016/j.ocemod.2013.05.005.
[31](1, 2) A Keith Turner. Challenges and trends for geological modelling and visualisation. Bulletin of Engineering Geology and the Environment, 65(2):109–127, 7~December 2005. doi:10.1007/s10064-005-0015-0.
[32]R J LeVeque, I M Mitchell, and V Stodden. Reproducible Research for Scientific Computing: Tools and Strategies for Changing the Culture. Computing in Science and Engineering, 14(4):13–17, 2012. doi:10.1109/MCSE.2012.38.
[33]European Commission. Commission recommendation on access to and preservation of scientific information. 17~July 2012.
[34]European Commission. Communication towards better access to scientific information. 17~July 2012.
[35]RCUK. Guidance on best practice in the management of research data. 2015.
[36]Directive 2003/35/ec of the european parliament and of the council on providing for public participation in respect of the drawing up of certain plans and programmes relating to the environment and amending with regard to public participation and access to justice council directives 85/337/EEC and 96/61/EC – statement by the commission. 26~May 2003.
[37]Harbours, Docks, Piers and Ferries: The Harbour Works (Environmental Impact Assessment) Regulations 1999 No. 3445. 21~December 1999. URL:
[38]Environmental protection: the marine works (environmental impact assessment) regulations 2007 no. 1518. 21~May 2007.
[39]Electricity: The Offshore Electricity Development (Environmental Impact Assessment) Regulations (Northern Ireland) 2008 No. 55. 7~February 2008.
[40]Directive 2003/4/ec of the european parliament and of the council on public access to environmental information. 28~January 2003.
[41]Freedom of information, environmental protection: the environmental information regulations 2004 no. 3391. 21~December 2004.
[42]Canadian Hydraulic Centre. Reference manual for Blue Kenue. National Research Council, 1998.