HOHQMesh.jl
This package is a Julia frontend to the Fortran-based High Order Hex-Quad Mesher (a.k.a. HOHQMesh) created and developed by David A. Kopriva. It augments HOHQMesh with interactive functionality that gives a user the ability to create, visualize, and generate high-order meshes. HOHQMesh.jl is available on Linux, MacOS, and Windows.
Further, one can seamlessly integrate meshes generated by HOHQMesh into a Julia-based simulation workflow. The presentation From Mesh Generation to Adaptive Simulation: A Journey in Julia, originally given as part of JuliaCon 2022, outlines how to use HOHQMesh.jl together with Trixi.jl for an adaptive simulation in two spatial dimensions on a complex domain. More details as well as code to run the simulation presented can be found at the reproducibility repository for the presentation. An additional resource is a tutorial available in the Trixi.jl documentation that describes how to run a simulation on an unstructured quadrilateral mesh.
Installation
If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6 and above.
HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:
julia> import Pkg; Pkg.add("HOHQMesh")
HOHQMesh.jl depends on the binary distribution of the HOHQMesh mesh generator, which is available via the Julia package HOHQMesh_jll.jl and which is automatically installed as a dependency.
Usage
In the Julia REPL, you can load HOHQMesh with
julia> using HOHQMesh
and then happily generate away!
Two 2D examples GingerbreadMan
and NACA0012
and a 3D example Snake
(all from HOHQMesh itself) come delivered with this package. You can generate a mesh for them by executing
julia> control_file = joinpath(HOHQMesh.examples_dir(), "GingerbreadMan.control")
julia> output = generate_mesh(control_file)
You will then find the resulting output files (mesh, plot file, statistics) in the designated output directory, which defaults to out
. The GingerbreadMan.control
file will yield the following mesh,
while the 3D file Snake.control
produces this mesh:
Examples scripts of interactive mesh generation tools are available in the examples/ subdirectory. These example scripts are prefaced with the phrase interactive_
. There is a brief summary at the top of each interactive
example script that describes the mesh it will create and the features of HOHQMesh it uses. An example script can be executed from a Julia REPL session with an include(...)
statement, e.g.,
julia> include(joinpath(HOHQMesh.examples_dir(), "interactive_outer_box_two_circles.jl"))
The resulting output mesh and plot files are saved in the output directory out
as designated in the example script. Mesh statistics are printed to the screen.
The interactive functionality uses Makie.jl to visualize the boundary curves and mesh from the interactive tool. A Makie backend, such as GLMakie, can be loaded in addition to HOHQMesh
julia> using Pkg; Pkg.add("GLMakie")
julia> using GLMakie
Now, running the example script produces a figure in addition to the mesh and plot files that are saved and the output of mesh statistics to the screen.
Further explanation of the interactive functionality can be found here. Additional examples are available in the Tutorials.
Authors
HOHQMesh.jl is maintained by the Trixi authors. Its principal developers are Andrew Winters (Linköping University, Sweden) and David A. Kopriva. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
License and contributing
HOHQMesh.jl is licensed under the MIT license (see License). HOHQMesh itself is also available under the MIT license. Since HOHQMesh is an open-source project, we are very happy to accept contributions from the community. Please refer to Contributing for more details. To get in touch with the developers, join us on Slack or create an issue.
Acknowledgements
The authors would like to thank David A. Kopriva for making the sources of HOHQMesh available as open source, and for assisting with making it work with Julia.