Giter Site home page Giter Site logo

trixi-framework / hohqmesh.jl Goto Github PK

View Code? Open in Web Editor NEW
30.0 6.0 7.0 1.27 MB

HOHQMesh.jl is a Julia wrapper for the HOHQMesh mesh generator, which allows to produce curved quadrilateral and hexahedral meshes for high-order numerical simulations.

Home Page: https://trixi-framework.github.io/HOHQMesh.jl

License: MIT License

Julia 100.00%
mesh-generation high-order-methods geometry

hohqmesh.jl's Introduction

HOHQMesh.jl

Docs-stable Docs-dev Build Status Coveralls License: MIT

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. It further allows one to seamlessly integrate meshes generated by HOHQMesh into a Julia-based simulation workflow. For example, running a simulation on an unstructured quadrilateral mesh with Trixi.jl. HOHQMesh.jl is available on Linux, MacOS, and Windows.

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,

gingerbreadman_with_edges_400px

while the 3D file Snake.control produces this mesh:

snake_400px

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.

box_two_circles

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.md). 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.md 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.

hohqmesh.jl's People

Contributors

andrewwinters5000 avatar arpit-babbar avatar danieldoehring avatar davidakopriva avatar dependabot[bot] avatar ranocha avatar sloede avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hohqmesh.jl's Issues

TODO before and after HOHQMesh and HOHQMesh_jll become registered packages

Right now, there are a few quirks that result from HOHQMesh and HOHQMesh_jll not being registered packages. These should be removed once they are available in the general registry.

Once HOHQMesh_jll is a registered package:

  • Remove main Manifest.toml
  • Remove HOHQMesh_jll dependency from docs/Project.toml
  • Use normal workflow in .github/workflows/Documenter.yml

Once HOHQMesh is a registered package:

  • Make stable the canonical URL in docs/make.jl
  • Update README.md:
    • installation procedures
    • Link to stable docs
  • Change main link to stable docs

Support mesh generation from and to strings

Right now, mesh generation only works from a file (the control file) to a file (the resulting mesh). For convenience and easier integration into a Julia-only workflow, it would be good to have the options to directly generate a mesh from a string (from wherever it might come from) and return the generated mesh as a string.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Deprecation warning from Makie.jl for `resolution` keyword

When I try to generate a mesh using the great wavy walls example by @andrewwinters5000, which I adapted in https://github.com/trixi-framework/talk-2024-dlr-braunschweig-trends-dgsem/blob/f57927e5acce89c8c26ac0dd7444725e00e39e92/examples/generate_mesh_cylinder_with_sine_walls.jl, I get the following deprecation warning from Makie.jl:

┌ Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
└ @ Makie ~/.julia/packages/Makie/VRavR/src/scenes.jl:220

Any idea what's wrong here and how to fix it?

Checklist about HQMTool

This serves as a meta issue on the interactive HQMTool capabilities and implementation. It follows the "make it work, make it nice" philosophy. The phrase "make it nice" can be interpreted as make the implementation more Julian.

Make it work:

  • Incorporate functionality and write corresponding tests #15
  • Update figures in the docs now that boundary curves are labeled in a different way.
  • Add example recipe scripts to the examples folders so it is easy for others to try out the new features

Make it nice:

  • Improve export and only send out the necessary functions
  • Fix the license. Currently year is set to 2010 which is incorrect. Possibly remove license from all files and let the main license cover everything
  • Clean up include statements as some are now redundant
  • Do not need explicit variable type statements in most functions because they have unique names
  • Function names are written in camel case whereas snake case is the Julia standard. Change this globally so, for example, getBackgroundGridSize becomes get_background_grid_size
  • Keep the docs consistent with all these updates #17
  • Convert all the warnings ending in "Try again." to either (i) proper errors with @error such that way we can use @ test_throws ErrorException for testing or (ii) proper warnings with @warning
  • If possible, increase the "power" of the generic remove! command to encompass more routines
  • Condense all plotting information into a new projectView struct such that the Project manages the model / curves in projectDictionary and the plotting is all managed via projectView
  • Multiple dispatch on the curve type in curvePoints(crvDict, N) to remove the if logic
  • Exported directory examples_dir() will clash with Trixi if a user wants to use the Trixi and HOHQMesh packages examples_dir() is no longer exported.

Minor stuff:

  • Indentation and spacing conventions
  • Plotting constants like MODEL and REFINEMENTS in Viz/VizProject.jl little unwieldy. Is there a better way? Now exported for easy user access.

Add proper tests

Right now, we only use a crude smoke test. We should at least properly verify the mesh generation for a non-trivial 2D and a non-trivial 3D example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.