This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples/ folder constructs an identical example mesh as shown in the Guided tour using generic function calls.
A thorough description of the functions can be found in the API section.
The general workflow of the interactive mesh functionality within a REPL session is
c = new(name, startLocation [x,y,z], endLocation [x,y,z]) *Straight Line*
+ c = new(name, center [x,y,z], radius, startAngle, endAngle) *Circular Arc*
+ c = new(name, xEqn, yEqn, zEqn) *Parametric equation*
+ c = new(name, dataFile) *Spline with data from a file*
+ c = new(name, nKnots, knotsMatrix) *Spline with given knot values*
Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.
All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.
HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).
HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.
Developer Certificate of Origin
+Version 1.1
+
+Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+1 Letterman Drive
+Suite D4700
+San Francisco, CA, 94129
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+
+Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+(a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+(b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+(c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+(d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
Settings
This document was generated with Documenter.jl version 0.27.25 on Sunday 1 September 2024. Using Julia version 1.10.5.
When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:
Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.
If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.
Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like VS Code with the Julia extension). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.
Set the new version number in Project.toml according to the Julian version of semver. Commit and push.
Comment @JuliaRegistrator register on the commit setting the version number.
JuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.
Increment the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.
You can build the documentation of HOHQMesh.jl locally by running
julia --project=docs -e 'using Pkg; Pkg.instantiate(); include("docs/make.jl")'
from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).
Settings
This document was generated with Documenter.jl version 0.27.25 on Sunday 1 September 2024. Using Julia version 1.10.5.
In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.
All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).
If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.
git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git
+# get latest main from the main repo
+git checkout main
+git pull
+# create a new branch for a cool new feature, bug fix, ...
+git checkout -b YOUR_BRANCH_NAME
+# do some work and push it to your fork
+git push -u myfork
+# go to https://github.com/trixi-framework/HOHQMesh.jl/pull
+# and create a PR from your new branch
Why using pull requests?
Immediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.
With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.
Avoid committing unwanted files
When you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.
For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:
Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.
Execute git fetch to get the latest changes from the repository.
Make sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.
Merge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.
In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.
If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should
merge the current main to your branch
run tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs
properly comment your code
delete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)
remove debug statements
add a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)
After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.
Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.
Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.
Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).
Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:
Update your clone by running git fetch.
Check out main using git checkout main.
Delete merged branch locally with git branch -d yourbranch.
Remove local references to deleted remote branch by executing git remote prune origin.
You can now proceed with your next changes by starting again at the top.
Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):
If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running
git reset HEAD~
This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.
If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.
Large files
You should never try to fix this yourself, as it potentially disrupts/destroys the work of others!
Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):
Tell everyone to commit and push their changes to the repository.
Fix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.
Perform the following steps to clean up the Git repository:
cd /tmp
+
+# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/
+
+# Get fresh clone of repo (so you can throw it away in case there is a problem)
+git clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git
+
+# Clean up repo of all files larger than 10M
+java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git
+
+# Enter repo
+cd HOHQMesh.jl.git
+
+# Clean up reflog and force aggressive garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
+
+# Push changes
+git push
+
+# Delete clone
+rm -rf HOHQMesh.jl.git
Tell everyone to clean up their local working copies by performing the following steps (also do this yourself):
# Enter repo
+cd HOHQMesh.jl
+
+# Get current changes
+git fetch
+
+# Check out the fixed branch
+git checkout branchname
+
+# IMPORTANT: Do a rebase instead of a pull!
+git rebase
+
+# Clean reflog and force garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
IMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.
Settings
This document was generated with Documenter.jl version 0.27.25 on Sunday 1 September 2024. Using Julia version 1.10.5.
diff --git a/dev/guided-tour/index.html b/dev/guided-tour/index.html
new file mode 100644
index 00000000..e1c238eb
--- /dev/null
+++ b/dev/guided-tour/index.html
@@ -0,0 +1,62 @@
+
+Guided tour · HOHQMesh.jl
In this brief overview, we highlight two scripts from the examples/ folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.
A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute
A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute
For completeness, we provide the example script and walk-through each step in the construction of the Project below.
using HOHQMesh
+
+# Create a new project with the name "IceCreamCone", which will also be the
+# name of the mesh, plot and stats files, written to output folder `out`.
+
+p = newProject("IceCreamCone", "out")
+
+# Outer boundary for this example mesh is a complete circle. Add it into the project.
+
+circ = newCircularArcCurve("outerCircle", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, "degrees")
+addCurveToOuterBoundary!(p, circ)
+
+# Inner boundary is three curves. Two straight lines and a circular arc.
+# Note the three curve are connected to ensure a counter-clockwise orientation
+# as required by HOHQMesh
+
+# Create the three interior curves. The individual names of each curve in the inner
+# chain are used internally by HOHQMesh and are output as the given boundary names in
+# the mesh file.
+
+cone1 = newEndPointsLineCurve("cone1", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])
+iceCream = newCircularArcCurve("iceCream", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, "degrees")
+cone2 = newEndPointsLineCurve("cone2", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])
+
+# Assemble the three curve in a closed chain oriented counter-clockwise. The chain
+# name `IceCreamCone` is only used internally by HOHQMesh.
+
+addCurveToInnerBoundary!(p, cone1, "IceCreamCone")
+addCurveToInnerBoundary!(p, iceCream, "IceCreamCone")
+addCurveToInnerBoundary!(p, cone2, "IceCreamCone")
+
+# Adjust some `RunParameters` and overwrite the defaults values. In this case, we
+# set a new value for the boundary order polynomial representation and adjust the
+# output mesh file format to be `sem`
+
+setPolynomialOrder!(p, 4)
+setPlotFileFormat!(p, "sem")
+
+# A background grid is required for the mesh generation. In this example we lay a
+# background grid of Cartesian boxes with size 0.5.
+
+addBackgroundGrid!(p, [0.5, 0.5, 0.0])
+
+# Plot the project model curves and background grid
+
+if isdefined(Main, :Makie)
+ plotProject!(p, MODEL+GRID)
+ @info "Press enter to generate the mesh and update the plot."
+ readline()
+ else # Throw an informational message about plotting to the user
+ @info "To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again."
+ end
+
+# Generate the mesh. This produces the mesh and TecPlot files `IceCreamCone.mesh` and `IceCreamCone.tec`
+# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is
+# updated with the mesh that was generated.
+
+generate_mesh(p)
+
+# After the mesh successfully generates mesh statistics, such as the number of corner nodes,
+# the number of elements etc., are printed to the REPL
The first line creates a new project, where the mesh and plot file names will be derived from the project name, "IceCreamCone" written to the specified folder.
To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:
Parametric equations
Cubic Splines
Lines defined by their end points
Circular arcs
In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.
Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, "IceCreamCone" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.
For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script resets the polynomial order (default = 5) and the plot file format (default = "skeleton").
One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, only the mesh size needs to be specified using
The example sets the background mesh size to be 0.5 in the x and y directions. The z component is ignored.
The script finishes by generating the quad mesh and plotting the results, as shown below
Finally, the script returns the project so that it can be edited further, if desired.
To save a control file for HOHQMesh, simply invoke
saveProject(proj::Project)
where the name of the control file (traditionally with a .control extension) matches the name of the project proj. saveProject is automatically called when a mesh is generated.
Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.
Settings
This document was generated with Documenter.jl version 0.27.25 on Sunday 1 September 2024. Using Julia version 1.10.5.
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.
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.
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
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.,
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.
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.
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.
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.
Settings
This document was generated with Documenter.jl version 0.27.25 on Sunday 1 September 2024. Using Julia version 1.10.5.
The supplied name will be the default name of the control, mesh, and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.
The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.
If the model is modified and you want to re-plot with the new values, invoke
updatePlot!(proj::Project, options)
but generally the plot will be updated automatically as you build the model.
HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.
The available mesh file formats are "ISM", "ISM-V2", or "ABAQUS". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.
The plot file (which can be viewed with something like VisIt or ParaView) format is either "skeleton" or "sem". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.
By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with
A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available in the documentation and in Minoli2011.
To change the defaults, the smoother parameters can be set/enquired with the functions
There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must be specified after a new project has been created.
Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.
Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).
where name labels the refinement region, the type is either "smooth" or "sharp", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.
The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a "chain" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.
The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.
The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.
See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.
Returns a new set of parametric equation. Equations must be of the form
<function name>(<argument>) = ...
The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
A cubic spline is defined by an array of knots, $t_j$, $x_j$, $y_j$, $z_j$. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the $t$, $x$, $y$, $z$ values, e.g.
The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either "degrees" or "radians". That argument is optional, and defaults to "degrees".
Using the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using
The syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.
Alternatively, all curves on an outer or inner boundary with the same name can have that name changed all at once everywhere in the project with the function
The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.
Several scripts are available in the examples/ folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.
Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.
The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.
To generate a mesh interactively you
Create a project with a user given projectName and folder where any generated files are to be saved
p = newProject(<projectName>, <folder>)
Both of these input arguments are strings.
Create inner and outer boundary curves from the available types
c = newEndPointsLineCurve(<name>, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*
+c = newCircularArcCurve(<name>, center [x, y, z], radius, startAngle, endAngle, units = "degrees" or "radians") *Circular Arc*
+c = newParametricEquationCurve(<name>, xEqn, yEqn, zEqn) *Parametric equation*
+c = newSplineCurve(<name>, dataFile) *Spline with data from a file*
+c = newSpline(<name>, nKnots, knotsMatrix) *Spline with given knot values*
See Defining curves for further details on the different curve type currently supported by HOHQMesh.
The generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.
Add curves to build the model to see what you have added,
addOuterBoundaryCurve!(p, <curveName>) *Add outer boundary curve*
+addInnerBoundaryCurve!(p, <curveName>, <InnerBoundaryName>) *Add curve to an inner boundary*
For a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.
Curves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.
Visualize the project's model, if desired
plotProject!(p, MODEL)
Plots are updated in response to user interactions. However, to update the plot at any time, use
updatePlot!(p, options)
Options are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.
Visualization requirement
The interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.
Set the background grid
When no outer boundary curve is present, the background grid can be set with
addBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])
Or
addBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])
The first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.
When an outer boundary is present the background grid can be set as
addBackgroundGrid!(p, [dx, dy, dz])
where the spacing controls the number of elements in each direction.
Background grid
A background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.
Adjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by
setPolynomialOrder!(p, order)
The background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately
The mesh file will be saved in <folder> with the name <projectName>.mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name <projectName>.control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.
The generate_mesh function has two optional arguments. The first is the Boolean verbose argument. One can pass verbose=true to output additional messages and information during the meshing process. The second is the integer subdivision_maximum argument. The default value is subdivision_maximum=8, meaning that elements can be up to a factor of 2^8 smaller than the existing background grid. Note, think before adjusting the subdivision_maximum level! It is often the case that adjusting the boundary curves, background grid size, adding local refinement regions, or some combination of these adjustments removes the need to adjust the subdivision depth.
All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.
Settings
This document was generated with Documenter.jl version 0.27.25 on Sunday 1 September 2024. Using Julia version 1.10.5.
Copyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-Lakemper
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Settings
This document was generated with Documenter.jl version 0.27.25 on Sunday 1 September 2024. Using Julia version 1.10.5.
Add the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version
Add the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.
Add an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.
Return a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.
Generate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.
You can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.
You can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.
To override the maximum number of allowable subdivisions in the quad tree during meshing adjust the value of subdivision_maximum. The default value of subdivision_maximum is 8, meaning that elements can be up to a factor of 2^8 smaller than the background grid. Note, think before doing this! It could be adjusting the boundary curves, background grid size, adding local refinement regions, or some combination may remove the need to adjust the subdivision depth.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
Generate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.
This function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.
With the optional argument verbose one can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information.
To override the maximum number of allowable subdivisions in the quad tree during meshing adjust the value of subdivision_maximum. The default value of subdivision_maximum is 8, meaning that elements can be up to a factor of 2^8 smaller than the background grid. Note, think before doing this! It could be adjusting the boundary curves, background grid size, adding local refinement regions, or some combination may remove the need to adjust the subdivision depth.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
getCurveType(crv::Dic{String,Any})
+
+Get the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,
+`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.
Get the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.
Plot objects specified by the plotOptions. Construct the plotOptions by the sum of what is to be drawn from the choices MODEL, GRID, MESH, REFINEMENTS.
Example: To plot the model and the grid, plotOptions = MODEL + GRID. To plot just the mesh, plotOptions = MESH.
To plot everything, plotOptions = MODEL + GRID + MESH + REFINEMENTS
Contents are overlaid in the order: GRID, MESH, MODEL, REFINEMENTS
Requires Makie.jl
Please note that for this function to work, you need to load Makie.jl in your REPL (e.g., by calling using GLMakie).
Set the file format for the plot file. Acceptable choices are "sem", which includes interior nodes and boundary nodes and "skeleton", which includes only the corner nodes.
This document was generated with Documenter.jl version 0.27.25 on Sunday 1 September 2024. Using Julia version 1.10.5.
diff --git a/dev/search_index.js b/dev/search_index.js
new file mode 100644
index 00000000..820c187b
--- /dev/null
+++ b/dev/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"contributing/#Contributing","page":"Contributing","title":"Contributing","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.","category":"page"},{"location":"contributing/#Developer-Certificate-of-Origin-(Version-1.1)","page":"Contributing","title":"Developer Certificate of Origin (Version 1.1)","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"The following text was taken from https://developercertificate.org:","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"Developer Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n1 Letterman Drive\nSuite D4700\nSan Francisco, CA, 94129\n\nEveryone is permitted to copy and distribute verbatim copies of this\nlicense document, but changing it is not allowed.\n\n\nDeveloper's Certificate of Origin 1.1\n\nBy making a contribution to this project, I certify that:\n\n(a) The contribution was created in whole or in part by me and I\n have the right to submit it under the open source license\n indicated in the file; or\n\n(b) The contribution is based upon previous work that, to the best\n of my knowledge, is covered under an appropriate open source\n license and I have the right under that license to submit that\n work with modifications, whether created in whole or in part\n by me, under the same open source license (unless I am\n permitted to submit under a different license), as indicated\n in the file; or\n\n(c) The contribution was provided directly to me by some other\n person who certified (a), (b) or (c) and I have not modified\n it.\n\n(d) I understand and agree that this project and the contribution\n are public and that a record of the contribution (including all\n personal information I submit with it, including my sign-off) is\n maintained indefinitely and may be redistributed consistent with\n this project or the open source license(s) involved.","category":"page"},{"location":"development/#Development","page":"Development","title":"Development","text":"","category":"section"},{"location":"development/#Text-editors","page":"Development","title":"Text editors","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:","category":"page"},{"location":"development/#VS-Code","page":"Development","title":"VS Code","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.","category":"page"},{"location":"development/#Juno","page":"Development","title":"Juno","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.","category":"page"},{"location":"development/#Vim-or-Emacs","page":"Development","title":"Vim or Emacs","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like VS Code with the Julia extension). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.","category":"page"},{"location":"development/#Releasing-a-new-version-of-HOHQMesh","page":"Development","title":"Releasing a new version of HOHQMesh","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Check whether everything is okay, tests pass etc.\nSet the new version number in Project.toml according to the Julian version of semver. Commit and push.\nComment @JuliaRegistrator register on the commit setting the version number.\nJuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.\nIncrement the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.","category":"page"},{"location":"development/#Preview-the-documentation","page":"Development","title":"Preview the documentation","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"You can build the documentation of HOHQMesh.jl locally by running","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"julia --project=docs -e 'using Pkg; Pkg.instantiate(); include(\"docs/make.jl\")'","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).","category":"page"},{"location":"tutorials/straight_outer_boundary/#Straight-sided-outer-boundary","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples/ folder.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Synopsis","page":"Straight-sided outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Initialization","page":"Straight-sided outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We create a new project with the name \"box_two_circles\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_project = newProject(\"box_two_circles\", \"out\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Adjusting-project-parameters","page":"Straight-sided outer boundary","title":"Adjusting project parameters","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"For the box_project we first query the current values for the polynomial order and the mesh output format","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> getPolynomialOrder(box_project)\n5\n\njulia> getMeshFileFormat(box_project)\n\"ISM-V2\"","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be 4 and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"setPolynomialOrder!(box_project, 4)\nsetMeshFileFormat!(box_project, \"ABAQUS\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-background-grid","page":"Straight-sided outer boundary","title":"Add the background grid","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The domain for this tutorial is a rectangular box with the bounds 030times015. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Set the lower left corner point of the domain (x_0 y_0), define the element size in each spatial direction Delta x and Delta y, and the number of steps taken in each direction N_x N_y. The resulting background grid will have the extent x_0 x_0 + N_x Delta x by y_0 y_0 + N_y Delta y. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands\nlower_left = [0.0, 0.0, 0.0]\nspacing = [1.0, 1.0, 0.0]\nnum_intervals = [30, 15, 0]\naddBackgroundGrid!(box_project, lower_left, spacing, num_intervals)\nSet the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box 030times015 we use\nbounds = [15.0, 0.0, 0.0, 30.0]\nN = [30, 15, 0]\naddBackgroundGrid!(box_project, bounds, N)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we visualize the box_project to ensure that the background grid has been added correctly.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"plotProject!(box_project, GRID)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use the keyword and GRID to indicate that we want the background grid to be included in the visualization.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: background)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-inner-boundaries","page":"Straight-sided outer boundary","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we add the two circular inner boundary curves with different radii.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The first circle will have radius r=2 and be centered at the point (4 4). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle1 = newCircularArcCurve(\"circle1\", # curve name\n [4.0, 4.0, 0.0], # circle center\n 2.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be \"circle1\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The new circle1 curve is then added to the box_project as an inner boundary curve with","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"addCurveToInnerBoundary!(box_project, circle1, \"inner1\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called \"inner1\" and it contains a single curve \"circle1\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: first_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With analogous steps we create another circular curve with radius r=4, centered at (20 9) and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle2 = newCircularArcCurve(\"circle2\", # curve name\n [20.0, 9.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 2.0 * pi, # end angle\n \"radians\") # angle units\naddCurveToInnerBoundary!(box_project, circle2, \"inner2\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called \"inner2\" and it contains a single curve \"circle2\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: second_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Generate-the-mesh","page":"Straight-sided outer boundary","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_two_circles.control: A HOHQMesh control file for the current project.\nbox_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nbox_two_circles.inp: A mesh file with format ABAQUS that was set above.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"generate_mesh(box_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 2.9116999999999997E-002\n Number of nodes = 498\n Number of Edges = 921\n Number of Elements = 422\n Number of Subdivisions = 0\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.34513977 1.15385313 0.91833886 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00000004 1.71084672 1.08736698 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 1.46547984 1.04928616 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00000006 2.43578615 1.16710823 1.00000000 4.00000000 1.00000000\n Jacobian 0.17854786 1.07210200 0.86801191 0.00000000 999.99900000 1.00000000\n Minimum Angle 50.57680338 89.99999787 83.84338772 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00000259 136.97085026 96.70176380 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: final_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Summary","page":"Straight-sided outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"github-git/#GitHub-and-Git","page":"GitHub & Git","title":"GitHub & Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This page contains information on how to use GitHub and Git when developing HOHQMesh.","category":"page"},{"location":"github-git/#Development-workflow","page":"GitHub & Git","title":"Development workflow","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For adding modifications to HOHQMesh, we generally follow these steps:","category":"page"},{"location":"github-git/#Create-an-issue-(optional)","page":"GitHub & Git","title":"Create an issue (optional)","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.","category":"page"},{"location":"github-git/#Create-a-branch-and-*immediately*-create-a-pull-request","page":"GitHub & Git","title":"Create a branch and immediately create a pull request","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git\n# get latest main from the main repo\ngit checkout main\ngit pull\n# create a new branch for a cool new feature, bug fix, ...\ngit checkout -b YOUR_BRANCH_NAME\n# do some work and push it to your fork\ngit push -u myfork\n# go to https://github.com/trixi-framework/HOHQMesh.jl/pull\n# and create a PR from your new branch","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"info: Why using pull requests?\nImmediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.","category":"page"},{"location":"github-git/#Make-changes","page":"GitHub & Git","title":"Make changes","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"warning: Avoid committing unwanted files\nWhen you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.","category":"page"},{"location":"github-git/#Keep-your-branch-in-sync-with-main","page":"GitHub & Git","title":"Keep your branch in sync with main","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.\nExecute git fetch to get the latest changes from the repository.\nMake sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.\nMerge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.","category":"page"},{"location":"github-git/#Prepare-for-review","page":"GitHub & Git","title":"Prepare for review","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"merge the current main to your branch\nrun tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs\nproperly comment your code\ndelete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)\nremove debug statements\nadd a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.","category":"page"},{"location":"github-git/#Get-reviewed","page":"GitHub & Git","title":"Get reviewed","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.","category":"page"},{"location":"github-git/#Merge-branch","page":"GitHub & Git","title":"Merge branch","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).","category":"page"},{"location":"github-git/#Update-your-working-copy","page":"GitHub & Git","title":"Update your working copy","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Update your clone by running git fetch.\nCheck out main using git checkout main.\nDelete merged branch locally with git branch -d yourbranch.\nRemove local references to deleted remote branch by executing git remote prune origin.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"You can now proceed with your next changes by starting again at the top.","category":"page"},{"location":"github-git/#Using-Git","page":"GitHub & Git","title":"Using Git","text":"","category":"section"},{"location":"github-git/#Resources-for-learning-Git","page":"GitHub & Git","title":"Resources for learning Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Git Handbook by GitHub\nLearn Git Branching","category":"page"},{"location":"github-git/#Tips-and-tricks","page":"GitHub & Git","title":"Tips and tricks","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This is an unordered collection of different tips and tricks that can be helpful while working with Git. As usual, your mileage might vary.","category":"page"},{"location":"github-git/#Undo-last-commit","page":"GitHub & Git","title":"Undo last commit","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git reset HEAD~","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.","category":"page"},{"location":"github-git/#Remove-large-file-from-repository","page":"GitHub & Git","title":"Remove large file from repository","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"danger: Large files\nYou should never try to fix this yourself, as it potentially disrupts/destroys the work of others!","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Tell everyone to commit and push their changes to the repository.\nFix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.\nPerform the following steps to clean up the Git repository:\ncd /tmp\n\n# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/\n\n# Get fresh clone of repo (so you can throw it away in case there is a problem)\ngit clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git\n\n# Clean up repo of all files larger than 10M\njava -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git\n\n# Enter repo\ncd HOHQMesh.jl.git\n\n# Clean up reflog and force aggressive garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\n\n# Push changes\ngit push\n\n# Delete clone\nrm -rf HOHQMesh.jl.git\nTell everyone to clean up their local working copies by performing the following steps (also do this yourself):\n# Enter repo\ncd HOHQMesh.jl\n\n# Get current changes\ngit fetch\n\n# Check out the fixed branch\ngit checkout branchname\n\n# IMPORTANT: Do a rebase instead of a pull!\ngit rebase\n\n# Clean reflog and force garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\nIMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.","category":"page"},{"location":"interactive-api/#API","page":"API","title":"API","text":"","category":"section"},{"location":"interactive-api/#Project-creation-and-saving","page":"API","title":"Project creation and saving","text":"","category":"section"},{"location":"interactive-api/#New-Project","page":"API","title":"New Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = newProject(name::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied name will be the default name of the control, mesh, and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.","category":"page"},{"location":"interactive-api/#Opening-an-existing-project-file","page":"API","title":"Opening an existing project file","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A project can be created from an existing HOHQMesh control file with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = openProject(fileName::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied fileName will be the name of the project and the generated mesh and plot files will be placed in the supplied folder.","category":"page"},{"location":"interactive-api/#Saving-a-Project","page":"API","title":"Saving a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" saveProject(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"writes a control file to the folder designated when creating the new project. It can be read in again with openProject.","category":"page"},{"location":"interactive-api/#Plotting-a-Project","page":"API","title":"Plotting a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" plotProject!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the model is modified and you want to re-plot with the new values, invoke","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" updatePlot!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"but generally the plot will be updated automatically as you build the model.","category":"page"},{"location":"interactive-api/#Modifying/editing-a-Project","page":"API","title":"Modifying/editing a Project","text":"","category":"section"},{"location":"interactive-api/#Setting-the-name-of-a-Project","page":"API","title":"Setting the name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name is the name under which the mesh, plot, statistics and control files will be written. It can be changed at any time with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setName!(proj::Project,name::String)","category":"page"},{"location":"interactive-api/#Getting-the-current-name-of-a-Project","page":"API","title":"Getting the current name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name can be fetched and printed to the screen with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getName(proj::Project)","category":"page"},{"location":"interactive-api/#Controlling-the-mesh-generation","page":"API","title":"Controlling the mesh generation","text":"","category":"section"},{"location":"interactive-api/#Editing-the-RunParameters","page":"API","title":"Editing the RunParameters","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The run parameters can be enquired and set with these getter/setter pairs:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setPolynomialOrder!(proj::Project, p::Int)\n [Return:Int] getPolynomialOrder(proj::Project)\n [Return:nothing] setMeshFileFormat!(proj::Project, meshFileFormat::String)\n [Return:String] getMeshFileFormat(proj::Project)\n [Return:nothing] setPlotFileFormat!(proj::Project, plotFileFormat::String)\n [Return:String] getPlotFileFormat(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The available mesh file formats are \"ISM\", \"ISM-V2\", or \"ABAQUS\". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot file (which can be viewed with something like VisIt or ParaView) format is either \"skeleton\" or \"sem\". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.","category":"page"},{"location":"interactive-api/#Changing-the-output-file-names","page":"API","title":"Changing the output file names","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setName!(proj::Project,name::String)\n [Return:String] getName(proj::Project)\n [Return:nothing] setFolder!(proj::Project,folder::String)\n [Return:String] getFolder(proj::Project)","category":"page"},{"location":"interactive-api/#Smoothing-operations","page":"API","title":"Smoothing operations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available in the documentation and in Minoli2011.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To change the defaults, the smoother parameters can be set/enquired with the functions","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setSmoothingStatus!(proj::Project, status::String)\n [Return:String] getSmoothingStatus(proj::Project)\n [Return:nothing] setSmoothingType!(proj::Project, type::String)\n [Return:String] getSmoothingType(proj::Project)\n [Return:nothing] setSmoothingIterations!(proj::Project, iterations::Int)\n [Return:Int] getSmoothingIterations(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The smooth status is either \"ON\" or \"OFF\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To remove the smoother altogether, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] removeSpringSmoother!(proj::Project)","category":"page"},{"location":"interactive-api/#Adding-the-background-grid","page":"API","title":"Adding the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must be specified after a new project has been created.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addBackgroundGrid!(proj::Project,\n x0::Array{Float64},\n dx::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n box::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n bgSize::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.","category":"page"},{"location":"interactive-api/#Changing-the-background-grid","page":"API","title":"Changing the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The size of an existing background grid in a Project can be adjusted with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setBackgroundGridSize!(proj::Project,\n dx::Float64,\n dy::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If a plot is present it will be updated automatically.","category":"page"},{"location":"interactive-api/#Manual-refinement-regions","page":"API","title":"Manual refinement regions","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To create a RefinementCenter,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementCenter(name::String,\n type::String,\n x0::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where name labels the refinement region, the type is either \"smooth\" or \"sharp\", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Similarly, one can create a RefinementLine,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementLine(name::String,\n type::String,\n x0::Array{Float64}, x1::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where x0 is the start position and x1 is the end of the line. The name, type, h, and w parameters are the same as for a RefinementCenter.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To add a refinement region to the project,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addRefinementRegion!(proj::Project, r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To get a reference to a refinement region with a given name, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] getRefinementRegion(proj::Project, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to get a list of all the refinement regions,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Array{Dict{String,Any}}] array = allRefinementRegions(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"A refinement region can be edited by using the following:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementType!(r::Dict{String,Any}, type::String)\n [Return:String] getRefinementType(r::Dict{String,Any})\n [Return:nothing] setRefinementLocation!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementLocation(r::Dict{String,Any})\n [Return:nothing] setRefinementGridSize!(r::Dict{String,Any}, h::Float64)\n [Return:Float64] getRefinementGridSize(r::Dict{String,Any})\n [Return:nothing] setRefinementWidth!(r::Dict{String,Any}, w::Float64)\n [Return:Float64] getRefinementWidth(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where r is a dictionary returned by newRefinementCenter!, newRefinementLine!, or getRefinementRegion.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To further edit a RefinementLine, use the methods","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementStart!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementStart(r::Dict{String,Any})\n [Return:nothing] setRefinementEnd!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementEnd(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Boundary-curves","page":"API","title":"Boundary curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a \"chain\" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.","category":"page"},{"location":"interactive-api/#Defining-curves","page":"API","title":"Defining curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Four curve types can be added to the outer and inner boundary curve chains. They are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"interactive-api/#Parametric-equations","page":"API","title":"Parametric equations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Creating a new curve equation","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\")","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Returns a new set of parametric equation. Equations must be of the form","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" () = ...","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" xEqn = \"x(t) = 4*cos(2*pi*t) - 0.6*cos(8*pi*t)^3\"\n yEqn = \"y(t) = 4*sin(2*pi*t) - 0.5*sin(11*pi*t)^2\"\n zEqn = \"z(t) = 0.0\"\n blob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The z-Equation is optional, but for now must define zero for z by default.","category":"page"},{"location":"interactive-api/#Cubic-spline-curve","page":"API","title":"Cubic spline curve","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A cubic spline is defined by an array of knots, t_j, x_j, y_j, z_j. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the t, x, y, z values, e.g.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" 9\n 0.000000000000000 -3.50000000000000 3.50000000000000 0.0\n 3.846153846153846E-002 -3.20000000000000 5.00000000000 0.0\n 7.692307692307693E-002 -2.00000000000000 6.00000000000 0.0\n 0.769230769230769 0.000000000000000 -1.00000000000000 0.0\n 0.807692307692308 -1.00000000000000 -1.00000000000000 0.0\n 0.846153846153846 -2.00000000000000 -0.800000000000000 0.0\n 0.884615384615385 -2.50000000000000 0.000000000000000 0.0\n 0.923076923076923 -3.00000000000000 1.00000000000000 0.0\n 1.00000000000000 -3.50000000000000 3.50000000000000 0.0","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"or by constructing the required nKnots x 4 array and supplying it to the new procedure. The respective constructors for a spline curve are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newSplineCurve(name::String,\n dataFile::String)\n [Return:Dict{String,Any}] newSplineCurve(name::String,\n nKnots::Int,\n data::Matrix{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the spline curve is to be closed. The last data point must be the same as the first.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n ex_spline = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"interactive-api/#Line-defined-by-end-points","page":"API","title":"Line defined by end points","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A straight line is constructed with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newEndPointsLineCurve(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The xStart and xEnd are arrays of the form [x, y, z]. The z component should be zero and for now is ignored.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" line1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])","category":"page"},{"location":"interactive-api/#Circular-arc","page":"API","title":"Circular arc","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newCircularArcCurve(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either \"degrees\" or \"radians\". That argument is optional, and defaults to \"degrees\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" halfCircle = newCircularArcCurve(\"Dome\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")","category":"page"},{"location":"interactive-api/#Adding-and-removing-outer-and-inner-boundaries","page":"API","title":"Adding and removing outer and inner boundaries","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Adding an outer boundary curve\nUsing the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using\n[Return:nothing] addCurveToOuterBoundary!(proj::Project,\n crv::Dict{String,Any})\ncrv is the dictionary that represents the curve.\nExample:\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\nAdding an inner boundary curve\nThe syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.\n[Return:nothing] addCurveToInnerBoundary!(proj::Project,\n crv::Dict{String,Any},\n chainName::String)\nExample:\nline1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\naddCurveToInnerBoundary!(p, line1, \"interior_curve\")\nTo edit curves they can be accessed by the name:\n[Return:Dict{String,Any}] getInnerBoundaryCurve(proj::Project,\n curveName::String,\n chainName::String)\n[Return:Dict{String,Any}] getOuterBoundaryCurveWithName(proj::Project,\n name::String)\nDeleting boundary curves\nThe entire outer boundary or an entire inner boundary can be removed from the project.\n[Return:nothing] removeOuterBoundary!(proj::Project)\n[Return:nothing] removeInnerBoundary!(proj::Project, chainName::String)\nAlternatively, individual pieces of the boundary curve chains can be removed.\n[Return:nothing] removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n[Return:nothing] removeInnerBoundaryCurve!(proj::Project,\n name::String,\n chainName::String)\nAs in HOHQMesh the project can have only one outer boundary chain, so the removal does not require a specific chainName.","category":"page"},{"location":"interactive-api/#Editing-curves","page":"API","title":"Editing curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"You can determine the type of a curve by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getCurveType(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"For any of the curves, their name can be changed by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setCurveName!(crv::Dict{String,Any}, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"and checked by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" getCurveName(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Alternatively, all curves on an outer or inner boundary with the same name can have that name changed all at once everywhere in the project with the function","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" renameCurve!(proj::Project, oldName::String, newName::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Otherwise there are special functions to change the parameters of curves","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setXEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setYEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setZEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcUnits!(arc::Dict{String,Any}, units::String)\n [Return:nothing] setArcCenter!(arc::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n [Return:String] getXEqn(crv::Dict{String,Any})\n [Return:String] getYEqn(crv::Dict{String,Any})\n [Return:String] getZEqn(crv::Dict{String,Any})\n [Return:Array{Float64}] getStartPoint(crv::Dict{String,Any})\n [Return:Array{Float64}] getEndPoint(crv::Dict{String,Any})\n [Return:String] getArcUnits(arc::Dict{String,Any})\n [Return:Array{Float64}] getArcCenter(arc::Dict{String,Any})\n [Return:Float64] getArcStartAngle(arc::Dict{String,Any})\n [Return:Float64] getArcEndAngle(arc::Dict{String,Any})\n [Return:Float64] getArcRadius(arc::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Undo/redo","page":"API","title":"Undo/redo","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The interactive mesh functionality has unlimited undo/redo for most actions.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"In interactive mode, actions can be undone by the commands","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undo()\n [Return:String] redo()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where the return string contains the name of the action performed.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To find out what the next actions are, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undoActionName()\n [Return:String] redoActionName()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to clear the undo stack, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] clearUndoRedo()","category":"page"},{"location":"tutorials/curved_outer_boundary/#Curved-outer-boundary","page":"Curved outer boundary","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Synopsis","page":"Curved outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initialization","page":"Curved outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We create a new project with the name \"TheBlob\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"blob_project = newProject(\"TheBlob\", \"out\")","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-the-outer-boundary","page":"Curved outer boundary","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary curve for the domain of interest in this tutorial is given by the parametric equations","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":" beginaligned\n x(t) = 4cos(2 pi t) - frac35cos^3(8 pi t)02cm\n y(t) = 4sin(2 pi t) - frac12sin^2(11 pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"xEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The name of this curve is assigned to be \"Blob\". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addCurveToOuterBoundary!(blob_project, blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-a-background-grid","page":"Curved outer boundary","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for blob_project to have elements with side length two in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"plotProject!(blob_project, MODEL+GRID)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"Blob\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: coarse_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From the visualization we see that the background grid is likely too coarse to produce a \"good\" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"setBackgroundGridSize!(blob_project, 0.5, 0.5)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: fine_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initial-mesh-and-user-adjustments","page":"Curved outer boundary","title":"Initial mesh and user adjustments","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"TheBlob.control: A HOHQMesh control file for the current project.\nTheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nTheBlob.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 8.4328000000000000E-002\n Number of nodes = 479\n Number of Edges = 895\n Number of Elements = 417\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025286 0.36208840 0.11936333 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002882 2.58443761 1.26335838 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.12867591 1.18585825 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006176 4.77438730 1.51314025 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011275 0.28170345 0.10292806 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.38249259 89.99827733 73.08294187 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132795 156.98701187 109.36585212 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: initial_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point (-4 0) is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"center = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Above we create a circular refinement region centered at the point (-4 -05) with a desired resolution size 04 and a radius of 10. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: refinement_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Final-mesh","page":"Curved outer boundary","title":"Final mesh","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 9.2778999999999986E-002\n Number of nodes = 503\n Number of Edges = 940\n Number of Elements = 438\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025286 0.36208840 0.11412688 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002883 2.47056840 1.26416662 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.12867592 1.18429212 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006176 4.77438730 1.51407242 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011275 0.28170345 0.09814903 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.38249259 89.99827897 72.80049710 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132784 156.98701188 109.63478104 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: final_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Summary","page":"Curved outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"# Interactive mesh with a curved outer boundary\n#\n# Create an outer boundary from a set of parametric equations.\n# Add manual refinement in a small region around the point (-4, -0.5).\n#\n# Keywords: outer boundary, parametric equations, refinement center\nusing HOHQMesh\n\n# Instantiate the project\nblob_project = newProject(\"TheBlob\", \"out\")\n\n# Create and add the outer boundary curve\nxEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)\naddCurveToOuterBoundary!(blob_project, blob)\n\n# Add the background grid\naddBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])\n\n# Create and add the refinement region\ncenter = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)\n\n# Generate the mesh\ngenerate_mesh(blob_project)","category":"page"},{"location":"tutorials/create_edit_curves/#Creating-and-editing-curves","page":"Creating and editing curves","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a \"chain\" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/create_edit_curves/#Synopsis","page":"Creating and editing curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/#Initialization","page":"Creating and editing curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a new project with the name \"sandbox\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox_project = newProject(\"sandbox\", \"out\")","category":"page"},{"location":"tutorials/create_edit_curves/#Add-the-outer-boundary-chain","page":"Creating and editing curves","title":"Add the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We first create the outer boundary curve chain that is composed of three pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (0 -7) to (5 3).\nHalf-circle arc of radius r=5 centered at (0 3).\nStraight line segment from (-5 3) to (0 -7).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [0.0, -7.0, 0.0], # start point\n [5.0, 3.0, 0.0]) # end point\n\nouter_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-5.0, 3.0, 0.0], # start point\n [0.0, -7.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from 0 to 180 degrees.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_arc = newCircularArcCurve(\"Arc\", # curve name\n [0.0, 3.0, 0.0], # center\n 5.0, # radius\n 0.0, # start angle\n 180.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", and \"Arc\" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-a-background-grid","page":"Creating and editing curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We visualize the outer boundary curve chain and background grid with the following","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"plotProject!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains three curve segments \"Line1\", \"Arc\", and \"Line2\" labeled in the figure by O.1, O.2, and O.3, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-the-outer-boundary-chain","page":"Creating and editing curves","title":"Edit the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the domain boundary requires a curved segment instead of the straight line \"Line2\". We will replace this line segment in the outer boundary chain with a cubic spline.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"First, we remove the \"Line2\" curve from the \"Outer\" chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Outer curve removal\nAlternatively, we can remove the curve \"Line2\" using its index in the \"Outer\" boundary chain.removeOuterBoundaryCurveAtIndex!(sandbox_project, 3)This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The plot automatically updates and we see that the outer boundary is open and contains two segments: \"Line1\" and \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve \"Arc\" and end at the first point of the curve \"Line1\". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. The spline curve constructor newSplineCurve also takes the number of points as an input argument.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"spline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we add the spline curve outer_spline into the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates automatically to display the \"Outer\" boundary chain with the new \"Spline\" curve labeled O.3.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-an-inner-boundary-chain","page":"Creating and editing curves","title":"Add an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a pill shaped inner boundary curve chain composed of four pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (1 5) to (1 3).\nHalf-circle arc of radius r=1 centered at (0 3).\nStraight line segment from (-1 3) to (-1 5).\nHalf-circle arc of radius r=1 centered at (0 5).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Similar to the construction of the \"Outer\" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [1.0, 5.0, 0.0], # start point\n [1.0, 3.0, 0.0]) # end point\n\ninner_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-1.0, 3.0, 0.0], # start point\n [-1.0, 5.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at (0 3) varies from 0 to -180 degrees. The top half-circle arc centered at (0 5) has an angle that varies from 180 to 0 degrees. The construction of the two circle arcs are","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_bottom_arc = newCircularArcCurve(\"BottomArc\", # curve name\n [0.0, 3.0, 0.0], # center\n 1.0, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\n\ninner_top_arc = newCircularArcCurve(\"TopArc\", # curve name\n [0.0, 5.0, 0.0], # center\n 1.0, # radius\n 180.0, # start angle\n 0.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Note, we use \"radians\" to set the angle bounds for inner_bottom_arc and \"degrees\" for the angle bounds of inner_top_arc.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", \"BottomArc\", and \"TopArc\" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This inner boundary chain name \"inner\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments \"Line1\", \"BottomArc\", \"Line2\", and \"TopArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_pill)","category":"page"},{"location":"tutorials/create_edit_curves/#Generate-the-mesh","page":"Creating and editing curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox.control: A HOHQMesh control file for the current project.\nsandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nsandbox.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 7.5414000000000009E-002\n Number of nodes = 511\n Number of Edges = 933\n Number of Elements = 422\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00002932 1.17335568 0.18813138 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00953438 2.30790024 1.31439620 1.00000000 999.99900000 1.00000000\n Condition 1.00041663 2.41773865 1.21024584 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.01673809 3.68828437 1.59413340 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001750 1.13820387 0.14143901 0.00000000 999.99900000 1.00000000\n Minimum Angle 32.22733574 89.35690571 68.75321248 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.61089476 152.37947944 113.36221513 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: initial_mesh)","category":"page"},{"location":"tutorials/create_edit_curves/#Delete-the-existing-mesh","page":"Creating and editing curves","title":"Delete the existing mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"remove_mesh!(sandbox_project)\nupdatePlot!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The remove_mesh! command deletes the mesh information from the sandbox_project as well as the mesh file sandbox.mesh, control file sandbox.control, plot file sandbox.tec, and mesh statistics file sandbox.txt from the out folder.","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-an-inner-boundary-chain","page":"Creating and editing curves","title":"Edit an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the inner boundary actually requires a curved segment instead of the straight line \"Line1\". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We remove the \"Line1\" curve from the inner chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Inner curve removal\nAlternatively, we can remove the curve \"Line1\" using its index in the inner boundary chain.removeInnerBoundaryCurveAtIndex!(sandbox_project, 1, \"inner\")This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: \"BottomArc\", \"Line2\", and \"TopArc\". Note that the index of the remaining curves has changed as shown below.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Brief note about undo / redo\nThe interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.undoActionName()\n\"Remove Inner Boundary Curve\"We can undo the removal of the \"Line1\" curve with undoundo()\n\"Undo Remove Inner Boundary Curve\"In addition to reinstating \"Line1\" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The new inner curve segment will be an oscillating line given by the parametric equations","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":" beginaligned\n x(t) = t + 102cm\n y(t) = -2t + 5 - frac32 cos(pi t) sin(pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"xEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The name of this new curve is assigned to be \"wiggleLine\". We add this new curve to the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The automatically updated figure now shows:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_open_chain)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We see from the figure that this parametric equation curve starts at the point (15) and, therefore, matches the end point of the existing curve \"TopArc\" present in the \"inner\" chain. However, the parametric equation curve ends at the point (23) which does not match the \"BottomArc\" curve. So, the inner boundary chain remains open.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"warning: Attempt to generate a mesh with an open curve chain\nAn open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create a closed boundary curve we must remove the \"BottomArc\" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point (2 3) and end at the point (-1 3) to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the \"BottomArc\" from the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates to display the \"inner\" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_remove_arc)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"A half-circle arc that joins the points (2 3) and (-1 3) has a radius r=15, is centered at (05 3) and has an angle that vaires from 0 to -180. We construct this circle arc and directly add it to the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"new_bottom_arc = newCircularArcCurve(\"wideBottomArc\", # curve name\n [0.5, 3.0, 0.0], # center\n 1.5, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The updated plot now gives the modified, closed inner curve chain that now contains four curve segments \"Line2\", \"TopArc\", \"wiggleLine\", and \"wideBottomArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/#Regenerate-the-mesh","page":"Creating and editing curves","title":"Regenerate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.11353599999999998\n Number of nodes = 712\n Number of Edges = 1308\n Number of Elements = 596\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00002932 1.15661960 0.12823902 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.01050856 3.14732001 1.34260027 1.00000000 999.99900000 1.00000000\n Condition 1.00037771 2.59434067 1.22850175 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.02744717 3.68828437 1.64751502 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001750 1.13149451 0.09443920 0.00000000 999.99900000 1.00000000\n Minimum Angle 31.87236189 89.33988565 67.86178629 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.44177106 157.27121105 114.35699650 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: zoom_corner)","category":"page"},{"location":"tutorials/create_edit_curves/#Summary","page":"Creating and editing curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"# Interactive mesh with modified outer and inner curve chains\n#\n# Create inner / outer boundary chains composed of the four\n# available HOHQMesh curve types.\n#\n# Keywords: outer boundary, inner boundary, parametric equations,\n# circle arcs, cubic spline, curve removal\nusing HOHQMesh\n\n# Instantiate the project\nsandbox_project = newProject(\"sandbox\", \"out\")\n\n# Add the background grid\naddBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])\n\n# Create and add the original outer boundary curves\nouter_line1 = newEndPointsLineCurve(\"Line1\", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])\nouter_line2 = newEndPointsLineCurve(\"Line2\", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])\nouter_arc = newCircularArcCurve(\"Arc\", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, \"degrees\")\n\naddCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)\n\n# Modify the outer boundary to have a spline instead of a straight line\nremoveOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")\n\nspline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)\naddCurveToOuterBoundary!(sandbox_project, outer_spline)\n\n# Create and add the inner boundary curves\ninner_line1 = newEndPointsLineCurve(\"Line1\", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])\ninner_line2 = newEndPointsLineCurve(\"Line2\", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])\ninner_bottom_arc = newCircularArcCurve(\"BottomArc\", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, \"radians\")\ninner_top_arc = newCircularArcCurve(\"TopArc\", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, \"degrees\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")\n\n# Generate a mesh\ngenerate_mesh(sandbox_project)\n\n# Delete the existing mesh before modifying the inner boundary curve chain\nremove_mesh!(sandbox_project)\n\n# Modify the inner boundary curve with an oscillatory line and a new circle arc\nremoveInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")\nremoveInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")\n\nxEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)\n\nnew_bottom_arc = newCircularArcCurve(\"wideBottomArc\", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, \"radians\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")\n\n# Regenerate the final mesh\ngenerate_mesh(sandbox_project)","category":"page"},{"location":"interactive_overview/#InteractiveTool","page":"Overview","title":"Overview","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Several scripts are available in the examples/ folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.","category":"page"},{"location":"interactive_overview/#Workflow-and-basic-moves","page":"Overview","title":"Workflow and basic moves","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"To generate a mesh interactively you","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Create a project with a user given projectName and folder where any generated files are to be saved\np = newProject(, )\nBoth of these input arguments are strings.\nCreate inner and outer boundary curves from the available types\nc = newEndPointsLineCurve(, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*\nc = newCircularArcCurve(, center [x, y, z], radius, startAngle, endAngle, units = \"degrees\" or \"radians\") *Circular Arc*\nc = newParametricEquationCurve(, xEqn, yEqn, zEqn) *Parametric equation*\nc = newSplineCurve(, dataFile) *Spline with data from a file*\nc = newSpline(, nKnots, knotsMatrix) *Spline with given knot values*\nSee Defining curves for further details on the different curve type currently supported by HOHQMesh.\nThe generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.\nAdd curves to build the model to see what you have added,\naddOuterBoundaryCurve!(p, ) *Add outer boundary curve*\naddInnerBoundaryCurve!(p, , ) *Add curve to an inner boundary*\nFor a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.\nCurves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.\nVisualize the project's model, if desired\nplotProject!(p, MODEL)\nPlots are updated in response to user interactions. However, to update the plot at any time, use\nupdatePlot!(p, options)\nOptions are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.\nnote: Visualization requirement\nThe interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.\nSet the background grid\nWhen no outer boundary curve is present, the background grid can be set with\naddBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])\nOr\naddBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])\nThe first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.\nWhen an outer boundary is present the background grid can be set as\naddBackgroundGrid!(p, [dx, dy, dz])\nwhere the spacing controls the number of elements in each direction.\nnote: Background grid\nA background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.\nAdjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by\nsetPolynomialOrder!(p, order)\nThe background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately\nsetBackgroundGridSize!(p, 0.5, 0.25)\nSee Controlling the mesh generation for details on adjusting parameters already present in the Project.\nGenerate the mesh\ngenerate_mesh(p)\nThe mesh file will be saved in with the name .mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name .control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.","category":"page"},{"location":"interactive_overview/#Advanced","page":"Overview","title":"Advanced","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The generate_mesh function has two optional arguments. The first is the Boolean verbose argument. One can pass verbose=true to output additional messages and information during the meshing process. The second is the integer subdivision_maximum argument. The default value is subdivision_maximum=8, meaning that elements can be up to a factor of 2^8 smaller than the existing background grid. Note, think before adjusting the subdivision_maximum level! It is often the case that adjusting the boundary curves, background grid size, adding local refinement regions, or some combination of these adjustments removes the need to adjust the subdivision depth.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.","category":"page"},{"location":"testing/#Testing","page":"Testing","title":"Testing","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In HOHQMesh and its related repositories, tests are triggered by","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"each git push to main and\neach git push to any pull request.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test and coverage requirements\nBefore merging a pull request (PR) to main, we require thatthe code passes all functional tests\ncode coverage does not decrease.","category":"page"},{"location":"testing/#Testing-setup","page":"Testing","title":"Testing setup","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> using Pkg; Pkg.test(\"HOHQMesh\")","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> # Run all test for the interactive Curve API\n include(joinpath(\"test\", \"test_curve.jl\"))","category":"page"},{"location":"testing/#Adding-new-tests","page":"Testing","title":"Adding new tests","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test duration\nAs a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).","category":"page"},{"location":"testing/#Test-coverage","page":"Testing","title":"Test coverage","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered \"covered\" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The \"Details\" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Coverage requirements\nIn general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.","category":"page"},{"location":"authors/#Authors","page":"Authors","title":"Authors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.","category":"page"},{"location":"authors/#Principal-Developers","page":"Authors","title":"Principal Developers","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"David A. Kopriva, Florida State University, USA\nAndrew Winters, Linköping University, Sweden","category":"page"},{"location":"authors/#Contributors","page":"Authors","title":"Contributors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"The following people contributed major additions or modifications to HOHQMesh and are listed in alphabetical order:","category":"page"},{"location":"authors/","page":"Authors","title":"Authors","text":"David Kopriva\nHendrik Ranocha\nMichael Schlottke-Lakemper\nAndrew Winters","category":"page"},{"location":"reference/#HOHQMesh.jl-API","page":"Reference","title":"HOHQMesh.jl API","text":"","category":"section"},{"location":"reference/","page":"Reference","title":"Reference","text":"CurrentModule = HOHQMesh","category":"page"},{"location":"reference/","page":"Reference","title":"Reference","text":"Modules = [HOHQMesh]","category":"page"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary named boundaryName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, obj::Dict{String,Any})\n\nAdd a curve to the outer boundary or a refinement reion to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}, Array{Float64}, Array{Int64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})\n\nAdd the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version\n\naddBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nis a lot easier to use.\n\nTODO: Change HOHQMesh and delete this way to specify the domain and use the bounding box one instead.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}, Array{Int64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nAdd the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid(proj::Project, bgSize::Array{Float64})\n\nAdd the background grid block with the grid size to be a 3-vector. Use this when there is an outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, dict::Dict{String,Any})\n\nUsed only for undo/redo.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToInnerBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.addCurveToInnerBoundary!","text":"addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary with name boundaryName. If an inner boundary of that name does not exist, one is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addCurveToOuterBoundary!","text":"addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})\n\nAdd a curve to the outer boundary. The curves must be added in order counter-clockwise\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addInnerBoundaryWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.addInnerBoundaryWithName!","text":"addInnerBoundaryWithName!(proj::Project,name::String)\n\nCreate a new empty inner boundary with the given name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addObserver-Tuple{Any, String, Any}","page":"Reference","title":"HOHQMesh.addObserver","text":"addObserver(observer::Any, note::String, f::Any)\n\nf is the function to be executed (called) when a notification of name note is given.\n\nThe function called upon notification must have the signature f(observer, sender, args...)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addOuterBoundary!","text":"addOuterBoundary!(proj::Project, outerBoundary::Dict{String,Any})\n\nAdd an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegion!","text":"addRefinementRegion!(proj::Project,r::Dict{String,Any})\n\nAdd the refinement region to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegionPoints!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegionPoints!","text":"addRefinementRegionPoints!(proj::Project, r::Dict{String,Any})\n\nCompute and add to the project the plotting points for the refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRunParameters!","page":"Reference","title":"HOHQMesh.addRunParameters!","text":"addRunParameters!(proj::Project,\n plotFormat::String = \"skeleton\",\n meshFileFormat::String = \"ISM-V2\",\n polynomialOrder::Int = 5)\n\nAdd a RUN_PARAMETERS block and set all the parameters in one call.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.addSpringSmoother!","page":"Reference","title":"HOHQMesh.addSpringSmoother!","text":"addSpringSmoother!(status::String, type::String, nIterations::Int)\n\nStatus is either ON or OFF Type is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.bboxUnion-Tuple{Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.bboxUnion","text":"bboxUnion(box1::Array{Float64}, box2::Array{Float64})\n\nReturns the union of two bounding boxes\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.curveBounds-Tuple{Matrix{Float64}}","page":"Reference","title":"HOHQMesh.curveBounds","text":"curveBounds(crvPoints::Array{Float64,2})\n\nFind the bounds of a single curve, discretized as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.emptyBounds-Tuple{}","page":"Reference","title":"HOHQMesh.emptyBounds","text":"emptyBounds()\n\nReturns an array that will always be ignored when unioned with another bounding box.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.examples_dir-Tuple{}","page":"Reference","title":"HOHQMesh.examples_dir","text":"examples_dir()\n\nReturn the path to the directory with some example mesh setups.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.extract_mesh_file_format-Tuple{Any}","page":"Reference","title":"HOHQMesh.extract_mesh_file_format","text":"extract_mesh_file_format(control_file)\n\nReturn a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{Any}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(control_file;\n output_directory=\"out\",\n mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing,\n verbose=false, subdivision_maximum=8)\n\nGenerate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.\n\nYou can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.\n\nYou can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.\n\nTo override the maximum number of allowable subdivisions in the quad tree during meshing adjust the value of subdivision_maximum. The default value of subdivision_maximum is 8, meaning that elements can be up to a factor of 2^8 smaller than the background grid. Note, think before doing this! It could be adjusting the boundary curves, background grid size, adding local refinement regions, or some combination may remove the need to adjust the subdivision depth.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(proj::Project; verbose=false, subdivision_maximum=8)\n\nGenerate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.\n\nThis function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.\n\nWith the optional argument verbose one can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information.\n\nTo override the maximum number of allowable subdivisions in the quad tree during meshing adjust the value of subdivision_maximum. The default value of subdivision_maximum is 8, meaning that elements can be up to a factor of 2^8 smaller than the background grid. Note, think before doing this! It could be adjusting the boundary curves, background grid size, adding local refinement regions, or some combination may remove the need to adjust the subdivision depth.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getAllRefinementRegions-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getAllRefinementRegions","text":"getAllRefinementRegions(proj::Project)\n\nGet the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcCenter","text":"getArcCenter(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the center of a circular arc as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcEndAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcEndAngle","text":"getArcEndAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcRadius-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcRadius","text":"getArcRadius(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcStartAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcStartAngle","text":"getArcStartAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcUnits-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcUnits","text":"getArcUnits(crv::Dict{String,Any}, units::String)\n\nGet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridLowerLeft-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridLowerLeft","text":"getBackgroundGridLowerLeft(proj::Project)\n\nReturns the [x,y] of the lower left point of the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSize-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSize","text":"getBackgroundGridSize(proj::Project)\n\nReturns the background grid size array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSteps-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSteps","text":"getBackgroundGridSteps(proj::Project)\n\nReturns the [Nx,Ny,Nz] for the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String, boundaryName::String)\n\nGet the curve named curveName from the inner boundary named boundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String)\n\nGet the curve with name curveName from the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveName","text":"getCurveName(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveType","text":"getCurveType(crv::Dic{String,Any})\n\nGet the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,\n`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getEndPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getEndPoint","text":"getEndPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the end point for a line curve as an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundary-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundary","text":"getInnerBoundary(proj::Project, name::String)\n\nGet the chain of curves from the inner boundary with name name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryChainWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryChainWithName","text":"getInnerBoundaryChainWithName(proj::Project, name::String)\n\nGet the inner boundary CHAIN with the given name. If one does not exist, it is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryCurve","text":"\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getMeshFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getMeshFileFormat","text":"getMeshFileFormat(proj::Project)\n\nReturns the format in which the mesh will be written.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getName-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getName","text":"getName(proj::Project)\n\nReturns the filename to be used by the mesh, plot, control, and stats files.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryChainList-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getOuterBoundaryChainList","text":"getOuterBoundaryChainList(proj::Project)\n\nGet the array of outer boundary curves.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryCurveWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getOuterBoundaryCurveWithName","text":"getOuterBoundaryCurveWithName(proj::Project, name::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPlotFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPlotFileFormat","text":"getPlotFileFormat(proj::Project)\n\nReturns the plot file format.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPolynomialOrder-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPolynomialOrder","text":"getPolynomialOrder(proj::Project)\n\nReturns the polynomial order for boundary curves in the mesh file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementEnd-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementEnd","text":"getRefinementEnd(r::Dict{String,Any})\n\nReturn Array{Float64} of the end location of the refinement line\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementGridSize-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementGridSize","text":"getRefinementGridSize(r::Dict{String,Any})\n\nReturns the grid size,h, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementLocation-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementLocation","text":"getRefinementLocation(r::Dict{String,Any})\n\nReturn Array{Float64} of the location of the refinement center.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementName","text":"getRefinementName(r::Dict{String,Any})\n\nReturn name of the refinement. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"getRefinementRegion(proj::Project, indx)\n\nGet the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"(i,r) = getRefinementRegion(project, name)\n\nGet the refinement region with the given name and its location in the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegionCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementRegionCenter","text":"getRefinementRegionCenter(r::Dict{String,Any})\n\nGet, or compute, the center of the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementStart-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementStart","text":"getRefinementStart (r::Dict{String,Any})\n\nReturn Array{Float64} of the start location of the refinement line. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementType","text":"getRefinementType(r::Dict{String,Any})\n\nReturn the type of refinement, either \"smooth\" or \"sharp\". r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementWidth-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementWidth","text":"getRefinementWidth(r::Dict{String,Any})\n\nReturns the region width,w, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingIterations-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingIterations","text":"getSmoothingIterations(proj::Project)\n\nGet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingStatus-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingStatus","text":"smoothingStatus(proj::Project)\n\nReturns whether the smoother will be \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingType-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingType","text":"getSmoothingType(proj::Project)\n\nReturns either \"LinearSpring\" or \"LinearAndCrossbarSpring\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplineNKnots-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplineNKnots","text":"getSplineNKnots(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplinePoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplinePoints","text":"getSplinePoints(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getStartPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getStartPoint","text":"getStartPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the start point for a line curve as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getXEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getXEqn","text":"getXEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getYEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getYEqn","text":"getYEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getZEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getZEqn","text":"getZEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.hasBackgroundGrid-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.hasBackgroundGrid","text":"hasBackgroundGrid(proj::Project)\n\nTests to see if the project has a backgroundGrid dictionary defined.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.innerBoundaryIndices-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.innerBoundaryIndices","text":"innerBoundaryIndices(proj::Project, curveName::String)\n\nReturns (curveIndex,chainIndex) for the location of the curve named curveName in it's inner boundary chain.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryAtIndex!-Tuple{HOHQMesh.Project, String, Int64, Dict{String, Any}, Vector{Any}, Vector{String}}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryAtIndex!","text":"insertInnerBoundaryAtIndex!(proj::Project, chainName::String, indx::Int, chain::??)\n\nInsert an entire inner boundary. Primarily meant for undo operation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64, String}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryCurveAtIndex!","text":"insertInnerBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any},\n indx::Int, boundaryName::String)\n\nInsert a curve crv into an inner boundary chain boundaryName at the specified index indx.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertOuterBoundaryCurveAtIndex!","text":"insertOuterBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any}, indx::Int)\n\nInsert a curve into the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertRefinementRegion!","text":"insertRefinementRegion!(proj::Project, r::Dict{String,Any}, indx::Int)\n\nUsed by undo()\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelChainIsOK-Tuple{Vector{Dict{String, Any}}, String}","page":"Reference","title":"HOHQMesh.modelChainIsOK","text":"modelChainIsOK(chain::Vector{Dict{String, Any}}, chainName::String)\n\nReturns true if the chain of curves is contiguous and closed; false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelCurvesAreOK-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.modelCurvesAreOK","text":"modelCurvesAreOK(proj::Project)\n\nGo through all curves in the model and make sure they are connected and closed. Also, remove any empty outer / inner boundary chains.\n\nReturns true if all curves are connected and closed, false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)\n\nCreate a new circular arc.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-2","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreate a new parametric equation curve.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-Tuple{String, Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})\n\nCreate a new line defined by its end points.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, nKnots::Int, data::Matrix{Float64})\n\nCreate a spline curve from an array of knots\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, String}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, dataFile::String)\n\nCreate a spline curve from the contents of a data file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newCircularArcCurve","page":"Reference","title":"HOHQMesh.newCircularArcCurve","text":"newCircularArcCurve(name::String, center::Array{Float64},\n startAngle::Float64, endAngle::Float64,\n units::String)\n\nCreates and returns a new circular arc curve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newEndPointsLineCurve-Tuple{String, Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.newEndPointsLineCurve","text":"newEndPointsLineCurve(name::String, xStart::Array{Float64},xEnd::Array[Float64])\n\nCreates and returns a new curve defined by its end points in the form of a Dictionary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newParametricEquationCurve","page":"Reference","title":"HOHQMesh.newParametricEquationCurve","text":"newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreates and returns a new parametricEquationCurve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newProject","text":"newProject(name::String, folder::String)\n\nCreate a new project with the given name. That name will be used for the mesh and plot files in the specified folder.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementCenter-Tuple{String, String, Array{Float64}, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementCenter","text":"newRefinementCenter(name, type,\n center, meshSize,\n width)\n\nCreate refinement center of type \"smooth\" or \"sharp\" centered at center = [x,y,z] with a mesh size meshSize spread over a radius width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementLine-Tuple{String, String, Array{Float64}, Array{Float64}, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementLine","text":"newRefinementLine(name, type,\n start, end,\n meshSize,\n width)\n\nCreate refinement line of type \"smooth\" or \"sharp\" between start = [x,y,z] and end = [x,y,z] with a mesh size meshSize spread over a width width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, nKnots::Int, data::Array{Float64,4})\n\nReturns a spline curve given the number of knots and the array of knots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, dataFile::String)\n\nReturns a spline curve given a data file that contains the number of knots on the first line, and the spline data following that.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.openProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.openProject","text":"openProject(fileName::String, folder::String)\n\nOpen existing project described in the control File.\n\nfolder = folder the control file is in\nfileName = the name of the file\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.plotProject!","page":"Reference","title":"HOHQMesh.plotProject!","text":"plotProject!(proj::Project, plotOptions::Int = 0)\n\nPlot objects specified by the plotOptions. Construct the plotOptions by the sum of what is to be drawn from the choices MODEL, GRID, MESH, REFINEMENTS.\n\nExample: To plot the model and the grid, plotOptions = MODEL + GRID. To plot just the mesh, plotOptions = MESH.\n\nTo plot everything, plotOptions = MODEL + GRID + MESH + REFINEMENTS\n\nContents are overlaid in the order: GRID, MESH, MODEL, REFINEMENTS\n\nnote: Requires Makie.jl\nPlease note that for this function to work, you need to load Makie.jl in your REPL (e.g., by calling using GLMakie).\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.postNotificationWithName-Tuple{Any, String, Tuple}","page":"Reference","title":"HOHQMesh.postNotificationWithName","text":"postNotificationWithName(sender::Any, name::String, userInfo::Tuple)\n\nExecutes the function associated with the observer for the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.refinementRegionPoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.refinementRegionPoints","text":"refinementRegionPoints(r::Dict{String,Any})\n\nReturns Array{Float64,2} being the plotting points of a refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String, innerBoundaryName::String)\n\nDelete the curve named curveName from the inner boundary named innerBoundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String)\n\nDelete the curve named curveName from the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeBackgroundGrid!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeBackgroundGrid!","text":"removeBackgroundGrid!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundary!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundary!","text":"removeInnerBoundary!(proj::Project, chainName::String)\n\nRemove an entire inner boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurve!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurve!","text":"removeInnerBoundaryCurve!(proj::Project, name::String, chainName::String)\n\nRemove the curve with name from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurveAtIndex!","text":"removeInnerBoundaryCurveAtIndex!(proj::Project, indx::Int, chainName::String)\n\nRemove the curve at index indx from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundary!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeOuterBoundary!","text":"removeOuterBoundary!(proj::Project)\n\nRemove the outer boundary curve if it exists.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveAtIndex!","text":"removeOuterBoundaryCurveAtIndex!(proj::Project, indx::Int)\n\nRemove a curve from the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveWithName!","text":"removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n\nRemove the named curve in the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRefinementRegion!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeRefinementRegion!","text":"removeRefinementRegion!(proj::Project, name::String)\n\nDelete the named refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRunParameters!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeRunParameters!","text":"removeRunParameters!(proj::Project)\n\nRemove the run parameters block from the project. This is not undo-able.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeSpringSmoother!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeSpringSmoother!","text":"removeSpringSmoother!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove_mesh!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.remove_mesh!","text":"remove_mesh!(proj::Project)\n\nRemove the mesh file, control file, plot file, and stats file from proj.projectDirectory and delete the mesh from the plot.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.renameCurve!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.renameCurve!","text":"renameCurve!(proj::Project, oldName::String, newName::String)\n\nAny curve(s) on the outer boundary or in the inner boundary chain(s) with oldName are renamed with newName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.saveProject-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.saveProject","text":"saveProject(proj::Project)\n\nproj = Project to be saved\n\nSave a project dictionary to the file path specified when the project was created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcCenter!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setArcCenter!","text":"setArcCenter!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the center of a circular arc.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcEndAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcEndAngle!","text":"setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcRadius!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcRadius!","text":"setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcStartAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcStartAngle!","text":"setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcUnits!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setArcUnits!","text":"setArcUnits(crv::Dict{String,Any}, units::String)\n\nSet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridLowerLeft!-Tuple{HOHQMesh.Project, Array{Float64}}","page":"Reference","title":"HOHQMesh.setBackgroundGridLowerLeft!","text":"setBackgroundGridLowerLeft!(proj::Project, x0::Array{Float64})\n\nSet the lower left location of the background grid for problems that have no outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSpacing!(proj::Project, dx::Float64, dy::Float64, dz::Float64 = 0.0)\n\nUser facing function\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Array{Float64}, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Array{Float64}, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, dx is passed an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Float64, Float64, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Float64, dy::Float64, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, the new grid size in either direction is passed individually with dxand dy.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSteps!-Tuple{HOHQMesh.Project, Array{Int64}}","page":"Reference","title":"HOHQMesh.setBackgroundGridSteps!","text":"setBackgroundGridSteps!(proj::Project, N::Array{Int})\n\nSet how many steps of size setBackgroundGridSpacing in each direction the background grid extends from the lower left.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setCurveName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setCurveName!","text":"setCurveName!(curveDict, name)\n\nSet the name of the curve represented by curveDict.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setEndPoint!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setEndPoint!","text":"setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the end point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setMeshFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setMeshFileFormat!","text":"setMeshFileFormat(proj::Project, meshFileFormat::String)\n\nSet the file format for the mesh file. Acceptable choices are \"ISM\", \"ISM-V2\", or \"ABAQUS\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setName!","text":"setName(proj::Project,name::String)\n\nThe name of the project is the filename to be used by the mesh, plot, and stats files. It is also the name of the control file the tool will produce.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPlotFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setPlotFileFormat!","text":"setPlotFileFormat(proj::Project, plotFileFormat::String)\n\nSet the file format for the plot file. Acceptable choices are \"sem\", which includes interior nodes and boundary nodes and \"skeleton\", which includes only the corner nodes.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPolynomialOrder!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setPolynomialOrder!","text":"setPolynomialOrder(proj::Project, p::Int)\n\nSet the polynomial order for boundary curves in the mesh file to p.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementEnd!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementEnd!","text":"setRefinementEnd!(refinementRegion, location)\n\nSet the end point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementGridSize!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementGridSize!","text":"setRefinementGridSize!(r::Dict{String,Any}, h)\n\nSet the grid size, h for the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementLocation!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementLocation!","text":"setRefinementLocation!(refinementCenter, location)\n\nSet the location of a refinement center to location = [x,y,z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementName!","text":"setRefinementName!(r::Dict{String,Any}, type)\n\nSet a name for the refinement region.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementStart!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementStart!","text":"setRefinementStart!(refinementRegion, location)\n\nSet the start point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementType!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementType!","text":"setRefinementType!(refinementRegion, type)\n\nSet the type, either \"smooth\" or \"sharp\" for the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementWidth!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementWidth!","text":"setRefinementWidth!(r::Dict{String,Any}, width)\n\nSet the width of the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingIterations!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setSmoothingIterations!","text":"setSmoothingIterations!(proj::Project, iterations::Int)\n\nSet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingStatus!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingStatus!","text":"setSmoothingStatus(proj:Project, status::String)\n\nStatus is either \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingType!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingType!","text":"setSmoothingType!(proj:Project, status::String)\n\nType is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplineNKnots!-Tuple{Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.setSplineNKnots!","text":"setSplineNKnots!(spline::Dict{String,Any}, nKnots::Int)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplinePoints!-Tuple{Dict{String, Any}, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.setSplinePoints!","text":"setSplinePoints!(spline::Dict{String,Any},points::Array{Float64,4})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setStartPoint!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setStartPoint!","text":"setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the start point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setXEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setXEqn!","text":"setXEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the x-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setYEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setYEqn!","text":"setYEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the y-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setZEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setZEqn!","text":"setZEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the zEqn-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.unRegisterForNotification-Tuple{Any, String}","page":"Reference","title":"HOHQMesh.unRegisterForNotification","text":"unRegisterForNotification(observer::Any, note::String)\n\nRemove the observer from being notified by the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.updatePlot!","page":"Reference","title":"HOHQMesh.updatePlot!","text":"updatePlot!(proj::Project, plotOptions::Int)\n\nReplot with the new plotOptions = combinations (sums) of\n\nGRID, MESH, MODEL, REFINEMENTS\n\nExample: updatePlot!(p, MESH + MODEL)\n\nnote: Requires Makie.jl\nPlease note that for this function to work, you need to load Makie.jl in your REPL (e.g., by calling using GLMakie).\n\n\n\n\n\n","category":"function"},{"location":"tutorials/spline_curves/#Spline-curves","page":"Spline curves","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line \"curves\". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.","category":"page"},{"location":"tutorials/spline_curves/#Synopsis","page":"Spline curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/spline_curves/#Initialization","page":"Spline curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a new project with the name \"spline_curves\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_project = newProject(\"spline_curves\", \"out\")","category":"page"},{"location":"tutorials/spline_curves/#Add-the-outer-boundary","page":"Spline curves","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The outer boundary curve for this tutorial is a circle of radius r=4 centered at the point (0 -1). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"circ = newCircularArcCurve(\"outerCircle\", # curve name\n [0.0, -1.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circ is assigned to be \"outerCircle\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new circ curve is then added to the spline_project as an outer boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToOuterBoundary!(spline_project, circ)","category":"page"},{"location":"tutorials/spline_curves/#Add-a-background-grid","page":"Spline curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for spline_project to have elements with side length 06 in each direction","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addBackgroundGrid!(spline_project, [0.6, 0.6, 0.0])","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"plotProject!(spline_project, MODEL+GRID)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"outerCircle\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/spline_curves/#Add-the-inner-boundaries","page":"Spline curves","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The domain of this tutorial will contain three inner boundary curves:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Cubic spline curve created from data points read in from a file.\nCubic spline curve created from points directly given in the code.\nTriangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-with-data-from-a-file","page":"Spline curves","title":"Cubic spline with data from a file","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots t_j, x_j, y_j, z_j where j indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a parametric spline curve from a file with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline1 = newSplineCurve(\"big_spline\", joinpath(@__DIR__, \"examples\", \"test_spline_curve_data.txt\"))","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline1 is assigned to be \"big_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline1 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline1, \"inner1\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve \"big_spline\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: one_curve)","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-from-data-in-Julia","page":"Spline curves","title":"Cubic spline from data in Julia","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Below, we construct another parametric spline using this strategy that consists of five data points","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n\nspline2 = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline2 is assigned to be \"small_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline2 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline2, \"inner2\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner2\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve \"small_spline\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: two_curves)","category":"page"},{"location":"tutorials/spline_curves/#Triangular-shape","page":"Spline curves","title":"Triangular shape","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"edge1 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.3, -1.0, 0.0], # start point\n [-1.7, -1.0, 0.0]) # end point\n\nedge2 = newEndPointsLineCurve(\"triangle\", # curve name\n [-1.7, -1.0, 0.0], # start point\n [-2.0, -0.4, 0.0]) # end point\n\nedge3 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.0, -0.4, 0.0], # start point\n [-2.3, -1.0, 0.0]) # end point","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, each edge of the curve is given the same name \"triangle\" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, edge1, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge2, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge3, \"inner3\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The inner boundary chain name \"inner3\" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called \"triangle\" labeled in the figure by 3.1, 3.2, and 3.3.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: three_curves)","category":"page"},{"location":"tutorials/spline_curves/#Generate-the-mesh","page":"Spline curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_curves.control: A HOHQMesh control file for the current project.\nspline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nspline_curves.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"generate_mesh(spline_project)\n 1 chevron elements removed from mesh.\n 1 chevron elements removed from mesh.\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.25359100000000001\n Number of nodes = 1176\n Number of Edges = 2225\n Number of Elements = 1047\n Number of Subdivisions = 4\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00006209 0.15607019 0.04505180 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00008965 2.78091496 1.23178864 1.00000000 999.99900000 1.00000000\n Condition 1.00000055 3.82171291 1.15535543 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00014261 6.78201663 1.46249737 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001491 0.10424647 0.03955817 0.00000000 999.99900000 1.00000000\n Minimum Angle 37.24189766 89.96174556 74.42003031 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.03128071 157.35065162 107.91806148 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of \"bad\" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: final_spline)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the \"big_spline\" curve. We decide that we are satisfied with the overall mesh quality.","category":"page"},{"location":"tutorials/spline_curves/#Summary","page":"Spline curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#Tutorials","page":"Overview","title":"Tutorials for HOHQMesh.jl","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"The tutorial section for HOHQMesh.jl provides step-by-step commands and accompanying explanations for the major features of the interactive mesh generation tools.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.","category":"page"},{"location":"tutorials/introduction/#[Straight-sided-outer-boundary](@ref)","page":"Overview","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.","category":"page"},{"location":"tutorials/introduction/#Synopsis","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/introduction/#[Curved-outer-boundary](@ref)","page":"Overview","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.","category":"page"},{"location":"tutorials/introduction/#Synopsis-2","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/introduction/#[Spline-curves](@ref)","page":"Overview","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/introduction/#Synopsis-3","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#[Creating-and-editing-curves](@ref)","page":"Overview","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve \"chain\" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.","category":"page"},{"location":"tutorials/introduction/#Synopsis-4","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/introduction/#[Symmetric-mesh](@ref)","page":"Overview","title":"Symmetric mesh","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs a mesh given a closed chain of outer boundary curves that is then reflected over a straight line or several co-linear lines indicated by the user. The result is a mesh that is symmetric with respect to the prescribed straight line.","category":"page"},{"location":"tutorials/introduction/#Synopsis-5","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Indicate a symmetry boundary line.\nConstruct an outer boundary with several connected curves.\nAdd the background grid when an outer boundary curve is present.\nRename boundaries in an existing interactive mesh project.\nVisualize an interactive mesh project.","category":"page"},{"location":"guided-tour/#Guided-tour","page":"Guided tour","title":"Guided tour","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In this brief overview, we highlight two scripts from the examples/ folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"See the HOHQMesh documentation for more details about its terminology and capabilities.","category":"page"},{"location":"guided-tour/#Mesh-from-a-control-file","page":"Guided tour","title":"Mesh from a control file","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_from_control_file.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"This command will create mesh and plot files in the out directory.","category":"page"},{"location":"guided-tour/#Build-a-mesh-from-scratch","page":"Guided tour","title":"Build a mesh from scratch","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_boundary.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For completeness, we provide the example script and walk-through each step in the construction of the Project below.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"using HOHQMesh\n\n# Create a new project with the name \"IceCreamCone\", which will also be the\n# name of the mesh, plot and stats files, written to output folder `out`.\n\np = newProject(\"IceCreamCone\", \"out\")\n\n# Outer boundary for this example mesh is a complete circle. Add it into the project.\n\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\n\n# Inner boundary is three curves. Two straight lines and a circular arc.\n# Note the three curve are connected to ensure a counter-clockwise orientation\n# as required by HOHQMesh\n\n# Create the three interior curves. The individual names of each curve in the inner\n# chain are used internally by HOHQMesh and are output as the given boundary names in\n# the mesh file.\n\ncone1 = newEndPointsLineCurve(\"cone1\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\niceCream = newCircularArcCurve(\"iceCream\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")\ncone2 = newEndPointsLineCurve(\"cone2\", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])\n\n# Assemble the three curve in a closed chain oriented counter-clockwise. The chain\n# name `IceCreamCone` is only used internally by HOHQMesh.\n\naddCurveToInnerBoundary!(p, cone1, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, iceCream, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, cone2, \"IceCreamCone\")\n\n# Adjust some `RunParameters` and overwrite the defaults values. In this case, we\n# set a new value for the boundary order polynomial representation and adjust the\n# output mesh file format to be `sem`\n\nsetPolynomialOrder!(p, 4)\nsetPlotFileFormat!(p, \"sem\")\n\n# A background grid is required for the mesh generation. In this example we lay a\n# background grid of Cartesian boxes with size 0.5.\n\naddBackgroundGrid!(p, [0.5, 0.5, 0.0])\n\n# Plot the project model curves and background grid\n\nif isdefined(Main, :Makie)\n plotProject!(p, MODEL+GRID)\n @info \"Press enter to generate the mesh and update the plot.\"\n readline()\n else # Throw an informational message about plotting to the user\n @info \"To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again.\"\n end\n\n# Generate the mesh. This produces the mesh and TecPlot files `IceCreamCone.mesh` and `IceCreamCone.tec`\n# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is\n# updated with the mesh that was generated.\n\ngenerate_mesh(p)\n\n# After the mesh successfully generates mesh statistics, such as the number of corner nodes,\n# the number of elements etc., are printed to the REPL","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The first line creates a new project, where the mesh and plot file names will be derived from the project name, \"IceCreamCone\" written to the specified folder.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, \"IceCreamCone\" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script resets the polynomial order (default = 5) and the plot file format (default = \"skeleton\").","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, only the mesh size needs to be specified using","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"addBackgroundGrid!(proj::Project, bgSize::Array{Float64})","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The example sets the background mesh size to be 0.5 in the x and y directions. The z component is ignored.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The script finishes by generating the quad mesh and plotting the results, as shown below","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"(Image: iceCreamCone)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Finally, the script returns the project so that it can be edited further, if desired.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To save a control file for HOHQMesh, simply invoke","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"saveProject(proj::Project)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"where the name of the control file (traditionally with a .control extension) matches the name of the project proj. saveProject is automatically called when a mesh is generated.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.","category":"page"},{"location":"license/#License","page":"License","title":"License","text":"","category":"section"},{"location":"license/","page":"License","title":"License","text":"MIT LicenseCopyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-LakemperPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"CheatSheet/#Commands-Cheat-Sheet","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples/ folder constructs an identical example mesh as shown in the Guided tour using generic function calls.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"A thorough description of the functions can be found in the API section.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The general workflow of the interactive mesh functionality within a REPL session is","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Create a project\nAdd boundary curves\nAdd a background grid\nAdd manual refinement (if desired)\nGenerate mesh","category":"page"},{"location":"CheatSheet/#Project","page":"Commands Cheat Sheet","title":"Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" p = newProject(, )","category":"page"},{"location":"CheatSheet/#cs-plotting","page":"Commands Cheat Sheet","title":"Plotting","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" plotProject!(p, options)\n updatePlot!(p, options)","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The options are any sum of MODEL, GRID, REFINEMENTS, and MESH.","category":"page"},{"location":"CheatSheet/#Curves","page":"Commands Cheat Sheet","title":"Curves","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" c = new(name, startLocation [x,y,z], endLocation [x,y,z]) *Straight Line*\n c = new(name, center [x,y,z], radius, startAngle, endAngle) *Circular Arc*\n c = new(name, xEqn, yEqn, zEqn) *Parametric equation*\n c = new(name, dataFile) *Spline with data from a file*\n c = new(name, nKnots, knotsMatrix) *Spline with given knot values*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#cs-manual-refinement","page":"Commands Cheat Sheet","title":"Manual Refinement","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" r = newRefinementCenter(name, type, center, gridSize, radius)\n r = newRefinementLine(name, type, startPoint, endPoint, gridSize, width)","category":"page"},{"location":"CheatSheet/#Adding-to-a-Project","page":"Commands Cheat Sheet","title":"Adding to a Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" add!(p, c) *Add outer boundary curve*\n add!(p, c, ) *Add curve to an inner boundary*\n add!(p, r) *Add refinement region*\n\n addBackgroundGrid!(p, [top, left, bottom, right], [nX, nY, nZ]) *No outer boundary*\n addBackgroundGrid!(p, [dx, dy, dz]) *If an outer boundary is present*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function add!, which is a shortcut to the full functions, e.g. addOuterBoundaryCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#Accessing-items","page":"Commands Cheat Sheet","title":"Accessing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" crv = getCurve(p, curveName) *Get a curve in the outer boundary*\n crv = getCurve(p, curveName, boundaryName) *Get a curve in an inner boundary*\n indx, chain = getChain(p, boundaryName) *Get a complete inner boundary curve*\n r = getRefinementRegion(p, name)","category":"page"},{"location":"CheatSheet/#Removing-from-Project","page":"Commands Cheat Sheet","title":"Removing from Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" removeOuterBoundary!(p) *Entire outer boundary curve*\n removeInnerBoundary!(p, innerBoundaryName) *Entire inner boundary curve*\n remove!(p, name) *Curve in outer boundary*\n remove!(p, name, innerBoundaryName) *Curve in inner boundary*\n removeRefinementRegion!(p, name)","category":"page"},{"location":"CheatSheet/#Editing-items","page":"Commands Cheat Sheet","title":"Editing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.","category":"page"},{"location":"CheatSheet/#Meshing","page":"Commands Cheat Sheet","title":"Meshing","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" generate_mesh(p)\n remove_mesh!(p)","category":"page"},{"location":"#HOHQMesh.jl","page":"Home","title":"HOHQMesh.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6 and above.","category":"page"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> import Pkg; Pkg.add(\"HOHQMesh\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the Julia REPL, you can load HOHQMesh with","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using HOHQMesh","category":"page"},{"location":"","page":"Home","title":"Home","text":"and then happily generate away!","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> control_file = joinpath(HOHQMesh.examples_dir(), \"GingerbreadMan.control\")\n\njulia> output = generate_mesh(control_file)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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,","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: gingerbreadman_with_edges_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"while the 3D file Snake.control produces this mesh:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: snake_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.,","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_box_two_circles.jl\"))","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using Pkg; Pkg.add(\"GLMakie\")\njulia> using GLMakie","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: box_two_circles)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Further explanation of the interactive functionality can be found here. Additional examples are available in the Tutorials.","category":"page"},{"location":"#authors-index-md","page":"Home","title":"Authors","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#License-and-contributing","page":"Home","title":"License and contributing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Acknowledgements","page":"Home","title":"Acknowledgements","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"tutorials/symmetric_mesh/#Symmetric-mesh","page":"Symmetric mesh","title":"Symmetric mesh","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh that is symmetric with respect to a straight line outer boundary as prescribed by the user. At the end of this tutorial one can find the script necessary to generate the meshes described herein.","category":"page"},{"location":"tutorials/symmetric_mesh/#Synopsis","page":"Symmetric mesh","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"Indicate a symmetry boundary line.\nConstruct an outer boundary with several connected curves.\nAdd the background grid when an outer boundary curve is present.\nRename boundaries in an existing interactive mesh project.\nVisualize an interactive mesh project.","category":"page"},{"location":"tutorials/symmetric_mesh/#Initialization","page":"Symmetric mesh","title":"Initialization","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"We create a new project with the name \"symmetric_mesh\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named symmetric_mesh.control. If the folder out does not exist, it will be created automatically in the current working directory.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"symmetric_mesh = newProject(\"symmetric_mesh\", \"out\")","category":"page"},{"location":"tutorials/symmetric_mesh/#Adjusting-project-parameters","page":"Symmetric mesh","title":"Adjusting project parameters","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"For the symmetric_mesh project we query the current values for the polynomial order and the mesh output format","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"julia> getPolynomialOrder(symmetric_mesh)\n5\n\njulia> getMeshFileFormat(symmetric_mesh)\n\"ISM-V2\"","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"We change the default polynomial order in the symmetric_mesh to be 6 with a corresponding setter function","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"setPolynomialOrder!(symmetric_mesh, 6)","category":"page"},{"location":"tutorials/symmetric_mesh/#Add-a-background-grid","page":"Symmetric mesh","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for symmetric_mesh to have elements with side length 025 in each direction","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"addBackgroundGrid!(spline_project, [0.25, 0.25, 0.0])","category":"page"},{"location":"tutorials/symmetric_mesh/#Add-the-outer-boundary","page":"Symmetric mesh","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"With the background grid size set, we next build the outer boundary for the present mesh project. This outer boundary is composed of nine straight line segments and a half circle arc. The curves will afterwards be added to the mesh project symmetric_mesh in counter-clockwise order as required by HOHQMesh.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"line1 = newEndPointsLineCurve(\":symmetry\", [-0.05, 2.0, 0.0],\n [-0.05, 0.0, 0.0])\n\nline2 = newEndPointsLineCurve(\"bottom\", [-0.05, 0.0, 0.0],\n [1.0, 0.0, 0.0])\n\nline3 = newEndPointsLineCurve(\"right\", [1.0, 0.0, 0.0],\n [1.0, 0.5, 0.0])\n\nhalf_circle = newCircularArcCurve(\"circle\", # curve name\n [1.0, 0.75, 0.0], # circle center\n 0.25, # circle radius\n 270.0, # start angle\n 90.0, # end angle\n \"degrees\") # angle units\n\nline4 = newEndPointsLineCurve(\"right\", [1.0, 1.0, 0.0],\n [1.0, 1.5, 0.0])\n\nline5 = newEndPointsLineCurve(\"bump\", [1.0, 1.5, 0.0],\n [0.75, 1.5, 0.0])\n\nline6 = newEndPointsLineCurve(\"bump\", [0.75, 1.5, 0.0],\n [0.75, 1.75, 0.0])\n\nline7 = newEndPointsLineCurve(\"bump\", [0.75, 1.75, 0.0],\n [1.0, 1.75, 0.0])\n\nline8 = newEndPointsLineCurve(\"right\", [1.0, 1.75, 0.0],\n [1.0, 2.0, 0.0])\n\nline9 = newEndPointsLineCurve(\"top\", [1.0, 2.0, 0.0],\n [-0.05, 2.0, 0.0])","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"The given boundary names will also be the element boundary names written to the mesh file. The only exception is the first boundary curve that is given the name \":symmetry\". This outer boundary curve name is a special keyword in HOHQMesh that says it is a straight line across which a reflection will occur. Two worthwhile notes are","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"the leading colon on this boundary name keyword is present to avoid conflicts with any other use of the symmetry name.\nif the curve designated as \":symmetry\" is not a straight line, then an error is thrown by HOHQMesh and the mesh will not be reflected.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"tip: Name of the symmetry boundary\nThe name of the reflection boundary line is not case-sensitive, thus\":symmetry\" or \":Symmetry\" or \":SYMMETRY\" are all valid and will be recognized as the keyword for symmetry.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"Now that all the outer boundary curves are defined we add them to the symmetric_mesh project in counter-clockwise order","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"addCurveToOuterBoundary!(symmetric_mesh, line1)\naddCurveToOuterBoundary!(symmetric_mesh, line2)\naddCurveToOuterBoundary!(symmetric_mesh, half_circle)\naddCurveToOuterBoundary!(symmetric_mesh, line3)\naddCurveToOuterBoundary!(symmetric_mesh, line4)\naddCurveToOuterBoundary!(symmetric_mesh, line5)\naddCurveToOuterBoundary!(symmetric_mesh, line6)\naddCurveToOuterBoundary!(symmetric_mesh, line7)\naddCurveToOuterBoundary!(symmetric_mesh, line8)\naddCurveToOuterBoundary!(symmetric_mesh, line9)","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"We visualize the outer boundary curve chain and background grid with the following","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"plotProject!(symmetric_mesh, MODEL+GRID)","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and its constituent curve segments are labeled accordingly with the names prescribed in the curve construction above.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"(Image: before_generation)","category":"page"},{"location":"tutorials/symmetric_mesh/#Generate-the-mesh","page":"Symmetric mesh","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"We next generate the mesh from the information contained in symmetric_mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"symmetric_mesh.control: A HOHQMesh control file for the current project.\nsymmetric_mesh.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nsymmetric_mesh.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"To do this we execute the command","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"generate_mesh(symmetric_mesh)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 4.0154999999999996E-002\n Number of nodes = 343\n Number of Edges = 626\n Number of Elements = 284\n Number of Subdivisions = 2\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00227157 0.06552808 0.01366911 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00389317 2.07480912 1.22443835 1.00000000 999.99900000 1.00000000\n Condition 1.00048947 1.93007666 1.12853177 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00607156 3.56541719 1.44892631 1.00000000 4.00000000 1.00000000\n Jacobian 0.00158627 0.06202757 0.01120120 0.00000000 999.99900000 1.00000000\n Minimum Angle 48.35050023 89.33703938 75.39251039 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.94150752 129.91539960 106.20679399 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"Note that the call to generate_mesh prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the mesh file generated.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"(Image: first_reflect_mesh)","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"tip: Boundary names in the mesh file\nThe boundary names of the original outer curves will be those defined by the user in their construction above. The boundary labeled \":symmetry\" is now internal and is marked appropriately as such. The reflected boundary names are appended with _R (for reflected) in the mesh file. For instance, the reflected version of the boundary bottom has the name bottom_R or the boundary named circle has the reflected boundary counterpart named circle_R. These can be changed as desired by editing the mesh file.","category":"page"},{"location":"tutorials/symmetric_mesh/#Changing-the-reflection-line","page":"Symmetric mesh","title":"Changing the reflection line","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"It is also possible to create a symmetry boundary composed of multiple co-linear segments.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"To change the line along which the mesh is reflected, we remove the current mesh that was just generated and re-plot the model curves and background grid.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"remove_mesh!(symmetric_mesh)\nupdatePlot!(symmetric_mesh, MODEL+GRID)","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"The remove_mesh! command deletes the mesh information from the interactive mesh project symmetric_mesh as well as the mesh file symmetric_mesh.mesh, control file symmetric_mesh.control, plot file symmetric_mesh.tec, and mesh statistics file symmetric_mesh.txt from the out folder.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"To illustrate the reflection about multiple boundary curves (which must be co-linear!), we first rename the current symmetry boundary curve O.1 to have the name \"left\". Next, we rename all the co-linear boundary curves O.3, O.5, and O.9 to have the name \":symmetry\". Both are done with the function renameCurve!","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"renameCurve!(symmetric_mesh, \":symmetry\", # existing curve name\n \"left\") # new curve name\nrenameCurve!(symmetric_mesh, \"right\", \":symmetry\")","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"After the boundary names are adjusted the plot updates automatically to give the figure below.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"(Image: before_generation2)","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"We then generate the new mesh from the information contained in symmetric_mesh. Again, a check ensures that the curves designated as \":symmetry\" are co-linear. An error is thrown if this is not the case and the mesh will not be reflected. This saves the control, tec, and mesh files into the out folder and yields","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"generate_mesh(symmetric_mesh)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 3.7763000000000019E-002\n Number of nodes = 337\n Number of Edges = 622\n Number of Elements = 284\n Number of Subdivisions = 2\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00227157 0.06552808 0.01366911 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00389317 2.07480912 1.22443835 1.00000000 999.99900000 1.00000000\n Condition 1.00048947 1.93007666 1.12853177 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00607156 3.56541719 1.44892631 1.00000000 4.00000000 1.00000000\n Jacobian 0.00158627 0.06202757 0.01120120 0.00000000 999.99900000 1.00000000\n Minimum Angle 48.35050023 89.33703938 75.39251039 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.94150752 129.91539960 106.20679399 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"The updated visualization is given below. Note, the flexibility to define multiple co-linear symmetric boundaries creates a symmetric mesh with closed internal boundaries. In this example, a circle and a rectangle.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"(Image: first_reflect_mesh2)","category":"page"},{"location":"tutorials/symmetric_mesh/#Summary","page":"Symmetric mesh","title":"Summary","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"Indicate a symmetry boundary line.\nConstruct an outer boundary with several connected curves.\nAdd the background grid when an outer boundary curve is present.\nRename boundaries in an existing interactive mesh project.\nVisualize an interactive mesh project.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"For completeness, we include two scripts with all the commands to generate the meshes displayed for a reflection about the left boundary line O.1 as well as a reflection about the right boundary composed of the three co-linear segments O.3, O.5, and O.9. Note, we do not include the plotting in these scripts.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"# Interactive mesh with reflection on the left over a single symmetry boundary\n# as well as a reflection on the right over multiple co-linear symmetry boundaries.\n#\n# Keywords: outer boundary, reflection, symmetric mesh\nusing HOHQMesh\n\n# new project\nsymmetric_mesh = newProject(\"symmetric_mesh\", \"out\")\n\n# reset the polynomial degree of the mesh\nsetPolynomialOrder!(symmetric_mesh, 6)\n\n# A background grid is required for the mesh generation\naddBackgroundGrid!(symmetric_mesh, [0.25, 0.25, 0.0])\n\n# Create all the outer boundary curves and add them to the mesh project.\n# Note: (1) Curve names are those that will be present in the mesh file\n# (2) Boundary named \":symmetry\" is where reflection occurs\n\nline1 = newEndPointsLineCurve(\":symmetry\", [-0.05, 2.0, 0.0],\n [-0.05, 0.0, 0.0])\n\nline2 = newEndPointsLineCurve(\"bottom\", [-0.05, 0.0, 0.0],\n [1.0, 0.0, 0.0])\n\nline3 = newEndPointsLineCurve(\"right\", [1.0, 0.0, 0.0],\n [1.0, 0.5, 0.0])\n\nhalf_circle = newCircularArcCurve(\"circle\", # curve name\n [1.0, 0.75, 0.0], # circle center\n 0.25, # circle radius\n 270.0, # start angle\n 90.0, # end angle\n \"degrees\") # angle units\n\nline4 = newEndPointsLineCurve(\"right\", [1.0, 1.0, 0.0],\n [1.0, 1.5, 0.0])\n\nline5 = newEndPointsLineCurve(\"bump\", [1.0, 1.5, 0.0],\n [0.75, 1.5, 0.0])\n\nline6 = newEndPointsLineCurve(\"bump\", [0.75, 1.5, 0.0],\n [0.75, 1.75, 0.0])\n\nline7 = newEndPointsLineCurve(\"bump\", [0.75, 1.75, 0.0],\n [1.0, 1.75, 0.0])\n\nline8 = newEndPointsLineCurve(\"right\", [1.0, 1.75, 0.0],\n [1.0, 2.0, 0.0])\n\nline9 = newEndPointsLineCurve(\"top\", [1.0, 2.0, 0.0],\n [-0.05, 2.0, 0.0])\n\naddCurveToOuterBoundary!(symmetric_mesh, line1)\naddCurveToOuterBoundary!(symmetric_mesh, line2)\naddCurveToOuterBoundary!(symmetric_mesh, half_circle)\naddCurveToOuterBoundary!(symmetric_mesh, line3)\naddCurveToOuterBoundary!(symmetric_mesh, line4)\naddCurveToOuterBoundary!(symmetric_mesh, line5)\naddCurveToOuterBoundary!(symmetric_mesh, line6)\naddCurveToOuterBoundary!(symmetric_mesh, line7)\naddCurveToOuterBoundary!(symmetric_mesh, line8)\naddCurveToOuterBoundary!(symmetric_mesh, line9)\n\n# Generate the mesh. Saves the mesh file to the directory \"out\".\ngenerate_mesh(symmetric_mesh)\n\n# Delete the existing mesh before modifying boundary names.\nremove_mesh!(symmetric_mesh)\n\n# Rename the outer boundaries appropriately to set the symmetry boundary\n# on the right composed of multiple co-linear segments.\nrenameCurve!(symmetric_mesh, \":symmetry\", # existing curve name\n \"left\") # new curve name\nrenameCurve!(symmetric_mesh, \"right\", \":symmetry\")\n\n# Generate the mesh. Saves the mesh file to the directory \"out\".\ngenerate_mesh(symmetric_mesh)","category":"page"}]
+}
diff --git a/dev/siteinfo.js b/dev/siteinfo.js
new file mode 100644
index 00000000..33434919
--- /dev/null
+++ b/dev/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "dev";
diff --git a/dev/testing/index.html b/dev/testing/index.html
new file mode 100644
index 00000000..45402804
--- /dev/null
+++ b/dev/testing/index.html
@@ -0,0 +1,3 @@
+
+Testing · HOHQMesh.jl
During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In HOHQMesh and its related repositories, tests are triggered by
each git push to main and
each git push to any pull request.
Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.
Test and coverage requirements
Before merging a pull request (PR) to main, we require that
The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing
julia> using Pkg; Pkg.test("HOHQMesh")
in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,
julia> # Run all test for the interactive Curve API
+ include(joinpath("test", "test_curve.jl"))
We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.
Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.
When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).
Test duration
As a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).
In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered "covered" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The "Details" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.
Coverage requirements
In general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.
Settings
This document was generated with Documenter.jl version 0.27.25 on Sunday 1 September 2024. Using Julia version 1.10.5.
diff --git a/dev/tutorials/create_edit_curves/index.html b/dev/tutorials/create_edit_curves/index.html
new file mode 100644
index 00000000..5f0a8918
--- /dev/null
+++ b/dev/tutorials/create_edit_curves/index.html
@@ -0,0 +1,166 @@
+
+Creating and editing curves · HOHQMesh.jl
The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a "chain" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "sandbox" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.
We first create the outer boundary curve chain that is composed of three pieces
Straight line segment from $(0, -7)$ to $(5, 3)$.
Half-circle arc of radius $r=5$ centered at $(0, 3)$.
Straight line segment from $(-5, 3)$ to $(0, -7)$.
Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
outer_line1 = newEndPointsLineCurve("Line1", # curve name
+ [0.0, -7.0, 0.0], # start point
+ [5.0, 3.0, 0.0]) # end point
+
+outer_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-5.0, 3.0, 0.0], # start point
+ [0.0, -7.0, 0.0]) # end point
To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from $0$ to $180$ degrees.
outer_arc = newCircularArcCurve("Arc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 5.0, # radius
+ 0.0, # start angle
+ 180.0, # end angle
+ "degrees") # units for angle
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be "Arc".
The curve names "Line1", "Line2", and "Arc" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.
The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction
We visualize the outer boundary curve chain and background grid with the following
plotProject!(sandbox_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains three curve segments "Line1", "Arc", and "Line2" labeled in the figure by O.1, O.2, and O.3, respectively.
Suppose that the domain boundary requires a curved segment instead of the straight line "Line2". We will replace this line segment in the outer boundary chain with a cubic spline.
First, we remove the "Line2" curve from the "Outer" chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
The plot automatically updates and we see that the outer boundary is open and contains two segments: "Line1" and "Arc".
Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve "Arc" and end at the first point of the curve "Line1". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. The spline curve constructor newSplineCurve also takes the number of points as an input argument.
We create a pill shaped inner boundary curve chain composed of four pieces
Straight line segment from $(1, 5)$ to $(1, 3)$.
Half-circle arc of radius $r=1$ centered at $(0, 3)$.
Straight line segment from $(-1, 3)$ to $(-1, 5)$.
Half-circle arc of radius $r=1$ centered at $(0, 5)$.
Similar to the construction of the "Outer" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
inner_line1 = newEndPointsLineCurve("Line1", # curve name
+ [1.0, 5.0, 0.0], # start point
+ [1.0, 3.0, 0.0]) # end point
+
+inner_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-1.0, 3.0, 0.0], # start point
+ [-1.0, 5.0, 0.0]) # end point
To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at $(0, 3)$ varies from $0$ to $-180$ degrees. The top half-circle arc centered at $(0, 5)$ has an angle that varies from $180$ to $0$ degrees. The construction of the two circle arcs are
inner_bottom_arc = newCircularArcCurve("BottomArc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 1.0, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+
+inner_top_arc = newCircularArcCurve("TopArc", # curve name
+ [0.0, 5.0, 0.0], # center
+ 1.0, # radius
+ 180.0, # start angle
+ 0.0, # end angle
+ "degrees") # units for angle
Note, we use "radians" to set the angle bounds for inner_bottom_arc and "degrees" for the angle bounds of inner_top_arc.
The curve names "Line1", "Line2", "BottomArc", and "TopArc" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.
The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.
This inner boundary chain name "inner" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments "Line1", "BottomArc", "Line2", and "TopArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:
sandbox.control: A HOHQMesh control file for the current project.
sandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
sandbox.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 7.5414000000000009E-002
+ Number of nodes = 511
+ Number of Edges = 933
+ Number of Elements = 422
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00002932 1.17335568 0.18813138 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00953438 2.30790024 1.31439620 1.00000000 999.99900000 1.00000000
+ Condition 1.00041663 2.41773865 1.21024584 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.01673809 3.68828437 1.59413340 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001750 1.13820387 0.14143901 0.00000000 999.99900000 1.00000000
+ Minimum Angle 32.22733574 89.35690571 68.75321248 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.61089476 152.37947944 113.36221513 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.
The remove_mesh! command deletes the mesh information from the sandbox_project as well as the mesh file sandbox.mesh, control file sandbox.control, plot file sandbox.tec, and mesh statistics file sandbox.txt from the out folder.
Suppose that the inner boundary actually requires a curved segment instead of the straight line "Line1". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.
We remove the "Line1" curve from the inner chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: "BottomArc", "Line2", and "TopArc". Note that the index of the remaining curves has changed as shown below.
Brief note about undo / redo
The interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.
undoActionName()
+"Remove Inner Boundary Curve"
We can undo the removal of the "Line1" curve with undo
undo()
+"Undo Remove Inner Boundary Curve"
In addition to reinstating "Line1" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.
Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.
The new inner curve segment will be an oscillating line given by the parametric equations
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above
We see from the figure that this parametric equation curve starts at the point $(1,5)$ and, therefore, matches the end point of the existing curve "TopArc" present in the "inner" chain. However, the parametric equation curve ends at the point $(2,3)$ which does not match the "BottomArc" curve. So, the inner boundary chain remains open.
Attempt to generate a mesh with an open curve chain
An open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.
To create a closed boundary curve we must remove the "BottomArc" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point $(2, 3)$ and end at the point $(-1, 3)$ to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the "BottomArc" from the "inner" chain.
The figure updates to display the "inner" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.
A half-circle arc that joins the points $(2, 3)$ and $(-1, 3)$ has a radius $r=1.5$, is centered at $(0.5, 3)$ and has an angle that vaires from $0$ to $-180$. We construct this circle arc and directly add it to the sandbox_project.
new_bottom_arc = newCircularArcCurve("wideBottomArc", # curve name
+ [0.5, 3.0, 0.0], # center
+ 1.5, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
The updated plot now gives the modified, closed inner curve chain that now contains four curve segments "Line2", "TopArc", "wiggleLine", and "wideBottomArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.11353599999999998
+ Number of nodes = 712
+ Number of Edges = 1308
+ Number of Elements = 596
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00002932 1.15661960 0.12823902 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.01050856 3.14732001 1.34260027 1.00000000 999.99900000 1.00000000
+ Condition 1.00037771 2.59434067 1.22850175 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.02744717 3.68828437 1.64751502 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001750 1.13149451 0.09443920 0.00000000 999.99900000 1.00000000
+ Minimum Angle 31.87236189 89.33988565 67.86178629 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.44177106 157.27121105 114.35699650 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The visualization updates automatically and the background grid is removed after when the mesh is generated.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.
Add the background grid when an outer boundary curve is present.
Visualize an interactive mesh project.
Discuss undo / redo capabilities.
Construct and add parametric spline curves.
Construct and add a curve from parametric equations.
Construct and add straight line segments.
Construct and add circular arc segments.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with modified outer and inner curve chains
+#
+# Create inner / outer boundary chains composed of the four
+# available HOHQMesh curve types.
+#
+# Keywords: outer boundary, inner boundary, parametric equations,
+# circle arcs, cubic spline, curve removal
+using HOHQMesh
+
+# Instantiate the project
+sandbox_project = newProject("sandbox", "out")
+
+# Add the background grid
+addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])
+
+# Create and add the original outer boundary curves
+outer_line1 = newEndPointsLineCurve("Line1", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])
+outer_line2 = newEndPointsLineCurve("Line2", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])
+outer_arc = newCircularArcCurve("Arc", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, "degrees")
+
+addCurveToOuterBoundary!(sandbox_project, outer_line1)
+addCurveToOuterBoundary!(sandbox_project, outer_arc)
+addCurveToOuterBoundary!(sandbox_project, outer_line2)
+
+# Modify the outer boundary to have a spline instead of a straight line
+removeOuterBoundaryCurveWithName!(sandbox_project, "Line2")
+
+spline_data = [ [0.0 -5.0 3.0 0.0]
+ [0.25 -2.0 1.0 0.0]
+ [0.5 -4.0 0.5 0.0]
+ [0.75 -2.0 -3.0 0.0]
+ [1.0 0.0 -7.0 0.0] ]
+outer_spline = newSplineCurve("Spline", 5, spline_data)
+addCurveToOuterBoundary!(sandbox_project, outer_spline)
+
+# Create and add the inner boundary curves
+inner_line1 = newEndPointsLineCurve("Line1", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])
+inner_line2 = newEndPointsLineCurve("Line2", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])
+inner_bottom_arc = newCircularArcCurve("BottomArc", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, "radians")
+inner_top_arc = newCircularArcCurve("TopArc", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, "degrees")
+
+addCurveToInnerBoundary!(sandbox_project, inner_line1, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_line2, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_top_arc, "inner")
+
+# Generate a mesh
+generate_mesh(sandbox_project)
+
+# Delete the existing mesh before modifying the inner boundary curve chain
+remove_mesh!(sandbox_project)
+
+# Modify the inner boundary curve with an oscillatory line and a new circle arc
+removeInnerBoundaryCurve!(sandbox_project, "Line1", "inner")
+removeInnerBoundaryCurve!(sandbox_project, "BottomArc", "inner")
+
+xEqn = "x(t) = t + 1"
+yEqn = "y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)"
+zEqn = "z(t) = 0.0"
+inner_eqn = newParametricEquationCurve("wiggleLine", xEqn, yEqn, zEqn)
+
+new_bottom_arc = newCircularArcCurve("wideBottomArc", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, "radians")
+
+addCurveToInnerBoundary!(sandbox_project, inner_eqn, "inner")
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
+
+# Regenerate the final mesh
+generate_mesh(sandbox_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Sunday 1 September 2024. Using Julia version 1.10.5.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.
The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "TheBlob" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
The following commands create a new curve for the parametric equations above
The name of this curve is assigned to be "Blob". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for blob_project to have elements with side length two in each direction
addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])
We next visualize the outer boundary curve and background grid with the following
plotProject!(blob_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "Blob" labeled in the figure by O.1.
From the visualization we see that the background grid is likely too coarse to produce a "good" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction
setBackgroundGridSize!(blob_project, 0.5, 0.5)
Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.
The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.
We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:
TheBlob.control: A HOHQMesh control file for the current project.
TheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
TheBlob.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 8.4328000000000000E-002
+ Number of nodes = 479
+ Number of Edges = 895
+ Number of Elements = 417
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025286 0.36208840 0.11936333 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002882 2.58443761 1.26335838 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.12867591 1.18585825 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006176 4.77438730 1.51314025 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011275 0.28170345 0.10292806 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.38249259 89.99827733 73.08294187 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132795 156.98701187 109.36585212 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point $(-4, 0)$ is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with
Above we create a circular refinement region centered at the point $(-4, -0.5)$ with a desired resolution size $0.4$ and a radius of $1.0$. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.
With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 9.2778999999999986E-002
+ Number of nodes = 503
+ Number of Edges = 940
+ Number of Elements = 438
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025286 0.36208840 0.11412688 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002883 2.47056840 1.26416662 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.12867592 1.18429212 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006176 4.77438730 1.51407242 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011275 0.28170345 0.09814903 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.38249259 89.99827897 72.80049710 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132784 156.98701188 109.63478104 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.
Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.
Define a curved outer boundary using parametric equations.
Add and adjust the background grid.
Visualize an interactive mesh project.
Add manual refinement to a local region of the domain.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with a curved outer boundary
+#
+# Create an outer boundary from a set of parametric equations.
+# Add manual refinement in a small region around the point (-4, -0.5).
+#
+# Keywords: outer boundary, parametric equations, refinement center
+using HOHQMesh
+
+# Instantiate the project
+blob_project = newProject("TheBlob", "out")
+
+# Create and add the outer boundary curve
+xEqn = "x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3"
+yEqn = "y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2"
+zEqn = "z(t) = 0.0"
+blob = newParametricEquationCurve("Blob", xEqn, yEqn, zEqn)
+addCurveToOuterBoundary!(blob_project, blob)
+
+# Add the background grid
+addBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])
+
+# Create and add the refinement region
+center = newRefinementCenter("region", "smooth", [-4.0, -0.5, 0.0], 0.4, 1.0)
+addRefinementRegion!(blob_project, center)
+
+# Generate the mesh
+generate_mesh(blob_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Sunday 1 September 2024. Using Julia version 1.10.5.
For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.
For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.
This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.
This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.
This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line "curves".
This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve "chain" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.
This tutorial constructs a mesh given a closed chain of outer boundary curves that is then reflected over a straight line or several co-linear lines indicated by the user. The result is a mesh that is symmetric with respect to the prescribed straight line.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line "curves". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "spline_curves" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.
The outer boundary curve for this tutorial is a circle of radius $r=4$ centered at the point $(0, -1)$. We define this circular curve with the function newCircularArcCurve as follows
circ = newCircularArcCurve("outerCircle", # curve name
+ [0.0, -1.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circ is assigned to be "outerCircle". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circ curve is then added to the spline_project as an outer boundary curve with
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for spline_project to have elements with side length $0.6$ in each direction
We next visualize the outer boundary curve and background grid with the following
plotProject!(spline_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "outerCircle" labeled in the figure by O.1.
A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots $t_j$, $x_j$, $y_j$, $z_j$ where $j$ indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder
We create a parametric spline curve from a file with
The name of the curve stored in the dictionary spline1 is assigned to be "big_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline1 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve "big_spline" labeled in the figure by 1.1.
Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.
Below, we construct another parametric spline using this strategy that consists of five data points
The name of the curve stored in the dictionary spline2 is assigned to be "small_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline2 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner2" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve "small_spline" labeled in the figure by 2.1.
Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with
edge1 = newEndPointsLineCurve("triangle", # curve name
+ [-2.3, -1.0, 0.0], # start point
+ [-1.7, -1.0, 0.0]) # end point
+
+edge2 = newEndPointsLineCurve("triangle", # curve name
+ [-1.7, -1.0, 0.0], # start point
+ [-2.0, -0.4, 0.0]) # end point
+
+edge3 = newEndPointsLineCurve("triangle", # curve name
+ [-2.0, -0.4, 0.0], # start point
+ [-2.3, -1.0, 0.0]) # end point
Here, each edge of the curve is given the same name "triangle" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.
The inner boundary chain name "inner3" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called "triangle" labeled in the figure by 3.1, 3.2, and 3.3.
With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:
spline_curves.control: A HOHQMesh control file for the current project.
spline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
spline_curves.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(spline_project)
+ 1 chevron elements removed from mesh.
+ 1 chevron elements removed from mesh.
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.25359100000000001
+ Number of nodes = 1176
+ Number of Edges = 2225
+ Number of Elements = 1047
+ Number of Subdivisions = 4
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00006209 0.15607019 0.04505180 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00008965 2.78091496 1.23178864 1.00000000 999.99900000 1.00000000
+ Condition 1.00000055 3.82171291 1.15535543 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00014261 6.78201663 1.46249737 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001491 0.10424647 0.03955817 0.00000000 999.99900000 1.00000000
+ Minimum Angle 37.24189766 89.96174556 74.42003031 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.03128071 157.35065162 107.91806148 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of "bad" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the "big_spline" curve. We decide that we are satisfied with the overall mesh quality.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples/ folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "box_two_circles" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.
When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.
For the box_project we first query the current values for the polynomial order and the mesh output format
We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be $4$ and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.
The domain for this tutorial is a rectangular box with the bounds $[0,30]\times[0,15]$. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:
Set the lower left corner point of the domain $(x_0, y_0)$, define the element size in each spatial direction $\Delta x$ and $\Delta y$, and the number of steps taken in each direction $N_x, N_y$. The resulting background grid will have the extent $[x_0, x_0 + N_x \Delta x]$ by $[y_0, y_0 + N_y \Delta y]$. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands
Set the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box $[0,30]\times[0,15]$ we use
Next, we add the two circular inner boundary curves with different radii.
The first circle will have radius $r=2$ and be centered at the point $(4, 4)$. We define this circular curve with the function newCircularArcCurve as follows
circle1 = newCircularArcCurve("circle1", # curve name
+ [4.0, 4.0, 0.0], # circle center
+ 2.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be "circle1". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circle1 curve is then added to the box_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called "inner1" and it contains a single curve "circle1" labeled in the figure by 1.1.
With analogous steps we create another circular curve with radius $r=4$, centered at $(20, 9)$ and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.
circle2 = newCircularArcCurve("circle2", # curve name
+ [20.0, 9.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 2.0 * pi, # end angle
+ "radians") # angle units
+addCurveToInnerBoundary!(box_project, circle2, "inner2")
Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called "inner2" and it contains a single curve "circle2" labeled in the figure by 2.1.
With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:
box_two_circles.control: A HOHQMesh control file for the current project.
box_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
box_two_circles.inp: A mesh file with format ABAQUS that was set above.
To do this we execute the command
generate_mesh(box_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 2.9116999999999997E-002
+ Number of nodes = 498
+ Number of Edges = 921
+ Number of Elements = 422
+ Number of Subdivisions = 0
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.34513977 1.15385313 0.91833886 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00000004 1.71084672 1.08736698 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 1.46547984 1.04928616 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00000006 2.43578615 1.16710823 1.00000000 4.00000000 1.00000000
+ Jacobian 0.17854786 1.07210200 0.86801191 0.00000000 999.99900000 1.00000000
+ Minimum Angle 50.57680338 89.99999787 83.84338772 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00000259 136.97085026 96.70176380 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.
From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh that is symmetric with respect to a straight line outer boundary as prescribed by the user. At the end of this tutorial one can find the script necessary to generate the meshes described herein.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "symmetric_mesh" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named symmetric_mesh.control. If the folder out does not exist, it will be created automatically in the current working directory.
When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.
For the symmetric_mesh project we query the current values for the polynomial order and the mesh output format
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for symmetric_mesh to have elements with side length $0.25$ in each direction
With the background grid size set, we next build the outer boundary for the present mesh project. This outer boundary is composed of nine straight line segments and a half circle arc. The curves will afterwards be added to the mesh project symmetric_mesh in counter-clockwise order as required by HOHQMesh.
The given boundary names will also be the element boundary names written to the mesh file. The only exception is the first boundary curve that is given the name ":symmetry". This outer boundary curve name is a special keyword in HOHQMesh that says it is a straight line across which a reflection will occur. Two worthwhile notes are
the leading colon on this boundary name keyword is present to avoid conflicts with any other use of the symmetry name.
if the curve designated as ":symmetry" is not a straight line, then an error is thrown by HOHQMesh and the mesh will not be reflected.
Name of the symmetry boundary
The name of the reflection boundary line is not case-sensitive, thus":symmetry" or ":Symmetry" or ":SYMMETRY" are all valid and will be recognized as the keyword for symmetry.
Now that all the outer boundary curves are defined we add them to the symmetric_mesh project in counter-clockwise order
We visualize the outer boundary curve chain and background grid with the following
plotProject!(symmetric_mesh, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and its constituent curve segments are labeled accordingly with the names prescribed in the curve construction above.
We next generate the mesh from the information contained in symmetric_mesh. This will output the following files to the out folder:
symmetric_mesh.control: A HOHQMesh control file for the current project.
symmetric_mesh.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
symmetric_mesh.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(symmetric_mesh)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 4.0154999999999996E-002
+ Number of nodes = 343
+ Number of Edges = 626
+ Number of Elements = 284
+ Number of Subdivisions = 2
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00227157 0.06552808 0.01366911 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00389317 2.07480912 1.22443835 1.00000000 999.99900000 1.00000000
+ Condition 1.00048947 1.93007666 1.12853177 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00607156 3.56541719 1.44892631 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00158627 0.06202757 0.01120120 0.00000000 999.99900000 1.00000000
+ Minimum Angle 48.35050023 89.33703938 75.39251039 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.94150752 129.91539960 106.20679399 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
Note that the call to generate_mesh prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the mesh file generated.
Boundary names in the mesh file
The boundary names of the original outer curves will be those defined by the user in their construction above. The boundary labeled ":symmetry" is now internal and is marked appropriately as such. The reflected boundary names are appended with _R (for reflected) in the mesh file. For instance, the reflected version of the boundary bottom has the name bottom_R or the boundary named circle has the reflected boundary counterpart named circle_R. These can be changed as desired by editing the mesh file.
It is also possible to create a symmetry boundary composed of multiple co-linear segments.
To change the line along which the mesh is reflected, we remove the current mesh that was just generated and re-plot the model curves and background grid.
The remove_mesh! command deletes the mesh information from the interactive mesh project symmetric_mesh as well as the mesh file symmetric_mesh.mesh, control file symmetric_mesh.control, plot file symmetric_mesh.tec, and mesh statistics file symmetric_mesh.txt from the out folder.
To illustrate the reflection about multiple boundary curves (which must be co-linear!), we first rename the current symmetry boundary curve O.1 to have the name "left". Next, we rename all the co-linear boundary curves O.3, O.5, and O.9 to have the name ":symmetry". Both are done with the function renameCurve!
renameCurve!(symmetric_mesh, ":symmetry", # existing curve name
+ "left") # new curve name
+renameCurve!(symmetric_mesh, "right", ":symmetry")
After the boundary names are adjusted the plot updates automatically to give the figure below.
We then generate the new mesh from the information contained in symmetric_mesh. Again, a check ensures that the curves designated as ":symmetry" are co-linear. An error is thrown if this is not the case and the mesh will not be reflected. This saves the control, tec, and mesh files into the out folder and yields
generate_mesh(symmetric_mesh)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 3.7763000000000019E-002
+ Number of nodes = 337
+ Number of Edges = 622
+ Number of Elements = 284
+ Number of Subdivisions = 2
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00227157 0.06552808 0.01366911 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00389317 2.07480912 1.22443835 1.00000000 999.99900000 1.00000000
+ Condition 1.00048947 1.93007666 1.12853177 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00607156 3.56541719 1.44892631 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00158627 0.06202757 0.01120120 0.00000000 999.99900000 1.00000000
+ Minimum Angle 48.35050023 89.33703938 75.39251039 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.94150752 129.91539960 106.20679399 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The updated visualization is given below. Note, the flexibility to define multiple co-linear symmetric boundaries creates a symmetric mesh with closed internal boundaries. In this example, a circle and a rectangle.
Construct an outer boundary with several connected curves.
Add the background grid when an outer boundary curve is present.
Rename boundaries in an existing interactive mesh project.
Visualize an interactive mesh project.
For completeness, we include two scripts with all the commands to generate the meshes displayed for a reflection about the left boundary line O.1 as well as a reflection about the right boundary composed of the three co-linear segments O.3, O.5, and O.9. Note, we do not include the plotting in these scripts.
# Interactive mesh with reflection on the left over a single symmetry boundary
+# as well as a reflection on the right over multiple co-linear symmetry boundaries.
+#
+# Keywords: outer boundary, reflection, symmetric mesh
+using HOHQMesh
+
+# new project
+symmetric_mesh = newProject("symmetric_mesh", "out")
+
+# reset the polynomial degree of the mesh
+setPolynomialOrder!(symmetric_mesh, 6)
+
+# A background grid is required for the mesh generation
+addBackgroundGrid!(symmetric_mesh, [0.25, 0.25, 0.0])
+
+# Create all the outer boundary curves and add them to the mesh project.
+# Note: (1) Curve names are those that will be present in the mesh file
+# (2) Boundary named ":symmetry" is where reflection occurs
+
+line1 = newEndPointsLineCurve(":symmetry", [-0.05, 2.0, 0.0],
+ [-0.05, 0.0, 0.0])
+
+line2 = newEndPointsLineCurve("bottom", [-0.05, 0.0, 0.0],
+ [1.0, 0.0, 0.0])
+
+line3 = newEndPointsLineCurve("right", [1.0, 0.0, 0.0],
+ [1.0, 0.5, 0.0])
+
+half_circle = newCircularArcCurve("circle", # curve name
+ [1.0, 0.75, 0.0], # circle center
+ 0.25, # circle radius
+ 270.0, # start angle
+ 90.0, # end angle
+ "degrees") # angle units
+
+line4 = newEndPointsLineCurve("right", [1.0, 1.0, 0.0],
+ [1.0, 1.5, 0.0])
+
+line5 = newEndPointsLineCurve("bump", [1.0, 1.5, 0.0],
+ [0.75, 1.5, 0.0])
+
+line6 = newEndPointsLineCurve("bump", [0.75, 1.5, 0.0],
+ [0.75, 1.75, 0.0])
+
+line7 = newEndPointsLineCurve("bump", [0.75, 1.75, 0.0],
+ [1.0, 1.75, 0.0])
+
+line8 = newEndPointsLineCurve("right", [1.0, 1.75, 0.0],
+ [1.0, 2.0, 0.0])
+
+line9 = newEndPointsLineCurve("top", [1.0, 2.0, 0.0],
+ [-0.05, 2.0, 0.0])
+
+addCurveToOuterBoundary!(symmetric_mesh, line1)
+addCurveToOuterBoundary!(symmetric_mesh, line2)
+addCurveToOuterBoundary!(symmetric_mesh, half_circle)
+addCurveToOuterBoundary!(symmetric_mesh, line3)
+addCurveToOuterBoundary!(symmetric_mesh, line4)
+addCurveToOuterBoundary!(symmetric_mesh, line5)
+addCurveToOuterBoundary!(symmetric_mesh, line6)
+addCurveToOuterBoundary!(symmetric_mesh, line7)
+addCurveToOuterBoundary!(symmetric_mesh, line8)
+addCurveToOuterBoundary!(symmetric_mesh, line9)
+
+# Generate the mesh. Saves the mesh file to the directory "out".
+generate_mesh(symmetric_mesh)
+
+# Delete the existing mesh before modifying boundary names.
+remove_mesh!(symmetric_mesh)
+
+# Rename the outer boundaries appropriately to set the symmetry boundary
+# on the right composed of multiple co-linear segments.
+renameCurve!(symmetric_mesh, ":symmetry", # existing curve name
+ "left") # new curve name
+renameCurve!(symmetric_mesh, "right", ":symmetry")
+
+# Generate the mesh. Saves the mesh file to the directory "out".
+generate_mesh(symmetric_mesh)
Settings
This document was generated with Documenter.jl version 0.27.25 on Sunday 1 September 2024. Using Julia version 1.10.5.
crv = get(p,curveName) *Get a curve in the outer boundary*
+ crv = get(p,curveName, boundaryName) *Get a curve in an inner boundary*
+ indx, chain = getChain(p,boundaryName) *Get a complete inner boundary curve*
+ r = getRefinementRegion(p, name)
All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them out.
HQMTool is an API to build quad/hex meshes. Two examples are included to get you started. The first reads in an existing control file from the HOHQMesh examples collection. To see that example, run
runDemo()
The second example builds a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. The script is
function iceCreamCone(folder::String)
+#
+# Create a project with the name "IceCreamCone", which will be the name of the mesh, plot and stats files,
+# written to `path`. This version uses generic versions of
+# the API.
+#
+ p = newProject("IceCreamCone",path)
+#
+# Outer boundary
+#
+ circ = new("outerCircle",[0.0,-1.0,0.0],4.0,0.0,360.0,"degrees")
+ add!(p,circ)
+#
+# Inner boundary
+#
+ cone1 = new("cone1", [0.0,-3.0,0.0],[1.0,0.0,0.0]) # A line
+ iceCream = new("iceCream",[0.0,0.0,0.0],1.0,0.0,180.0,"degrees") # An arc
+ cone2 = new("cone2", [-1.0,0.0,0.0],[0.0,-3.0,0.0]) # A line
+ add!(p,cone1,"IceCreamCone")
+ add!(p,iceCream,"IceCreamCone")
+ add!(p,cone2,"IceCreamCone")
+#
+# Set some control RunParameters to overwrite the defaults
+#
+ setPolynomialOrder!(p,4)
+ setPlotFileFormat!(p,"sem")
+#
+# To mesh, a background grid is needed
+#
+ addBackgroundGrid!(p, [0.1,0.1,0.0])
+#
+# Show the model and grid
+#
+ plotProject!(p, MODEL+GRID)
+#
+# Generate the mesh and plot
+#
+ println("Press any key to continue and generate the mesh")
+ readline()
+ generateMesh(p)
+ updatePlot!(p, MODEL+MESH)
+
+ return p
+end
The first line creates a new project, where the mesh and plot file names will be derived from the project name, "IceCreamCone" written to the specified folder.
To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently operational:
Parametric equations
Splines
Lines defined by their end points
Circular arcs
In the example, the outer boundary is a closed circular arc with center at [0,0,0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary! through the generic name add!. You can add any number of curves, but they must be added in order, counter-clockwise.
Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, "IceCreamCone" made up of two lines and a half circular arc. Again, add them in order, counter-clockwise.
For convenience, newProject will generate default run parameters, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script sets the polynomial order (default = 5) and the plot file format (default = "skeleton").
One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extend of the domain to be meshed, so only the mesh size needs to be specified using
plotProject(p,MODEL)
+
+To update the plot at any time, use
+
+ updatePlot!(p, options)
+
+Options are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. (You normally are not intersted in the background grid once the mesh is generated.)
The mesh will be stored in <folder> with the name <projectName>.mesh. The control file will also be saved in that folder with the name <projectName>.control, which you can read in again later and modify, remesh, etc. The function will print grid information, and will plot the grid as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject command.
The supplied name will be the default name of the mesh and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.
The options are any combination of MODEL, GRID, MESH, and REFINEMENTS. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH. REFINEMENTS will show where manual refinement is added.
If the model is modified and you want to re-plot with the new values, invoke
updatePlot!(proj::Project, options)
but genrally the plot will be updated automatically as you build the model.
The mesh file format is either ISM or ISM-V2. The plot file (Which can be viewed with something like VisIt or Paraview) format is either skeleton or sem. The former is just a low order finite elemnt represntation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom. At this time, if you want to plot the grid in HQMTool, then you must use ISM-V2 as the mesh file format.
By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with
There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One or the other has to be specified after a new project has been created.
Use one of the first two if there is no outer boundary. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1]+N dx[1]]X[x0[2], x0[2]+Ndx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, N, bgSize are all vectors [ *, \, *] giving the x, y, and z components.
A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations.
To change the defaults, the smoother parameters can be set/enquired with the functions
Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas in the geometry.
where the type is either smooth or sharp, x0 = [x,y,z] is the location of the center, h is the mesh size, and w is the extent of the refinement region.
Using the curve creation routines, described in the next section below, create curves in sucessive order counter-clockwise along the outer boundary and add them to the outer boundary curve using
+
+ [Return:nothing] addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})
+ Generic: add!(...)
+
+`crv` is the dictionary that represents the curve.
[Return:Dict{String,Any}] newParametricEquationCurve(name::String,
+ xEqn::String,
+ yEqn::String,
+ zEqn::String = "z(t) = 0.0" )
+ Generic: new(...)
+
+Returns a new parametric equation. Equations must be of the form
+
+ <function name>(<argument>) = ...
+
+The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant `pi` is defined for use. Exponention is done with `^`. All number literals are interpreted as floating point numbers.
+
+Example:
+
+ x(s) = 2.0 + 3*cos(2*pi*s)^2
+
+The z-Equation is optional, but for now must define zero for z.
The center is an array of the form [x,y,z]. The units argument defines the start and end angle units, and is either "degrees" or "radians". That argument is optional, and defaults to "degrees".
A spline is defined by an array of knots, t<sub>j</sub>,x<sub>j</sub>,y<sub>j</sub>,z<sub>j</sub>. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the t,x,y,z values, e.g.
All curves are actually dictionaries of type Dict{String,Any}, and since Julia is not a particularly object oriented language, the parameters can be accessed and edited directly by key and value. In fact, all objects except for the Project, are of type Dict{String,Any}. The project holds all the control and model objects in its projectDirectory. However, if you do that, then undo/redo and plot updating won't happen.
Settings
This document was generated with Documenter.jl version 0.27.14 on Saturday 12 March 2022. Using Julia version 1.6.5.
diff --git a/previews/PR10/assets/documenter.js b/previews/PR10/assets/documenter.js
new file mode 100644
index 00000000..a1ada46f
--- /dev/null
+++ b/previews/PR10/assets/documenter.js
@@ -0,0 +1,325 @@
+// Generated by Documenter.jl
+requirejs.config({
+ paths: {
+ 'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/languages/julia.min',
+ 'headroom': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/headroom.min',
+ 'jqueryui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min',
+ 'katex-auto-render': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/contrib/auto-render.min',
+ 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min',
+ 'headroom-jquery': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/jQuery.headroom.min',
+ 'katex': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/katex.min',
+ 'highlight': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/highlight.min',
+ 'highlight-julia-repl': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/languages/julia-repl.min',
+ },
+ shim: {
+ "highlight-julia": {
+ "deps": [
+ "highlight"
+ ]
+ },
+ "katex-auto-render": {
+ "deps": [
+ "katex"
+ ]
+ },
+ "headroom-jquery": {
+ "deps": [
+ "jquery",
+ "headroom"
+ ]
+ },
+ "highlight-julia-repl": {
+ "deps": [
+ "highlight"
+ ]
+ }
+}
+});
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'katex', 'katex-auto-render'], function($, katex, renderMathInElement) {
+$(document).ready(function() {
+ renderMathInElement(
+ document.body,
+ {
+ "delimiters": [
+ {
+ "left": "$",
+ "right": "$",
+ "display": false
+ },
+ {
+ "left": "$$",
+ "right": "$$",
+ "display": true
+ },
+ {
+ "left": "\\[",
+ "right": "\\]",
+ "display": true
+ }
+ ]
+}
+
+ );
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'highlight', 'highlight-julia', 'highlight-julia-repl'], function($) {
+$(document).ready(function() {
+ hljs.highlightAll();
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require([], function() {
+function addCopyButtonCallbacks() {
+ for (const el of document.getElementsByTagName("pre")) {
+ const button = document.createElement("button");
+ button.classList.add("copy-button", "fas", "fa-copy");
+ el.appendChild(button);
+
+ const success = function () {
+ button.classList.add("success", "fa-check");
+ button.classList.remove("fa-copy");
+ };
+
+ const failure = function () {
+ button.classList.add("error", "fa-times");
+ button.classList.remove("fa-copy");
+ };
+
+ button.addEventListener("click", function () {
+ copyToClipboard(el.innerText).then(success, failure);
+
+ setTimeout(function () {
+ button.classList.add("fa-copy");
+ button.classList.remove("success", "fa-check", "fa-times");
+ }, 5000);
+ });
+ }
+}
+
+function copyToClipboard(text) {
+ // clipboard API is only available in secure contexts
+ if (window.navigator && window.navigator.clipboard) {
+ return window.navigator.clipboard.writeText(text);
+ } else {
+ return new Promise(function (resolve, reject) {
+ try {
+ const el = document.createElement("textarea");
+ el.textContent = text;
+ el.style.position = "fixed";
+ el.style.opacity = 0;
+ document.body.appendChild(el);
+ el.select();
+ document.execCommand("copy");
+
+ resolve();
+ } catch (err) {
+ reject(err);
+ } finally {
+ document.body.removeChild(el);
+ }
+ });
+ }
+}
+
+if (document.readyState === "loading") {
+ document.addEventListener("DOMContentLoaded", addCopyButtonCallbacks);
+} else {
+ addCopyButtonCallbacks();
+}
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'headroom', 'headroom-jquery'], function($, Headroom) {
+
+// Manages the top navigation bar (hides it when the user starts scrolling down on the
+// mobile).
+window.Headroom = Headroom; // work around buggy module loading?
+$(document).ready(function() {
+ $('#documenter .docs-navbar').headroom({
+ "tolerance": {"up": 10, "down": 10},
+ });
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+// Modal settings dialog
+$(document).ready(function() {
+ var settings = $('#documenter-settings');
+ $('#documenter-settings-button').click(function(){
+ settings.toggleClass('is-active');
+ });
+ // Close the dialog if X is clicked
+ $('#documenter-settings button.delete').click(function(){
+ settings.removeClass('is-active');
+ });
+ // Close dialog if ESC is pressed
+ $(document).keyup(function(e) {
+ if (e.keyCode == 27) settings.removeClass('is-active');
+ });
+});
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+// Manages the showing and hiding of the sidebar.
+$(document).ready(function() {
+ var sidebar = $("#documenter > .docs-sidebar");
+ var sidebar_button = $("#documenter-sidebar-button")
+ sidebar_button.click(function(ev) {
+ ev.preventDefault();
+ sidebar.toggleClass('visible');
+ if (sidebar.hasClass('visible')) {
+ // Makes sure that the current menu item is visible in the sidebar.
+ $("#documenter .docs-menu a.is-active").focus();
+ }
+ });
+ $("#documenter > .docs-main").bind('click', function(ev) {
+ if ($(ev.target).is(sidebar_button)) {
+ return;
+ }
+ if (sidebar.hasClass('visible')) {
+ sidebar.removeClass('visible');
+ }
+ });
+})
+
+// Resizes the package name / sitename in the sidebar if it is too wide.
+// Inspired by: https://github.com/davatron5000/FitText.js
+$(document).ready(function() {
+ e = $("#documenter .docs-autofit");
+ function resize() {
+ var L = parseInt(e.css('max-width'), 10);
+ var L0 = e.width();
+ if(L0 > L) {
+ var h0 = parseInt(e.css('font-size'), 10);
+ e.css('font-size', L * h0 / L0);
+ // TODO: make sure it survives resizes?
+ }
+ }
+ // call once and then register events
+ resize();
+ $(window).resize(resize);
+ $(window).on('orientationchange', resize);
+});
+
+// Scroll the navigation bar to the currently selected menu item
+$(document).ready(function() {
+ var sidebar = $("#documenter .docs-menu").get(0);
+ var active = $("#documenter .docs-menu .is-active").get(0);
+ if(typeof active !== 'undefined') {
+ sidebar.scrollTop = active.offsetTop - sidebar.offsetTop - 15;
+ }
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+function set_theme(theme) {
+ var active = null;
+ var disabled = [];
+ for (var i = 0; i < document.styleSheets.length; i++) {
+ var ss = document.styleSheets[i];
+ var themename = ss.ownerNode.getAttribute("data-theme-name");
+ if(themename === null) continue; // ignore non-theme stylesheets
+ // Find the active theme
+ if(themename === theme) active = ss;
+ else disabled.push(ss);
+ }
+ if(active !== null) {
+ active.disabled = false;
+ if(active.ownerNode.getAttribute("data-theme-primary") === null) {
+ document.getElementsByTagName('html')[0].className = "theme--" + theme;
+ } else {
+ document.getElementsByTagName('html')[0].className = "";
+ }
+ disabled.forEach(function(ss){
+ ss.disabled = true;
+ });
+ }
+
+ // Store the theme in localStorage
+ if(typeof(window.localStorage) !== "undefined") {
+ window.localStorage.setItem("documenter-theme", theme);
+ } else {
+ console.error("Browser does not support window.localStorage");
+ }
+}
+
+// Theme picker setup
+$(document).ready(function() {
+ // onchange callback
+ $('#documenter-themepicker').change(function themepick_callback(ev){
+ var themename = $('#documenter-themepicker option:selected').attr('value');
+ set_theme(themename);
+ });
+
+ // Make sure that the themepicker displays the correct theme when the theme is retrieved
+ // from localStorage
+ if(typeof(window.localStorage) !== "undefined") {
+ var theme = window.localStorage.getItem("documenter-theme");
+ if(theme !== null) {
+ $('#documenter-themepicker option').each(function(i,e) {
+ e.selected = (e.value === theme);
+ })
+ } else {
+ $('#documenter-themepicker option').each(function(i,e) {
+ e.selected = $("html").hasClass(`theme--${e.value}`);
+ })
+ }
+ }
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+// update the version selector with info from the siteinfo.js and ../versions.js files
+$(document).ready(function() {
+ var version_selector = $("#documenter .docs-version-selector");
+ var version_selector_select = $("#documenter .docs-version-selector select");
+
+ version_selector_select.change(function(x) {
+ target_href = version_selector_select.children("option:selected").get(0).value;
+ window.location.href = target_href;
+ });
+
+ // add the current version to the selector based on siteinfo.js, but only if the selector is empty
+ if (typeof DOCUMENTER_CURRENT_VERSION !== 'undefined' && $('#version-selector > option').length == 0) {
+ var option = $("");
+ version_selector_select.append(option);
+ }
+
+ if (typeof DOC_VERSIONS !== 'undefined') {
+ var existing_versions = version_selector_select.children("option");
+ var existing_versions_texts = existing_versions.map(function(i,x){return x.text});
+ DOC_VERSIONS.forEach(function(each) {
+ var version_url = documenterBaseURL + "/../" + each;
+ var existing_id = $.inArray(each, existing_versions_texts);
+ // if not already in the version selector, add it as a new option,
+ // otherwise update the old option with the URL and enable it
+ if (existing_id == -1) {
+ var option = $("");
+ version_selector_select.append(option);
+ } else {
+ var option = existing_versions[existing_id];
+ option.value = version_url;
+ option.disabled = false;
+ }
+ });
+ }
+
+ // only show the version selector if the selector has been populated
+ if (version_selector_select.children("option").length > 0) {
+ version_selector.toggleClass("visible");
+ }
+})
+
+})
diff --git a/previews/PR10/assets/search.js b/previews/PR10/assets/search.js
new file mode 100644
index 00000000..1a514547
--- /dev/null
+++ b/previews/PR10/assets/search.js
@@ -0,0 +1,251 @@
+// Generated by Documenter.jl
+requirejs.config({
+ paths: {
+ 'lunr': 'https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.9/lunr.min',
+ 'lodash': 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min',
+ 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min',
+ }
+});
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'lunr', 'lodash'], function($, lunr, _) {
+
+$(document).ready(function() {
+ // parseUri 1.2.2
+ // (c) Steven Levithan
+ // MIT License
+ function parseUri (str) {
+ var o = parseUri.options,
+ m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
+ uri = {},
+ i = 14;
+
+ while (i--) uri[o.key[i]] = m[i] || "";
+
+ uri[o.q.name] = {};
+ uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
+ if ($1) uri[o.q.name][$1] = $2;
+ });
+
+ return uri;
+ };
+ parseUri.options = {
+ strictMode: false,
+ key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
+ q: {
+ name: "queryKey",
+ parser: /(?:^|&)([^&=]*)=?([^&]*)/g
+ },
+ parser: {
+ strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
+ loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
+ }
+ };
+
+ $("#search-form").submit(function(e) {
+ e.preventDefault()
+ })
+
+ // list below is the lunr 2.1.3 list minus the intersect with names(Base)
+ // (all, any, get, in, is, only, which) and (do, else, for, let, where, while, with)
+ // ideally we'd just filter the original list but it's not available as a variable
+ lunr.stopWordFilter = lunr.generateStopWordFilter([
+ 'a',
+ 'able',
+ 'about',
+ 'across',
+ 'after',
+ 'almost',
+ 'also',
+ 'am',
+ 'among',
+ 'an',
+ 'and',
+ 'are',
+ 'as',
+ 'at',
+ 'be',
+ 'because',
+ 'been',
+ 'but',
+ 'by',
+ 'can',
+ 'cannot',
+ 'could',
+ 'dear',
+ 'did',
+ 'does',
+ 'either',
+ 'ever',
+ 'every',
+ 'from',
+ 'got',
+ 'had',
+ 'has',
+ 'have',
+ 'he',
+ 'her',
+ 'hers',
+ 'him',
+ 'his',
+ 'how',
+ 'however',
+ 'i',
+ 'if',
+ 'into',
+ 'it',
+ 'its',
+ 'just',
+ 'least',
+ 'like',
+ 'likely',
+ 'may',
+ 'me',
+ 'might',
+ 'most',
+ 'must',
+ 'my',
+ 'neither',
+ 'no',
+ 'nor',
+ 'not',
+ 'of',
+ 'off',
+ 'often',
+ 'on',
+ 'or',
+ 'other',
+ 'our',
+ 'own',
+ 'rather',
+ 'said',
+ 'say',
+ 'says',
+ 'she',
+ 'should',
+ 'since',
+ 'so',
+ 'some',
+ 'than',
+ 'that',
+ 'the',
+ 'their',
+ 'them',
+ 'then',
+ 'there',
+ 'these',
+ 'they',
+ 'this',
+ 'tis',
+ 'to',
+ 'too',
+ 'twas',
+ 'us',
+ 'wants',
+ 'was',
+ 'we',
+ 'were',
+ 'what',
+ 'when',
+ 'who',
+ 'whom',
+ 'why',
+ 'will',
+ 'would',
+ 'yet',
+ 'you',
+ 'your'
+ ])
+
+ // add . as a separator, because otherwise "title": "Documenter.Anchors.add!"
+ // would not find anything if searching for "add!", only for the entire qualification
+ lunr.tokenizer.separator = /[\s\-\.]+/
+
+ // custom trimmer that doesn't strip @ and !, which are used in julia macro and function names
+ lunr.trimmer = function (token) {
+ return token.update(function (s) {
+ return s.replace(/^[^a-zA-Z0-9@!]+/, '').replace(/[^a-zA-Z0-9@!]+$/, '')
+ })
+ }
+
+ lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'juliaStopWordFilter')
+ lunr.Pipeline.registerFunction(lunr.trimmer, 'juliaTrimmer')
+
+ var index = lunr(function () {
+ this.ref('location')
+ this.field('title',{boost: 100})
+ this.field('text')
+ documenterSearchIndex['docs'].forEach(function(e) {
+ this.add(e)
+ }, this)
+ })
+ var store = {}
+
+ documenterSearchIndex['docs'].forEach(function(e) {
+ store[e.location] = {title: e.title, category: e.category, page: e.page}
+ })
+
+ $(function(){
+ searchresults = $('#documenter-search-results');
+ searchinfo = $('#documenter-search-info');
+ searchbox = $('#documenter-search-query');
+ function update_search(querystring) {
+ tokens = lunr.tokenizer(querystring)
+ results = index.query(function (q) {
+ tokens.forEach(function (t) {
+ q.term(t.toString(), {
+ fields: ["title"],
+ boost: 100,
+ usePipeline: true,
+ editDistance: 0,
+ wildcard: lunr.Query.wildcard.NONE
+ })
+ q.term(t.toString(), {
+ fields: ["title"],
+ boost: 10,
+ usePipeline: true,
+ editDistance: 2,
+ wildcard: lunr.Query.wildcard.NONE
+ })
+ q.term(t.toString(), {
+ fields: ["text"],
+ boost: 1,
+ usePipeline: true,
+ editDistance: 0,
+ wildcard: lunr.Query.wildcard.NONE
+ })
+ })
+ })
+ searchinfo.text("Number of results: " + results.length)
+ searchresults.empty()
+ results.forEach(function(result) {
+ data = store[result.ref]
+ link = $(''+data.title+'')
+ link.attr('href', documenterBaseURL+'/'+result.ref)
+ if (data.category != "page"){
+ cat = $('('+data.category+', '+data.page+')')
+ } else {
+ cat = $('('+data.category+')')
+ }
+ li = $('
This package is a thin Julia wrapper around the High Order Hex-Quad Mesher (a.k.a. HOHQMesh) created and developed by David A. Kopriva. HOHQMesh.jl is available on Linux, MacOS, and Windows.
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.
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
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:
HOHQMesh.jl was initiated by Michael Schlottke-Lakemper (University of Cologne, Germany), who is also the principal developer of HOHQMesh.jl. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
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.
Settings
This document was generated with Documenter.jl version 0.27.14 on Saturday 12 March 2022. Using Julia version 1.6.5.
Copyright (c) 2021-present Michael Schlottke-Lakemper
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Settings
This document was generated with Documenter.jl version 0.27.14 on Saturday 12 March 2022. Using Julia version 1.6.5.
Add the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version
Add the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.
addSpringSmoother!(status::String, type::String, nIterations::Int)
+
+status is either `ON` or `OFF`
+type is either `LinearSpring` or `LinearAndCrossbarSpring`
Return a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.
Generate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.
You can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.
You can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
getCurveType(crv::Dic{String,Any})
+
+Get the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,
+`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.
Get the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.
Plot objects specified by the plotOptions. Construct the plotOptions by the sum of what is to be drawn from the choices MODEL, GRID, MESH, REFINEMENTS.
Example: To plot the model and the grid, plotOptions = MODEL + GRID. To plot just the mesh, plotOptions = MESH.
To plot everything, plotOptions = MODEL + GRID + MESH + REFINEMENTS
Contents are overlayed in the order: GRID, MESH, MODEL, REFINEMENTS
Set the file format for the plot file. Acceptable choices are "sem", which includes interior nodes and boundary nodes and "skeleton", which includes only the corner nodes.
This document was generated with Documenter.jl version 0.27.14 on Saturday 12 March 2022. Using Julia version 1.6.5.
diff --git a/previews/PR10/search_index.js b/previews/PR10/search_index.js
new file mode 100644
index 00000000..f2b3b2f9
--- /dev/null
+++ b/previews/PR10/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"HQMTool/#HQMTool","page":"Interactive mesh generation","title":"HQMTool","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"HQMTool is currently an API to generate a quad (Future:Hex) mesh using Julia.","category":"page"},{"location":"HQMTool/#Contents","page":"Interactive mesh generation","title":"Contents","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Introduction\nBasic Moves\nHQMTool API\nProject Creation and Saving\nPlotting\nModifying/Editing a Project\nControlling the Mesh Generation Process\nEditing the Run Parameters\nChanging the output file names\nAdding the background grid\nSmoothing Operations\nManual Refinement\nBoundary Curves\nAdding and Removing Outer and Inner Boundaries\nDefining Curves\nEditing Curves\nUndo/Redo\nAdvanced","category":"page"},{"location":"HQMTool/#Introduction","page":"Interactive mesh generation","title":"Introduction","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"HQMTool is an API to build quad/hex meshes. Two examples are included to get you started. The first reads in an existing control file from the HOHQMesh examples collection. To see that example, run","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\trunDemo()","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The second example builds a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. The script is","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"function iceCreamCone(folder::String)\n#\n# Create a project with the name \"IceCreamCone\", which will be the name of the mesh, plot and stats files,\n# written to `path`. This version uses generic versions of\n# the API.\n#\n p = newProject(\"IceCreamCone\",path)\n#\n# Outer boundary\n#\n circ = new(\"outerCircle\",[0.0,-1.0,0.0],4.0,0.0,360.0,\"degrees\")\n add!(p,circ)\n#\n# Inner boundary\n#\n cone1 = new(\"cone1\", [0.0,-3.0,0.0],[1.0,0.0,0.0]) # A line\n iceCream = new(\"iceCream\",[0.0,0.0,0.0],1.0,0.0,180.0,\"degrees\") # An arc\n cone2 = new(\"cone2\", [-1.0,0.0,0.0],[0.0,-3.0,0.0]) # A line\n add!(p,cone1,\"IceCreamCone\")\n add!(p,iceCream,\"IceCreamCone\")\n add!(p,cone2,\"IceCreamCone\")\n#\n# Set some control RunParameters to overwrite the defaults\n#\n setPolynomialOrder!(p,4)\n setPlotFileFormat!(p,\"sem\")\n#\n# To mesh, a background grid is needed\n#\n addBackgroundGrid!(p, [0.1,0.1,0.0])\n#\n# Show the model and grid\n#\n plotProject!(p, MODEL+GRID)\n#\n# Generate the mesh and plot\n#\n println(\"Press any key to continue and generate the mesh\")\n readline()\n generateMesh(p)\n updatePlot!(p, MODEL+MESH)\n\n return p\nend","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The first line creates a new project, where the mesh and plot file names will be derived from the project name, \"IceCreamCone\" written to the specified folder.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently operational:","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Parametric equations\nSplines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"In the example, the outer boundary is a closed circular arc with center at [0,0,0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary! through the generic name add!. You can add any number of curves, but they must be added in order, counter-clockwise. ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, \"IceCreamCone\" made up of two lines and a half circular arc. Again, add them in order, counter-clockwise.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"For convenience, newProject will generate default run parameters, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script sets the polynomial order (default = 5) and the plot file format (default = \"skeleton\").","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extend of the domain to be meshed, so only the mesh size needs to be specified using","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\taddBackgroundGrid!(proj::Project, bgSize::Array{Float64})","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The example sets the background mesh size to be 0.1 in the x and y directions. The z component is ignored.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The script finishes by generating the quad mesh and plotting the results, as shown below","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"It also returns the project so that it can be edited further, if desired.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To save a control file for HOHQMesh, simply invoke","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tsaveProject(proj::Project,outFile::String)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"where outFile is the name of the control file (traditionally with a .control extension). saveProject is automatically called when a mesh is generated.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Methods are available to edit a model. For example to move the center of the outer boundary","category":"page"},{"location":"HQMTool/#Basic-Moves","page":"Interactive mesh generation","title":"Basic Moves","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To create generate a mesh you","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Create a project","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tp = newProject(,)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Create inner and outer boundary curves","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tc = new(, startLocation [x,y,z],endLocation [x,y,z]) (Straight Line)\n\tc = new(,center [x,y,z],radius,startAngle,endAngle,units = \"degrees\" or \"radians\") (Circular Arc)\n\tc = new(, xEqn, yEqn, zEqn ) (Parametric equation)\n\tc = new(, dataFile) (Spline)\n\tc = new(, nKnots, knotsMatrix) (also Spline)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Add curves to build the model to see what you have added,","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tadd!(p, ) (Add outer boundary curve)\n\tadd!(p, , ) (add curve to an inner boundary)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To visualize the project's model,","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tplotProject(p,MODEL)\n\t\nTo update the plot at any time, use\n\n\tupdatePlot!(p, options)\n\t\nOptions are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. (You normally are not intersted in the background grid once the mesh is generated.)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Set the background grid","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t addBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ]) (No outer boundary)\n\t *OR*\n\t addBackgroundGrid!(p, [top, left, bottom, right], num Intervals [nX,nY,nZ]) (No outer boundary)\n\t \n\t addBackgroundGrid!(p, grid size [dx,dy,dz]) (If an outer boundary is present)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Adjust parameters, if desired (e.g.)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tsetPolynomialOrder!(p,order)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Generate the mesh","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tgenerateMesh(p)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The mesh will be stored in with the name .mesh. The control file will also be saved in that folder with the name .control, which you can read in again later and modify, remesh, etc. The function will print grid information, and will plot the grid as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject command.","category":"page"},{"location":"HQMTool/#HQMTool-API","page":"Interactive mesh generation","title":"HQMTool API","text":"","category":"section"},{"location":"HQMTool/#Project-Creation-and-Saving","page":"Interactive mesh generation","title":"Project Creation and Saving","text":"","category":"section"},{"location":"HQMTool/#New-Project","page":"Interactive mesh generation","title":"New Project","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t(Return:Project) proj = newProject(name::String, folder::String)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The supplied name will be the default name of the mesh and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.","category":"page"},{"location":"HQMTool/#Opening-an-existing-project-file","page":"Interactive mesh generation","title":"Opening an existing project file","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t(Return:Project) proj = openProject(fileName::String, folder::String)","category":"page"},{"location":"HQMTool/#Saving-a-project","page":"Interactive mesh generation","title":"Saving a project","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tsaveProject(proj::Project)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"writes a control file to the folder designated when creating the new project. It can be read in again with OpenProject.","category":"page"},{"location":"HQMTool/#Plotting","page":"Interactive mesh generation","title":"Plotting","text":"","category":"section"},{"location":"HQMTool/#Plotting-a-Project","page":"Interactive mesh generation","title":"Plotting a Project","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tplotProject(proj::Project, options)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The options are any combination of MODEL, GRID, MESH, and REFINEMENTS. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH. REFINEMENTS will show where manual refinement is added.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"If the model is modified and you want to re-plot with the new values, invoke","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tupdatePlot!(proj::Project, options)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"but genrally the plot will be updated automatically as you build the model.","category":"page"},{"location":"HQMTool/#Modifying/Editing-a-Project","page":"Interactive mesh generation","title":"Modifying/Editing a Project","text":"","category":"section"},{"location":"HQMTool/#Setting-the-name-of-a-project","page":"Interactive mesh generation","title":"Setting the name of a project","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The project name is the name under which the mesh, plot, statistics and control files will be written.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tsetName!(proj::Project,name::String)","category":"page"},{"location":"HQMTool/#Getting-the-current-name-of-a-Project","page":"Interactive mesh generation","title":"Getting the current name of a Project","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:String]\tgetName(proj::Project)","category":"page"},{"location":"HQMTool/#Controlling-the-Mesh-Generation-Process","page":"Interactive mesh generation","title":"Controlling the Mesh Generation Process","text":"","category":"section"},{"location":"HQMTool/#Editing-the-Run-Parameters","page":"Interactive mesh generation","title":"Editing the Run Parameters","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The run parameters can be enquired and set with these getter/setter pairs:","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] setPolynomialOrder!(proj::Project, p::Int)\n\t[Return:Int] getPolynomialOrder(proj::Project)\n\t[Return:nothing] setMeshFileFormat!(proj::Project, meshFileFormat::String)\n\t[Return:String] getMeshFileFormat(proj::Project)\n\t[Return:nothing] setPlotFileFormat!(proj::Project, plotFileFormat::String)\n\t[Return:String] getPlotFileFormat(proj::Project)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The mesh file format is either ISM or ISM-V2. The plot file (Which can be viewed with something like VisIt or Paraview) format is either skeleton or sem. The former is just a low order finite elemnt represntation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom. At this time, if you want to plot the grid in HQMTool, then you must use ISM-V2 as the mesh file format.","category":"page"},{"location":"HQMTool/#Changing-the-output-file-names","page":"Interactive mesh generation","title":"Changing the output file names","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] setName!(proj::Project,name::String)\n\t[Return:String] getName(proj::Project)\n\t[Return:nothing] setFolder!(proj::Project,folder::String)\n\t[Return:String] getFolder(proj::Project)","category":"page"},{"location":"HQMTool/#Adding-the-background-grid","page":"Interactive mesh generation","title":"Adding the background grid","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One or the other has to be specified after a new project has been created.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})\n\t[Return:nothing] addBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int})\n\t[Return:nothing] addBackgroundGrid!(proj::Project, bgSize::Array{Float64})","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Use one of the first two if there is no outer boundary. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1]+N dx[1]]X[x0[2], x0[2]+Ndx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, N, bgSize are all vectors [ *, \\, *] giving the x, y, and z components.","category":"page"},{"location":"HQMTool/#Smoothing-Operations","page":"Interactive mesh generation","title":"Smoothing Operations","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To change the defaults, the smoother parameters can be set/enquired with the functions","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] setSmoothingStatus!(proj::Project, status::String)\n\t[Return:String] getSmoothingStatus(proj::Project)\n\t[Return:nothing] setSmoothingType!(proj::Project, type::String)\n\t[Return:String] getSmoothingType(proj::Project)\n\t[Return:nothing] setSmoothingIterations!(proj::Project, iterations::Int)\n\t[Return:Int] getSmoothingIterations(proj::Project)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"status is either \"ON\" or \"OFF\". ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To remove the smoother altogether,","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] removeSpringSmoother!(proj::Project)","category":"page"},{"location":"HQMTool/#Manual-Refinement","page":"Interactive mesh generation","title":"Manual Refinement","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas in the geometry.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To create a refinement center,","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Dict{String,Any}] newRefinementCenter!(proj::Project, type::String, \n \t \t\t\t\t x0::Array{Float64}, h::Float64,\n \t \t\t\t\t w::Float64 )","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"where the type is either smooth or sharp, x0 = [x,y,z] is the location of the center, h is the mesh size, and w is the extent of the refinement region.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Similarly, one can create a RefinementLine,","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Dict{String,Any}] newRefinementLine!(proj::Project, type::String, \n \t\t\t\t x0::Array{Float64}, x1::Array{Float64},\n \t\t\t\t h::Float64,\n w::Float64 )","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"where x0 is the start postition and x1 is the end of the line.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To add a refinement region to the project,","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] addRefinementRegion!(proj::Project,r::Dict{String,Any})","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To get the indx'th refinement region from the project, or to get a refinement region with a given name, use ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Dict{String,Any}] getRefinementRegion(proj::Project, indx::Int)\n\t[Return:Dict{String,Any}] getRefinementRegion(proj::Project, name::String)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Finally, to get a list of all the refinement regions, ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Array{Dict{String,Any}}] array = allRefinementRegions(proj::Project)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"A refinement region can be edited by using the following","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] \t\t setRefinementType!(r::Dict{String,Any}, type::String)\n\t[Return:String] \t\t getRefinementType(r::Dict{String,Any})\n\t[Return:nothing] \t\t setRefinementLocation!(r::Dict{String,Any}, x::Array{Float64})\n\t[Return:Array{Float64}] getRefinementLocation(r::Dict{String,Any})\n\t[Return:nothing] \t\t setRefinementGridSize!(r::Dict{String,Any},h::Float64)\n\t[Return:float64] \t\t getRefinementGridSize(r::Dict{String,Any})\n\t[Return:nothing] \t\t setRefinementWidth!(r::Dict{String,Any},w::Float64)\n\t[Return:float64] \t\t getRefinementWidth(r::Dict{String,Any})","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"where r is a dictionary returned by newRefinementCenter!, newRefinementLine!, or getRefinementRegion.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To further edit a RefinementLine, use the methods","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] \t\t setRefinementStart!(r::Dict{String,Any}, x::Array{Float64})\n\t[Return:Array{Float64}] getRefinementStart(r::Dict{String,Any})\n\t[Return:nothing] \t\t setRefinementEnd!(r::Dict{String,Any}, x::Array{Float64})\n\t[Return:Array{Float64}] getRefinementEnd(r::Dict{String,Any})","category":"page"},{"location":"HQMTool/#Boundary-Curves","page":"Interactive mesh generation","title":"Boundary Curves","text":"","category":"section"},{"location":"HQMTool/#Adding-and-Removing-Outer-and-Inner-Boundaries","page":"Interactive mesh generation","title":"Adding and Removing Outer and Inner Boundaries","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Adding an outer boundary curve","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Using the curve creation routines, described in the next section below, create curves in sucessive order counter-clockwise along the outer boundary and add them to the outer boundary curve using\n\n\t[Return:nothing] addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})\n Generic: add!(...)\n\n`crv` is the dictionary that represents the curve.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Example:","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tadd!(p,circ)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Adding an inner boundary curve","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n Generic: add!(...)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Example:","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tadd!(p,cone1,\"IceCreamCone\")","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To edit curves they can be accessed by name:","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Dict{String,Any}] getInnerBoundaryCurve(proj::Project, curveName::String, boundaryName::String)\n Generic: get(...)\n\t[Return:Dict{String,Any}] getOuterBoundaryCurveWithName(proj::Project, name::String)\n Generic: get(...)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Deleting boundary curves","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n\tGeneric: remove!(...)\n\t[Return:nothing] removeInnerBoundaryCurve!(proj::Project, name::String, chainName::String)\n\tGeneric: remove!(...)","category":"page"},{"location":"HQMTool/#Defining-Curves","page":"Interactive mesh generation","title":"Defining Curves","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Four curve types can be added to the outer and inner boundary curve chains. They are","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"parametricEquation\nendPointsLine\ncircularArc\nspline","category":"page"},{"location":"HQMTool/#Parametric-Equations","page":"Interactive mesh generation","title":"Parametric Equations","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Creating new ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Dict{String,Any}] newParametricEquationCurve(name::String, \n \t\t\t\t\t\t\t\t\t\t xEqn::String, \n \t\t\t\t\t\t\t\t\t\t yEqn::String, \n \t\t\t\t\t\t\t\t\t\t zEqn::String = \"z(t) = 0.0\" )\n Generic: new(...)\n \nReturns a new parametric equation. Equations must be of the form \n\n\t() = ...\n\nThe name of the function, and the argument are arbitrary. The equation \tcan be any legitimate equation. The constant `pi` is defined for use. \tExponention is done with `^`. All number literals are interpreted as \tfloating point numbers.\n\nExample:\n\n\tx(s) = 2.0 + 3*cos(2*pi*s)^2\n\t\nThe z-Equation is optional, but for now must define zero for z.","category":"page"},{"location":"HQMTool/#Line-Defined-by-End-Points","page":"Interactive mesh generation","title":"Line Defined by End Points","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Dict{String,Any}] newEndPointsLineCurve(name::String, \n \t xStart::Array{Float64},\n xEnd::Array{Float64})\n Generic: new(...)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The xStart and xEnd are arrays of the form [x,y,z]. The z component should be zero and for now is ignored.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Example:","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t\tcone1 = new(\"cone1\", [0.0,-3.0,0.0],[1.0,0.0,0.0])","category":"page"},{"location":"HQMTool/#Circular-Arc","page":"Interactive mesh generation","title":"Circular Arc","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"[Return:Dict{String,Any}] newCircularArcCurve(name::String, \n \t\t\t\t\t center::Array{Float64}, \n \t\t\t\t\t radius::Float64,\n \t\t\t\t\t startAngle::Float64, \n \t\t\t\t\t endAngle::Float64,\n \t\t\t\t\t units::String)\n Generic: new(...)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The center is an array of the form [x,y,z]. The units argument defines the start and end angle units, and is either \"degrees\" or \"radians\". That argument is optional, and defaults to \"degrees\".","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Example: ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\ticeCream = new(\"iceCream\",[0.0,0.0,0.0],1.0,0.0,180.0,\"degrees\")","category":"page"},{"location":"HQMTool/#Spline-Curve","page":"Interactive mesh generation","title":"Spline Curve","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"A spline is defined by an array of knots, tj,xj,yj,zj. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the t,x,y,z values, e.g.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t\t9\n\t\t0.000000000000000 -3.50000000000000 3.50000000000000 0.0\n\t\t3.846153846153846E-002 -3.20000000000000 5.00000000000 0.0\n\t\t7.692307692307693E-002 -2.00000000000000 6.00000000000 0.0\n\t\t0.769230769230769 0.000000000000000 -1.00000000000000 0.0\n\t\t0.807692307692308 -1.00000000000000 -1.00000000000000 0.0\n\t\t0.846153846153846 -2.00000000000000 -0.800000000000000 0.0\n\t\t0.884615384615385 -2.50000000000000 0.000000000000000 0.0\n\t\t0.923076923076923 -3.00000000000000 1.00000000000000 0.0\n\t\t1.00000000000000 -3.50000000000000 3.50000000000000 0.0","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"or by constructing the Nx4 array supplying it to the new procedure. The constructors are","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"[Return:Dict{String,Any}] newSplineCurve(name::String, nKnots::Int, data::Matrix{Float64})\nGeneric: new(...)\n[Return:Dict{String,Any}] newSplineCurve(name::String, dataFile::String)\nGeneric: new(...)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"If the curve is to be closed. The last point must be the same as the first.","category":"page"},{"location":"HQMTool/#Editing-Curves","page":"Interactive mesh generation","title":"Editing Curves","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"You can determine the type of a curve by ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:String] getCurveType(crv::Dict{String,Any})","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"For any of the curves, their name can be changed by ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tsetCurveName!(crv::Dict{String,Any}, name::String)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"and checked by","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tgetCurveName(crv::Dict{String,Any})","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Otherwise there are special functions to change the parameters of curves","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] setXEqn!(crv::Dict{String,Any}, eqn::String)\n\t[Return:nothing] setYEqn!(crv::Dict{String,Any}, eqn::String)\n\t[Return:nothing] setZEqn!(crv::Dict{String,Any}, eqn::String)\n\t[Return:nothing] setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\t[Return:nothing] setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\t[Return:nothing] setArcUnits!(arc::Dict{String,Any}, units::String)\n\t[Return:nothing] setArcCenter!(arc::Dict{String,Any}, point::Array{Float64})\n\t[Return:nothing] setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n\t[Return:nothing] setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n\t[Return:nothing] setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\t\n\t[Return:String] \t\tgetXEqn(crv::Dict{String,Any})\n\t[Return:String] \t\tgetYEqn(crv::Dict{String,Any})\n\t[Return:String] \t\tgetZEqn(crv::Dict{String,Any})\n\t[Return:Array{Float64}] getStartPoint(crv::Dict{String,Any})\n\t[Return:Array{Float64}] getEndPoint(crv::Dict{String,Any})\n\t[Return:String] \t\tgetArcUnits(arc::Dict{String,Any})\n\t[Return:Array{Float64}] getArcCenter(arc::Dict{String,Any})\n\t[Return:Float64]\t\tgetArcStartAngle(arc::Dict{String,Any})\n\t[Return:Float64] \t\tgetArcEndAngle(arc::Dict{String,Any})\n\t[Return:Float64] \t\tgetArcRadius(arc::Dict{String,Any})","category":"page"},{"location":"HQMTool/#Undo/Redo","page":"Interactive mesh generation","title":"Undo/Redo","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The HQMTool has unlimited undo/redo for most actions.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"In interactive mode, actions can be undone by the commands","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:String] undo()\n\t[Return:String] redo()","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"where the return string contains the name of the action performed.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To find out what the next actions are, use","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:String] undoName()\n\t[Return:String] redoName()","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Finally, to clear the undo stack, use","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] clearUndoRedo()","category":"page"},{"location":"HQMTool/#Advanced","page":"Interactive mesh generation","title":"Advanced","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"All curves are actually dictionaries of type Dict{String,Any}, and since Julia is not a particularly object oriented language, the parameters can be accessed and edited directly by key and value. In fact, all objects except for the Project, are of type Dict{String,Any}. The project holds all the control and model objects in its projectDirectory. However, if you do that, then undo/redo and plot updating won't happen.","category":"page"},{"location":"license/#License","page":"License","title":"License","text":"","category":"section"},{"location":"license/","page":"License","title":"License","text":"MIT LicenseCopyright (c) 2021-present Michael Schlottke-LakemperPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"CheatSheet/#HQMTool-CheatSheet","page":"Cheat sheet","title":"HQMTool CheatSheet","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"Workflow:","category":"page"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"Create a project\nAdd boundary curves\nAdd a background grid\nAdd manual refinement (if desired)\nGenerate mesh","category":"page"},{"location":"CheatSheet/#Project","page":"Cheat sheet","title":"Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tp = newProject(,)","category":"page"},{"location":"CheatSheet/#cs-plotting","page":"Cheat sheet","title":"Plotting","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tplotProject!(p,options)\n\tupdatePlot!(p,options)","category":"page"},{"location":"CheatSheet/#Curves","page":"Cheat sheet","title":"Curves","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tc = new(name, startLocation [x,y,z],endLocation [x,y,z]) *Straight Line*\n\tc = new(name,center [x,y,z],radius, startAngle, endAngle) *Circular Arc*\n\tc = new(name, xEqn, yEqn, zEqn ) *Parametric equation*\n\tc = new(name, dataFile) \t\t\t *Spline*\n\tc = new(name, nKnots, knotsMatrix) *also Spline*","category":"page"},{"location":"CheatSheet/#cs-manual-refinement","page":"Cheat sheet","title":"Manual Refinement","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tr = newRefinementCenter(name, center, gridSize, radius )\n\tr = newRefinementLine(name,type, startPoint, endPoint, gridSize, width )","category":"page"},{"location":"CheatSheet/#Adding-to-a-Project","page":"Cheat sheet","title":"Adding to a Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tadd!(p, c) \t\t\t\t\t\t *Add outer boundary curve*\n\tadd!(p, c, ) *add curve to an inner boundary*\n\tadd!(p, r) \t\t\t\t\t\t *Add refinement region*\n\n\taddBackgroundGrid!(p, [top, left, bottom, right], [nX,nY,nZ]) *No outer boundary*\n\taddBackgroundGrid!(p, [dx,dy,dz]) *If an outer boundary is present*","category":"page"},{"location":"CheatSheet/#Accessing-items","page":"Cheat sheet","title":"Accessing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tcrv = get(p,curveName)\t *Get a curve in the outer boundary*\n\tcrv = get(p,curveName, boundaryName) *Get a curve in an inner boundary*\n\tindx, chain = getChain(p,boundaryName) *Get a complete inner boundary curve*\n\tr = getRefinementRegion(p, name)","category":"page"},{"location":"CheatSheet/#Removing-from-Project","page":"Cheat sheet","title":"Removing from Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tremoveOuterboundary!(p) \t\t\t *Entire outer boundary curve*\n\tremoveInnerBoundary!(p, innerBoundaryName) *Entire inner boundary curve\n\tremove!(p, name) \t\t\t\t\t *Curve in outer boundary*\n\tremove!(p, name, innerBoundaryName) *Curve in inner boundary*\n\tremoveRefinementRegion!(p, name)","category":"page"},{"location":"CheatSheet/#Editing-items","page":"Cheat sheet","title":"Editing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them out.","category":"page"},{"location":"CheatSheet/#Meshing","page":"Cheat sheet","title":"Meshing","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tgenerateMesh(p)\n\tremoveMesh!(p)","category":"page"},{"location":"reference/#HOHQMesh.jl-API","page":"Reference","title":"HOHQMesh.jl API","text":"","category":"section"},{"location":"reference/","page":"Reference","title":"Reference","text":"CurrentModule = HOHQMesh","category":"page"},{"location":"reference/","page":"Reference","title":"Reference","text":"Modules = [HOHQMesh]","category":"page"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary named boundaryName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, obj::Dict{String,Any})\n\nAdd a curve to the outer boundary or a refinement reion to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, Array{Float64, N} where N, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})\n\nAdd the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version\n\naddBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nis a lot easier to use.\n\nTODO: Change HOHQMesh and delete this way to specify the domain and use the bounding box one instead.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nAdd the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid(proj::Project, bgSize::Array{Float64})\n\nAdd the background grid block with the grid size to be a 3-vector. Use this when there is an outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, dict::Dict{String,Any})\n\nUsed only for undo/redo.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToInnerBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.addCurveToInnerBoundary!","text":"addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary with name boundaryName. If an inner boundary of that name does not exist, one is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addCurveToOuterBoundary!","text":"addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})\n\nAdd a curve to the outer boundary. The curves must be added in order counter-clockwise\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addInnerBoundaryWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.addInnerBoundaryWithName!","text":"addInnerBoundaryWithName!(proj::Project,name::String)\n\nCreate a new empty inner boundary with the given name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addObserver-Tuple{Any, String, Any}","page":"Reference","title":"HOHQMesh.addObserver","text":"addObserver(observer::Any, note::String, fnction::Any)\n\nfnction is the function to be executed (called) when a notification of name note is given.\n\nThe function called upon notification must have the signature fnction(observer, sender, args...)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addOuterBoundary!","text":"addOuterBoundary!(proj::Project)\n\nAdd an empty outer boundary to the project. There can be only one.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegion!","text":"addRefinementRegion!(proj::Project,r::Dict{String,Any})\n\nAdd the refinement region to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegionPoints!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegionPoints!","text":"addRefinementRegionPoints!(proj::Project, r::Dict{String,Any})\n\nCompute and add to the project the plotting points for the refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRunParameters!","page":"Reference","title":"HOHQMesh.addRunParameters!","text":"addRunParameters!(proj::Project, \n plotFormat::String = \"skeleton\", \n meshFileFormat::String = \"ISM-V2\", \n polynomialOrder::Int = 5)\n\nAdd a RUN_PARAMETERS block and set all the parameters in one call.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.addSpringSmoother!","page":"Reference","title":"HOHQMesh.addSpringSmoother!","text":"addSpringSmoother!(status::String, type::String, nIterations::Int)\n\nstatus is either `ON` or `OFF`\ntype is either `LinearSpring` or `LinearAndCrossbarSpring`\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.bboxUnion-Tuple{Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.bboxUnion","text":"bboxUnion(box1::Array{Float64}, box2::Array{Float64})\n\nReturns the union of two bounding boxes\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.curveBounds-Tuple{Matrix{Float64}}","page":"Reference","title":"HOHQMesh.curveBounds","text":"curveBounds(crvPoints::Array{Float64,2})\n\nFind the bounds of a single curve, discretized as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.duplicateCurve-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.duplicateCurve","text":"duplicateCurve(crv::Dict{String,Any}, newName::String)\n\nDuplicate the given curve giving it the new name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.emptyBounds-Tuple{}","page":"Reference","title":"HOHQMesh.emptyBounds","text":"Returns an array that will always be ignored when unioned with another bounding box.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.examples_dir-Tuple{}","page":"Reference","title":"HOHQMesh.examples_dir","text":"examples_dir()\n\nReturn the path to the directory with some example mesh setups.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.extract_mesh_file_format-Tuple{Any}","page":"Reference","title":"HOHQMesh.extract_mesh_file_format","text":"extract_mesh_file_format(control_file)\n\nReturn a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{Any}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(control_file;\n output_directory=\"out\",\n mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing,\n verbose=false)\n\nGenerate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.\n\nYou can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.\n\nYou can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.get-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.get","text":"get(proj::Project, curveName::String, boundaryName::String)\n\nGet the curve named curveName from the inner boundary named boundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.get-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.get","text":"get(proj::Project, curveName::String)\n\nGet the curve with name curveName from the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getAllRefinementRegions-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getAllRefinementRegions","text":"allRefinementRegions(proj::Project)\n\nGet the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcCenter","text":"getArcCenter(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the center of a circular arc as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcEndAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcEndAngle","text":"getArcEndAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcRadius-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcRadius","text":"getArcRadius(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcStartAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcStartAngle","text":"getArcStartAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcUnits!-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcUnits!","text":"getArcUnits(crv::Dict{String,Any}, units::String)\n\nGet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridLowerLeft-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridLowerLeft","text":"function getBackgroundGridLowerLeft(proj::Project)\n\nReturns the [x,y] of the lower left point of thebackground grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSize-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSize","text":"getBackgroundGridSize(proj::Project)\n\nReturns the background grid size array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSteps-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSteps","text":"function getBackgroundGridLowerLeft(proj::Project)\n\nReturns the [x,y,z] of the lower left point of thebackground grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveName","text":"getCurveName(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveType","text":"getCurveType(crv::Dic{String,Any})\n\nGet the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,\n`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getEndPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getEndPoint","text":"getEndPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the end point for a line curve as an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundary-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundary","text":"getInnerBoundary(proj::Project, name::String)\n\nGet the chain of curves from the inner boundary with name name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryChainWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryChainWithName","text":"getInnerBoundaryWithName(proj::Project, name::String)\n\nGet the inner boundary CHAIN with the given name. If one does not exist, it is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryCurve","text":"\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getMeshFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getMeshFileFormat","text":"getMeshFileFormat(proj::Project)\n\nReturns the format in which the mesh will be written.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getName-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getName","text":"getName(proj::Project)\n\nReturns the filename to be used by the mesh, plot, control, and stats files.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryChainList-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getOuterBoundaryChainList","text":"getOuterBoundary(proj::Project)\n\nGet the array of outer boundary curves.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryCurveWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getOuterBoundaryCurveWithName","text":"getOuterBoundaryCurveWithName(proj::Project, name::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPlotFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPlotFileFormat","text":"getPlotFileFormat(proj::Project)\n\nReturns the plot file format.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPolynomialOrder-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPolynomialOrder","text":"getPolynomialOrder(proj::Project)\n\nReturns the polynomial order for boundary curves in the mesh file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementEnd-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementEnd","text":"getRefinementEnd(r::Dict{String,Any})\n\nReturn Array{Float64} of the end location of the refinement line\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementGridSize-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementGridSize","text":"getRefinementGridSize(r::Dict{String,Any})\n\nReturns the grid size,h, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementLocation-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementLocation","text":"getRefinementLocation(r::Dict{String,Any})\n\nReturn Array{Float64} of the location of the refinement center.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementName","text":"getRefinementName(r::Dict{String,Any})\n\nReturn name of the refinement. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"getRefinementRegion(proj::Project, indx)\n\nGet the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"(i,r) = getRefinementRegion(project, name)\n\nGet the refinement region with the given name and its location in the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementStart-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementStart","text":"getRefinementStart (r::Dict{String,Any})\n\nReturn Array{Float64} of the start location of the refinement line. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementType","text":"getRefinementType(r::Dict{String,Any})\n\nReturn the type of refinement, either \"smooth\" or \"sharp\". r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementWidth-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementWidth","text":"getRefinementWidth(r::Dict{String,Any})\n\nReturns the region width,w, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingIterations-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingIterations","text":"\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingStatus-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingStatus","text":"smoothingStatus(proj::Project)\n\nReturns whether the smoother will be \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingType-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingType","text":"smoothingType(proj::Project)\n\nReturns either \"LinearSpring\" or \"LinearAndCrossbarSpring\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplineNKnots-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplineNKnots","text":"getSplineNKnots(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplinePoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplinePoints","text":"getSplinePoints(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getStartPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getStartPoint","text":"getStartPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the start point for a line curve as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getXEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getXEqn","text":"getXEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getYEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getYEqn","text":"getYEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getZEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getZEqn","text":"getZEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getfolder-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getfolder","text":"path(proj::Project)\n\nReturns the directory where the project files will be written\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.hasBackgroundGrid-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.hasBackgroundGrid","text":"hasBackgroundGrid(proj::Project)\n\nTests to see if the project has a backgroundGrid dictionary defined.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.innerBoundaryIndices-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.innerBoundaryIndices","text":"innerBoundaryIndices(proj::Project, curveName::String)\n\nReturns (curveIndex,chainIndex) for the location of the curve named curveName in it's inner boundary chain.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertOuterBoundaryCurveAtIndex!","text":"insertOuterBoundaryCurveAtIndex(proj::Project, crv::Dict{String,Any}, indx::Int)\n\nInsert a curve at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertRefinementRegion!","text":"insertRefinementRegion!(proj::Project, r::Dict{String,Any}, indx::Int)\n\nUsed by undo()\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, \n center::Array{Float64}, \n radius::Float64,\n startAngle::Float64, \n endAngle::Float64,\n units::String)\n\nCreate a new circular arc.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-2","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, \n xEqn::String, \n yEqn::String, \n zEqn::String = \"z(t) = 0.0\" )\n\nCreate a new parametric equation curve.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-Tuple{String, Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})\n\nCreate a new line defined by its end points.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, nKnots::Int, data::Matrix{Float64})\n\nCreate a spline curve from an array of knots\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, String}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, dataFile::String)\n\nCreate a spline curve from the contents of a data file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newCircularArcCurve","page":"Reference","title":"HOHQMesh.newCircularArcCurve","text":"newCircularArcCurve(name::String, center::Array{Float64}, \n startAngle::Float64, endAngle::Float64,\n units::String)\n\nCreates and returns a new circular arc curve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newEndPointsLineCurve-Tuple{String, Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.newEndPointsLineCurve","text":"newEndPointsLineCurve(name::String, xStart::Array{Float64},xEnd::Array[Float64])\n\nCreates and returns a new curve defined by its end points in the form of a Dictionary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newParametricEquationCurve","page":"Reference","title":"HOHQMesh.newParametricEquationCurve","text":"newParametricEquationCurve(name::String, \n xEqn::String, \n yEqn::String, \n zEqn::String = \"z(t) = 0.0\" )\n\nCreates and returns a new parametricEquationCurve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newProject","text":"newProject(name::String, folder::String)\n\nCreate a new project with the given name. That name will be used for the mesh and plot files in the specified folder.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementCenter-Tuple{String, String, Array{Float64, N} where N, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementCenter","text":"newRefinementCenter(type, center, meshSize, width )\n\nCreate refinement center of type \"smooth\" or \"sharp\" centered at center = [x,y,z]with a mesh sizemeshSizespread over a radiuswidth`.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementLine-Tuple{String, String, Array{Float64, N} where N, Array{Float64, N} where N, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementLine","text":"newRefinementLine(type, \n start, end,\n meshSize,\n width )\n\nCreate refinement line of type \"smooth\" or \"sharp\" between start = [x,y,z] and end = [x,y,z] with a mesh size meshSize spread over a width width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, nKnots::Int, data::Array{Float64,4})\n\nReturns a spline curve given the number of knots and the array of knots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, dataFile::String)\n\nReturns a spline curve given a data file that contains the number of knots on the first line, and the spline data following that.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.openProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.openProject","text":"openProject(fileName::String, folder::String)\n\nOpen existing project described in the control File.\n\nfolder = folder the control file is in\nfileNmae = the name of the file\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.plotProject!","page":"Reference","title":"HOHQMesh.plotProject!","text":"plotProject!(proj::Project, plotOptions::Int = 0)\n\nPlot objects specified by the plotOptions. Construct the plotOptions by the sum of what is to be drawn from the choices MODEL, GRID, MESH, REFINEMENTS. \n\nExample: To plot the model and the grid, plotOptions = MODEL + GRID. To plot just the mesh, plotOptions = MESH. \n\nTo plot everything, plotOptions = MODEL + GRID + MESH + REFINEMENTS\n\nContents are overlayed in the order: GRID, MESH, MODEL, REFINEMENTS\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.postNotificationWithName-Tuple{Any, String, Tuple}","page":"Reference","title":"HOHQMesh.postNotificationWithName","text":"postNotificationWithName(sender::Any, name::String, userInfo::Tuple)\n\nExecutes the function associated with the observer for the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.refinementRegionCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.refinementRegionCenter","text":"refinementRegionCenter(r::Dict{String,Any})\n\nGet, or compute, the center of the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.refinementRegionPoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.refinementRegionPoints","text":"refinementRegionPoints(r::Dict{String,Any})\n\nReturns Array{Float64,2} being the plotting points of a refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String, innerBoundaryName::String)\n\nDelete the curve named curveName from the inner boundary named innerBoundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String)\n\nDelete the curve named curveName from the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeBackgroundGrid!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeBackgroundGrid!","text":"removeBackgroundGrid!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundary!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundary!","text":"removeInnerBoundary!(proj::Project, chainName::String)\n\nRemove an entire inner boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurve!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurve!","text":"removeInnerBoundaryCurve!(proj::Project, name::String)\n\nRemove the named curve in the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveWithName!","text":"removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n\nRemove the named curve in the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterboundary!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeOuterboundary!","text":"removeOuterboundary!(proj::Project)\n\nRemove the outer boundary curve if it exists.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRefinementRegion!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeRefinementRegion!","text":"removeRefinementRegion!(proj::Project, name::String)\n\nDelete the named refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRunParameters!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeRunParameters!","text":"removeRunParameters!(proj::Project)\n\nRemove the run parameters block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeSpringSmoother!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeSpringSmoother!","text":"removeSpringSmoother!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.saveProject-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.saveProject","text":"saveProject(proj::Project)\n\nproj = Project to be saved\n\nSave a project dictionary to the file path specified when the project was created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcCenter!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setArcCenter!","text":"setArcCenter!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the center of a circular arc.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcEndAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcEndAngle!","text":"setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcRadius!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcRadius!","text":"setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcStartAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcStartAngle!","text":"setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcUnits!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setArcUnits!","text":"setArcUnits(crv::Dict{String,Any}, units::String)\n\nSet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridLowerLeft!-Tuple{HOHQMesh.Project, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setBackgroundGridLowerLeft!","text":"setBackgroundGridLowerLeft!(proj::Project, x0::Array{Float64})\n\nSet the lower left location of the background grid for problems that have no outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSpacing!(proj::Project, dx::Float64, dy::Float64, dz::Float64 = 0.0)\n\nUser facing function\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Array{Float64},key::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Float64, Float64, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Float64, dy::Float64,key::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSteps!-Tuple{HOHQMesh.Project, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.setBackgroundGridSteps!","text":"setBackgroundGridSteps!(proj::Project, N::Array{Int})\n\nSet how many steps of size setBackgroundGridSpacing in each direction the background grid extends from the lower left.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setCurveName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setCurveName!","text":"setCurveName!(curveDict, name)\n\nSet the name of the curve represented by curveDict.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setEndPoint!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setEndPoint!","text":"setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the end point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setFolder-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setFolder","text":"setFolder(proj::Project,folder::String)\n\nSet the path to the directory where the mesh, plot, control, and stats files will be written \n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setMeshFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setMeshFileFormat!","text":"setMeshFileFormat(proj::Project, meshFileFormat::String)\n\nSet the file format for the mesh file. Acceptable choices are \"ISM\" and \"ISM-V2\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setName!","text":"setName(proj::Project,name::String)\n\nThe name of the project is the filename to be used by the mesh, plot, and stats files. It is also the name of the control file the tool will produce.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPlotFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setPlotFileFormat!","text":"setPlotFileFormat(proj::Project, plotFileFormat::String)\n\nSet the file format for the plot file. Acceptable choices are \"sem\", which includes interior nodes and boundary nodes and \"skeleton\", which includes only the corner nodes.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPolynomialOrder!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setPolynomialOrder!","text":"setPolynomialOrder(proj::Project, p::Int)\n\nSet the polynomial order for boundary curves in the mesh file to p.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementEnd!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementEnd!","text":"setRefinementEnd(refinementRegion, location)\n\nSet the end point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementGridSize!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementGridSize!","text":"setRefinementGridSize(r::Dict{String,Any}, h)\n\nSet the grid size, h for the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementLocation!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementLocation!","text":"setRefinementLocation!(refinementCenter, location)\n\nSet the location of a refinement center to location = [x,y,z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementName!","text":"setRefinementName!(r::Dict{String,Any}, type)\n\nSet a name for the refinement region.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementStart!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementStart!","text":"setRefinementStart!(refinementRegion, location)\n\nSet the start point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementType!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementType!","text":"setRefinementType!(refinementRegion, type)\n\nSet the type, either \"smooth\" or \"sharp\" for the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementWidth!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementWidth!","text":"setRefinementWidth!(r::Dict{String,Any}, width)\n\nSet the width of the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingIterations!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setSmoothingIterations!","text":"setSmoothingIterations!((proj::Project, iterations::Int)\n\nSet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingStatus!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingStatus!","text":"setSmoothingStatus(proj:Project, status::String)\n\nstatus is either \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingType!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingType!","text":"setSmoothingType!(proj:Project, status::String)\n\ntype is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplineNKnots!-Tuple{Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.setSplineNKnots!","text":"setSplineNKnots!(spline::Dict{String,Any}, nKnots::Int)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplinePoints!-Tuple{Dict{String, Any}, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.setSplinePoints!","text":"setSplinePoints!(spline::Dict{String,Any},points::Array{Float64,4})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setStartPoint!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setStartPoint!","text":"setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the start point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setXEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setXEqn!","text":"setXEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the x-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setYEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setYEqn!","text":"setYEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the y-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setZEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setZEqn!","text":"setZEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the zEqn-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.unRegisterForNotification-Tuple{Any, String}","page":"Reference","title":"HOHQMesh.unRegisterForNotification","text":"unRegisterForNotification(observer::Any, note::String)\n\nRemove the observer from being notified by the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.updatePlot!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.updatePlot!","text":"updatePlot!(proj::Project, plotOptions::Int)\n\nReplot with the new plotOptions = combinations (sums) of \n\nGRID, MESH, MODEL, REFINEMENTS\n\nExample: updatePlot(p, MESH + MODEL)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.updatePlot!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.updatePlot!","text":"updatePlot!(proj::Project)\n\nThis version replots the figure with the current options. Legacy.\n\n\n\n\n\n","category":"method"},{"location":"#HOHQMesh.jl","page":"Home","title":"HOHQMesh.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"This package is a thin Julia wrapper around the High Order Hex-Quad Mesher (a.k.a. HOHQMesh) created and developed by David A. Kopriva. HOHQMesh.jl is available on Linux, MacOS, and Windows.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6.","category":"page"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> import Pkg; Pkg.add(\"HOHQMesh\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the Julia REPL, you can load HOHQMesh with","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using HOHQMesh","category":"page"},{"location":"","page":"Home","title":"Home","text":"and then happily generate away!","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> control_file = joinpath(HOHQMesh.examples_dir(), \"GingerbreadMan.control\")\n\njulia> output = generate_mesh(control_file)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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,","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: gingerbreadman_with_edges_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"while the 3D file Snake.control produces this mesh:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: snake_400px)","category":"page"},{"location":"#Authors","page":"Home","title":"Authors","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl was initiated by Michael Schlottke-Lakemper (University of Cologne, Germany), who is also the principal developer of HOHQMesh.jl. The HOHQMesh mesh generator itself is developed by David A. Kopriva.","category":"page"},{"location":"#License-and-contributing","page":"Home","title":"License and contributing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is licensed under the MIT license (see License). HOHQMesh itself is also available under the MIT license.","category":"page"},{"location":"#Acknowledgements","page":"Home","title":"Acknowledgements","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"}]
+}
diff --git a/previews/PR10/siteinfo.js b/previews/PR10/siteinfo.js
new file mode 100644
index 00000000..c76cf63e
--- /dev/null
+++ b/previews/PR10/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "previews/PR10";
diff --git a/previews/PR11/CheatSheet/index.html b/previews/PR11/CheatSheet/index.html
new file mode 100644
index 00000000..a161d4c3
--- /dev/null
+++ b/previews/PR11/CheatSheet/index.html
@@ -0,0 +1,21 @@
+
+Cheat sheet · HOHQMesh.jl
crv = get(p,curveName) *Get a curve in the outer boundary*
+ crv = get(p,curveName, boundaryName) *Get a curve in an inner boundary*
+ indx, chain = getChain(p,boundaryName) *Get a complete inner boundary curve*
+ r = getRefinementRegion(p, name)
All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them out.
HQMTool is an API to build quad/hex meshes. Two examples are included to get you started. The first reads in an existing control file from the HOHQMesh examples collection. To see that example, run
runDemo()
The second example builds a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. The script is
function iceCreamCone(folder::String)
+#
+# Create a project with the name "IceCreamCone", which will be the name of the mesh, plot and stats files,
+# written to `path`. This version uses generic versions of
+# the API.
+#
+ p = newProject("IceCreamCone",path)
+#
+# Outer boundary
+#
+ circ = new("outerCircle",[0.0,-1.0,0.0],4.0,0.0,360.0,"degrees")
+ add!(p,circ)
+#
+# Inner boundary
+#
+ cone1 = new("cone1", [0.0,-3.0,0.0],[1.0,0.0,0.0]) # A line
+ iceCream = new("iceCream",[0.0,0.0,0.0],1.0,0.0,180.0,"degrees") # An arc
+ cone2 = new("cone2", [-1.0,0.0,0.0],[0.0,-3.0,0.0]) # A line
+ add!(p,cone1,"IceCreamCone")
+ add!(p,iceCream,"IceCreamCone")
+ add!(p,cone2,"IceCreamCone")
+#
+# Set some control RunParameters to overwrite the defaults
+#
+ setPolynomialOrder!(p,4)
+ setPlotFileFormat!(p,"sem")
+#
+# To mesh, a background grid is needed
+#
+ addBackgroundGrid!(p, [0.1,0.1,0.0])
+#
+# Show the model and grid
+#
+ plotProject!(p, MODEL+GRID)
+#
+# Generate the mesh and plot
+#
+ println("Press any key to continue and generate the mesh")
+ readline()
+ generateMesh(p)
+ updatePlot!(p, MODEL+MESH)
+
+ return p
+end
The first line creates a new project, where the mesh and plot file names will be derived from the project name, "IceCreamCone" written to the specified folder.
To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently operational:
Parametric equations
Splines
Lines defined by their end points
Circular arcs
In the example, the outer boundary is a closed circular arc with center at [0,0,0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary! through the generic name add!. You can add any number of curves, but they must be added in order, counter-clockwise.
Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, "IceCreamCone" made up of two lines and a half circular arc. Again, add them in order, counter-clockwise.
For convenience, newProject will generate default run parameters, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script sets the polynomial order (default = 5) and the plot file format (default = "skeleton").
One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extend of the domain to be meshed, so only the mesh size needs to be specified using
plotProject(p,MODEL)
+
+To update the plot at any time, use
+
+ updatePlot!(p, options)
+
+Options are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. (You normally are not intersted in the background grid once the mesh is generated.)
The mesh will be stored in <folder> with the name <projectName>.mesh. The control file will also be saved in that folder with the name <projectName>.control, which you can read in again later and modify, remesh, etc. The function will print grid information, and will plot the grid as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject command.
The supplied name will be the default name of the mesh and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.
The options are any combination of MODEL, GRID, MESH, and REFINEMENTS. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH. REFINEMENTS will show where manual refinement is added.
If the model is modified and you want to re-plot with the new values, invoke
updatePlot!(proj::Project, options)
but genrally the plot will be updated automatically as you build the model.
The mesh file format is either ISM or ISM-V2. The plot file (Which can be viewed with something like VisIt or Paraview) format is either skeleton or sem. The former is just a low order finite elemnt represntation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom. At this time, if you want to plot the grid in HQMTool, then you must use ISM-V2 as the mesh file format.
By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with
There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One or the other has to be specified after a new project has been created.
Use one of the first two if there is no outer boundary. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1]+N dx[1]]X[x0[2], x0[2]+Ndx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, N, bgSize are all vectors [ *, \, *] giving the x, y, and z components.
A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations.
To change the defaults, the smoother parameters can be set/enquired with the functions
Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas in the geometry.
where the type is either smooth or sharp, x0 = [x,y,z] is the location of the center, h is the mesh size, and w is the extent of the refinement region.
Using the curve creation routines, described in the next section below, create curves in sucessive order counter-clockwise along the outer boundary and add them to the outer boundary curve using
+
+ [Return:nothing] addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})
+ Generic: add!(...)
+
+`crv` is the dictionary that represents the curve.
[Return:Dict{String,Any}] newParametricEquationCurve(name::String,
+ xEqn::String,
+ yEqn::String,
+ zEqn::String = "z(t) = 0.0" )
+ Generic: new(...)
+
+Returns a new parametric equation. Equations must be of the form
+
+ <function name>(<argument>) = ...
+
+The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant `pi` is defined for use. Exponention is done with `^`. All number literals are interpreted as floating point numbers.
+
+Example:
+
+ x(s) = 2.0 + 3*cos(2*pi*s)^2
+
+The z-Equation is optional, but for now must define zero for z.
The center is an array of the form [x,y,z]. The units argument defines the start and end angle units, and is either "degrees" or "radians". That argument is optional, and defaults to "degrees".
A spline is defined by an array of knots, t<sub>j</sub>,x<sub>j</sub>,y<sub>j</sub>,z<sub>j</sub>. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the t,x,y,z values, e.g.
All curves are actually dictionaries of type Dict{String,Any}, and since Julia is not a particularly object oriented language, the parameters can be accessed and edited directly by key and value. In fact, all objects except for the Project, are of type Dict{String,Any}. The project holds all the control and model objects in its projectDirectory. However, if you do that, then undo/redo and plot updating won't happen.
Settings
This document was generated with Documenter.jl version 0.27.6 on Saturday 11 September 2021. Using Julia version 1.6.2.
diff --git a/previews/PR11/assets/documenter.js b/previews/PR11/assets/documenter.js
new file mode 100644
index 00000000..6d0b7853
--- /dev/null
+++ b/previews/PR11/assets/documenter.js
@@ -0,0 +1,264 @@
+// Generated by Documenter.jl
+requirejs.config({
+ paths: {
+ 'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/languages/julia.min',
+ 'headroom': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/headroom.min',
+ 'jqueryui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min',
+ 'katex-auto-render': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/contrib/auto-render.min',
+ 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min',
+ 'headroom-jquery': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/jQuery.headroom.min',
+ 'katex': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/katex.min',
+ 'highlight': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/highlight.min',
+ 'highlight-julia-repl': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/languages/julia-repl.min',
+ },
+ shim: {
+ "highlight-julia": {
+ "deps": [
+ "highlight"
+ ]
+ },
+ "katex-auto-render": {
+ "deps": [
+ "katex"
+ ]
+ },
+ "headroom-jquery": {
+ "deps": [
+ "jquery",
+ "headroom"
+ ]
+ },
+ "highlight-julia-repl": {
+ "deps": [
+ "highlight"
+ ]
+ }
+}
+});
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'katex', 'katex-auto-render'], function($, katex, renderMathInElement) {
+$(document).ready(function() {
+ renderMathInElement(
+ document.body,
+ {
+ "delimiters": [
+ {
+ "left": "$",
+ "right": "$",
+ "display": false
+ },
+ {
+ "left": "$$",
+ "right": "$$",
+ "display": true
+ },
+ {
+ "left": "\\[",
+ "right": "\\]",
+ "display": true
+ }
+ ]
+}
+
+ );
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'highlight', 'highlight-julia', 'highlight-julia-repl'], function($) {
+$(document).ready(function() {
+ hljs.highlightAll();
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'headroom', 'headroom-jquery'], function($, Headroom) {
+
+// Manages the top navigation bar (hides it when the user starts scrolling down on the
+// mobile).
+window.Headroom = Headroom; // work around buggy module loading?
+$(document).ready(function() {
+ $('#documenter .docs-navbar').headroom({
+ "tolerance": {"up": 10, "down": 10},
+ });
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+// Modal settings dialog
+$(document).ready(function() {
+ var settings = $('#documenter-settings');
+ $('#documenter-settings-button').click(function(){
+ settings.toggleClass('is-active');
+ });
+ // Close the dialog if X is clicked
+ $('#documenter-settings button.delete').click(function(){
+ settings.removeClass('is-active');
+ });
+ // Close dialog if ESC is pressed
+ $(document).keyup(function(e) {
+ if (e.keyCode == 27) settings.removeClass('is-active');
+ });
+});
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+// Manages the showing and hiding of the sidebar.
+$(document).ready(function() {
+ var sidebar = $("#documenter > .docs-sidebar");
+ var sidebar_button = $("#documenter-sidebar-button")
+ sidebar_button.click(function(ev) {
+ ev.preventDefault();
+ sidebar.toggleClass('visible');
+ if (sidebar.hasClass('visible')) {
+ // Makes sure that the current menu item is visible in the sidebar.
+ $("#documenter .docs-menu a.is-active").focus();
+ }
+ });
+ $("#documenter > .docs-main").bind('click', function(ev) {
+ if ($(ev.target).is(sidebar_button)) {
+ return;
+ }
+ if (sidebar.hasClass('visible')) {
+ sidebar.removeClass('visible');
+ }
+ });
+})
+
+// Resizes the package name / sitename in the sidebar if it is too wide.
+// Inspired by: https://github.com/davatron5000/FitText.js
+$(document).ready(function() {
+ e = $("#documenter .docs-autofit");
+ function resize() {
+ var L = parseInt(e.css('max-width'), 10);
+ var L0 = e.width();
+ if(L0 > L) {
+ var h0 = parseInt(e.css('font-size'), 10);
+ e.css('font-size', L * h0 / L0);
+ // TODO: make sure it survives resizes?
+ }
+ }
+ // call once and then register events
+ resize();
+ $(window).resize(resize);
+ $(window).on('orientationchange', resize);
+});
+
+// Scroll the navigation bar to the currently selected menu item
+$(document).ready(function() {
+ var sidebar = $("#documenter .docs-menu").get(0);
+ var active = $("#documenter .docs-menu .is-active").get(0);
+ if(typeof active !== 'undefined') {
+ sidebar.scrollTop = active.offsetTop - sidebar.offsetTop - 15;
+ }
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+function set_theme(theme) {
+ var active = null;
+ var disabled = [];
+ for (var i = 0; i < document.styleSheets.length; i++) {
+ var ss = document.styleSheets[i];
+ var themename = ss.ownerNode.getAttribute("data-theme-name");
+ if(themename === null) continue; // ignore non-theme stylesheets
+ // Find the active theme
+ if(themename === theme) active = ss;
+ else disabled.push(ss);
+ }
+ if(active !== null) {
+ active.disabled = false;
+ if(active.ownerNode.getAttribute("data-theme-primary") === null) {
+ document.getElementsByTagName('html')[0].className = "theme--" + theme;
+ } else {
+ document.getElementsByTagName('html')[0].className = "";
+ }
+ disabled.forEach(function(ss){
+ ss.disabled = true;
+ });
+ }
+
+ // Store the theme in localStorage
+ if(typeof(window.localStorage) !== "undefined") {
+ window.localStorage.setItem("documenter-theme", theme);
+ } else {
+ console.error("Browser does not support window.localStorage");
+ }
+}
+
+// Theme picker setup
+$(document).ready(function() {
+ // onchange callback
+ $('#documenter-themepicker').change(function themepick_callback(ev){
+ var themename = $('#documenter-themepicker option:selected').attr('value');
+ set_theme(themename);
+ });
+
+ // Make sure that the themepicker displays the correct theme when the theme is retrieved
+ // from localStorage
+ if(typeof(window.localStorage) !== "undefined") {
+ var theme = window.localStorage.getItem("documenter-theme");
+ if(theme !== null) {
+ $('#documenter-themepicker option').each(function(i,e) {
+ e.selected = (e.value === theme);
+ })
+ } else {
+ $('#documenter-themepicker option').each(function(i,e) {
+ e.selected = $("html").hasClass(`theme--${e.value}`);
+ })
+ }
+ }
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+// update the version selector with info from the siteinfo.js and ../versions.js files
+$(document).ready(function() {
+ var version_selector = $("#documenter .docs-version-selector");
+ var version_selector_select = $("#documenter .docs-version-selector select");
+
+ version_selector_select.change(function(x) {
+ target_href = version_selector_select.children("option:selected").get(0).value;
+ window.location.href = target_href;
+ });
+
+ // add the current version to the selector based on siteinfo.js, but only if the selector is empty
+ if (typeof DOCUMENTER_CURRENT_VERSION !== 'undefined' && $('#version-selector > option').length == 0) {
+ var option = $("");
+ version_selector_select.append(option);
+ }
+
+ if (typeof DOC_VERSIONS !== 'undefined') {
+ var existing_versions = version_selector_select.children("option");
+ var existing_versions_texts = existing_versions.map(function(i,x){return x.text});
+ DOC_VERSIONS.forEach(function(each) {
+ var version_url = documenterBaseURL + "/../" + each;
+ var existing_id = $.inArray(each, existing_versions_texts);
+ // if not already in the version selector, add it as a new option,
+ // otherwise update the old option with the URL and enable it
+ if (existing_id == -1) {
+ var option = $("");
+ version_selector_select.append(option);
+ } else {
+ var option = existing_versions[existing_id];
+ option.value = version_url;
+ option.disabled = false;
+ }
+ });
+ }
+
+ // only show the version selector if the selector has been populated
+ if (version_selector_select.children("option").length > 0) {
+ version_selector.toggleClass("visible");
+ }
+})
+
+})
diff --git a/previews/PR11/assets/search.js b/previews/PR11/assets/search.js
new file mode 100644
index 00000000..1a514547
--- /dev/null
+++ b/previews/PR11/assets/search.js
@@ -0,0 +1,251 @@
+// Generated by Documenter.jl
+requirejs.config({
+ paths: {
+ 'lunr': 'https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.9/lunr.min',
+ 'lodash': 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min',
+ 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min',
+ }
+});
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'lunr', 'lodash'], function($, lunr, _) {
+
+$(document).ready(function() {
+ // parseUri 1.2.2
+ // (c) Steven Levithan
+ // MIT License
+ function parseUri (str) {
+ var o = parseUri.options,
+ m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
+ uri = {},
+ i = 14;
+
+ while (i--) uri[o.key[i]] = m[i] || "";
+
+ uri[o.q.name] = {};
+ uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
+ if ($1) uri[o.q.name][$1] = $2;
+ });
+
+ return uri;
+ };
+ parseUri.options = {
+ strictMode: false,
+ key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
+ q: {
+ name: "queryKey",
+ parser: /(?:^|&)([^&=]*)=?([^&]*)/g
+ },
+ parser: {
+ strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
+ loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
+ }
+ };
+
+ $("#search-form").submit(function(e) {
+ e.preventDefault()
+ })
+
+ // list below is the lunr 2.1.3 list minus the intersect with names(Base)
+ // (all, any, get, in, is, only, which) and (do, else, for, let, where, while, with)
+ // ideally we'd just filter the original list but it's not available as a variable
+ lunr.stopWordFilter = lunr.generateStopWordFilter([
+ 'a',
+ 'able',
+ 'about',
+ 'across',
+ 'after',
+ 'almost',
+ 'also',
+ 'am',
+ 'among',
+ 'an',
+ 'and',
+ 'are',
+ 'as',
+ 'at',
+ 'be',
+ 'because',
+ 'been',
+ 'but',
+ 'by',
+ 'can',
+ 'cannot',
+ 'could',
+ 'dear',
+ 'did',
+ 'does',
+ 'either',
+ 'ever',
+ 'every',
+ 'from',
+ 'got',
+ 'had',
+ 'has',
+ 'have',
+ 'he',
+ 'her',
+ 'hers',
+ 'him',
+ 'his',
+ 'how',
+ 'however',
+ 'i',
+ 'if',
+ 'into',
+ 'it',
+ 'its',
+ 'just',
+ 'least',
+ 'like',
+ 'likely',
+ 'may',
+ 'me',
+ 'might',
+ 'most',
+ 'must',
+ 'my',
+ 'neither',
+ 'no',
+ 'nor',
+ 'not',
+ 'of',
+ 'off',
+ 'often',
+ 'on',
+ 'or',
+ 'other',
+ 'our',
+ 'own',
+ 'rather',
+ 'said',
+ 'say',
+ 'says',
+ 'she',
+ 'should',
+ 'since',
+ 'so',
+ 'some',
+ 'than',
+ 'that',
+ 'the',
+ 'their',
+ 'them',
+ 'then',
+ 'there',
+ 'these',
+ 'they',
+ 'this',
+ 'tis',
+ 'to',
+ 'too',
+ 'twas',
+ 'us',
+ 'wants',
+ 'was',
+ 'we',
+ 'were',
+ 'what',
+ 'when',
+ 'who',
+ 'whom',
+ 'why',
+ 'will',
+ 'would',
+ 'yet',
+ 'you',
+ 'your'
+ ])
+
+ // add . as a separator, because otherwise "title": "Documenter.Anchors.add!"
+ // would not find anything if searching for "add!", only for the entire qualification
+ lunr.tokenizer.separator = /[\s\-\.]+/
+
+ // custom trimmer that doesn't strip @ and !, which are used in julia macro and function names
+ lunr.trimmer = function (token) {
+ return token.update(function (s) {
+ return s.replace(/^[^a-zA-Z0-9@!]+/, '').replace(/[^a-zA-Z0-9@!]+$/, '')
+ })
+ }
+
+ lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'juliaStopWordFilter')
+ lunr.Pipeline.registerFunction(lunr.trimmer, 'juliaTrimmer')
+
+ var index = lunr(function () {
+ this.ref('location')
+ this.field('title',{boost: 100})
+ this.field('text')
+ documenterSearchIndex['docs'].forEach(function(e) {
+ this.add(e)
+ }, this)
+ })
+ var store = {}
+
+ documenterSearchIndex['docs'].forEach(function(e) {
+ store[e.location] = {title: e.title, category: e.category, page: e.page}
+ })
+
+ $(function(){
+ searchresults = $('#documenter-search-results');
+ searchinfo = $('#documenter-search-info');
+ searchbox = $('#documenter-search-query');
+ function update_search(querystring) {
+ tokens = lunr.tokenizer(querystring)
+ results = index.query(function (q) {
+ tokens.forEach(function (t) {
+ q.term(t.toString(), {
+ fields: ["title"],
+ boost: 100,
+ usePipeline: true,
+ editDistance: 0,
+ wildcard: lunr.Query.wildcard.NONE
+ })
+ q.term(t.toString(), {
+ fields: ["title"],
+ boost: 10,
+ usePipeline: true,
+ editDistance: 2,
+ wildcard: lunr.Query.wildcard.NONE
+ })
+ q.term(t.toString(), {
+ fields: ["text"],
+ boost: 1,
+ usePipeline: true,
+ editDistance: 0,
+ wildcard: lunr.Query.wildcard.NONE
+ })
+ })
+ })
+ searchinfo.text("Number of results: " + results.length)
+ searchresults.empty()
+ results.forEach(function(result) {
+ data = store[result.ref]
+ link = $(''+data.title+'')
+ link.attr('href', documenterBaseURL+'/'+result.ref)
+ if (data.category != "page"){
+ cat = $('('+data.category+', '+data.page+')')
+ } else {
+ cat = $('('+data.category+')')
+ }
+ li = $('
This package is a thin Julia wrapper around the High Order Hex-Quad Mesher (a.k.a. HOHQMesh) created and developed by David A. Kopriva. HOHQMesh.jl is available on Linux, MacOS, and Windows.
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.
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
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:
HOHQMesh.jl was initiated by Michael Schlottke-Lakemper (University of Cologne, Germany), who is also the principal developer of HOHQMesh.jl. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
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.
Settings
This document was generated with Documenter.jl version 0.27.6 on Saturday 11 September 2021. Using Julia version 1.6.2.
Copyright (c) 2021-present Michael Schlottke-Lakemper
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Settings
This document was generated with Documenter.jl version 0.27.6 on Saturday 11 September 2021. Using Julia version 1.6.2.
Add the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version
Add the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.
addSpringSmoother!(status::String, type::String, nIterations::Int)
+
+status is either `ON` or `OFF`
+type is either `LinearSpring` or `LinearAndCrossbarSpring`
Generate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.
You can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.
You can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
getCurveType(crv::Dic{String,Any})
+
+Get the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,
+`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.
Get the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.
Plot objects specified by the plotOptions. Construct the plotOptions by the sum of what is to be drawn from the choices MODEL, GRID, MESH, REFINEMENTS.
Example: To plot the model and the grid, plotOptions = MODEL + GRID. To plot just the mesh, plotOptions = MESH.
To plot everything, plotOptions = MODEL + GRID + MESH + REFINEMENTS
Contents are overlayed in the order: GRID, MESH, MODEL, REFINEMENTS
Set the file format for the plot file. Acceptable choices are "sem", which includes interior nodes and boundary nodes and "skeleton", which includes only the corner nodes.
This document was generated with Documenter.jl version 0.27.6 on Saturday 11 September 2021. Using Julia version 1.6.2.
diff --git a/previews/PR11/search_index.js b/previews/PR11/search_index.js
new file mode 100644
index 00000000..c29c7137
--- /dev/null
+++ b/previews/PR11/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"HQMTool/#HQMTool","page":"Interactive mesh generation","title":"HQMTool","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"HQMTool is currently an API to generate a quad (Future:Hex) mesh using Julia.","category":"page"},{"location":"HQMTool/#Contents","page":"Interactive mesh generation","title":"Contents","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Introduction\nBasic Moves\nHQMTool API\nProject Creation and Saving\nPlotting\nModifying/Editing a Project\nControlling the Mesh Generation Process\nEditing the Run Parameters\nChanging the output file names\nAdding the background grid\nSmoothing Operations\nManual Refinement\nBoundary Curves\nAdding and Removing Outer and Inner Boundaries\nDefining Curves\nEditing Curves\nUndo/Redo\nAdvanced","category":"page"},{"location":"HQMTool/#Introduction","page":"Interactive mesh generation","title":"Introduction","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"HQMTool is an API to build quad/hex meshes. Two examples are included to get you started. The first reads in an existing control file from the HOHQMesh examples collection. To see that example, run","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\trunDemo()","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The second example builds a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. The script is","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"function iceCreamCone(folder::String)\n#\n# Create a project with the name \"IceCreamCone\", which will be the name of the mesh, plot and stats files,\n# written to `path`. This version uses generic versions of\n# the API.\n#\n p = newProject(\"IceCreamCone\",path)\n#\n# Outer boundary\n#\n circ = new(\"outerCircle\",[0.0,-1.0,0.0],4.0,0.0,360.0,\"degrees\")\n add!(p,circ)\n#\n# Inner boundary\n#\n cone1 = new(\"cone1\", [0.0,-3.0,0.0],[1.0,0.0,0.0]) # A line\n iceCream = new(\"iceCream\",[0.0,0.0,0.0],1.0,0.0,180.0,\"degrees\") # An arc\n cone2 = new(\"cone2\", [-1.0,0.0,0.0],[0.0,-3.0,0.0]) # A line\n add!(p,cone1,\"IceCreamCone\")\n add!(p,iceCream,\"IceCreamCone\")\n add!(p,cone2,\"IceCreamCone\")\n#\n# Set some control RunParameters to overwrite the defaults\n#\n setPolynomialOrder!(p,4)\n setPlotFileFormat!(p,\"sem\")\n#\n# To mesh, a background grid is needed\n#\n addBackgroundGrid!(p, [0.1,0.1,0.0])\n#\n# Show the model and grid\n#\n plotProject!(p, MODEL+GRID)\n#\n# Generate the mesh and plot\n#\n println(\"Press any key to continue and generate the mesh\")\n readline()\n generateMesh(p)\n updatePlot!(p, MODEL+MESH)\n\n return p\nend","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The first line creates a new project, where the mesh and plot file names will be derived from the project name, \"IceCreamCone\" written to the specified folder.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently operational:","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Parametric equations\nSplines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"In the example, the outer boundary is a closed circular arc with center at [0,0,0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary! through the generic name add!. You can add any number of curves, but they must be added in order, counter-clockwise. ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, \"IceCreamCone\" made up of two lines and a half circular arc. Again, add them in order, counter-clockwise.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"For convenience, newProject will generate default run parameters, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script sets the polynomial order (default = 5) and the plot file format (default = \"skeleton\").","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extend of the domain to be meshed, so only the mesh size needs to be specified using","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\taddBackgroundGrid!(proj::Project, bgSize::Array{Float64})","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The example sets the background mesh size to be 0.1 in the x and y directions. The z component is ignored.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The script finishes by generating the quad mesh and plotting the results, as shown below","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"It also returns the project so that it can be edited further, if desired.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To save a control file for HOHQMesh, simply invoke","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tsaveProject(proj::Project,outFile::String)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"where outFile is the name of the control file (traditionally with a .control extension). saveProject is automatically called when a mesh is generated.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Methods are available to edit a model. For example to move the center of the outer boundary","category":"page"},{"location":"HQMTool/#Basic-Moves","page":"Interactive mesh generation","title":"Basic Moves","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To create generate a mesh you","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Create a project","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tp = newProject(,)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Create inner and outer boundary curves","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tc = new(, startLocation [x,y,z],endLocation [x,y,z]) (Straight Line)\n\tc = new(,center [x,y,z],radius,startAngle,endAngle,units = \"degrees\" or \"radians\") (Circular Arc)\n\tc = new(, xEqn, yEqn, zEqn ) (Parametric equation)\n\tc = new(, dataFile) (Spline)\n\tc = new(, nKnots, knotsMatrix) (also Spline)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Add curves to build the model to see what you have added,","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tadd!(p, ) (Add outer boundary curve)\n\tadd!(p, , ) (add curve to an inner boundary)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To visualize the project's model,","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tplotProject(p,MODEL)\n\t\nTo update the plot at any time, use\n\n\tupdatePlot!(p, options)\n\t\nOptions are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. (You normally are not intersted in the background grid once the mesh is generated.)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Set the background grid","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t addBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ]) (No outer boundary)\n\t *OR*\n\t addBackgroundGrid!(p, [top, left, bottom, right], num Intervals [nX,nY,nZ]) (No outer boundary)\n\t \n\t addBackgroundGrid!(p, grid size [dx,dy,dz]) (If an outer boundary is present)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Adjust parameters, if desired (e.g.)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tsetPolynomialOrder!(p,order)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Generate the mesh","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tgenerateMesh(p)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The mesh will be stored in with the name .mesh. The control file will also be saved in that folder with the name .control, which you can read in again later and modify, remesh, etc. The function will print grid information, and will plot the grid as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject command.","category":"page"},{"location":"HQMTool/#HQMTool-API","page":"Interactive mesh generation","title":"HQMTool API","text":"","category":"section"},{"location":"HQMTool/#Project-Creation-and-Saving","page":"Interactive mesh generation","title":"Project Creation and Saving","text":"","category":"section"},{"location":"HQMTool/#New-Project","page":"Interactive mesh generation","title":"New Project","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t(Return:Project) proj = newProject(name::String, folder::String)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The supplied name will be the default name of the mesh and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.","category":"page"},{"location":"HQMTool/#Opening-an-existing-project-file","page":"Interactive mesh generation","title":"Opening an existing project file","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t(Return:Project) proj = openProject(fileName::String, folder::String)","category":"page"},{"location":"HQMTool/#Saving-a-project","page":"Interactive mesh generation","title":"Saving a project","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tsaveProject(proj::Project)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"writes a control file to the folder designated when creating the new project. It can be read in again with OpenProject.","category":"page"},{"location":"HQMTool/#Plotting","page":"Interactive mesh generation","title":"Plotting","text":"","category":"section"},{"location":"HQMTool/#Plotting-a-Project","page":"Interactive mesh generation","title":"Plotting a Project","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tplotProject(proj::Project, options)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The options are any combination of MODEL, GRID, MESH, and REFINEMENTS. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH. REFINEMENTS will show where manual refinement is added.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"If the model is modified and you want to re-plot with the new values, invoke","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tupdatePlot!(proj::Project, options)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"but genrally the plot will be updated automatically as you build the model.","category":"page"},{"location":"HQMTool/#Modifying/Editing-a-Project","page":"Interactive mesh generation","title":"Modifying/Editing a Project","text":"","category":"section"},{"location":"HQMTool/#Setting-the-name-of-a-project","page":"Interactive mesh generation","title":"Setting the name of a project","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The project name is the name under which the mesh, plot, statistics and control files will be written.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tsetName!(proj::Project,name::String)","category":"page"},{"location":"HQMTool/#Getting-the-current-name-of-a-Project","page":"Interactive mesh generation","title":"Getting the current name of a Project","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:String]\tgetName(proj::Project)","category":"page"},{"location":"HQMTool/#Controlling-the-Mesh-Generation-Process","page":"Interactive mesh generation","title":"Controlling the Mesh Generation Process","text":"","category":"section"},{"location":"HQMTool/#Editing-the-Run-Parameters","page":"Interactive mesh generation","title":"Editing the Run Parameters","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The run parameters can be enquired and set with these getter/setter pairs:","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] setPolynomialOrder!(proj::Project, p::Int)\n\t[Return:Int] getPolynomialOrder(proj::Project)\n\t[Return:nothing] setMeshFileFormat!(proj::Project, meshFileFormat::String)\n\t[Return:String] getMeshFileFormat(proj::Project)\n\t[Return:nothing] setPlotFileFormat!(proj::Project, plotFileFormat::String)\n\t[Return:String] getPlotFileFormat(proj::Project)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The mesh file format is either ISM or ISM-V2. The plot file (Which can be viewed with something like VisIt or Paraview) format is either skeleton or sem. The former is just a low order finite elemnt represntation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom. At this time, if you want to plot the grid in HQMTool, then you must use ISM-V2 as the mesh file format.","category":"page"},{"location":"HQMTool/#Changing-the-output-file-names","page":"Interactive mesh generation","title":"Changing the output file names","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] setName!(proj::Project,name::String)\n\t[Return:String] getName(proj::Project)\n\t[Return:nothing] setFolder!(proj::Project,folder::String)\n\t[Return:String] getFolder(proj::Project)","category":"page"},{"location":"HQMTool/#Adding-the-background-grid","page":"Interactive mesh generation","title":"Adding the background grid","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One or the other has to be specified after a new project has been created.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})\n\t[Return:nothing] addBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int})\n\t[Return:nothing] addBackgroundGrid!(proj::Project, bgSize::Array{Float64})","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Use one of the first two if there is no outer boundary. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1]+N dx[1]]X[x0[2], x0[2]+Ndx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, N, bgSize are all vectors [ *, \\, *] giving the x, y, and z components.","category":"page"},{"location":"HQMTool/#Smoothing-Operations","page":"Interactive mesh generation","title":"Smoothing Operations","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To change the defaults, the smoother parameters can be set/enquired with the functions","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] setSmoothingStatus!(proj::Project, status::String)\n\t[Return:String] getSmoothingStatus(proj::Project)\n\t[Return:nothing] setSmoothingType!(proj::Project, type::String)\n\t[Return:String] getSmoothingType(proj::Project)\n\t[Return:nothing] setSmoothingIterations!(proj::Project, iterations::Int)\n\t[Return:Int] getSmoothingIterations(proj::Project)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"status is either \"ON\" or \"OFF\". ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To remove the smoother altogether,","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] removeSpringSmoother!(proj::Project)","category":"page"},{"location":"HQMTool/#Manual-Refinement","page":"Interactive mesh generation","title":"Manual Refinement","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas in the geometry.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To create a refinement center,","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Dict{String,Any}] newRefinementCenter!(proj::Project, type::String, \n \t \t\t\t\t x0::Array{Float64}, h::Float64,\n \t \t\t\t\t w::Float64 )","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"where the type is either smooth or sharp, x0 = [x,y,z] is the location of the center, h is the mesh size, and w is the extent of the refinement region.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Similarly, one can create a RefinementLine,","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Dict{String,Any}] newRefinementLine!(proj::Project, type::String, \n \t\t\t\t x0::Array{Float64}, x1::Array{Float64},\n \t\t\t\t h::Float64,\n w::Float64 )","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"where x0 is the start postition and x1 is the end of the line.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To add a refinement region to the project,","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] addRefinementRegion!(proj::Project,r::Dict{String,Any})","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To get the indx'th refinement region from the project, or to get a refinement region with a given name, use ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Dict{String,Any}] getRefinementRegion(proj::Project, indx::Int)\n\t[Return:Dict{String,Any}] getRefinementRegion(proj::Project, name::String)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Finally, to get a list of all the refinement regions, ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Array{Dict{String,Any}}] array = allRefinementRegions(proj::Project)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"A refinement region can be edited by using the following","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] \t\t setRefinementType!(r::Dict{String,Any}, type::String)\n\t[Return:String] \t\t getRefinementType(r::Dict{String,Any})\n\t[Return:nothing] \t\t setRefinementLocation!(r::Dict{String,Any}, x::Array{Float64})\n\t[Return:Array{Float64}] getRefinementLocation(r::Dict{String,Any})\n\t[Return:nothing] \t\t setRefinementGridSize!(r::Dict{String,Any},h::Float64)\n\t[Return:float64] \t\t getRefinementGridSize(r::Dict{String,Any})\n\t[Return:nothing] \t\t setRefinementWidth!(r::Dict{String,Any},w::Float64)\n\t[Return:float64] \t\t getRefinementWidth(r::Dict{String,Any})","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"where r is a dictionary returned by newRefinementCenter!, newRefinementLine!, or getRefinementRegion.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To further edit a RefinementLine, use the methods","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] \t\t setRefinementStart!(r::Dict{String,Any}, x::Array{Float64})\n\t[Return:Array{Float64}] getRefinementStart(r::Dict{String,Any})\n\t[Return:nothing] \t\t setRefinementEnd!(r::Dict{String,Any}, x::Array{Float64})\n\t[Return:Array{Float64}] getRefinementEnd(r::Dict{String,Any})","category":"page"},{"location":"HQMTool/#Boundary-Curves","page":"Interactive mesh generation","title":"Boundary Curves","text":"","category":"section"},{"location":"HQMTool/#Adding-and-Removing-Outer-and-Inner-Boundaries","page":"Interactive mesh generation","title":"Adding and Removing Outer and Inner Boundaries","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Adding an outer boundary curve","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Using the curve creation routines, described in the next section below, create curves in sucessive order counter-clockwise along the outer boundary and add them to the outer boundary curve using\n\n\t[Return:nothing] addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})\n Generic: add!(...)\n\n`crv` is the dictionary that represents the curve.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Example:","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tadd!(p,circ)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Adding an inner boundary curve","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n Generic: add!(...)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Example:","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tadd!(p,cone1,\"IceCreamCone\")","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To edit curves they can be accessed by name:","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Dict{String,Any}] getInnerBoundaryCurve(proj::Project, curveName::String, boundaryName::String)\n Generic: get(...)\n\t[Return:Dict{String,Any}] getOuterBoundaryCurveWithName(proj::Project, name::String)\n Generic: get(...)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Deleting boundary curves","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n\tGeneric: remove!(...)\n\t[Return:nothing] removeInnerBoundaryCurve!(proj::Project, name::String, chainName::String)\n\tGeneric: remove!(...)","category":"page"},{"location":"HQMTool/#Defining-Curves","page":"Interactive mesh generation","title":"Defining Curves","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Four curve types can be added to the outer and inner boundary curve chains. They are","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"parametricEquation\nendPointsLine\ncircularArc\nspline","category":"page"},{"location":"HQMTool/#Parametric-Equations","page":"Interactive mesh generation","title":"Parametric Equations","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Creating new ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Dict{String,Any}] newParametricEquationCurve(name::String, \n \t\t\t\t\t\t\t\t\t\t xEqn::String, \n \t\t\t\t\t\t\t\t\t\t yEqn::String, \n \t\t\t\t\t\t\t\t\t\t zEqn::String = \"z(t) = 0.0\" )\n Generic: new(...)\n \nReturns a new parametric equation. Equations must be of the form \n\n\t() = ...\n\nThe name of the function, and the argument are arbitrary. The equation \tcan be any legitimate equation. The constant `pi` is defined for use. \tExponention is done with `^`. All number literals are interpreted as \tfloating point numbers.\n\nExample:\n\n\tx(s) = 2.0 + 3*cos(2*pi*s)^2\n\t\nThe z-Equation is optional, but for now must define zero for z.","category":"page"},{"location":"HQMTool/#Line-Defined-by-End-Points","page":"Interactive mesh generation","title":"Line Defined by End Points","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:Dict{String,Any}] newEndPointsLineCurve(name::String, \n \t xStart::Array{Float64},\n xEnd::Array{Float64})\n Generic: new(...)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The xStart and xEnd are arrays of the form [x,y,z]. The z component should be zero and for now is ignored.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Example:","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t\tcone1 = new(\"cone1\", [0.0,-3.0,0.0],[1.0,0.0,0.0])","category":"page"},{"location":"HQMTool/#Circular-Arc","page":"Interactive mesh generation","title":"Circular Arc","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"[Return:Dict{String,Any}] newCircularArcCurve(name::String, \n \t\t\t\t\t center::Array{Float64}, \n \t\t\t\t\t radius::Float64,\n \t\t\t\t\t startAngle::Float64, \n \t\t\t\t\t endAngle::Float64,\n \t\t\t\t\t units::String)\n Generic: new(...)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The center is an array of the form [x,y,z]. The units argument defines the start and end angle units, and is either \"degrees\" or \"radians\". That argument is optional, and defaults to \"degrees\".","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Example: ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\ticeCream = new(\"iceCream\",[0.0,0.0,0.0],1.0,0.0,180.0,\"degrees\")","category":"page"},{"location":"HQMTool/#Spline-Curve","page":"Interactive mesh generation","title":"Spline Curve","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"A spline is defined by an array of knots, tj,xj,yj,zj. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the t,x,y,z values, e.g.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t\t9\n\t\t0.000000000000000 -3.50000000000000 3.50000000000000 0.0\n\t\t3.846153846153846E-002 -3.20000000000000 5.00000000000 0.0\n\t\t7.692307692307693E-002 -2.00000000000000 6.00000000000 0.0\n\t\t0.769230769230769 0.000000000000000 -1.00000000000000 0.0\n\t\t0.807692307692308 -1.00000000000000 -1.00000000000000 0.0\n\t\t0.846153846153846 -2.00000000000000 -0.800000000000000 0.0\n\t\t0.884615384615385 -2.50000000000000 0.000000000000000 0.0\n\t\t0.923076923076923 -3.00000000000000 1.00000000000000 0.0\n\t\t1.00000000000000 -3.50000000000000 3.50000000000000 0.0","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"or by constructing the Nx4 array supplying it to the new procedure. The constructors are","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"[Return:Dict{String,Any}] newSplineCurve(name::String, nKnots::Int, data::Matrix{Float64})\nGeneric: new(...)\n[Return:Dict{String,Any}] newSplineCurve(name::String, dataFile::String)\nGeneric: new(...)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"If the curve is to be closed. The last point must be the same as the first.","category":"page"},{"location":"HQMTool/#Editing-Curves","page":"Interactive mesh generation","title":"Editing Curves","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"You can determine the type of a curve by ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:String] getCurveType(crv::Dict{String,Any})","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"For any of the curves, their name can be changed by ","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tsetCurveName!(crv::Dict{String,Any}, name::String)","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"and checked by","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\tgetCurveName(crv::Dict{String,Any})","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Otherwise there are special functions to change the parameters of curves","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] setXEqn!(crv::Dict{String,Any}, eqn::String)\n\t[Return:nothing] setYEqn!(crv::Dict{String,Any}, eqn::String)\n\t[Return:nothing] setZEqn!(crv::Dict{String,Any}, eqn::String)\n\t[Return:nothing] setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\t[Return:nothing] setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\t[Return:nothing] setArcUnits!(arc::Dict{String,Any}, units::String)\n\t[Return:nothing] setArcCenter!(arc::Dict{String,Any}, point::Array{Float64})\n\t[Return:nothing] setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n\t[Return:nothing] setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n\t[Return:nothing] setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\t\n\t[Return:String] \t\tgetXEqn(crv::Dict{String,Any})\n\t[Return:String] \t\tgetYEqn(crv::Dict{String,Any})\n\t[Return:String] \t\tgetZEqn(crv::Dict{String,Any})\n\t[Return:Array{Float64}] getStartPoint(crv::Dict{String,Any})\n\t[Return:Array{Float64}] getEndPoint(crv::Dict{String,Any})\n\t[Return:String] \t\tgetArcUnits(arc::Dict{String,Any})\n\t[Return:Array{Float64}] getArcCenter(arc::Dict{String,Any})\n\t[Return:Float64]\t\tgetArcStartAngle(arc::Dict{String,Any})\n\t[Return:Float64] \t\tgetArcEndAngle(arc::Dict{String,Any})\n\t[Return:Float64] \t\tgetArcRadius(arc::Dict{String,Any})","category":"page"},{"location":"HQMTool/#Undo/Redo","page":"Interactive mesh generation","title":"Undo/Redo","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"The HQMTool has unlimited undo/redo for most actions.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"In interactive mode, actions can be undone by the commands","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:String] undo()\n\t[Return:String] redo()","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"where the return string contains the name of the action performed.","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"To find out what the next actions are, use","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:String] undoName()\n\t[Return:String] redoName()","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"Finally, to clear the undo stack, use","category":"page"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"\t[Return:nothing] clearUndoRedo()","category":"page"},{"location":"HQMTool/#Advanced","page":"Interactive mesh generation","title":"Advanced","text":"","category":"section"},{"location":"HQMTool/","page":"Interactive mesh generation","title":"Interactive mesh generation","text":"All curves are actually dictionaries of type Dict{String,Any}, and since Julia is not a particularly object oriented language, the parameters can be accessed and edited directly by key and value. In fact, all objects except for the Project, are of type Dict{String,Any}. The project holds all the control and model objects in its projectDirectory. However, if you do that, then undo/redo and plot updating won't happen.","category":"page"},{"location":"license/#License","page":"License","title":"License","text":"","category":"section"},{"location":"license/","page":"License","title":"License","text":"MIT LicenseCopyright (c) 2021-present Michael Schlottke-LakemperPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"CheatSheet/#HQMTool-CheatSheet","page":"Cheat sheet","title":"HQMTool CheatSheet","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"Workflow:","category":"page"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"Create a project\nAdd boundary curves\nAdd a background grid\nAdd manual refinement (if desired)\nGenerate mesh","category":"page"},{"location":"CheatSheet/#Project","page":"Cheat sheet","title":"Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tp = newProject(,)","category":"page"},{"location":"CheatSheet/#cs-plotting","page":"Cheat sheet","title":"Plotting","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tplotProject!(p,options)\n\tupdatePlot!(p,options)","category":"page"},{"location":"CheatSheet/#Curves","page":"Cheat sheet","title":"Curves","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tc = new(name, startLocation [x,y,z],endLocation [x,y,z]) *Straight Line*\n\tc = new(name,center [x,y,z],radius, startAngle, endAngle) *Circular Arc*\n\tc = new(name, xEqn, yEqn, zEqn ) *Parametric equation*\n\tc = new(name, dataFile) \t\t\t *Spline*\n\tc = new(name, nKnots, knotsMatrix) *also Spline*","category":"page"},{"location":"CheatSheet/#cs-manual-refinement","page":"Cheat sheet","title":"Manual Refinement","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tr = newRefinementCenter(name, center, gridSize, radius )\n\tr = newRefinementLine(name,type, startPoint, endPoint, gridSize, width )","category":"page"},{"location":"CheatSheet/#Adding-to-a-Project","page":"Cheat sheet","title":"Adding to a Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tadd!(p, c) \t\t\t\t\t\t *Add outer boundary curve*\n\tadd!(p, c, ) *add curve to an inner boundary*\n\tadd!(p, r) \t\t\t\t\t\t *Add refinement region*\n\n\taddBackgroundGrid!(p, [top, left, bottom, right], [nX,nY,nZ]) *No outer boundary*\n\taddBackgroundGrid!(p, [dx,dy,dz]) *If an outer boundary is present*","category":"page"},{"location":"CheatSheet/#Accessing-items","page":"Cheat sheet","title":"Accessing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tcrv = get(p,curveName)\t *Get a curve in the outer boundary*\n\tcrv = get(p,curveName, boundaryName) *Get a curve in an inner boundary*\n\tindx, chain = getChain(p,boundaryName) *Get a complete inner boundary curve*\n\tr = getRefinementRegion(p, name)","category":"page"},{"location":"CheatSheet/#Removing-from-Project","page":"Cheat sheet","title":"Removing from Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tremoveOuterboundary!(p) \t\t\t *Entire outer boundary curve*\n\tremoveInnerBoundary!(p, innerBoundaryName) *Entire inner boundary curve\n\tremove!(p, name) \t\t\t\t\t *Curve in outer boundary*\n\tremove!(p, name, innerBoundaryName) *Curve in inner boundary*\n\tremoveRefinementRegion!(p, name)","category":"page"},{"location":"CheatSheet/#Editing-items","page":"Cheat sheet","title":"Editing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them out.","category":"page"},{"location":"CheatSheet/#Meshing","page":"Cheat sheet","title":"Meshing","text":"","category":"section"},{"location":"CheatSheet/","page":"Cheat sheet","title":"Cheat sheet","text":"\tgenerateMesh(p)\n\tremoveMesh!(p)","category":"page"},{"location":"reference/#HOHQMesh.jl-API","page":"Reference","title":"HOHQMesh.jl API","text":"","category":"section"},{"location":"reference/","page":"Reference","title":"Reference","text":"CurrentModule = HOHQMesh","category":"page"},{"location":"reference/","page":"Reference","title":"Reference","text":"Modules = [HOHQMesh]","category":"page"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary named boundaryName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, obj::Dict{String,Any})\n\nAdd a curve to the outer boundary or a refinement reion to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, Array{Float64, N} where N, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})\n\nAdd the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version\n\naddBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nis a lot easier to use.\n\nTODO: Change HOHQMesh and delete this way to specify the domain and use the bounding box one instead.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nAdd the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid(proj::Project, bgSize::Array{Float64})\n\nAdd the background grid block with the grid size to be a 3-vector. Use this when there is an outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, dict::Dict{String,Any})\n\nUsed only for undo/redo.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToInnerBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.addCurveToInnerBoundary!","text":"addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary with name boundaryName. If an inner boundary of that name does not exist, one is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addCurveToOuterBoundary!","text":"addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})\n\nAdd a curve to the outer boundary. The curves must be added in order counter-clockwise\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addInnerBoundaryWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.addInnerBoundaryWithName!","text":"addInnerBoundaryWithName!(proj::Project,name::String)\n\nCreate a new empty inner boundary with the given name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addObserver-Tuple{Any, String, Any}","page":"Reference","title":"HOHQMesh.addObserver","text":"addObserver(observer::Any, note::String, fnction::Any)\n\nfnction is the function to be executed (called) when a notification of name note is given.\n\nThe function called upon notification must have the signature fnction(observer, sender, args...)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addOuterBoundary!","text":"addOuterBoundary!(proj::Project)\n\nAdd an empty outer boundary to the project. There can be only one.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegion!","text":"addRefinementRegion!(proj::Project,r::Dict{String,Any})\n\nAdd the refinement region to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegionPoints!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegionPoints!","text":"addRefinementRegionPoints!(proj::Project, r::Dict{String,Any})\n\nCompute and add to the project the plotting points for the refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRunParameters!","page":"Reference","title":"HOHQMesh.addRunParameters!","text":"addRunParameters!(proj::Project, \n plotFormat::String = \"skeleton\", \n meshFileFormat::String = \"ISM-V2\", \n polynomialOrder::Int = 5)\n\nAdd a RUN_PARAMETERS block and set all the parameters in one call.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.addSpringSmoother!","page":"Reference","title":"HOHQMesh.addSpringSmoother!","text":"addSpringSmoother!(status::String, type::String, nIterations::Int)\n\nstatus is either `ON` or `OFF`\ntype is either `LinearSpring` or `LinearAndCrossbarSpring`\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.bboxUnion-Tuple{Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.bboxUnion","text":"bboxUnion(box1::Array{Float64}, box2::Array{Float64})\n\nReturns the union of two bounding boxes\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.curveBounds-Tuple{Matrix{Float64}}","page":"Reference","title":"HOHQMesh.curveBounds","text":"curveBounds(crvPoints::Array{Float64,2})\n\nFind the bounds of a single curve, discretized as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.duplicateCurve-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.duplicateCurve","text":"duplicateCurve(crv::Dict{String,Any}, newName::String)\n\nDuplicate the given curve giving it the new name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.emptyBounds-Tuple{}","page":"Reference","title":"HOHQMesh.emptyBounds","text":"Returns an array that will always be ignored when unioned with another bounding box.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.examples_dir-Tuple{}","page":"Reference","title":"HOHQMesh.examples_dir","text":"examples_dir()\n\nReturn the path to the directory with some example mesh setups.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{Any}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(control_file;\n output_directory=\"out\",\n mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing)\n\nGenerate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.\n\nYou can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.\n\nYou can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.get-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.get","text":"get(proj::Project, curveName::String, boundaryName::String)\n\nGet the curve named curveName from the inner boundary named boundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.get-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.get","text":"get(proj::Project, curveName::String)\n\nGet the curve with name curveName from the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getAllRefinementRegions-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getAllRefinementRegions","text":"allRefinementRegions(proj::Project)\n\nGet the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcCenter","text":"getArcCenter(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the center of a circular arc as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcEndAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcEndAngle","text":"getArcEndAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcRadius-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcRadius","text":"getArcRadius(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcStartAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcStartAngle","text":"getArcStartAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcUnits!-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcUnits!","text":"getArcUnits(crv::Dict{String,Any}, units::String)\n\nGet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridLowerLeft-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridLowerLeft","text":"function getBackgroundGridLowerLeft(proj::Project)\n\nReturns the [x,y] of the lower left point of thebackground grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSize-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSize","text":"getBackgroundGridSize(proj::Project)\n\nReturns the background grid size array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSteps-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSteps","text":"function getBackgroundGridLowerLeft(proj::Project)\n\nReturns the [x,y,z] of the lower left point of thebackground grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveName","text":"getCurveName(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveType","text":"getCurveType(crv::Dic{String,Any})\n\nGet the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,\n`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getEndPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getEndPoint","text":"getEndPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the end point for a line curve as an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundary-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundary","text":"getInnerBoundary(proj::Project, name::String)\n\nGet the chain of curves from the inner boundary with name name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryChainWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryChainWithName","text":"getInnerBoundaryWithName(proj::Project, name::String)\n\nGet the inner boundary CHAIN with the given name. If one does not exist, it is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryCurve","text":"\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getMeshFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getMeshFileFormat","text":"getMeshFileFormat(proj::Project)\n\nReturns the format in which the mesh will be written.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getName-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getName","text":"getName(proj::Project)\n\nReturns the filename to be used by the mesh, plot, control, and stats files.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryChainList-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getOuterBoundaryChainList","text":"getOuterBoundary(proj::Project)\n\nGet the array of outer boundary curves.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryCurveWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getOuterBoundaryCurveWithName","text":"getOuterBoundaryCurveWithName(proj::Project, name::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPlotFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPlotFileFormat","text":"getPlotFileFormat(proj::Project)\n\nReturns the plot file format.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPolynomialOrder-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPolynomialOrder","text":"getPolynomialOrder(proj::Project)\n\nReturns the polynomial order for boundary curves in the mesh file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementEnd-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementEnd","text":"getRefinementEnd(r::Dict{String,Any})\n\nReturn Array{Float64} of the end location of the refinement line\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementGridSize-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementGridSize","text":"getRefinementGridSize(r::Dict{String,Any})\n\nReturns the grid size,h, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementLocation-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementLocation","text":"getRefinementLocation(r::Dict{String,Any})\n\nReturn Array{Float64} of the location of the refinement center.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementName","text":"getRefinementName(r::Dict{String,Any})\n\nReturn name of the refinement. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"getRefinementRegion(proj::Project, indx)\n\nGet the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"(i,r) = getRefinementRegion(project, name)\n\nGet the refinement region with the given name and its location in the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementStart-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementStart","text":"getRefinementStart (r::Dict{String,Any})\n\nReturn Array{Float64} of the start location of the refinement line. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementType","text":"getRefinementType(r::Dict{String,Any})\n\nReturn the type of refinement, either \"smooth\" or \"sharp\". r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementWidth-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementWidth","text":"getRefinementWidth(r::Dict{String,Any})\n\nReturns the region width,w, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingIterations-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingIterations","text":"\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingStatus-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingStatus","text":"smoothingStatus(proj::Project)\n\nReturns whether the smoother will be \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingType-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingType","text":"smoothingType(proj::Project)\n\nReturns either \"LinearSpring\" or \"LinearAndCrossbarSpring\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplineNKnots-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplineNKnots","text":"getSplineNKnots(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplinePoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplinePoints","text":"getSplinePoints(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getStartPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getStartPoint","text":"getStartPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the start point for a line curve as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getXEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getXEqn","text":"getXEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getYEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getYEqn","text":"getYEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getZEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getZEqn","text":"getZEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getfolder-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getfolder","text":"path(proj::Project)\n\nReturns the directory where the project files will be written\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.hasBackgroundGrid-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.hasBackgroundGrid","text":"hasBackgroundGrid(proj::Project)\n\nTests to see if the project has a backgroundGrid dictionary defined.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.innerBoundaryIndices-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.innerBoundaryIndices","text":"innerBoundaryIndices(proj::Project, curveName::String)\n\nReturns (curveIndex,chainIndex) for the location of the curve named curveName in it's inner boundary chain.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertOuterBoundaryCurveAtIndex!","text":"insertOuterBoundaryCurveAtIndex(proj::Project, crv::Dict{String,Any}, indx::Int)\n\nInsert a curve at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertRefinementRegion!","text":"insertRefinementRegion!(proj::Project, r::Dict{String,Any}, indx::Int)\n\nUsed by undo()\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, \n center::Array{Float64}, \n radius::Float64,\n startAngle::Float64, \n endAngle::Float64,\n units::String)\n\nCreate a new circular arc.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-2","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, \n xEqn::String, \n yEqn::String, \n zEqn::String = \"z(t) = 0.0\" )\n\nCreate a new parametric equation curve.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-Tuple{String, Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})\n\nCreate a new line defined by its end points.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, nKnots::Int, data::Matrix{Float64})\n\nCreate a spline curve from an array of knots\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, String}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, dataFile::String)\n\nCreate a spline curve from the contents of a data file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newCircularArcCurve","page":"Reference","title":"HOHQMesh.newCircularArcCurve","text":"newCircularArcCurve(name::String, center::Array{Float64}, \n startAngle::Float64, endAngle::Float64,\n units::String)\n\nCreates and returns a new circular arc curve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newEndPointsLineCurve-Tuple{String, Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.newEndPointsLineCurve","text":"newEndPointsLineCurve(name::String, xStart::Array{Float64},xEnd::Array[Float64])\n\nCreates and returns a new curve defined by its end points in the form of a Dictionary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newParametricEquationCurve","page":"Reference","title":"HOHQMesh.newParametricEquationCurve","text":"newParametricEquationCurve(name::String, \n xEqn::String, \n yEqn::String, \n zEqn::String = \"z(t) = 0.0\" )\n\nCreates and returns a new parametricEquationCurve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newProject","text":"newProject(name::String, folder::String)\n\nCreate a new project with the given name. That name will be used for the mesh and plot files in the specified folder.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementCenter-Tuple{String, String, Array{Float64, N} where N, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementCenter","text":"newRefinementCenter(type, center, meshSize, width )\n\nCreate refinement center of type \"smooth\" or \"sharp\" centered at center = [x,y,z]with a mesh sizemeshSizespread over a radiuswidth`.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementLine-Tuple{String, String, Array{Float64, N} where N, Array{Float64, N} where N, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementLine","text":"newRefinementLine(type, \n start, end,\n meshSize,\n width )\n\nCreate refinement line of type \"smooth\" or \"sharp\" between start = [x,y,z] and end = [x,y,z] with a mesh size meshSize spread over a width width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, nKnots::Int, data::Array{Float64,4})\n\nReturns a spline curve given the number of knots and the array of knots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, dataFile::String)\n\nReturns a spline curve given a data file that contains the number of knots on the first line, and the spline data following that.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.openProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.openProject","text":"openProject(fileName::String, folder::String)\n\nOpen existing project described in the control File.\n\nfolder = folder the control file is in\nfileNmae = the name of the file\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.plotProject!","page":"Reference","title":"HOHQMesh.plotProject!","text":"plotProject!(proj::Project, plotOptions::Int = 0)\n\nPlot objects specified by the plotOptions. Construct the plotOptions by the sum of what is to be drawn from the choices MODEL, GRID, MESH, REFINEMENTS. \n\nExample: To plot the model and the grid, plotOptions = MODEL + GRID. To plot just the mesh, plotOptions = MESH. \n\nTo plot everything, plotOptions = MODEL + GRID + MESH + REFINEMENTS\n\nContents are overlayed in the order: GRID, MESH, MODEL, REFINEMENTS\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.postNotificationWithName-Tuple{Any, String, Tuple}","page":"Reference","title":"HOHQMesh.postNotificationWithName","text":"postNotificationWithName(sender::Any, name::String, userInfo::Tuple)\n\nExecutes the function associated with the observer for the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.refinementRegionCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.refinementRegionCenter","text":"refinementRegionCenter(r::Dict{String,Any})\n\nGet, or compute, the center of the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.refinementRegionPoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.refinementRegionPoints","text":"refinementRegionPoints(r::Dict{String,Any})\n\nReturns Array{Float64,2} being the plotting points of a refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String, innerBoundaryName::String)\n\nDelete the curve named curveName from the inner boundary named innerBoundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String)\n\nDelete the curve named curveName from the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeBackgroundGrid!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeBackgroundGrid!","text":"removeBackgroundGrid!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundary!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundary!","text":"removeInnerBoundary!(proj::Project, chainName::String)\n\nRemove an entire inner boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurve!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurve!","text":"removeInnerBoundaryCurve!(proj::Project, name::String)\n\nRemove the named curve in the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveWithName!","text":"removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n\nRemove the named curve in the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterboundary!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeOuterboundary!","text":"removeOuterboundary!(proj::Project)\n\nRemove the outer boundary curve if it exists.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRefinementRegion!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeRefinementRegion!","text":"removeRefinementRegion!(proj::Project, name::String)\n\nDelete the named refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRunParameters!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeRunParameters!","text":"removeRunParameters!(proj::Project)\n\nRemove the run parameters block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeSpringSmoother!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeSpringSmoother!","text":"removeSpringSmoother!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.saveProject-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.saveProject","text":"saveProject(proj::Project)\n\nproj = Project to be saved\n\nSave a project dictionary to the file path specified when the project was created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcCenter!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setArcCenter!","text":"setArcCenter!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the center of a circular arc.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcEndAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcEndAngle!","text":"setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcRadius!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcRadius!","text":"setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcStartAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcStartAngle!","text":"setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcUnits!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setArcUnits!","text":"setArcUnits(crv::Dict{String,Any}, units::String)\n\nSet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridLowerLeft!-Tuple{HOHQMesh.Project, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setBackgroundGridLowerLeft!","text":"setBackgroundGridLowerLeft!(proj::Project, x0::Array{Float64})\n\nSet the lower left location of the background grid for problems that have no outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSpacing!(proj::Project, dx::Float64, dy::Float64, dz::Float64 = 0.0)\n\nUser facing function\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Array{Float64},key::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Float64, Float64, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Float64, dy::Float64,key::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSteps!-Tuple{HOHQMesh.Project, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.setBackgroundGridSteps!","text":"setBackgroundGridSteps!(proj::Project, N::Array{Int})\n\nSet how many steps of size setBackgroundGridSpacing in each direction the background grid extends from the lower left.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setCurveName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setCurveName!","text":"setCurveName!(curveDict, name)\n\nSet the name of the curve represented by curveDict.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setEndPoint!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setEndPoint!","text":"setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the end point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setFolder-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setFolder","text":"setFolder(proj::Project,folder::String)\n\nSet the path to the directory where the mesh, plot, control, and stats files will be written \n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setMeshFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setMeshFileFormat!","text":"setMeshFileFormat(proj::Project, meshFileFormat::String)\n\nSet the file format for the mesh file. Acceptable choices are \"ISM\" and \"ISM-V2\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setName!","text":"setName(proj::Project,name::String)\n\nThe name of the project is the filename to be used by the mesh, plot, and stats files. It is also the name of the control file the tool will produce.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPlotFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setPlotFileFormat!","text":"setPlotFileFormat(proj::Project, plotFileFormat::String)\n\nSet the file format for the plot file. Acceptable choices are \"sem\", which includes interior nodes and boundary nodes and \"skeleton\", which includes only the corner nodes.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPolynomialOrder!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setPolynomialOrder!","text":"setPolynomialOrder(proj::Project, p::Int)\n\nSet the polynomial order for boundary curves in the mesh file to p.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementEnd!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementEnd!","text":"setRefinementEnd(refinementRegion, location)\n\nSet the end point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementGridSize!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementGridSize!","text":"setRefinementGridSize(r::Dict{String,Any}, h)\n\nSet the grid size, h for the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementLocation!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementLocation!","text":"setRefinementLocation!(refinementCenter, location)\n\nSet the location of a refinement center to location = [x,y,z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementName!","text":"setRefinementName!(r::Dict{String,Any}, type)\n\nSet a name for the refinement region.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementStart!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementStart!","text":"setRefinementStart!(refinementRegion, location)\n\nSet the start point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementType!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementType!","text":"setRefinementType!(refinementRegion, type)\n\nSet the type, either \"smooth\" or \"sharp\" for the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementWidth!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementWidth!","text":"setRefinementWidth!(r::Dict{String,Any}, width)\n\nSet the width of the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingIterations!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setSmoothingIterations!","text":"setSmoothingIterations!((proj::Project, iterations::Int)\n\nSet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingStatus!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingStatus!","text":"setSmoothingStatus(proj:Project, status::String)\n\nstatus is either \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingType!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingType!","text":"setSmoothingType!(proj:Project, status::String)\n\ntype is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplineNKnots!-Tuple{Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.setSplineNKnots!","text":"setSplineNKnots!(spline::Dict{String,Any}, nKnots::Int)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplinePoints!-Tuple{Dict{String, Any}, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.setSplinePoints!","text":"setSplinePoints!(spline::Dict{String,Any},points::Array{Float64,4})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setStartPoint!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setStartPoint!","text":"setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the start point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setXEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setXEqn!","text":"setXEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the x-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setYEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setYEqn!","text":"setYEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the y-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setZEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setZEqn!","text":"setZEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the zEqn-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.unRegisterForNotification-Tuple{Any, String}","page":"Reference","title":"HOHQMesh.unRegisterForNotification","text":"unRegisterForNotification(observer::Any, note::String)\n\nRemove the observer from being notified by the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.updatePlot!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.updatePlot!","text":"updatePlot!(proj::Project, plotOptions::Int)\n\nReplot with the new plotOptions = combinations (sums) of \n\nGRID, MESH, MODEL, REFINEMENTS\n\nExample: updatePlot(p, MESH + MODEL)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.updatePlot!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.updatePlot!","text":"updatePlot!(proj::Project)\n\nThis version replots the figure with the current options. Legacy.\n\n\n\n\n\n","category":"method"},{"location":"#HOHQMesh.jl","page":"Home","title":"HOHQMesh.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"This package is a thin Julia wrapper around the High Order Hex-Quad Mesher (a.k.a. HOHQMesh) created and developed by David A. Kopriva. HOHQMesh.jl is available on Linux, MacOS, and Windows.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6.","category":"page"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> import Pkg; Pkg.add(\"HOHQMesh\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the Julia REPL, you can load HOHQMesh with","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using HOHQMesh","category":"page"},{"location":"","page":"Home","title":"Home","text":"and then happily generate away!","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> control_file = joinpath(HOHQMesh.examples_dir(), \"GingerbreadMan.control\")\n\njulia> output = generate_mesh(control_file)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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,","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: gingerbreadman_with_edges_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"while the 3D file Snake.control produces this mesh:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: snake_400px)","category":"page"},{"location":"#Authors","page":"Home","title":"Authors","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl was initiated by Michael Schlottke-Lakemper (University of Cologne, Germany), who is also the principal developer of HOHQMesh.jl. The HOHQMesh mesh generator itself is developed by David A. Kopriva.","category":"page"},{"location":"#License-and-contributing","page":"Home","title":"License and contributing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is licensed under the MIT license (see License). HOHQMesh itself is also available under the MIT license.","category":"page"},{"location":"#Acknowledgements","page":"Home","title":"Acknowledgements","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"}]
+}
diff --git a/previews/PR11/siteinfo.js b/previews/PR11/siteinfo.js
new file mode 100644
index 00000000..06c127a0
--- /dev/null
+++ b/previews/PR11/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "previews/PR11";
diff --git a/stable b/stable
new file mode 120000
index 00000000..3788c772
--- /dev/null
+++ b/stable
@@ -0,0 +1 @@
+v0.2.6
\ No newline at end of file
diff --git a/v0.1 b/v0.1
new file mode 120000
index 00000000..a1c2c6a9
--- /dev/null
+++ b/v0.1
@@ -0,0 +1 @@
+v0.1.1
\ No newline at end of file
diff --git a/v0.1.0/assets/documenter.js b/v0.1.0/assets/documenter.js
new file mode 100644
index 00000000..6d0b7853
--- /dev/null
+++ b/v0.1.0/assets/documenter.js
@@ -0,0 +1,264 @@
+// Generated by Documenter.jl
+requirejs.config({
+ paths: {
+ 'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/languages/julia.min',
+ 'headroom': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/headroom.min',
+ 'jqueryui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min',
+ 'katex-auto-render': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/contrib/auto-render.min',
+ 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min',
+ 'headroom-jquery': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/jQuery.headroom.min',
+ 'katex': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/katex.min',
+ 'highlight': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/highlight.min',
+ 'highlight-julia-repl': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/languages/julia-repl.min',
+ },
+ shim: {
+ "highlight-julia": {
+ "deps": [
+ "highlight"
+ ]
+ },
+ "katex-auto-render": {
+ "deps": [
+ "katex"
+ ]
+ },
+ "headroom-jquery": {
+ "deps": [
+ "jquery",
+ "headroom"
+ ]
+ },
+ "highlight-julia-repl": {
+ "deps": [
+ "highlight"
+ ]
+ }
+}
+});
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'katex', 'katex-auto-render'], function($, katex, renderMathInElement) {
+$(document).ready(function() {
+ renderMathInElement(
+ document.body,
+ {
+ "delimiters": [
+ {
+ "left": "$",
+ "right": "$",
+ "display": false
+ },
+ {
+ "left": "$$",
+ "right": "$$",
+ "display": true
+ },
+ {
+ "left": "\\[",
+ "right": "\\]",
+ "display": true
+ }
+ ]
+}
+
+ );
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'highlight', 'highlight-julia', 'highlight-julia-repl'], function($) {
+$(document).ready(function() {
+ hljs.highlightAll();
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'headroom', 'headroom-jquery'], function($, Headroom) {
+
+// Manages the top navigation bar (hides it when the user starts scrolling down on the
+// mobile).
+window.Headroom = Headroom; // work around buggy module loading?
+$(document).ready(function() {
+ $('#documenter .docs-navbar').headroom({
+ "tolerance": {"up": 10, "down": 10},
+ });
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+// Modal settings dialog
+$(document).ready(function() {
+ var settings = $('#documenter-settings');
+ $('#documenter-settings-button').click(function(){
+ settings.toggleClass('is-active');
+ });
+ // Close the dialog if X is clicked
+ $('#documenter-settings button.delete').click(function(){
+ settings.removeClass('is-active');
+ });
+ // Close dialog if ESC is pressed
+ $(document).keyup(function(e) {
+ if (e.keyCode == 27) settings.removeClass('is-active');
+ });
+});
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+// Manages the showing and hiding of the sidebar.
+$(document).ready(function() {
+ var sidebar = $("#documenter > .docs-sidebar");
+ var sidebar_button = $("#documenter-sidebar-button")
+ sidebar_button.click(function(ev) {
+ ev.preventDefault();
+ sidebar.toggleClass('visible');
+ if (sidebar.hasClass('visible')) {
+ // Makes sure that the current menu item is visible in the sidebar.
+ $("#documenter .docs-menu a.is-active").focus();
+ }
+ });
+ $("#documenter > .docs-main").bind('click', function(ev) {
+ if ($(ev.target).is(sidebar_button)) {
+ return;
+ }
+ if (sidebar.hasClass('visible')) {
+ sidebar.removeClass('visible');
+ }
+ });
+})
+
+// Resizes the package name / sitename in the sidebar if it is too wide.
+// Inspired by: https://github.com/davatron5000/FitText.js
+$(document).ready(function() {
+ e = $("#documenter .docs-autofit");
+ function resize() {
+ var L = parseInt(e.css('max-width'), 10);
+ var L0 = e.width();
+ if(L0 > L) {
+ var h0 = parseInt(e.css('font-size'), 10);
+ e.css('font-size', L * h0 / L0);
+ // TODO: make sure it survives resizes?
+ }
+ }
+ // call once and then register events
+ resize();
+ $(window).resize(resize);
+ $(window).on('orientationchange', resize);
+});
+
+// Scroll the navigation bar to the currently selected menu item
+$(document).ready(function() {
+ var sidebar = $("#documenter .docs-menu").get(0);
+ var active = $("#documenter .docs-menu .is-active").get(0);
+ if(typeof active !== 'undefined') {
+ sidebar.scrollTop = active.offsetTop - sidebar.offsetTop - 15;
+ }
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+function set_theme(theme) {
+ var active = null;
+ var disabled = [];
+ for (var i = 0; i < document.styleSheets.length; i++) {
+ var ss = document.styleSheets[i];
+ var themename = ss.ownerNode.getAttribute("data-theme-name");
+ if(themename === null) continue; // ignore non-theme stylesheets
+ // Find the active theme
+ if(themename === theme) active = ss;
+ else disabled.push(ss);
+ }
+ if(active !== null) {
+ active.disabled = false;
+ if(active.ownerNode.getAttribute("data-theme-primary") === null) {
+ document.getElementsByTagName('html')[0].className = "theme--" + theme;
+ } else {
+ document.getElementsByTagName('html')[0].className = "";
+ }
+ disabled.forEach(function(ss){
+ ss.disabled = true;
+ });
+ }
+
+ // Store the theme in localStorage
+ if(typeof(window.localStorage) !== "undefined") {
+ window.localStorage.setItem("documenter-theme", theme);
+ } else {
+ console.error("Browser does not support window.localStorage");
+ }
+}
+
+// Theme picker setup
+$(document).ready(function() {
+ // onchange callback
+ $('#documenter-themepicker').change(function themepick_callback(ev){
+ var themename = $('#documenter-themepicker option:selected').attr('value');
+ set_theme(themename);
+ });
+
+ // Make sure that the themepicker displays the correct theme when the theme is retrieved
+ // from localStorage
+ if(typeof(window.localStorage) !== "undefined") {
+ var theme = window.localStorage.getItem("documenter-theme");
+ if(theme !== null) {
+ $('#documenter-themepicker option').each(function(i,e) {
+ e.selected = (e.value === theme);
+ })
+ } else {
+ $('#documenter-themepicker option').each(function(i,e) {
+ e.selected = $("html").hasClass(`theme--${e.value}`);
+ })
+ }
+ }
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+// update the version selector with info from the siteinfo.js and ../versions.js files
+$(document).ready(function() {
+ var version_selector = $("#documenter .docs-version-selector");
+ var version_selector_select = $("#documenter .docs-version-selector select");
+
+ version_selector_select.change(function(x) {
+ target_href = version_selector_select.children("option:selected").get(0).value;
+ window.location.href = target_href;
+ });
+
+ // add the current version to the selector based on siteinfo.js, but only if the selector is empty
+ if (typeof DOCUMENTER_CURRENT_VERSION !== 'undefined' && $('#version-selector > option').length == 0) {
+ var option = $("");
+ version_selector_select.append(option);
+ }
+
+ if (typeof DOC_VERSIONS !== 'undefined') {
+ var existing_versions = version_selector_select.children("option");
+ var existing_versions_texts = existing_versions.map(function(i,x){return x.text});
+ DOC_VERSIONS.forEach(function(each) {
+ var version_url = documenterBaseURL + "/../" + each;
+ var existing_id = $.inArray(each, existing_versions_texts);
+ // if not already in the version selector, add it as a new option,
+ // otherwise update the old option with the URL and enable it
+ if (existing_id == -1) {
+ var option = $("");
+ version_selector_select.append(option);
+ } else {
+ var option = existing_versions[existing_id];
+ option.value = version_url;
+ option.disabled = false;
+ }
+ });
+ }
+
+ // only show the version selector if the selector has been populated
+ if (version_selector_select.children("option").length > 0) {
+ version_selector.toggleClass("visible");
+ }
+})
+
+})
diff --git a/v0.1.0/assets/search.js b/v0.1.0/assets/search.js
new file mode 100644
index 00000000..1a514547
--- /dev/null
+++ b/v0.1.0/assets/search.js
@@ -0,0 +1,251 @@
+// Generated by Documenter.jl
+requirejs.config({
+ paths: {
+ 'lunr': 'https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.9/lunr.min',
+ 'lodash': 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min',
+ 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min',
+ }
+});
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'lunr', 'lodash'], function($, lunr, _) {
+
+$(document).ready(function() {
+ // parseUri 1.2.2
+ // (c) Steven Levithan
+ // MIT License
+ function parseUri (str) {
+ var o = parseUri.options,
+ m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
+ uri = {},
+ i = 14;
+
+ while (i--) uri[o.key[i]] = m[i] || "";
+
+ uri[o.q.name] = {};
+ uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
+ if ($1) uri[o.q.name][$1] = $2;
+ });
+
+ return uri;
+ };
+ parseUri.options = {
+ strictMode: false,
+ key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
+ q: {
+ name: "queryKey",
+ parser: /(?:^|&)([^&=]*)=?([^&]*)/g
+ },
+ parser: {
+ strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
+ loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
+ }
+ };
+
+ $("#search-form").submit(function(e) {
+ e.preventDefault()
+ })
+
+ // list below is the lunr 2.1.3 list minus the intersect with names(Base)
+ // (all, any, get, in, is, only, which) and (do, else, for, let, where, while, with)
+ // ideally we'd just filter the original list but it's not available as a variable
+ lunr.stopWordFilter = lunr.generateStopWordFilter([
+ 'a',
+ 'able',
+ 'about',
+ 'across',
+ 'after',
+ 'almost',
+ 'also',
+ 'am',
+ 'among',
+ 'an',
+ 'and',
+ 'are',
+ 'as',
+ 'at',
+ 'be',
+ 'because',
+ 'been',
+ 'but',
+ 'by',
+ 'can',
+ 'cannot',
+ 'could',
+ 'dear',
+ 'did',
+ 'does',
+ 'either',
+ 'ever',
+ 'every',
+ 'from',
+ 'got',
+ 'had',
+ 'has',
+ 'have',
+ 'he',
+ 'her',
+ 'hers',
+ 'him',
+ 'his',
+ 'how',
+ 'however',
+ 'i',
+ 'if',
+ 'into',
+ 'it',
+ 'its',
+ 'just',
+ 'least',
+ 'like',
+ 'likely',
+ 'may',
+ 'me',
+ 'might',
+ 'most',
+ 'must',
+ 'my',
+ 'neither',
+ 'no',
+ 'nor',
+ 'not',
+ 'of',
+ 'off',
+ 'often',
+ 'on',
+ 'or',
+ 'other',
+ 'our',
+ 'own',
+ 'rather',
+ 'said',
+ 'say',
+ 'says',
+ 'she',
+ 'should',
+ 'since',
+ 'so',
+ 'some',
+ 'than',
+ 'that',
+ 'the',
+ 'their',
+ 'them',
+ 'then',
+ 'there',
+ 'these',
+ 'they',
+ 'this',
+ 'tis',
+ 'to',
+ 'too',
+ 'twas',
+ 'us',
+ 'wants',
+ 'was',
+ 'we',
+ 'were',
+ 'what',
+ 'when',
+ 'who',
+ 'whom',
+ 'why',
+ 'will',
+ 'would',
+ 'yet',
+ 'you',
+ 'your'
+ ])
+
+ // add . as a separator, because otherwise "title": "Documenter.Anchors.add!"
+ // would not find anything if searching for "add!", only for the entire qualification
+ lunr.tokenizer.separator = /[\s\-\.]+/
+
+ // custom trimmer that doesn't strip @ and !, which are used in julia macro and function names
+ lunr.trimmer = function (token) {
+ return token.update(function (s) {
+ return s.replace(/^[^a-zA-Z0-9@!]+/, '').replace(/[^a-zA-Z0-9@!]+$/, '')
+ })
+ }
+
+ lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'juliaStopWordFilter')
+ lunr.Pipeline.registerFunction(lunr.trimmer, 'juliaTrimmer')
+
+ var index = lunr(function () {
+ this.ref('location')
+ this.field('title',{boost: 100})
+ this.field('text')
+ documenterSearchIndex['docs'].forEach(function(e) {
+ this.add(e)
+ }, this)
+ })
+ var store = {}
+
+ documenterSearchIndex['docs'].forEach(function(e) {
+ store[e.location] = {title: e.title, category: e.category, page: e.page}
+ })
+
+ $(function(){
+ searchresults = $('#documenter-search-results');
+ searchinfo = $('#documenter-search-info');
+ searchbox = $('#documenter-search-query');
+ function update_search(querystring) {
+ tokens = lunr.tokenizer(querystring)
+ results = index.query(function (q) {
+ tokens.forEach(function (t) {
+ q.term(t.toString(), {
+ fields: ["title"],
+ boost: 100,
+ usePipeline: true,
+ editDistance: 0,
+ wildcard: lunr.Query.wildcard.NONE
+ })
+ q.term(t.toString(), {
+ fields: ["title"],
+ boost: 10,
+ usePipeline: true,
+ editDistance: 2,
+ wildcard: lunr.Query.wildcard.NONE
+ })
+ q.term(t.toString(), {
+ fields: ["text"],
+ boost: 1,
+ usePipeline: true,
+ editDistance: 0,
+ wildcard: lunr.Query.wildcard.NONE
+ })
+ })
+ })
+ searchinfo.text("Number of results: " + results.length)
+ searchresults.empty()
+ results.forEach(function(result) {
+ data = store[result.ref]
+ link = $(''+data.title+'')
+ link.attr('href', documenterBaseURL+'/'+result.ref)
+ if (data.category != "page"){
+ cat = $('('+data.category+', '+data.page+')')
+ } else {
+ cat = $('('+data.category+')')
+ }
+ li = $('
This package is a thin Julia wrapper around the High Order Hex-Quad Mesher (a.k.a. HOHQMesh) created and developed by David A. Kopriva. HOHQMesh.jl is available on Linux, MacOS, and Windows.
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.
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
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:
HOHQMesh.jl was initiated by Michael Schlottke-Lakemper (University of Cologne, Germany), who is also the principal developer of HOHQMesh.jl. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
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.
Settings
This document was generated with Documenter.jl on Saturday 19 June 2021. Using Julia version 1.6.1.
Copyright (c) 2021-present Michael Schlottke-Lakemper
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Settings
This document was generated with Documenter.jl on Saturday 19 June 2021. Using Julia version 1.6.1.
Generate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.
You can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.
You can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
This document was generated with Documenter.jl on Saturday 19 June 2021. Using Julia version 1.6.1.
diff --git a/v0.1.0/search_index.js b/v0.1.0/search_index.js
new file mode 100644
index 00000000..82deb2c0
--- /dev/null
+++ b/v0.1.0/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"license/#License","page":"License","title":"License","text":"","category":"section"},{"location":"license/","page":"License","title":"License","text":"MIT LicenseCopyright (c) 2021-present Michael Schlottke-LakemperPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"reference/#HOHQMesh.jl-API","page":"Reference","title":"HOHQMesh.jl API","text":"","category":"section"},{"location":"reference/","page":"Reference","title":"Reference","text":"CurrentModule = HOHQMesh","category":"page"},{"location":"reference/","page":"Reference","title":"Reference","text":"Modules = [HOHQMesh]","category":"page"},{"location":"reference/#HOHQMesh.examples_dir-Tuple{}","page":"Reference","title":"HOHQMesh.examples_dir","text":"examples_dir()\n\nReturn the path to the directory with some example mesh setups.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{Any}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(control_file;\n output_directory=\"out\",\n mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing)\n\nGenerate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.\n\nYou can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.\n\nYou can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"#HOHQMesh.jl","page":"Home","title":"HOHQMesh.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"This package is a thin Julia wrapper around the High Order Hex-Quad Mesher (a.k.a. HOHQMesh) created and developed by David A. Kopriva. HOHQMesh.jl is available on Linux, MacOS, and Windows.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6.","category":"page"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> import Pkg; Pkg.add(\"HOHQMesh\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the Julia REPL, you can load HOHQMesh with","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using HOHQMesh","category":"page"},{"location":"","page":"Home","title":"Home","text":"and then happily generate away!","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> control_file = joinpath(HOHQMesh.examples_dir(), \"GingerbreadMan.control\")\n\njulia> output = generate_mesh(control_file)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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,","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: gingerbreadman_with_edges_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"while the 3D file Snake.control produces this mesh:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: snake_400px)","category":"page"},{"location":"#Authors","page":"Home","title":"Authors","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl was initiated by Michael Schlottke-Lakemper (University of Cologne, Germany), who is also the principal developer of HOHQMesh.jl. The HOHQMesh mesh generator itself is developed by David A. Kopriva.","category":"page"},{"location":"#License-and-contributing","page":"Home","title":"License and contributing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is licensed under the MIT license (see License). HOHQMesh itself is also available under the MIT license.","category":"page"},{"location":"#Acknowledgements","page":"Home","title":"Acknowledgements","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"}]
+}
diff --git a/v0.1.0/siteinfo.js b/v0.1.0/siteinfo.js
new file mode 100644
index 00000000..a7a85ce6
--- /dev/null
+++ b/v0.1.0/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.1.0";
diff --git a/v0.1.1/assets/documenter.js b/v0.1.1/assets/documenter.js
new file mode 100644
index 00000000..6d0b7853
--- /dev/null
+++ b/v0.1.1/assets/documenter.js
@@ -0,0 +1,264 @@
+// Generated by Documenter.jl
+requirejs.config({
+ paths: {
+ 'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/languages/julia.min',
+ 'headroom': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/headroom.min',
+ 'jqueryui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min',
+ 'katex-auto-render': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/contrib/auto-render.min',
+ 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min',
+ 'headroom-jquery': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/jQuery.headroom.min',
+ 'katex': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/katex.min',
+ 'highlight': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/highlight.min',
+ 'highlight-julia-repl': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/languages/julia-repl.min',
+ },
+ shim: {
+ "highlight-julia": {
+ "deps": [
+ "highlight"
+ ]
+ },
+ "katex-auto-render": {
+ "deps": [
+ "katex"
+ ]
+ },
+ "headroom-jquery": {
+ "deps": [
+ "jquery",
+ "headroom"
+ ]
+ },
+ "highlight-julia-repl": {
+ "deps": [
+ "highlight"
+ ]
+ }
+}
+});
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'katex', 'katex-auto-render'], function($, katex, renderMathInElement) {
+$(document).ready(function() {
+ renderMathInElement(
+ document.body,
+ {
+ "delimiters": [
+ {
+ "left": "$",
+ "right": "$",
+ "display": false
+ },
+ {
+ "left": "$$",
+ "right": "$$",
+ "display": true
+ },
+ {
+ "left": "\\[",
+ "right": "\\]",
+ "display": true
+ }
+ ]
+}
+
+ );
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'highlight', 'highlight-julia', 'highlight-julia-repl'], function($) {
+$(document).ready(function() {
+ hljs.highlightAll();
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'headroom', 'headroom-jquery'], function($, Headroom) {
+
+// Manages the top navigation bar (hides it when the user starts scrolling down on the
+// mobile).
+window.Headroom = Headroom; // work around buggy module loading?
+$(document).ready(function() {
+ $('#documenter .docs-navbar').headroom({
+ "tolerance": {"up": 10, "down": 10},
+ });
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+// Modal settings dialog
+$(document).ready(function() {
+ var settings = $('#documenter-settings');
+ $('#documenter-settings-button').click(function(){
+ settings.toggleClass('is-active');
+ });
+ // Close the dialog if X is clicked
+ $('#documenter-settings button.delete').click(function(){
+ settings.removeClass('is-active');
+ });
+ // Close dialog if ESC is pressed
+ $(document).keyup(function(e) {
+ if (e.keyCode == 27) settings.removeClass('is-active');
+ });
+});
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+// Manages the showing and hiding of the sidebar.
+$(document).ready(function() {
+ var sidebar = $("#documenter > .docs-sidebar");
+ var sidebar_button = $("#documenter-sidebar-button")
+ sidebar_button.click(function(ev) {
+ ev.preventDefault();
+ sidebar.toggleClass('visible');
+ if (sidebar.hasClass('visible')) {
+ // Makes sure that the current menu item is visible in the sidebar.
+ $("#documenter .docs-menu a.is-active").focus();
+ }
+ });
+ $("#documenter > .docs-main").bind('click', function(ev) {
+ if ($(ev.target).is(sidebar_button)) {
+ return;
+ }
+ if (sidebar.hasClass('visible')) {
+ sidebar.removeClass('visible');
+ }
+ });
+})
+
+// Resizes the package name / sitename in the sidebar if it is too wide.
+// Inspired by: https://github.com/davatron5000/FitText.js
+$(document).ready(function() {
+ e = $("#documenter .docs-autofit");
+ function resize() {
+ var L = parseInt(e.css('max-width'), 10);
+ var L0 = e.width();
+ if(L0 > L) {
+ var h0 = parseInt(e.css('font-size'), 10);
+ e.css('font-size', L * h0 / L0);
+ // TODO: make sure it survives resizes?
+ }
+ }
+ // call once and then register events
+ resize();
+ $(window).resize(resize);
+ $(window).on('orientationchange', resize);
+});
+
+// Scroll the navigation bar to the currently selected menu item
+$(document).ready(function() {
+ var sidebar = $("#documenter .docs-menu").get(0);
+ var active = $("#documenter .docs-menu .is-active").get(0);
+ if(typeof active !== 'undefined') {
+ sidebar.scrollTop = active.offsetTop - sidebar.offsetTop - 15;
+ }
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+function set_theme(theme) {
+ var active = null;
+ var disabled = [];
+ for (var i = 0; i < document.styleSheets.length; i++) {
+ var ss = document.styleSheets[i];
+ var themename = ss.ownerNode.getAttribute("data-theme-name");
+ if(themename === null) continue; // ignore non-theme stylesheets
+ // Find the active theme
+ if(themename === theme) active = ss;
+ else disabled.push(ss);
+ }
+ if(active !== null) {
+ active.disabled = false;
+ if(active.ownerNode.getAttribute("data-theme-primary") === null) {
+ document.getElementsByTagName('html')[0].className = "theme--" + theme;
+ } else {
+ document.getElementsByTagName('html')[0].className = "";
+ }
+ disabled.forEach(function(ss){
+ ss.disabled = true;
+ });
+ }
+
+ // Store the theme in localStorage
+ if(typeof(window.localStorage) !== "undefined") {
+ window.localStorage.setItem("documenter-theme", theme);
+ } else {
+ console.error("Browser does not support window.localStorage");
+ }
+}
+
+// Theme picker setup
+$(document).ready(function() {
+ // onchange callback
+ $('#documenter-themepicker').change(function themepick_callback(ev){
+ var themename = $('#documenter-themepicker option:selected').attr('value');
+ set_theme(themename);
+ });
+
+ // Make sure that the themepicker displays the correct theme when the theme is retrieved
+ // from localStorage
+ if(typeof(window.localStorage) !== "undefined") {
+ var theme = window.localStorage.getItem("documenter-theme");
+ if(theme !== null) {
+ $('#documenter-themepicker option').each(function(i,e) {
+ e.selected = (e.value === theme);
+ })
+ } else {
+ $('#documenter-themepicker option').each(function(i,e) {
+ e.selected = $("html").hasClass(`theme--${e.value}`);
+ })
+ }
+ }
+})
+
+})
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery'], function($) {
+
+// update the version selector with info from the siteinfo.js and ../versions.js files
+$(document).ready(function() {
+ var version_selector = $("#documenter .docs-version-selector");
+ var version_selector_select = $("#documenter .docs-version-selector select");
+
+ version_selector_select.change(function(x) {
+ target_href = version_selector_select.children("option:selected").get(0).value;
+ window.location.href = target_href;
+ });
+
+ // add the current version to the selector based on siteinfo.js, but only if the selector is empty
+ if (typeof DOCUMENTER_CURRENT_VERSION !== 'undefined' && $('#version-selector > option').length == 0) {
+ var option = $("");
+ version_selector_select.append(option);
+ }
+
+ if (typeof DOC_VERSIONS !== 'undefined') {
+ var existing_versions = version_selector_select.children("option");
+ var existing_versions_texts = existing_versions.map(function(i,x){return x.text});
+ DOC_VERSIONS.forEach(function(each) {
+ var version_url = documenterBaseURL + "/../" + each;
+ var existing_id = $.inArray(each, existing_versions_texts);
+ // if not already in the version selector, add it as a new option,
+ // otherwise update the old option with the URL and enable it
+ if (existing_id == -1) {
+ var option = $("");
+ version_selector_select.append(option);
+ } else {
+ var option = existing_versions[existing_id];
+ option.value = version_url;
+ option.disabled = false;
+ }
+ });
+ }
+
+ // only show the version selector if the selector has been populated
+ if (version_selector_select.children("option").length > 0) {
+ version_selector.toggleClass("visible");
+ }
+})
+
+})
diff --git a/v0.1.1/assets/search.js b/v0.1.1/assets/search.js
new file mode 100644
index 00000000..1a514547
--- /dev/null
+++ b/v0.1.1/assets/search.js
@@ -0,0 +1,251 @@
+// Generated by Documenter.jl
+requirejs.config({
+ paths: {
+ 'lunr': 'https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.9/lunr.min',
+ 'lodash': 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min',
+ 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min',
+ }
+});
+////////////////////////////////////////////////////////////////////////////////
+require(['jquery', 'lunr', 'lodash'], function($, lunr, _) {
+
+$(document).ready(function() {
+ // parseUri 1.2.2
+ // (c) Steven Levithan
+ // MIT License
+ function parseUri (str) {
+ var o = parseUri.options,
+ m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
+ uri = {},
+ i = 14;
+
+ while (i--) uri[o.key[i]] = m[i] || "";
+
+ uri[o.q.name] = {};
+ uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
+ if ($1) uri[o.q.name][$1] = $2;
+ });
+
+ return uri;
+ };
+ parseUri.options = {
+ strictMode: false,
+ key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
+ q: {
+ name: "queryKey",
+ parser: /(?:^|&)([^&=]*)=?([^&]*)/g
+ },
+ parser: {
+ strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
+ loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
+ }
+ };
+
+ $("#search-form").submit(function(e) {
+ e.preventDefault()
+ })
+
+ // list below is the lunr 2.1.3 list minus the intersect with names(Base)
+ // (all, any, get, in, is, only, which) and (do, else, for, let, where, while, with)
+ // ideally we'd just filter the original list but it's not available as a variable
+ lunr.stopWordFilter = lunr.generateStopWordFilter([
+ 'a',
+ 'able',
+ 'about',
+ 'across',
+ 'after',
+ 'almost',
+ 'also',
+ 'am',
+ 'among',
+ 'an',
+ 'and',
+ 'are',
+ 'as',
+ 'at',
+ 'be',
+ 'because',
+ 'been',
+ 'but',
+ 'by',
+ 'can',
+ 'cannot',
+ 'could',
+ 'dear',
+ 'did',
+ 'does',
+ 'either',
+ 'ever',
+ 'every',
+ 'from',
+ 'got',
+ 'had',
+ 'has',
+ 'have',
+ 'he',
+ 'her',
+ 'hers',
+ 'him',
+ 'his',
+ 'how',
+ 'however',
+ 'i',
+ 'if',
+ 'into',
+ 'it',
+ 'its',
+ 'just',
+ 'least',
+ 'like',
+ 'likely',
+ 'may',
+ 'me',
+ 'might',
+ 'most',
+ 'must',
+ 'my',
+ 'neither',
+ 'no',
+ 'nor',
+ 'not',
+ 'of',
+ 'off',
+ 'often',
+ 'on',
+ 'or',
+ 'other',
+ 'our',
+ 'own',
+ 'rather',
+ 'said',
+ 'say',
+ 'says',
+ 'she',
+ 'should',
+ 'since',
+ 'so',
+ 'some',
+ 'than',
+ 'that',
+ 'the',
+ 'their',
+ 'them',
+ 'then',
+ 'there',
+ 'these',
+ 'they',
+ 'this',
+ 'tis',
+ 'to',
+ 'too',
+ 'twas',
+ 'us',
+ 'wants',
+ 'was',
+ 'we',
+ 'were',
+ 'what',
+ 'when',
+ 'who',
+ 'whom',
+ 'why',
+ 'will',
+ 'would',
+ 'yet',
+ 'you',
+ 'your'
+ ])
+
+ // add . as a separator, because otherwise "title": "Documenter.Anchors.add!"
+ // would not find anything if searching for "add!", only for the entire qualification
+ lunr.tokenizer.separator = /[\s\-\.]+/
+
+ // custom trimmer that doesn't strip @ and !, which are used in julia macro and function names
+ lunr.trimmer = function (token) {
+ return token.update(function (s) {
+ return s.replace(/^[^a-zA-Z0-9@!]+/, '').replace(/[^a-zA-Z0-9@!]+$/, '')
+ })
+ }
+
+ lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'juliaStopWordFilter')
+ lunr.Pipeline.registerFunction(lunr.trimmer, 'juliaTrimmer')
+
+ var index = lunr(function () {
+ this.ref('location')
+ this.field('title',{boost: 100})
+ this.field('text')
+ documenterSearchIndex['docs'].forEach(function(e) {
+ this.add(e)
+ }, this)
+ })
+ var store = {}
+
+ documenterSearchIndex['docs'].forEach(function(e) {
+ store[e.location] = {title: e.title, category: e.category, page: e.page}
+ })
+
+ $(function(){
+ searchresults = $('#documenter-search-results');
+ searchinfo = $('#documenter-search-info');
+ searchbox = $('#documenter-search-query');
+ function update_search(querystring) {
+ tokens = lunr.tokenizer(querystring)
+ results = index.query(function (q) {
+ tokens.forEach(function (t) {
+ q.term(t.toString(), {
+ fields: ["title"],
+ boost: 100,
+ usePipeline: true,
+ editDistance: 0,
+ wildcard: lunr.Query.wildcard.NONE
+ })
+ q.term(t.toString(), {
+ fields: ["title"],
+ boost: 10,
+ usePipeline: true,
+ editDistance: 2,
+ wildcard: lunr.Query.wildcard.NONE
+ })
+ q.term(t.toString(), {
+ fields: ["text"],
+ boost: 1,
+ usePipeline: true,
+ editDistance: 0,
+ wildcard: lunr.Query.wildcard.NONE
+ })
+ })
+ })
+ searchinfo.text("Number of results: " + results.length)
+ searchresults.empty()
+ results.forEach(function(result) {
+ data = store[result.ref]
+ link = $(''+data.title+'')
+ link.attr('href', documenterBaseURL+'/'+result.ref)
+ if (data.category != "page"){
+ cat = $('('+data.category+', '+data.page+')')
+ } else {
+ cat = $('('+data.category+')')
+ }
+ li = $('
This package is a thin Julia wrapper around the High Order Hex-Quad Mesher (a.k.a. HOHQMesh) created and developed by David A. Kopriva. HOHQMesh.jl is available on Linux, MacOS, and Windows.
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.
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
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:
HOHQMesh.jl was initiated by Michael Schlottke-Lakemper (University of Cologne, Germany), who is also the principal developer of HOHQMesh.jl. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
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.
Settings
This document was generated with Documenter.jl version 0.27.10 on Friday 5 November 2021. Using Julia version 1.6.3.
Copyright (c) 2021-present Michael Schlottke-Lakemper
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Settings
This document was generated with Documenter.jl version 0.27.10 on Friday 5 November 2021. Using Julia version 1.6.3.
Return a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.
Generate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.
You can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.
You can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
This document was generated with Documenter.jl version 0.27.10 on Friday 5 November 2021. Using Julia version 1.6.3.
diff --git a/v0.1.1/search_index.js b/v0.1.1/search_index.js
new file mode 100644
index 00000000..4b1241b1
--- /dev/null
+++ b/v0.1.1/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"license/#License","page":"License","title":"License","text":"","category":"section"},{"location":"license/","page":"License","title":"License","text":"MIT LicenseCopyright (c) 2021-present Michael Schlottke-LakemperPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"reference/#HOHQMesh.jl-API","page":"Reference","title":"HOHQMesh.jl API","text":"","category":"section"},{"location":"reference/","page":"Reference","title":"Reference","text":"CurrentModule = HOHQMesh","category":"page"},{"location":"reference/","page":"Reference","title":"Reference","text":"Modules = [HOHQMesh]","category":"page"},{"location":"reference/#HOHQMesh.examples_dir-Tuple{}","page":"Reference","title":"HOHQMesh.examples_dir","text":"examples_dir()\n\nReturn the path to the directory with some example mesh setups.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.extract_mesh_file_format-Tuple{Any}","page":"Reference","title":"HOHQMesh.extract_mesh_file_format","text":"extract_mesh_file_format(control_file)\n\nReturn a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{Any}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(control_file;\n output_directory=\"out\",\n mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing,\n verbose=false)\n\nGenerate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.\n\nYou can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.\n\nYou can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"#HOHQMesh.jl","page":"Home","title":"HOHQMesh.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"This package is a thin Julia wrapper around the High Order Hex-Quad Mesher (a.k.a. HOHQMesh) created and developed by David A. Kopriva. HOHQMesh.jl is available on Linux, MacOS, and Windows.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6.","category":"page"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> import Pkg; Pkg.add(\"HOHQMesh\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the Julia REPL, you can load HOHQMesh with","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using HOHQMesh","category":"page"},{"location":"","page":"Home","title":"Home","text":"and then happily generate away!","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> control_file = joinpath(HOHQMesh.examples_dir(), \"GingerbreadMan.control\")\n\njulia> output = generate_mesh(control_file)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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,","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: gingerbreadman_with_edges_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"while the 3D file Snake.control produces this mesh:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: snake_400px)","category":"page"},{"location":"#Authors","page":"Home","title":"Authors","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl was initiated by Michael Schlottke-Lakemper (University of Cologne, Germany), who is also the principal developer of HOHQMesh.jl. The HOHQMesh mesh generator itself is developed by David A. Kopriva.","category":"page"},{"location":"#License-and-contributing","page":"Home","title":"License and contributing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is licensed under the MIT license (see License). HOHQMesh itself is also available under the MIT license.","category":"page"},{"location":"#Acknowledgements","page":"Home","title":"Acknowledgements","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"}]
+}
diff --git a/v0.1.1/siteinfo.js b/v0.1.1/siteinfo.js
new file mode 100644
index 00000000..20089fd7
--- /dev/null
+++ b/v0.1.1/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.1.1";
diff --git a/v0.2 b/v0.2
new file mode 120000
index 00000000..3788c772
--- /dev/null
+++ b/v0.2
@@ -0,0 +1 @@
+v0.2.6
\ No newline at end of file
diff --git a/v0.2.0/CheatSheet/index.html b/v0.2.0/CheatSheet/index.html
new file mode 100644
index 00000000..66b8a90d
--- /dev/null
+++ b/v0.2.0/CheatSheet/index.html
@@ -0,0 +1,21 @@
+
+Commands Cheat Sheet · HOHQMesh.jl
This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples folder constructs an identical example mesh as shown in the Guided tour using generic function calls.
A thorough description of the functions can be found in the API section.
The general workflow of the interactive mesh functionality within a REPL session is
c = new(name, startLocation [x,y,z],endLocation [x,y,z]) *Straight Line*
+ c = new(name,center [x,y,z],radius, startAngle, endAngle) *Circular Arc*
+ c = new(name, xEqn, yEqn, zEqn) *Parametric equation*
+ c = new(name, dataFile) *Spline with data from a file*
+ c = new(name, nKnots, knotsMatrix) *Spline with given knot values*
Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.
All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.
HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).
HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.
Developer Certificate of Origin
+Version 1.1
+
+Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+1 Letterman Drive
+Suite D4700
+San Francisco, CA, 94129
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+
+Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+(a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+(b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+(c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+(d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
Settings
This document was generated with Documenter.jl version 0.27.19 on Friday 24 June 2022. Using Julia version 1.6.6.
When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:
Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.
If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.
Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like Juno). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.
Set the new version number in Project.toml according to the Julian version of semver. Commit and push.
Comment @JuliaRegistrator register on the commit setting the version number.
JuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.
Increment the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.
You can build the documentation of HOHQMesh.jl locally by running
julia --project=docs -e 'using Pkg; Pkg.instantiate(); include("docs/make.jl")'
from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).
Settings
This document was generated with Documenter.jl version 0.27.19 on Friday 24 June 2022. Using Julia version 1.6.6.
In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.
All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).
If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.
git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git
+# get latest main from the main repo
+git checkout main
+git pull
+# create a new branch for a cool new feature, bug fix, ...
+git checkout -b YOUR_BRANCH_NAME
+# do some work and push it to your fork
+git push -u myfork
+# go to https://github.com/trixi-framework/HOHQMesh.jl/pull
+# and create a PR from your new branch
Why using pull requests?
Immediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.
With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.
Avoid committing unwanted files
When you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.
For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:
Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.
Execute git fetch to get the latest changes from the repository.
Make sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.
Merge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.
In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.
If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should
merge the current main to your branch
run tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs
properly comment your code
delete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)
remove debug statements
add a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh funtionality)
After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.
Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.
Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.
Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).
Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:
Update your clone by running git fetch.
Check out main using git checkout main.
Delete merged branch locally with git branch -d yourbranch.
Remove local references to deleted remote branch by executing git remote prune origin.
You can now proceed with your next changes by starting again at the top.
Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):
If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running
git reset HEAD~
This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.
If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.
Large files
You should never try to fix this yourself, as it potentially disrupts/destroys the work of others!
Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):
Tell everyone to commit and push their changes to the repository.
Fix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.
Perform the following steps to clean up the Git repository:
cd /tmp
+
+# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/
+
+# Get fresh clone of repo (so you can throw it away in case there is a problem)
+git clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git
+
+# Clean up repo of all files larger than 10M
+java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git
+
+# Enter repo
+cd Trixi.jl.git
+
+# Clean up reflog and force aggressive garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
+
+# Push changes
+git push
+
+# Delete clone
+rm -rf HOHQMesh.jl.git
Tell everyone to clean up their local working copies by performing the following steps (also do this yourself):
# Enter repo
+cd HOHQMesh.jl
+
+# Get current changes
+git fetch
+
+# Check out the fixed branch
+git checkout branchname
+
+# IMPORTANT: Do a rebase instead of a pull!
+git rebase
+
+# Clean reflog and force garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
IMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.
Settings
This document was generated with Documenter.jl version 0.27.19 on Friday 24 June 2022. Using Julia version 1.6.6.
diff --git a/v0.2.0/guided-tour/index.html b/v0.2.0/guided-tour/index.html
new file mode 100644
index 00000000..03a6759d
--- /dev/null
+++ b/v0.2.0/guided-tour/index.html
@@ -0,0 +1,62 @@
+
+Guided tour · HOHQMesh.jl
In this brief overview, we highlight two scripts from the examples folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.
A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute
A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute
For completeness, we provide the example script and walk-through each step in the construction of the Project below.
using HOHQMesh
+
+# Create a new project with the name "IceCreamCone", which will also be the
+# name of the mesh, plot and stats files, written to output folder `out`.
+
+p = newProject("IceCreamCone", "out")
+
+# Outer boundary for this example mesh is a complete circle. Add it into the project.
+
+circ = newCircularArcCurve("outerCircle", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, "degrees")
+addCurveToOuterBoundary!(p, circ)
+
+# Inner boundary is three curves. Two straight lines and a circular arc.
+# Note the three curve are connected to ensure a counter-clockwise orientation
+# as required by HOHQMesh
+
+# Create the three interior curves. The individual names of each curve in the inner
+# chain are used internally by HOHQMesh and are output as the given boundary names in
+# the mesh file.
+
+cone1 = newEndPointsLineCurve("cone1", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])
+iceCream = newCircularArcCurve("iceCream", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, "degrees")
+cone2 = newEndPointsLineCurve("cone2", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])
+
+# Assemble the three curve in a closed chain oriented counter-clockwise. The chain
+# name `IceCreamCone` is only used internally by HOHQMesh.
+
+addCurveToInnerBoundary!(p, cone1, "IceCreamCone")
+addCurveToInnerBoundary!(p, iceCream, "IceCreamCone")
+addCurveToInnerBoundary!(p, cone2, "IceCreamCone")
+
+# Adjust some `RunParameters` and overwrite the defaults values. In this case, we
+# set a new value for the boundary order polynomial representation and adjust the
+# output mesh file format to be `sem`
+
+setPolynomialOrder!(p, 4)
+setPlotFileFormat!(p, "sem")
+
+# A background grid is required for the mesh generation. In this example we lay a
+# background grid of Cartesian boxes with size 0.5.
+
+addBackgroundGrid!(p, [0.5, 0.5, 0.0])
+
+# Plot the project model curves and background grid
+
+if isdefined(Main, :Makie)
+ plotProject!(p, MODEL+GRID)
+ @info "Press enter to generate the mesh and update the plot."
+ readline()
+ else # Throw an informational message about plotting to the user
+ @info "To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again."
+ end
+
+# Generate the mesh. This produces the mesh and TecPlot files `AllFeatures.mesh` and `AllFeatures.tec`
+# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is
+# updated with the mesh that was generated.
+
+generate_mesh(p)
+
+# After the mesh successfully generates mesh statistics, such as the number of corner nodes,
+# the number of elements etc., are printed to the REPL
The first line creates a new project, where the mesh and plot file names will be derived from the project name, "IceCreamCone" written to the specified folder.
To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:
Parametric equations
Cubic Splines
Lines defined by their end points
Circular arcs
In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.
Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, "IceCreamCone" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.
For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script sets the polynomial order (default = 5) and the plot file format (default = "skeleton").
One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, so only the mesh size needs to be specified using
The example sets the background mesh size to be 0.1 in the x and y directions. The z component is ignored.
The script finishes by generating the quad mesh and plotting the results, as shown below
Finally, the script returns the project so that it can be edited further, if desired.
To save a control file for HOHQMesh, simply invoke
saveProject(proj::Project, outFile::String)
where outFile is the name of the control file (traditionally with a .control extension). saveProject is automatically called when a mesh is generated.
Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.
Settings
This document was generated with Documenter.jl version 0.27.19 on Friday 24 June 2022. Using Julia version 1.6.6.
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.
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.
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
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.,
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.
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.
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.
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.
Settings
This document was generated with Documenter.jl version 0.27.19 on Friday 24 June 2022. Using Julia version 1.6.6.
The supplied name will be the default name of the mesh and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.
The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.
If the model is modified and you want to re-plot with the new values, invoke
updatePlot!(proj::Project, options)
but generally the plot will be updated automatically as you build the model.
HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.
The available mesh file formats are "ISM", "ISM-V2", or "ABAQUS". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.
The plot file (which can be viewed with something like VisIt or ParaView) format is either "skeleton" or "sem". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.
By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with
A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available here.
To change the defaults, the smoother parameters can be set/enquired with the functions
There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must to be specified after a new project has been created.
Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.
Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g a sharp corner).
where name labels the refinement region, the type is either "smooth" or "sharp", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.
The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a "chain" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.
The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.
The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.
See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.
Returns a new set of parametric equation. Equations must be of the form
<function name>(<argument>) = ...
The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
A cubic spline is defined by an array of knots, $t_j$, $x_j$, $y_j$, $z_j$. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the $t$, $x$, $y$, $z$ values, e.g.
The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either "degrees" or "radians". That argument is optional, and defaults to "degrees".
Using the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using
The syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.
The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.
Several scripts are available in the examples folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.
Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.
The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.
To generate a mesh interactively you
Create a project with a user given projectName and folder where any generated files are to be saved
p = newProject(<projectName>, <folder>)
Both of these input arguments are strings.
Create inner and outer boundary curves from the available types
c = newEndPointsLineCurve(<name>, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*
+c = newCircularArcCurve(<name>, center [x, y, z], radius, startAngle, endAngle, units = "degrees" or "radians") *Circular Arc*
+c = newParametricEquationCurve(<name>, xEqn, yEqn, zEqn) *Parametric equation*
+c = newSplineCurve(<name>, dataFile) *Spline with data from a file*
+c = newSpline(<name>, nKnots, knotsMatrix) *Spline with given knot values*
See Defining curves for further details on the different curve type currently supported by HOHQMesh.
The generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.
Add curves to build the model to see what you have added,
addOuterBoundaryCurve!(p, <curveName>) *Add outer boundary curve*
+addInnerBoundaryCurve!(p, <curveName>, <InnerBoundaryName>) *Add curve to an inner boundary*
For a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.
Curves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.
Visualize the project's model, if desired
plotProject!(p, MODEL)
Plots are updated in response to user interactions. However, to update the plot at any time, use
updatePlot!(p, options)
Options are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.
Visualization requirement
The interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.
Set the background grid
When no outer boundary curve is present, the background grid can be set with
addBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])
Or
addBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])
The first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.
When an outer boundary is present the background grid can be set as
addBackgroundGrid!(p, [dx, dy, dz])
where the spacing controls the number of elements in each direction.
Background grid
A background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.
Adjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by
setPolynomialOrder!(p, order)
The background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately
The mesh file will be saved in <folder> with the name <projectName>.mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name <projectName>.control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.
All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.
Settings
This document was generated with Documenter.jl version 0.27.19 on Friday 24 June 2022. Using Julia version 1.6.6.
Copyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-Lakemper
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Settings
This document was generated with Documenter.jl version 0.27.19 on Friday 24 June 2022. Using Julia version 1.6.6.
Add the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version
Add the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.
Add an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.
Return a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.
Generate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.
You can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.
You can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
Generate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.
This function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
getCurveType(crv::Dic{String,Any})
+
+Get the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,
+`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.
Get the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.
Set the file format for the plot file. Acceptable choices are "sem", which includes interior nodes and boundary nodes and "skeleton", which includes only the corner nodes.
This document was generated with Documenter.jl version 0.27.19 on Friday 24 June 2022. Using Julia version 1.6.6.
diff --git a/v0.2.0/search_index.js b/v0.2.0/search_index.js
new file mode 100644
index 00000000..0579c434
--- /dev/null
+++ b/v0.2.0/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"contributing/#Contributing","page":"Contributing","title":"Contributing","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.","category":"page"},{"location":"contributing/#Developer-Certificate-of-Origin-(Version-1.1)","page":"Contributing","title":"Developer Certificate of Origin (Version 1.1)","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"The following text was taken from https://developercertificate.org:","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"Developer Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n1 Letterman Drive\nSuite D4700\nSan Francisco, CA, 94129\n\nEveryone is permitted to copy and distribute verbatim copies of this\nlicense document, but changing it is not allowed.\n\n\nDeveloper's Certificate of Origin 1.1\n\nBy making a contribution to this project, I certify that:\n\n(a) The contribution was created in whole or in part by me and I\n have the right to submit it under the open source license\n indicated in the file; or\n\n(b) The contribution is based upon previous work that, to the best\n of my knowledge, is covered under an appropriate open source\n license and I have the right under that license to submit that\n work with modifications, whether created in whole or in part\n by me, under the same open source license (unless I am\n permitted to submit under a different license), as indicated\n in the file; or\n\n(c) The contribution was provided directly to me by some other\n person who certified (a), (b) or (c) and I have not modified\n it.\n\n(d) I understand and agree that this project and the contribution\n are public and that a record of the contribution (including all\n personal information I submit with it, including my sign-off) is\n maintained indefinitely and may be redistributed consistent with\n this project or the open source license(s) involved.","category":"page"},{"location":"development/#Development","page":"Development","title":"Development","text":"","category":"section"},{"location":"development/#Text-editors","page":"Development","title":"Text editors","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:","category":"page"},{"location":"development/#VS-Code","page":"Development","title":"VS Code","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.","category":"page"},{"location":"development/#Juno","page":"Development","title":"Juno","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.","category":"page"},{"location":"development/#Vim-or-Emacs","page":"Development","title":"Vim or Emacs","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like Juno). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.","category":"page"},{"location":"development/#Releasing-a-new-version-of-HOHQMesh","page":"Development","title":"Releasing a new version of HOHQMesh","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Check whether everything is okay, tests pass etc.\nSet the new version number in Project.toml according to the Julian version of semver. Commit and push.\nComment @JuliaRegistrator register on the commit setting the version number.\nJuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.\nIncrement the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.","category":"page"},{"location":"development/#Preview-the-documentation","page":"Development","title":"Preview the documentation","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"You can build the documentation of HOHQMesh.jl locally by running","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"julia --project=docs -e 'using Pkg; Pkg.instantiate(); include(\"docs/make.jl\")'","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).","category":"page"},{"location":"tutorials/straight_outer_boundary/#Straight-sided-outer-boundary","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples folder.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Synopsis","page":"Straight-sided outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Initialization","page":"Straight-sided outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We create a new project with the name \"box_two_circles\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_project = newProject(\"box_two_circles\", \"out\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Adjusting-project-parameters","page":"Straight-sided outer boundary","title":"Adjusting project parameters","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"For the box_project we first query the current values for the polynomial order and the mesh output format","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> getPolynomialOrder(box_project)\n5\n\njulia> getMeshFileFormat(box_project)\n\"ISM-V2\"","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be 4 and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"setPolynomialOrder!(box_project, 4)\nsetMeshFileFormat!(box_project, \"ABAQUS\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-background-grid","page":"Straight-sided outer boundary","title":"Add the background grid","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The domain for this tutorial is a rectangular box with the bounds 030times015. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Set the lower left corner point of the domain (x_0 y_0), define the element size in each spatial direction Delta x and Delta y, and the number of steps taken in each direction N_x N_y. The resulting background grid will have the extent x_0 x_0 + N_x Delta x by y_0 y_0 + N_y Delta y. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands\nlower_left = [0.0, 0.0, 0.0]\nspacing = [1.0, 1.0, 0.0]\nnum_intervals = [30, 15, 0]\naddBackgroundGrid!(box_project, lower_left, spacing, num_intervals)\nSet the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box 030times015 we use\nbounds = [15.0, 0.0, 0.0, 30.0]\nN = [30, 15, 0]\naddBackgroundGrid!(box_project, bounds, N)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we visualize the box_project to ensure that the background grid has been added correctly.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"plotProject!(box_project, GRID)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use the keyword and GRID to indicate that we want the background grid to be included in the visualization.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: background)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-inner-boundaries","page":"Straight-sided outer boundary","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we add the two circular inner boundary curves with different radii.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The first circle will have radius r=2 and be centered at the point (4 4). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle1 = newCircularArcCurve(\"circle1\", # curve name\n [4.0, 4.0, 0.0], # circle center\n 2.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be \"circle1\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The new circle1 curve is then added to the box_project as an inner boundary curve with","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"addCurveToInnerBoundary!(box_project, circle1, \"inner1\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called \"inner1\" and it contains a single curve \"circle1\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: first_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With analogous steps we create another circular curve with radius r=4, centered at (20 9) and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle2 = newCircularArcCurve(\"circle2\", # curve name\n [20.0, 9.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 2.0 * pi, # end angle\n \"radians\") # angle units\naddCurveToInnerBoundary!(box_project, circle2, \"inner2\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called \"inner2\" and it contains a single curve \"circle2\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: second_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Generate-the-mesh","page":"Straight-sided outer boundary","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_two_circles.control: A HOHQMesh control file for the current project.\nbox_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nbox_two_circles.inp: A mesh file with format ABAQUS that was set above.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"generate_mesh(box_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 3.5553999999999995E-002\n Number of nodes = 498\n Number of Edges = 921\n Number of Elements = 422\n Number of Subdivisions = 0\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.34513058 1.15383206 0.91833833 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00000004 1.71083844 1.08733476 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 1.46558793 1.04922640 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00000006 2.43503343 1.16700825 1.00000000 4.00000000 1.00000000\n Jacobian 0.17863168 1.07210721 0.86801359 0.00000000 999.99900000 1.00000000\n Minimum Angle 50.56155029 89.99999787 83.84466557 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00000259 136.97479459 96.69930735 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: final_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Summary","page":"Straight-sided outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"github-git/#GitHub-and-Git","page":"GitHub & Git","title":"GitHub & Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This page contains information on how to use GitHub and Git when developing HOHQMesh.","category":"page"},{"location":"github-git/#Development-workflow","page":"GitHub & Git","title":"Development workflow","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For adding modifications to HOHQMesh, we generally follow these steps:","category":"page"},{"location":"github-git/#Create-an-issue-(optional)","page":"GitHub & Git","title":"Create an issue (optional)","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.","category":"page"},{"location":"github-git/#Create-a-branch-and-*immediately*-create-a-pull-request","page":"GitHub & Git","title":"Create a branch and immediately create a pull request","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git\n# get latest main from the main repo\ngit checkout main\ngit pull\n# create a new branch for a cool new feature, bug fix, ...\ngit checkout -b YOUR_BRANCH_NAME\n# do some work and push it to your fork\ngit push -u myfork\n# go to https://github.com/trixi-framework/HOHQMesh.jl/pull\n# and create a PR from your new branch","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"info: Why using pull requests?\nImmediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.","category":"page"},{"location":"github-git/#Make-changes","page":"GitHub & Git","title":"Make changes","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"warning: Avoid committing unwanted files\nWhen you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.","category":"page"},{"location":"github-git/#Keep-your-branch-in-sync-with-main","page":"GitHub & Git","title":"Keep your branch in sync with main","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.\nExecute git fetch to get the latest changes from the repository.\nMake sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.\nMerge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.","category":"page"},{"location":"github-git/#Prepare-for-review","page":"GitHub & Git","title":"Prepare for review","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"merge the current main to your branch\nrun tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs\nproperly comment your code\ndelete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)\nremove debug statements\nadd a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh funtionality)","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.","category":"page"},{"location":"github-git/#Get-reviewed","page":"GitHub & Git","title":"Get reviewed","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.","category":"page"},{"location":"github-git/#Merge-branch","page":"GitHub & Git","title":"Merge branch","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).","category":"page"},{"location":"github-git/#Update-your-working-copy","page":"GitHub & Git","title":"Update your working copy","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Update your clone by running git fetch.\nCheck out main using git checkout main.\nDelete merged branch locally with git branch -d yourbranch.\nRemove local references to deleted remote branch by executing git remote prune origin.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"You can now proceed with your next changes by starting again at the top.","category":"page"},{"location":"github-git/#Using-Git","page":"GitHub & Git","title":"Using Git","text":"","category":"section"},{"location":"github-git/#Resources-for-learning-Git","page":"GitHub & Git","title":"Resources for learning Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Git Handbook by GitHub\nLearn Git Branching","category":"page"},{"location":"github-git/#Tips-and-tricks","page":"GitHub & Git","title":"Tips and tricks","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This is an unordered collection of different tips and tricks that can be helpful while working with Git. As usual, your mileage might vary.","category":"page"},{"location":"github-git/#Undo-last-commit","page":"GitHub & Git","title":"Undo last commit","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git reset HEAD~","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.","category":"page"},{"location":"github-git/#Remove-large-file-from-repository","page":"GitHub & Git","title":"Remove large file from repository","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"danger: Large files\nYou should never try to fix this yourself, as it potentially disrupts/destroys the work of others!","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Tell everyone to commit and push their changes to the repository.\nFix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.\nPerform the following steps to clean up the Git repository:\ncd /tmp\n\n# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/\n\n# Get fresh clone of repo (so you can throw it away in case there is a problem)\ngit clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git\n\n# Clean up repo of all files larger than 10M\njava -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git\n\n# Enter repo\ncd Trixi.jl.git\n\n# Clean up reflog and force aggressive garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\n\n# Push changes\ngit push\n\n# Delete clone\nrm -rf HOHQMesh.jl.git\nTell everyone to clean up their local working copies by performing the following steps (also do this yourself):\n# Enter repo\ncd HOHQMesh.jl\n\n# Get current changes\ngit fetch\n\n# Check out the fixed branch\ngit checkout branchname\n\n# IMPORTANT: Do a rebase instead of a pull!\ngit rebase\n\n# Clean reflog and force garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\nIMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.","category":"page"},{"location":"interactive-api/#API","page":"API","title":"API","text":"","category":"section"},{"location":"interactive-api/#Project-creation-and-saving","page":"API","title":"Project creation and saving","text":"","category":"section"},{"location":"interactive-api/#New-Project","page":"API","title":"New Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = newProject(name::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied name will be the default name of the mesh and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.","category":"page"},{"location":"interactive-api/#Opening-an-existing-project-file","page":"API","title":"Opening an existing project file","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A project can be created from an existing HOHQMesh control file with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = openProject(fileName::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied fileName will be the name of the project and the generated mesh and plot files will be placed in the supplied folder.","category":"page"},{"location":"interactive-api/#Saving-a-Project","page":"API","title":"Saving a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" saveProject(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"writes a control file to the folder designated when creating the new project. It can be read in again with openProject.","category":"page"},{"location":"interactive-api/#Plotting-a-Project","page":"API","title":"Plotting a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" plotProject!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the model is modified and you want to re-plot with the new values, invoke","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" updatePlot!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"but generally the plot will be updated automatically as you build the model.","category":"page"},{"location":"interactive-api/#Modifying/editing-a-Project","page":"API","title":"Modifying/editing a Project","text":"","category":"section"},{"location":"interactive-api/#Setting-the-name-of-a-Project","page":"API","title":"Setting the name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name is the name under which the mesh, plot, statistics and control files will be written. It can be changed at any time with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setName!(proj::Project,name::String)","category":"page"},{"location":"interactive-api/#Getting-the-current-name-of-a-Project","page":"API","title":"Getting the current name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name can be fetched and printed to the screen with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getName(proj::Project)","category":"page"},{"location":"interactive-api/#Controlling-the-mesh-generation","page":"API","title":"Controlling the mesh generation","text":"","category":"section"},{"location":"interactive-api/#Editing-the-RunParameters","page":"API","title":"Editing the RunParameters","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The run parameters can be enquired and set with these getter/setter pairs:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setPolynomialOrder!(proj::Project, p::Int)\n [Return:Int] getPolynomialOrder(proj::Project)\n [Return:nothing] setMeshFileFormat!(proj::Project, meshFileFormat::String)\n [Return:String] getMeshFileFormat(proj::Project)\n [Return:nothing] setPlotFileFormat!(proj::Project, plotFileFormat::String)\n [Return:String] getPlotFileFormat(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The available mesh file formats are \"ISM\", \"ISM-V2\", or \"ABAQUS\". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot file (which can be viewed with something like VisIt or ParaView) format is either \"skeleton\" or \"sem\". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.","category":"page"},{"location":"interactive-api/#Changing-the-output-file-names","page":"API","title":"Changing the output file names","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setName!(proj::Project,name::String)\n [Return:String] getName(proj::Project)\n [Return:nothing] setFolder!(proj::Project,folder::String)\n [Return:String] getFolder(proj::Project)","category":"page"},{"location":"interactive-api/#Smoothing-operations","page":"API","title":"Smoothing operations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available here.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To change the defaults, the smoother parameters can be set/enquired with the functions","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setSmoothingStatus!(proj::Project, status::String)\n [Return:String] getSmoothingStatus(proj::Project)\n [Return:nothing] setSmoothingType!(proj::Project, type::String)\n [Return:String] getSmoothingType(proj::Project)\n [Return:nothing] setSmoothingIterations!(proj::Project, iterations::Int)\n [Return:Int] getSmoothingIterations(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The smooth status is either \"ON\" or \"OFF\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To remove the smoother altogether, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] removeSpringSmoother!(proj::Project)","category":"page"},{"location":"interactive-api/#Adding-the-background-grid","page":"API","title":"Adding the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must to be specified after a new project has been created.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addBackgroundGrid!(proj::Project,\n x0::Array{Float64},\n dx::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n box::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n bgSize::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.","category":"page"},{"location":"interactive-api/#Changing-the-background-grid","page":"API","title":"Changing the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The size of an existing background grid in a Project can be adjusted with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setBackgroundGridSize!(proj::Project,\n dx::Float64,\n dy::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If a plot is present it will be updated automatically.","category":"page"},{"location":"interactive-api/#Manual-refinement-regions","page":"API","title":"Manual refinement regions","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g a sharp corner).","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To create a RefinementCenter,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementCenter(name::String,\n type::String,\n x0::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where name labels the refinement region, the type is either \"smooth\" or \"sharp\", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Similarly, one can create a RefinementLine,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementLine(name::String,\n type::String,\n x0::Array{Float64}, x1::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where x0 is the start position and x1 is the end of the line. The name, type, h, and w parameters are the same as for a RefinementCenter.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To add a refinement region to the project,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addRefinementRegion!(proj::Project, r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To get a reference to a refinement region with a given name, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] getRefinementRegion(proj::Project, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to get a list of all the refinement regions,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Array{Dict{String,Any}}] array = allRefinementRegions(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"A refinement region can be edited by using the following:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementType!(r::Dict{String,Any}, type::String)\n [Return:String] getRefinementType(r::Dict{String,Any})\n [Return:nothing] setRefinementLocation!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementLocation(r::Dict{String,Any})\n [Return:nothing] setRefinementGridSize!(r::Dict{String,Any}, h::Float64)\n [Return:Float64] getRefinementGridSize(r::Dict{String,Any})\n [Return:nothing] setRefinementWidth!(r::Dict{String,Any}, w::Float64)\n [Return:Float64] getRefinementWidth(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where r is a dictionary returned by newRefinementCenter!, newRefinementLine!, or getRefinementRegion.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To further edit a RefinementLine, use the methods","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementStart!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementStart(r::Dict{String,Any})\n [Return:nothing] setRefinementEnd!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementEnd(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Boundary-curves","page":"API","title":"Boundary curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a \"chain\" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.","category":"page"},{"location":"interactive-api/#Defining-curves","page":"API","title":"Defining curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Four curve types can be added to the outer and inner boundary curve chains. They are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"interactive-api/#Parametric-equations","page":"API","title":"Parametric equations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Creating a new curve equation","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\")","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Returns a new set of parametric equation. Equations must be of the form","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" () = ...","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" xEqn = \"x(t) = 4*cos(2*pi*t) - 0.6*cos(8*pi*t)^3\"\n yEqn = \"y(t) = 4*sin(2*pi*t) - 0.5*sin(11*pi*t)^2\"\n zEqn = \"z(t) = 0.0\"\n blob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The z-Equation is optional, but for now must define zero for z by default.","category":"page"},{"location":"interactive-api/#Cubic-spline-curve","page":"API","title":"Cubic spline curve","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A cubic spline is defined by an array of knots, t_j, x_j, y_j, z_j. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the t, x, y, z values, e.g.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" 9\n 0.000000000000000 -3.50000000000000 3.50000000000000 0.0\n 3.846153846153846E-002 -3.20000000000000 5.00000000000 0.0\n 7.692307692307693E-002 -2.00000000000000 6.00000000000 0.0\n 0.769230769230769 0.000000000000000 -1.00000000000000 0.0\n 0.807692307692308 -1.00000000000000 -1.00000000000000 0.0\n 0.846153846153846 -2.00000000000000 -0.800000000000000 0.0\n 0.884615384615385 -2.50000000000000 0.000000000000000 0.0\n 0.923076923076923 -3.00000000000000 1.00000000000000 0.0\n 1.00000000000000 -3.50000000000000 3.50000000000000 0.0","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"or by constructing the required nKnots x 4 array and supplying it to the new procedure. The respective constructors for a spline curve are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newSplineCurve(name::String,\n dataFile::String)\n [Return:Dict{String,Any}] newSplineCurve(name::String,\n nKnots::Int,\n data::Matrix{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the spline curve is to be closed. The last data point must be the same as the first.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n ex_spline = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"interactive-api/#Line-defined-by-end-points","page":"API","title":"Line defined by end points","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A straight line is constructed with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newEndPointsLineCurve(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The xStart and xEnd are arrays of the form [x, y, z]. The z component should be zero and for now is ignored.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" line1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])","category":"page"},{"location":"interactive-api/#Circular-arc","page":"API","title":"Circular arc","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newCircularArcCurve(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either \"degrees\" or \"radians\". That argument is optional, and defaults to \"degrees\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" halfCircle = newCircularArcCurve(\"Dome\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")","category":"page"},{"location":"interactive-api/#Adding-and-removing-outer-and-inner-boundaries","page":"API","title":"Adding and removing outer and inner boundaries","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Adding an outer boundary curve\nUsing the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using\n[Return:nothing] addCurveToOuterBoundary!(proj::Project,\n crv::Dict{String,Any})\ncrv is the dictionary that represents the curve.\nExample:\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\nAdding an inner boundary curve\nThe syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.\n[Return:nothing] addCurveToInnerBoundary!(proj::Project,\n crv::Dict{String,Any},\n chainName::String)\nExample:\nline1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\naddCurveToInnerBoundary!(p, line1, \"interior_curve\")\nTo edit curves they can be accessed by the name:\n[Return:Dict{String,Any}] getInnerBoundaryCurve(proj::Project,\n curveName::String,\n chainName::String)\n[Return:Dict{String,Any}] getOuterBoundaryCurveWithName(proj::Project,\n name::String)\nDeleting boundary curves\nThe entire outer boundary or an entire inner boundary can be removed from the project.\n[Return:nothing] removeOuterBoundary!(proj::Project)\n[Return:nothing] removeInnerBoundary!(proj::Project, chainName::String)\nAlternatively, individual pieces of the boundary curve chains can be removed.\n[Return:nothing] removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n[Return:nothing] removeInnerBoundaryCurve!(proj::Project,\n name::String,\n chainName::String)\nAs in HOHQMesh the project can have only one outer boundary chain, so the removal does not require a specific chainName.","category":"page"},{"location":"interactive-api/#Editing-curves","page":"API","title":"Editing curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"You can determine the type of a curve by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getCurveType(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"For any of the curves, their name can be changed by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setCurveName!(crv::Dict{String,Any}, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"and checked by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" getCurveName(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Otherwise there are special functions to change the parameters of curves","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setXEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setYEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setZEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcUnits!(arc::Dict{String,Any}, units::String)\n [Return:nothing] setArcCenter!(arc::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n [Return:String] getXEqn(crv::Dict{String,Any})\n [Return:String] getYEqn(crv::Dict{String,Any})\n [Return:String] getZEqn(crv::Dict{String,Any})\n [Return:Array{Float64}] getStartPoint(crv::Dict{String,Any})\n [Return:Array{Float64}] getEndPoint(crv::Dict{String,Any})\n [Return:String] getArcUnits(arc::Dict{String,Any})\n [Return:Array{Float64}] getArcCenter(arc::Dict{String,Any})\n [Return:Float64] getArcStartAngle(arc::Dict{String,Any})\n [Return:Float64] getArcEndAngle(arc::Dict{String,Any})\n [Return:Float64] getArcRadius(arc::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Undo/redo","page":"API","title":"Undo/redo","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The interactive mesh functionality has unlimited undo/redo for most actions.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"In interactive mode, actions can be undone by the commands","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undo()\n [Return:String] redo()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where the return string contains the name of the action performed.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To find out what the next actions are, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undoActionName()\n [Return:String] redoActionName()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to clear the undo stack, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] clearUndoRedo()","category":"page"},{"location":"tutorials/curved_outer_boundary/#Curved-outer-boundary","page":"Curved outer boundary","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Synopsis","page":"Curved outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initialization","page":"Curved outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We create a new project with the name \"TheBlob\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"blob_project = newProject(\"TheBlob\", \"out\")","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-the-outer-boundary","page":"Curved outer boundary","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary curve for the domain of interest in this tutorial is given by the parametric equations","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":" beginaligned\n x(t) = 4cos(2 pi t) - frac35cos^3(8 pi t)02cm\n y(t) = 4sin(2 pi t) - frac12sin^2(11 pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"xEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The name of this curve is assigned to be \"Blob\". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addCurveToOuterBoundary!(blob_project, blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-a-background-grid","page":"Curved outer boundary","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for blob_project to have elements with side length two in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"plotProject!(blob_project, MODEL+GRID)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"Blob\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: coarse_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From the visualization we see that the background grid is likely too coarse to produce a \"good\" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"setBackgroundGridSize!(blob_project, 0.5, 0.5)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: fine_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initial-mesh-and-user-adjustments","page":"Curved outer boundary","title":"Initial mesh and user adjustments","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"TheBlob.control: A HOHQMesh control file for the current project.\nTheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nTheBlob.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.10612399999999998\n Number of nodes = 481\n Number of Edges = 895\n Number of Elements = 417\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025346 0.36181966 0.11936327 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002883 2.58066393 1.26340310 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.11480166 1.18583253 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006177 4.80707901 1.51313656 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011326 0.28172540 0.10292251 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.30873612 89.99827738 73.08079323 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132792 156.87642432 109.37004979 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: initial_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point (-4 0) is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"center = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Above we create a circular refinement region centered at the point (-4 -05) with a desired resolution size 04 and a radius of 10. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: refinement_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Final-mesh","page":"Curved outer boundary","title":"Final mesh","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.11373499999999999\n Number of nodes = 505\n Number of Edges = 940\n Number of Elements = 438\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025346 0.36181966 0.11412658 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002884 2.47585614 1.26424390 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.11480166 1.18425870 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006177 4.80707901 1.51413601 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011326 0.28172540 0.09814547 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.30873612 89.99827901 72.79596483 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132782 156.87642433 109.63912468 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: final_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Summary","page":"Curved outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"# Interactive mesh with a curved outer boundary\n#\n# Create an outer boundary from a set of parametric equations.\n# Add manual refinement in a small region around the point (-4, -0.5).\n#\n# Keywords: outer boundary, parametric equations, refinement center\nusing HOHQMesh\n\n# Instantiate the project\nblob_project = newProject(\"TheBlob\", \"out\")\n\n# Create and add the outer boundary curve\nxEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)\naddCurveToOuterBoundary!(blob_project, blob)\n\n# Add the background grid\naddBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])\n\n# Create and add the refinement region\ncenter = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)\n\n# Generate the mesh\ngenerate_mesh(blob_project)","category":"page"},{"location":"tutorials/create_edit_curves/#Creating-and-editing-curves","page":"Creating and editing curves","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a \"chain\" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/create_edit_curves/#Synopsis","page":"Creating and editing curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/#Initialization","page":"Creating and editing curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a new project with the name \"sandbox\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox_project = newProject(\"sandbox\", \"out\")","category":"page"},{"location":"tutorials/create_edit_curves/#Add-the-outer-boundary-chain","page":"Creating and editing curves","title":"Add the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We first create the outer boundary curve chain that is composed of three pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (0 -7) to (5 3).\nHalf-circle arc of radius r=5 centered at (0 3).\nStraight line segment from (-5 3) to (0 -7).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [0.0, -7.0, 0.0], # start point\n [5.0, 3.0, 0.0]) # end point\n\nouter_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-5.0, 3.0, 0.0], # start point\n [0.0, -7.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from 0 to 180 degrees.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_arc = newCircularArcCurve(\"Arc\", # curve name\n [0.0, 3.0, 0.0], # center\n 5.0, # radius\n 0.0, # start angle\n 180.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", and \"Arc\" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-a-background-grid","page":"Creating and editing curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We visualize the outer boundary curve chain and background grid with the following","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"plotProject!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains three curve segments \"Line1\", \"Arc\", and \"Line2\" labeled in the figure by O.1, O.2, and O.3, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-the-outer-boundary-chain","page":"Creating and editing curves","title":"Edit the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the domain boundary requires a curved segment instead of the straight line \"Line2\". We will replace this line segment in the outer boundary chain with a cubic spline.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"First, we remove the \"Line2\" curve from the \"Outer\" chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Outer curve removal\nAlternatively, we can remove the curve \"Line2\" using its index in the \"Outer\" boundary chain.removeOuterBoundaryCurveAtIndex!(sandbox_project, 3)This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The plot automatically updates and we see that the outer boundary is open and contains two segments: \"Line1\" and \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve \"Arc\" and end at the first point of the curve \"Line1\". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. The spline curve constructor newSplineCurve also takes the number of points as an input argument.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"spline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we add the spline curve outer_spline into the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates automatically to display the \"Outer\" boundary chain with the new \"Spline\" curve labeled O.3.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-an-inner-boundary-chain","page":"Creating and editing curves","title":"Add an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a pill shaped inner boundary curve chain composed of four pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (1 5) to (1 3).\nHalf-circle arc of radius r=1 centered at (0 3).\nStraight line segment from (-1 3) to (-1 5).\nHalf-circle arc of radius r=1 centered at (0 5).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Similar to the construction of the \"Outer\" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [1.0, 5.0, 0.0], # start point\n [1.0, 3.0, 0.0]) # end point\n\ninner_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-1.0, 3.0, 0.0], # start point\n [-1.0, 5.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at (0 3) varies from 0 to -180 degrees. The top half-circle arc centered at (0 5) has an angle that varies from 180 to 0 degrees. The construction of the two circle arcs are","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_bottom_arc = newCircularArcCurve(\"BottomArc\", # curve name\n [0.0, 3.0, 0.0], # center\n 1.0, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\n\ninner_top_arc = newCircularArcCurve(\"TopArc\", # curve name\n [0.0, 5.0, 0.0], # center\n 1.0, # radius\n 180.0, # start angle\n 0.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Note, we use \"radians\" to set the angle bounds for inner_bottom_arc and \"degrees\" for the angle bounds of inner_top_arc.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", \"BottomArc\", and \"TopArc\" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This inner boundary chain name \"inner\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments \"Line1\", \"BottomArc\", \"Line2\", and \"TopArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_pill)","category":"page"},{"location":"tutorials/create_edit_curves/#Generate-the-mesh","page":"Creating and editing curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox.control: A HOHQMesh control file for the current project.\nsandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nsandbox.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 8.7928000000000006E-002\n Number of nodes = 513\n Number of Edges = 933\n Number of Elements = 422\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00003020 1.17336756 0.18813064 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00984888 2.32321419 1.31488869 1.00000000 999.99900000 1.00000000\n Condition 1.00041121 2.42894151 1.21101797 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.01674110 3.74861238 1.59495734 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001734 1.13821390 0.14136293 0.00000000 999.99900000 1.00000000\n Minimum Angle 32.20087774 89.35157729 68.75755243 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.60787193 152.53515465 113.36966060 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: initial_mesh)","category":"page"},{"location":"tutorials/create_edit_curves/#Delete-the-existing-mesh","page":"Creating and editing curves","title":"Delete the existing mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"remove_mesh!(sandbox_project)\nupdatePlot!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Additionally, the remove_mesh! command deletes the mesh information from the sandbox_project and sandbox.mesh from the out folder. However, the sandbox.control and sandbox.tec files are still present in out directory.","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-an-inner-boundary-chain","page":"Creating and editing curves","title":"Edit an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the inner boundary actually requires a curved segment instead of the straight line \"Line1\". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We remove the \"Line1\" curve from the inner chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Inner curve removal\nAlternatively, we can remove the curve \"Line1\" using its index in the inner boundary chain.removeInnerBoundaryCurveAtIndex!(sandbox_project, 1, \"inner\")This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: \"BottomArc\", \"Line2\", and \"TopArc\". Note that the index of the remaining curves has changed as shown below.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Brief note about undo / redo\nThe interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.undoActionName()\n\"Remove Inner Boundary Curve\"We can undo the removal of the \"Line1\" curve with undoundo()\n\"Undo Remove Inner Boundary Curve\"In addition to reinstating \"Line1\" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The new inner curve segment will be an oscillating line given by the parametric equations","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":" beginaligned\n x(t) = t + 102cm\n y(t) = -2t + 5 - frac32 cos(pi t) sin(pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"xEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The name of this new curve is assigned to be \"wiggleLine\". We add this new curve to the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The automatically updated figure now shows:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_open_chain)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We see from the figure that this parametric equation curve starts at the point (15) and, therefore, matches the end point of the existing curve \"TopArc\" present in the \"inner\" chain. However, the parametric equation curve ends at the point (23) which does not match the \"BottomArc\" curve. So, the inner boundary chain remains open.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"warning: Attempt to generate a mesh with an open curve chain\nAn open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create a closed boundary curve we must remove the \"BottomArc\" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point (2 3) and end at the point (-1 3) to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the \"BottomArc\" from the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates to display the \"inner\" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_remove_arc)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"A half-circle arc that joins the points (2 3) and (-1 3) has a radius r=15, is centered at (05 3) and has an angle that vaires from 0 to -180. We construct this circle arc and directly add it to the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"new_bottom_arc = newCircularArcCurve(\"wideBottomArc\", # curve name\n [0.5, 3.0, 0.0], # center\n 1.5, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The updated plot now gives the modified, closed inner curve chain that now contains four curve segments \"Line2\", \"TopArc\", \"wiggleLine\", and \"wideBottomArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/#Regenerate-the-mesh","page":"Creating and editing curves","title":"Regenerate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.13299600000000000\n Number of nodes = 714\n Number of Edges = 1308\n Number of Elements = 596\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00003020 1.15662678 0.12823840 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.01082600 3.14765817 1.34292128 1.00000000 999.99900000 1.00000000\n Condition 1.00037252 2.59936116 1.22903490 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.02724726 3.74861238 1.64807401 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001734 1.13150266 0.09438571 0.00000000 999.99900000 1.00000000\n Minimum Angle 31.88018513 89.33451932 67.86550651 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.43850948 157.31718198 114.36070355 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: zoom_corner)","category":"page"},{"location":"tutorials/create_edit_curves/#Summary","page":"Creating and editing curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"# Interactive mesh with modified outer and inner curve chains\n#\n# Create inner / outer boundary chains composed of the four\n# available HOHQMesh curve types.\n#\n# Keywords: outer boundary, inner boundary, parametric equations,\n# circle arcs, cubic spline, curve removal\nusing HOHQMesh\n\n# Instantiate the project\nsandbox_project = newProject(\"sandbox\", \"out\")\n\n# Add the background grid\naddBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])\n\n# Create and add the original outer boundary curves\nouter_line1 = newEndPointsLineCurve(\"Line1\", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])\nouter_line2 = newEndPointsLineCurve(\"Line2\", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])\nouter_arc = newCircularArcCurve(\"Arc\", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, \"degrees\")\n\naddCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)\n\n# Modify the outer boundary to have a spline instead of a straight line\nremoveOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")\n\nspline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)\naddCurveToOuterBoundary!(sandbox_project, outer_spline)\n\n# Create and add the inner boundary curves\ninner_line1 = newEndPointsLineCurve(\"Line1\", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])\ninner_line2 = newEndPointsLineCurve(\"Line2\", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])\ninner_bottom_arc = newCircularArcCurve(\"BottomArc\", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, \"radians\")\ninner_top_arc = newCircularArcCurve(\"TopArc\", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, \"degrees\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")\n\n# Generate a mesh\ngenerate_mesh(sandbox_project)\n\n# Delete the existing mesh before modifying the inner boundary curve chain\nremove_mesh!(sandbox_project)\n\n# Modify the inner boundary curve with an oscillatory line and a new circle arc\nremoveInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")\nremoveInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")\n\nxEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)\n\nnew_bottom_arc = newCircularArcCurve(\"wideBottomArc\", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, \"radians\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")\n\n# Regenerate the final mesh\ngenerate_mesh(sandbox_project)","category":"page"},{"location":"interactive_overview/#InteractiveTool","page":"Overview","title":"Overview","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Several scripts are available in the examples folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.","category":"page"},{"location":"interactive_overview/#Workflow-and-basic-moves","page":"Overview","title":"Workflow and basic moves","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"To generate a mesh interactively you","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Create a project with a user given projectName and folder where any generated files are to be saved\np = newProject(, )\nBoth of these input arguments are strings.\nCreate inner and outer boundary curves from the available types\nc = newEndPointsLineCurve(, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*\nc = newCircularArcCurve(, center [x, y, z], radius, startAngle, endAngle, units = \"degrees\" or \"radians\") *Circular Arc*\nc = newParametricEquationCurve(, xEqn, yEqn, zEqn) *Parametric equation*\nc = newSplineCurve(, dataFile) *Spline with data from a file*\nc = newSpline(, nKnots, knotsMatrix) *Spline with given knot values*\nSee Defining curves for further details on the different curve type currently supported by HOHQMesh.\nThe generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.\nAdd curves to build the model to see what you have added,\naddOuterBoundaryCurve!(p, ) *Add outer boundary curve*\naddInnerBoundaryCurve!(p, , ) *Add curve to an inner boundary*\nFor a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.\nCurves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.\nVisualize the project's model, if desired\nplotProject!(p, MODEL)\nPlots are updated in response to user interactions. However, to update the plot at any time, use\nupdatePlot!(p, options)\nOptions are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.\nnote: Visualization requirement\nThe interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.\nSet the background grid\nWhen no outer boundary curve is present, the background grid can be set with\naddBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])\nOr\naddBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])\nThe first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.\nWhen an outer boundary is present the background grid can be set as\naddBackgroundGrid!(p, [dx, dy, dz])\nwhere the spacing controls the number of elements in each direction.\nnote: Background grid\nA background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.\nAdjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by\nsetPolynomialOrder!(p, order)\nThe background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately\nsetBackgroundGridSize!(p, 0.5, 0.25)\nSee Controlling the mesh generation for details on adjusting parameters already present in the Project.\nGenerate the mesh\ngenerate_mesh(p)\nThe mesh file will be saved in with the name .mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name .control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.","category":"page"},{"location":"interactive_overview/#Advanced","page":"Overview","title":"Advanced","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.","category":"page"},{"location":"testing/#Testing","page":"Testing","title":"Testing","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In Trixi and its related repositories, tests are triggered by","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"each git push to main and\neach git push to any pull request.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test and coverage requirements\nBefore merging a pull request (PR) to main, we require thatthe code passes all functional tests\ncode coverage does not decrease.","category":"page"},{"location":"testing/#Testing-setup","page":"Testing","title":"Testing setup","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> using Pkg; Pkg.test(\"HOHQMesh\")","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> # Run all test for the interactive Curve API\n include(joinpath(\"test\", \"test_curve.jl\"))","category":"page"},{"location":"testing/#Adding-new-tests","page":"Testing","title":"Adding new tests","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test duration\nAs a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).","category":"page"},{"location":"testing/#Test-coverage","page":"Testing","title":"Test coverage","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered \"covered\" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The \"Details\" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Coverage requirements\nIn general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.","category":"page"},{"location":"authors/#Authors","page":"Authors","title":"Authors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.","category":"page"},{"location":"authors/#Principal-Developers","page":"Authors","title":"Principal Developers","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"David A. Kopriva, Florida State University, USA\nAndrew Winters, Linköping University, Sweden","category":"page"},{"location":"authors/#Contributors","page":"Authors","title":"Contributors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"The following people contributed major additions or modifications to HOHQMesh and are listed in alphabetical order:","category":"page"},{"location":"authors/","page":"Authors","title":"Authors","text":"David Kopriva\nHendrik Ranocha\nMichael Schlottke-Lakemper\nAndrew Winters","category":"page"},{"location":"reference/#HOHQMesh.jl-API","page":"Reference","title":"HOHQMesh.jl API","text":"","category":"section"},{"location":"reference/","page":"Reference","title":"Reference","text":"CurrentModule = HOHQMesh","category":"page"},{"location":"reference/","page":"Reference","title":"Reference","text":"Modules = [HOHQMesh]","category":"page"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary named boundaryName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, obj::Dict{String,Any})\n\nAdd a curve to the outer boundary or a refinement reion to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, Array{Float64, N} where N, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})\n\nAdd the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version\n\naddBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nis a lot easier to use.\n\nTODO: Change HOHQMesh and delete this way to specify the domain and use the bounding box one instead.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nAdd the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid(proj::Project, bgSize::Array{Float64})\n\nAdd the background grid block with the grid size to be a 3-vector. Use this when there is an outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, dict::Dict{String,Any})\n\nUsed only for undo/redo.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToInnerBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.addCurveToInnerBoundary!","text":"addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary with name boundaryName. If an inner boundary of that name does not exist, one is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addCurveToOuterBoundary!","text":"addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})\n\nAdd a curve to the outer boundary. The curves must be added in order counter-clockwise\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addInnerBoundaryWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.addInnerBoundaryWithName!","text":"addInnerBoundaryWithName!(proj::Project,name::String)\n\nCreate a new empty inner boundary with the given name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addObserver-Tuple{Any, String, Any}","page":"Reference","title":"HOHQMesh.addObserver","text":"addObserver(observer::Any, note::String, fnction::Any)\n\nfnction is the function to be executed (called) when a notification of name note is given.\n\nThe function called upon notification must have the signature fnction(observer, sender, args...)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addOuterBoundary!","text":"addOuterBoundary!(proj::Project, outerBoundary::Dict{String,Any})\n\nAdd an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegion!","text":"addRefinementRegion!(proj::Project,r::Dict{String,Any})\n\nAdd the refinement region to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegionPoints!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegionPoints!","text":"addRefinementRegionPoints!(proj::Project, r::Dict{String,Any})\n\nCompute and add to the project the plotting points for the refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRunParameters!","page":"Reference","title":"HOHQMesh.addRunParameters!","text":"addRunParameters!(proj::Project,\n plotFormat::String = \"skeleton\",\n meshFileFormat::String = \"ISM-V2\",\n polynomialOrder::Int = 5)\n\nAdd a RUN_PARAMETERS block and set all the parameters in one call.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.addSpringSmoother!","page":"Reference","title":"HOHQMesh.addSpringSmoother!","text":"addSpringSmoother!(status::String, type::String, nIterations::Int)\n\nStatus is either ON or OFF Type is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.bboxUnion-Tuple{Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.bboxUnion","text":"bboxUnion(box1::Array{Float64}, box2::Array{Float64})\n\nReturns the union of two bounding boxes\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.curveBounds-Tuple{Matrix{Float64}}","page":"Reference","title":"HOHQMesh.curveBounds","text":"curveBounds(crvPoints::Array{Float64,2})\n\nFind the bounds of a single curve, discretized as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.emptyBounds-Tuple{}","page":"Reference","title":"HOHQMesh.emptyBounds","text":"emptyBounds()\n\nReturns an array that will always be ignored when unioned with another bounding box.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.examples_dir-Tuple{}","page":"Reference","title":"HOHQMesh.examples_dir","text":"examples_dir()\n\nReturn the path to the directory with some example mesh setups.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.extract_mesh_file_format-Tuple{Any}","page":"Reference","title":"HOHQMesh.extract_mesh_file_format","text":"extract_mesh_file_format(control_file)\n\nReturn a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{Any}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(control_file;\n output_directory=\"out\",\n mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing,\n verbose=false)\n\nGenerate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.\n\nYou can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.\n\nYou can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(proj::Project)\n\nGenerate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.\n\nThis function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getAllRefinementRegions-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getAllRefinementRegions","text":"getAllRefinementRegions(proj::Project)\n\nGet the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcCenter","text":"getArcCenter(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the center of a circular arc as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcEndAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcEndAngle","text":"getArcEndAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcRadius-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcRadius","text":"getArcRadius(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcStartAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcStartAngle","text":"getArcStartAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcUnits-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcUnits","text":"getArcUnits(crv::Dict{String,Any}, units::String)\n\nGet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridLowerLeft-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridLowerLeft","text":"getBackgroundGridLowerLeft(proj::Project)\n\nReturns the [x,y] of the lower left point of the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSize-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSize","text":"getBackgroundGridSize(proj::Project)\n\nReturns the background grid size array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSteps-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSteps","text":"getBackgroundGridSteps(proj::Project)\n\nReturns the [Nx,Ny,Nz] for the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String, boundaryName::String)\n\nGet the curve named curveName from the inner boundary named boundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String)\n\nGet the curve with name curveName from the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveName","text":"getCurveName(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveType","text":"getCurveType(crv::Dic{String,Any})\n\nGet the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,\n`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getEndPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getEndPoint","text":"getEndPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the end point for a line curve as an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundary-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundary","text":"getInnerBoundary(proj::Project, name::String)\n\nGet the chain of curves from the inner boundary with name name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryChainWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryChainWithName","text":"getInnerBoundaryWithName(proj::Project, name::String)\n\nGet the inner boundary CHAIN with the given name. If one does not exist, it is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryCurve","text":"\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getMeshFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getMeshFileFormat","text":"getMeshFileFormat(proj::Project)\n\nReturns the format in which the mesh will be written.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getName-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getName","text":"getName(proj::Project)\n\nReturns the filename to be used by the mesh, plot, control, and stats files.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryChainList-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getOuterBoundaryChainList","text":"getOuterBoundaryChainList(proj::Project)\n\nGet the array of outer boundary curves.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryCurveWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getOuterBoundaryCurveWithName","text":"getOuterBoundaryCurveWithName(proj::Project, name::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPlotFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPlotFileFormat","text":"getPlotFileFormat(proj::Project)\n\nReturns the plot file format.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPolynomialOrder-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPolynomialOrder","text":"getPolynomialOrder(proj::Project)\n\nReturns the polynomial order for boundary curves in the mesh file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementEnd-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementEnd","text":"getRefinementEnd(r::Dict{String,Any})\n\nReturn Array{Float64} of the end location of the refinement line\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementGridSize-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementGridSize","text":"getRefinementGridSize(r::Dict{String,Any})\n\nReturns the grid size,h, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementLocation-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementLocation","text":"getRefinementLocation(r::Dict{String,Any})\n\nReturn Array{Float64} of the location of the refinement center.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementName","text":"getRefinementName(r::Dict{String,Any})\n\nReturn name of the refinement. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"getRefinementRegion(proj::Project, indx)\n\nGet the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"(i,r) = getRefinementRegion(project, name)\n\nGet the refinement region with the given name and its location in the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegionCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementRegionCenter","text":"getRefinementRegionCenter(r::Dict{String,Any})\n\nGet, or compute, the center of the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementStart-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementStart","text":"getRefinementStart (r::Dict{String,Any})\n\nReturn Array{Float64} of the start location of the refinement line. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementType","text":"getRefinementType(r::Dict{String,Any})\n\nReturn the type of refinement, either \"smooth\" or \"sharp\". r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementWidth-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementWidth","text":"getRefinementWidth(r::Dict{String,Any})\n\nReturns the region width,w, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingIterations-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingIterations","text":"getSmoothingIterations(proj::Project)\n\nGet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingStatus-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingStatus","text":"smoothingStatus(proj::Project)\n\nReturns whether the smoother will be \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingType-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingType","text":"getSmoothingType(proj::Project)\n\nReturns either \"LinearSpring\" or \"LinearAndCrossbarSpring\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplineNKnots-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplineNKnots","text":"getSplineNKnots(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplinePoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplinePoints","text":"getSplinePoints(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getStartPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getStartPoint","text":"getStartPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the start point for a line curve as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getXEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getXEqn","text":"getXEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getYEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getYEqn","text":"getYEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getZEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getZEqn","text":"getZEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.hasBackgroundGrid-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.hasBackgroundGrid","text":"hasBackgroundGrid(proj::Project)\n\nTests to see if the project has a backgroundGrid dictionary defined.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.innerBoundaryIndices-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.innerBoundaryIndices","text":"innerBoundaryIndices(proj::Project, curveName::String)\n\nReturns (curveIndex,chainIndex) for the location of the curve named curveName in it's inner boundary chain.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryAtIndex!-Tuple{HOHQMesh.Project, String, Int64, Dict{String, Any}, Vector{Any}, Vector{String}}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryAtIndex!","text":"insertInnerBoundaryAtIndex!(proj::Project, chainName::String, indx::Int, chain::??)\n\nInsert an entire inner boundary. Primarily meant for undo operation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64, String}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryCurveAtIndex!","text":"insertInnerBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any},\n indx::Int, boundaryName::String)\n\nInsert a curve crv into an inner boundary chain boundaryName at the specified index indx.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertOuterBoundaryCurveAtIndex!","text":"insertOuterBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any}, indx::Int)\n\nInsert a curve into the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertRefinementRegion!","text":"insertRefinementRegion!(proj::Project, r::Dict{String,Any}, indx::Int)\n\nUsed by undo()\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelChainIsOK-Tuple{Vector{Dict{String, Any}}, String}","page":"Reference","title":"HOHQMesh.modelChainIsOK","text":"modelChainIsOK(chain::Vector{Dict{String, Any}}, chainName::String)\n\nReturns true if the chain of curves is contiguous and closed; false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelCurvesAreOK-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.modelCurvesAreOK","text":"modelCurvesAreOK(proj::Project)\n\nGo through all curves in the model and make sure they are connected and closed. Also, remove any empty outer / inner boundary chains.\n\nReturns true if all curves are connected and closed, false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreate a new parametric equation curve.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-2","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)\n\nCreate a new circular arc.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-Tuple{String, Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})\n\nCreate a new line defined by its end points.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, nKnots::Int, data::Matrix{Float64})\n\nCreate a spline curve from an array of knots\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, String}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, dataFile::String)\n\nCreate a spline curve from the contents of a data file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newCircularArcCurve","page":"Reference","title":"HOHQMesh.newCircularArcCurve","text":"newCircularArcCurve(name::String, center::Array{Float64},\n startAngle::Float64, endAngle::Float64,\n units::String)\n\nCreates and returns a new circular arc curve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newEndPointsLineCurve-Tuple{String, Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.newEndPointsLineCurve","text":"newEndPointsLineCurve(name::String, xStart::Array{Float64},xEnd::Array[Float64])\n\nCreates and returns a new curve defined by its end points in the form of a Dictionary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newParametricEquationCurve","page":"Reference","title":"HOHQMesh.newParametricEquationCurve","text":"newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreates and returns a new parametricEquationCurve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newProject","text":"newProject(name::String, folder::String)\n\nCreate a new project with the given name. That name will be used for the mesh and plot files in the specified folder.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementCenter-Tuple{String, String, Array{Float64, N} where N, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementCenter","text":"newRefinementCenter(name, type,\n center, meshSize,\n width)\n\nCreate refinement center of type \"smooth\" or \"sharp\" centered at center = [x,y,z]with a mesh sizemeshSizespread over a radiuswidth`.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementLine-Tuple{String, String, Array{Float64, N} where N, Array{Float64, N} where N, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementLine","text":"newRefinementLine(name, type,\n start, end,\n meshSize,\n width)\n\nCreate refinement line of type \"smooth\" or \"sharp\" between start = [x,y,z] and end = [x,y,z] with a mesh size meshSize spread over a width width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, nKnots::Int, data::Array{Float64,4})\n\nReturns a spline curve given the number of knots and the array of knots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, dataFile::String)\n\nReturns a spline curve given a data file that contains the number of knots on the first line, and the spline data following that.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.openProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.openProject","text":"openProject(fileName::String, folder::String)\n\nOpen existing project described in the control File.\n\nfolder = folder the control file is in\nfileName = the name of the file\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.postNotificationWithName-Tuple{Any, String, Tuple}","page":"Reference","title":"HOHQMesh.postNotificationWithName","text":"postNotificationWithName(sender::Any, name::String, userInfo::Tuple)\n\nExecutes the function associated with the observer for the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.refinementRegionPoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.refinementRegionPoints","text":"refinementRegionPoints(r::Dict{String,Any})\n\nReturns Array{Float64,2} being the plotting points of a refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String, innerBoundaryName::String)\n\nDelete the curve named curveName from the inner boundary named innerBoundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String)\n\nDelete the curve named curveName from the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeBackgroundGrid!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeBackgroundGrid!","text":"removeBackgroundGrid!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundary!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundary!","text":"removeInnerBoundary!(proj::Project, chainName::String)\n\nRemove an entire inner boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurve!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurve!","text":"removeInnerBoundaryCurve!(proj::Project, name::String, chainName::String)\n\nRemove the curve with name from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurveAtIndex!","text":"removeInnerBoundaryCurveAtIndex!(proj::Project, indx::Int, chainName::String)\n\nRemove the curve at index indx from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundary!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeOuterBoundary!","text":"removeOuterBoundary!(proj::Project)\n\nRemove the outer boundary curve if it exists.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveAtIndex!","text":"removeOuterBoundaryCurveAtIndex!(proj::Project, indx::Int)\n\nRemove a curve from the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveWithName!","text":"removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n\nRemove the named curve in the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRefinementRegion!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeRefinementRegion!","text":"removeRefinementRegion!(proj::Project, name::String)\n\nDelete the named refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRunParameters!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeRunParameters!","text":"removeRunParameters!(proj::Project)\n\nRemove the run parameters block from the project. This is not undo-able.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeSpringSmoother!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeSpringSmoother!","text":"removeSpringSmoother!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove_mesh!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.remove_mesh!","text":"remove_mesh!(proj::Project)\n\nRemove the mesh file from proj.projectDirectory and delete the mesh from the plot\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.saveProject-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.saveProject","text":"saveProject(proj::Project)\n\nproj = Project to be saved\n\nSave a project dictionary to the file path specified when the project was created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcCenter!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setArcCenter!","text":"setArcCenter!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the center of a circular arc.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcEndAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcEndAngle!","text":"setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcRadius!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcRadius!","text":"setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcStartAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcStartAngle!","text":"setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcUnits!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setArcUnits!","text":"setArcUnits(crv::Dict{String,Any}, units::String)\n\nSet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridLowerLeft!-Tuple{HOHQMesh.Project, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setBackgroundGridLowerLeft!","text":"setBackgroundGridLowerLeft!(proj::Project, x0::Array{Float64})\n\nSet the lower left location of the background grid for problems that have no outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSpacing!(proj::Project, dx::Float64, dy::Float64, dz::Float64 = 0.0)\n\nUser facing function\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Array{Float64}, key::String)\n\nSet the grid size dx of an existing background grid withing proj. Here, dx is passed an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Float64, Float64, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Float64, dy::Float64, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, the new grid size in either direction is passed individually with dxand dy.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSteps!-Tuple{HOHQMesh.Project, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.setBackgroundGridSteps!","text":"setBackgroundGridSteps!(proj::Project, N::Array{Int})\n\nSet how many steps of size setBackgroundGridSpacing in each direction the background grid extends from the lower left.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setCurveName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setCurveName!","text":"setCurveName!(curveDict, name)\n\nSet the name of the curve represented by curveDict.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setEndPoint!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setEndPoint!","text":"setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the end point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setMeshFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setMeshFileFormat!","text":"setMeshFileFormat(proj::Project, meshFileFormat::String)\n\nSet the file format for the mesh file. Acceptable choices are \"ISM\", \"ISM-V2\", or \"ABAQUS\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setName!","text":"setName(proj::Project,name::String)\n\nThe name of the project is the filename to be used by the mesh, plot, and stats files. It is also the name of the control file the tool will produce.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPlotFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setPlotFileFormat!","text":"setPlotFileFormat(proj::Project, plotFileFormat::String)\n\nSet the file format for the plot file. Acceptable choices are \"sem\", which includes interior nodes and boundary nodes and \"skeleton\", which includes only the corner nodes.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPolynomialOrder!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setPolynomialOrder!","text":"setPolynomialOrder(proj::Project, p::Int)\n\nSet the polynomial order for boundary curves in the mesh file to p.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementEnd!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementEnd!","text":"setRefinementEnd!(refinementRegion, location)\n\nSet the end point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementGridSize!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementGridSize!","text":"setRefinementGridSize!(r::Dict{String,Any}, h)\n\nSet the grid size, h for the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementLocation!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementLocation!","text":"setRefinementLocation!(refinementCenter, location)\n\nSet the location of a refinement center to location = [x,y,z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementName!","text":"setRefinementName!(r::Dict{String,Any}, type)\n\nSet a name for the refinement region.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementStart!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementStart!","text":"setRefinementStart!(refinementRegion, location)\n\nSet the start point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementType!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementType!","text":"setRefinementType!(refinementRegion, type)\n\nSet the type, either \"smooth\" or \"sharp\" for the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementWidth!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementWidth!","text":"setRefinementWidth!(r::Dict{String,Any}, width)\n\nSet the width of the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingIterations!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setSmoothingIterations!","text":"setSmoothingIterations!(proj::Project, iterations::Int)\n\nSet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingStatus!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingStatus!","text":"setSmoothingStatus(proj:Project, status::String)\n\nStatus is either \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingType!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingType!","text":"setSmoothingType!(proj:Project, status::String)\n\nType is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplineNKnots!-Tuple{Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.setSplineNKnots!","text":"setSplineNKnots!(spline::Dict{String,Any}, nKnots::Int)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplinePoints!-Tuple{Dict{String, Any}, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.setSplinePoints!","text":"setSplinePoints!(spline::Dict{String,Any},points::Array{Float64,4})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setStartPoint!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setStartPoint!","text":"setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the start point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setXEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setXEqn!","text":"setXEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the x-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setYEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setYEqn!","text":"setYEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the y-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setZEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setZEqn!","text":"setZEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the zEqn-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.unRegisterForNotification-Tuple{Any, String}","page":"Reference","title":"HOHQMesh.unRegisterForNotification","text":"unRegisterForNotification(observer::Any, note::String)\n\nRemove the observer from being notified by the notification note\n\n\n\n\n\n","category":"method"},{"location":"tutorials/spline_curves/#Spline-curves","page":"Spline curves","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line \"curves\". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.","category":"page"},{"location":"tutorials/spline_curves/#Synopsis","page":"Spline curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/spline_curves/#Initialization","page":"Spline curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a new project with the name \"spline_curves\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_project = newProject(\"spline_curves\", \"out\")","category":"page"},{"location":"tutorials/spline_curves/#Add-the-outer-boundary","page":"Spline curves","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The outer boundary curve for this tutorial is a circle of radius r=4 centered at the point (0 -1). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"circ = newCircularArcCurve(\"outerCircle\", # curve name\n [0.0, -1.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circ is assigned to be \"outerCircle\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new circ curve is then added to the spline_project as an outer boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToOuterBoundary!(spline_project, circ)","category":"page"},{"location":"tutorials/spline_curves/#Add-a-background-grid","page":"Spline curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for spline_project to have elements with side length 06 in each direction","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addBackgroundGrid!(spline_project, [0.6, 0.6, 0.0])","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"plotProject!(spline_project, MODEL+GRID)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"outerCircle\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/spline_curves/#Add-the-inner-boundaries","page":"Spline curves","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The domain of this tutorial will contain three inner boundary curves:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Cubic spline curve created from data points read in from a file.\nCubic spline curve created from points directly given in the code.\nTriangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-with-data-from-a-file","page":"Spline curves","title":"Cubic spline with data from a file","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots t_j, x_j, y_j, z_j where j indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a parametric spline curve from a file with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline1 = newSplineCurve(\"big_spline\", joinpath(@__DIR__, \"examples\", \"test_spline_curve_data.txt\"))","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline1 is assigned to be \"big_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline1 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline1, \"inner1\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve \"big_spline\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: one_curve)","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-from-data-in-Julia","page":"Spline curves","title":"Cubic spline from data in Julia","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Below, we construct another parametric spline using this strategy that consists of five data points","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n\nspline2 = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline2 is assigned to be \"small_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline2 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline2, \"inner2\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner2\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve \"small_spline\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: two_curves)","category":"page"},{"location":"tutorials/spline_curves/#Triangular-shape","page":"Spline curves","title":"Triangular shape","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"edge1 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.3, -1.0, 0.0], # start point\n [-1.7, -1.0, 0.0]) # end point\n\nedge2 = newEndPointsLineCurve(\"triangle\", # curve name\n [-1.7, -1.0, 0.0], # start point\n [-2.0, -0.4, 0.0]) # end point\n\nedge3 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.0, -0.4, 0.0], # start point\n [-2.3, -1.0, 0.0]) # end point","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, each edge of the curve is given the same name \"triangle\" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, edge1, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge2, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge3, \"inner3\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The inner boundary chain name \"inner3\" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called \"triangle\" labeled in the figure by 3.1, 3.2, and 3.3.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: three_curves)","category":"page"},{"location":"tutorials/spline_curves/#Generate-the-mesh","page":"Spline curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_curves.control: A HOHQMesh control file for the current project.\nspline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nspline_curves.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"generate_mesh(spline_project)\n 1 chevron elements removed from mesh.\n 1 chevron elements removed from mesh.\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.29613000000000000\n Number of nodes = 1177\n Number of Edges = 2225\n Number of Elements = 1047\n Number of Subdivisions = 4\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00006214 0.15607014 0.04505181 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00008989 2.78073390 1.23192911 1.00000000 999.99900000 1.00000000\n Condition 1.00000055 3.81350981 1.15526066 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00014319 6.76310951 1.46264239 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001495 0.10424741 0.03955903 0.00000000 999.99900000 1.00000000\n Minimum Angle 37.25504203 89.96195708 74.41060580 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.03105286 157.27881545 107.90994073 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of \"bad\" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: final_spline)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the \"big_spline\" curve. We decide that we are satisfied with the overall mesh quality.","category":"page"},{"location":"tutorials/spline_curves/#Summary","page":"Spline curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#Tutorials","page":"Overview","title":"Tutorials for HOHQMesh.jl","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"The tutorial section for HOHQMesh.jl provides step-by-step commands and accompanying explanations for the major features of the interactive mesh generation tools.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.","category":"page"},{"location":"tutorials/introduction/#[Straight-sided-outer-boundary](@ref)","page":"Overview","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.","category":"page"},{"location":"tutorials/introduction/#Synopsis","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/introduction/#[Curved-outer-boundary](@ref)","page":"Overview","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.","category":"page"},{"location":"tutorials/introduction/#Synopsis-2","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/introduction/#[Spline-curves](@ref)","page":"Overview","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/introduction/#Synopsis-3","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#[Creating-and-editing-curves](@ref)","page":"Overview","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve \"chain\" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.","category":"page"},{"location":"tutorials/introduction/#Synopsis-4","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"guided-tour/#Guided-tour","page":"Guided tour","title":"Guided tour","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In this brief overview, we highlight two scripts from the examples folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"See the HOHQMesh documentation for more details about its terminology and capabilities.","category":"page"},{"location":"guided-tour/#Mesh-from-a-control-file","page":"Guided tour","title":"Mesh from a control file","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_from_control_file.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"This command will create mesh and plot files in the out directory.","category":"page"},{"location":"guided-tour/#Build-a-mesh-from-scratch","page":"Guided tour","title":"Build a mesh from scratch","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_boundary.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For completeness, we provide the example script and walk-through each step in the construction of the Project below.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"using HOHQMesh\n\n# Create a new project with the name \"IceCreamCone\", which will also be the\n# name of the mesh, plot and stats files, written to output folder `out`.\n\np = newProject(\"IceCreamCone\", \"out\")\n\n# Outer boundary for this example mesh is a complete circle. Add it into the project.\n\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\n\n# Inner boundary is three curves. Two straight lines and a circular arc.\n# Note the three curve are connected to ensure a counter-clockwise orientation\n# as required by HOHQMesh\n\n# Create the three interior curves. The individual names of each curve in the inner\n# chain are used internally by HOHQMesh and are output as the given boundary names in\n# the mesh file.\n\ncone1 = newEndPointsLineCurve(\"cone1\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\niceCream = newCircularArcCurve(\"iceCream\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")\ncone2 = newEndPointsLineCurve(\"cone2\", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])\n\n# Assemble the three curve in a closed chain oriented counter-clockwise. The chain\n# name `IceCreamCone` is only used internally by HOHQMesh.\n\naddCurveToInnerBoundary!(p, cone1, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, iceCream, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, cone2, \"IceCreamCone\")\n\n# Adjust some `RunParameters` and overwrite the defaults values. In this case, we\n# set a new value for the boundary order polynomial representation and adjust the\n# output mesh file format to be `sem`\n\nsetPolynomialOrder!(p, 4)\nsetPlotFileFormat!(p, \"sem\")\n\n# A background grid is required for the mesh generation. In this example we lay a\n# background grid of Cartesian boxes with size 0.5.\n\naddBackgroundGrid!(p, [0.5, 0.5, 0.0])\n\n# Plot the project model curves and background grid\n\nif isdefined(Main, :Makie)\n plotProject!(p, MODEL+GRID)\n @info \"Press enter to generate the mesh and update the plot.\"\n readline()\n else # Throw an informational message about plotting to the user\n @info \"To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again.\"\n end\n\n# Generate the mesh. This produces the mesh and TecPlot files `AllFeatures.mesh` and `AllFeatures.tec`\n# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is\n# updated with the mesh that was generated.\n\ngenerate_mesh(p)\n\n# After the mesh successfully generates mesh statistics, such as the number of corner nodes,\n# the number of elements etc., are printed to the REPL","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The first line creates a new project, where the mesh and plot file names will be derived from the project name, \"IceCreamCone\" written to the specified folder.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, \"IceCreamCone\" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script sets the polynomial order (default = 5) and the plot file format (default = \"skeleton\").","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, so only the mesh size needs to be specified using","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"addBackgroundGrid!(proj::Project, bgSize::Array{Float64})","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The example sets the background mesh size to be 0.1 in the x and y directions. The z component is ignored.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The script finishes by generating the quad mesh and plotting the results, as shown below","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"(Image: iceCreamCone)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Finally, the script returns the project so that it can be edited further, if desired.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To save a control file for HOHQMesh, simply invoke","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"saveProject(proj::Project, outFile::String)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"where outFile is the name of the control file (traditionally with a .control extension). saveProject is automatically called when a mesh is generated.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.","category":"page"},{"location":"license/#License","page":"License","title":"License","text":"","category":"section"},{"location":"license/","page":"License","title":"License","text":"MIT LicenseCopyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-LakemperPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"CheatSheet/#Commands-Cheat-Sheet","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples folder constructs an identical example mesh as shown in the Guided tour using generic function calls.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"A thorough description of the functions can be found in the API section.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The general workflow of the interactive mesh functionality within a REPL session is","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Create a project\nAdd boundary curves\nAdd a background grid\nAdd manual refinement (if desired)\nGenerate mesh","category":"page"},{"location":"CheatSheet/#Project","page":"Commands Cheat Sheet","title":"Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" p = newProject(, )","category":"page"},{"location":"CheatSheet/#cs-plotting","page":"Commands Cheat Sheet","title":"Plotting","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" plotProject!(p, options)\n updatePlot!(p, options)","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The options are any sum of MODEL, GRID, REFINEMENTS, and MESH.","category":"page"},{"location":"CheatSheet/#Curves","page":"Commands Cheat Sheet","title":"Curves","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" c = new(name, startLocation [x,y,z],endLocation [x,y,z]) *Straight Line*\n c = new(name,center [x,y,z],radius, startAngle, endAngle) *Circular Arc*\n c = new(name, xEqn, yEqn, zEqn) *Parametric equation*\n c = new(name, dataFile) *Spline with data from a file*\n c = new(name, nKnots, knotsMatrix) *Spline with given knot values*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#cs-manual-refinement","page":"Commands Cheat Sheet","title":"Manual Refinement","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" r = newRefinementCenter(name, center, gridSize, radius)\n r = newRefinementLine(name, type, startPoint, endPoint, gridSize, width)","category":"page"},{"location":"CheatSheet/#Adding-to-a-Project","page":"Commands Cheat Sheet","title":"Adding to a Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" add!(p, c) *Add outer boundary curve*\n add!(p, c, ) *Add curve to an inner boundary*\n add!(p, r) *Add refinement region*\n\n addBackgroundGrid!(p, [top, left, bottom, right], [nX, nY, nZ]) *No outer boundary*\n addBackgroundGrid!(p, [dx, dy, dz]) *If an outer boundary is present*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function add!, which is a shortcut to the full functions, e.g. addOuterBoundaryCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#Accessing-items","page":"Commands Cheat Sheet","title":"Accessing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" crv = getCurve(p, curveName) *Get a curve in the outer boundary*\n crv = getCurve(p, curveName, boundaryName) *Get a curve in an inner boundary*\n indx, chain = getChain(p, boundaryName) *Get a complete inner boundary curve*\n r = getRefinementRegion(p, name)","category":"page"},{"location":"CheatSheet/#Removing-from-Project","page":"Commands Cheat Sheet","title":"Removing from Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" removeOuterboundary!(p) *Entire outer boundary curve*\n removeInnerBoundary!(p, innerBoundaryName) *Entire inner boundary curve*\n remove!(p, name) *Curve in outer boundary*\n remove!(p, name, innerBoundaryName) *Curve in inner boundary*\n removeRefinementRegion!(p, name)","category":"page"},{"location":"CheatSheet/#Editing-items","page":"Commands Cheat Sheet","title":"Editing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.","category":"page"},{"location":"CheatSheet/#Meshing","page":"Commands Cheat Sheet","title":"Meshing","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" generate_mesh(p)\n remove_mesh!(p)","category":"page"},{"location":"#HOHQMesh.jl","page":"Home","title":"HOHQMesh.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6 and above.","category":"page"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> import Pkg; Pkg.add(\"HOHQMesh\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the Julia REPL, you can load HOHQMesh with","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using HOHQMesh","category":"page"},{"location":"","page":"Home","title":"Home","text":"and then happily generate away!","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> control_file = joinpath(HOHQMesh.examples_dir(), \"GingerbreadMan.control\")\n\njulia> output = generate_mesh(control_file)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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,","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: gingerbreadman_with_edges_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"while the 3D file Snake.control produces this mesh:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: snake_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.,","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_box_two_circles.jl\"))","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using Pkg; Pkg.add(\"GLMakie\")\njulia> using GLMakie","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: box_two_circles)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Further explanation of the interactive functionality can be found here. Additional examples are available in the Tutorials.","category":"page"},{"location":"#authors-index-md","page":"Home","title":"Authors","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#License-and-contributing","page":"Home","title":"License and contributing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Acknowledgements","page":"Home","title":"Acknowledgements","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"}]
+}
diff --git a/v0.2.0/siteinfo.js b/v0.2.0/siteinfo.js
new file mode 100644
index 00000000..057c824f
--- /dev/null
+++ b/v0.2.0/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.2.0";
diff --git a/v0.2.0/testing/index.html b/v0.2.0/testing/index.html
new file mode 100644
index 00000000..713086f6
--- /dev/null
+++ b/v0.2.0/testing/index.html
@@ -0,0 +1,3 @@
+
+Testing · HOHQMesh.jl
During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In Trixi and its related repositories, tests are triggered by
each git push to main and
each git push to any pull request.
Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.
Test and coverage requirements
Before merging a pull request (PR) to main, we require that
The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing
julia> using Pkg; Pkg.test("HOHQMesh")
in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,
julia> # Run all test for the interactive Curve API
+ include(joinpath("test", "test_curve.jl"))
We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.
Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.
When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).
Test duration
As a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).
In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered "covered" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The "Details" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.
Coverage requirements
In general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.
Settings
This document was generated with Documenter.jl version 0.27.19 on Friday 24 June 2022. Using Julia version 1.6.6.
diff --git a/v0.2.0/tutorials/create_edit_curves/index.html b/v0.2.0/tutorials/create_edit_curves/index.html
new file mode 100644
index 00000000..d71104d7
--- /dev/null
+++ b/v0.2.0/tutorials/create_edit_curves/index.html
@@ -0,0 +1,166 @@
+
+Creating and editing curves · HOHQMesh.jl
The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a "chain" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "sandbox" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.
We first create the outer boundary curve chain that is composed of three pieces
Straight line segment from $(0, -7)$ to $(5, 3)$.
Half-circle arc of radius $r=5$ centered at $(0, 3)$.
Straight line segment from $(-5, 3)$ to $(0, -7)$.
Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
outer_line1 = newEndPointsLineCurve("Line1", # curve name
+ [0.0, -7.0, 0.0], # start point
+ [5.0, 3.0, 0.0]) # end point
+
+outer_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-5.0, 3.0, 0.0], # start point
+ [0.0, -7.0, 0.0]) # end point
To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from $0$ to $180$ degrees.
outer_arc = newCircularArcCurve("Arc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 5.0, # radius
+ 0.0, # start angle
+ 180.0, # end angle
+ "degrees") # units for angle
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be "Arc".
The curve names "Line1", "Line2", and "Arc" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.
The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction
We visualize the outer boundary curve chain and background grid with the following
plotProject!(sandbox_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains three curve segments "Line1", "Arc", and "Line2" labeled in the figure by O.1, O.2, and O.3, respectively.
Suppose that the domain boundary requires a curved segment instead of the straight line "Line2". We will replace this line segment in the outer boundary chain with a cubic spline.
First, we remove the "Line2" curve from the "Outer" chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
The plot automatically updates and we see that the outer boundary is open and contains two segments: "Line1" and "Arc".
Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve "Arc" and end at the first point of the curve "Line1". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. The spline curve constructor newSplineCurve also takes the number of points as an input argument.
We create a pill shaped inner boundary curve chain composed of four pieces
Straight line segment from $(1, 5)$ to $(1, 3)$.
Half-circle arc of radius $r=1$ centered at $(0, 3)$.
Straight line segment from $(-1, 3)$ to $(-1, 5)$.
Half-circle arc of radius $r=1$ centered at $(0, 5)$.
Similar to the construction of the "Outer" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
inner_line1 = newEndPointsLineCurve("Line1", # curve name
+ [1.0, 5.0, 0.0], # start point
+ [1.0, 3.0, 0.0]) # end point
+
+inner_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-1.0, 3.0, 0.0], # start point
+ [-1.0, 5.0, 0.0]) # end point
To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at $(0, 3)$ varies from $0$ to $-180$ degrees. The top half-circle arc centered at $(0, 5)$ has an angle that varies from $180$ to $0$ degrees. The construction of the two circle arcs are
inner_bottom_arc = newCircularArcCurve("BottomArc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 1.0, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+
+inner_top_arc = newCircularArcCurve("TopArc", # curve name
+ [0.0, 5.0, 0.0], # center
+ 1.0, # radius
+ 180.0, # start angle
+ 0.0, # end angle
+ "degrees") # units for angle
Note, we use "radians" to set the angle bounds for inner_bottom_arc and "degrees" for the angle bounds of inner_top_arc.
The curve names "Line1", "Line2", "BottomArc", and "TopArc" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.
The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.
This inner boundary chain name "inner" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments "Line1", "BottomArc", "Line2", and "TopArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:
sandbox.control: A HOHQMesh control file for the current project.
sandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
sandbox.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 8.7928000000000006E-002
+ Number of nodes = 513
+ Number of Edges = 933
+ Number of Elements = 422
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00003020 1.17336756 0.18813064 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00984888 2.32321419 1.31488869 1.00000000 999.99900000 1.00000000
+ Condition 1.00041121 2.42894151 1.21101797 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.01674110 3.74861238 1.59495734 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001734 1.13821390 0.14136293 0.00000000 999.99900000 1.00000000
+ Minimum Angle 32.20087774 89.35157729 68.75755243 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.60787193 152.53515465 113.36966060 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.
Additionally, the remove_mesh! command deletes the mesh information from the sandbox_project and sandbox.mesh from the out folder. However, the sandbox.control and sandbox.tec files are still present in out directory.
Suppose that the inner boundary actually requires a curved segment instead of the straight line "Line1". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.
We remove the "Line1" curve from the inner chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: "BottomArc", "Line2", and "TopArc". Note that the index of the remaining curves has changed as shown below.
Brief note about undo / redo
The interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.
undoActionName()
+"Remove Inner Boundary Curve"
We can undo the removal of the "Line1" curve with undo
undo()
+"Undo Remove Inner Boundary Curve"
In addition to reinstating "Line1" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.
Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.
The new inner curve segment will be an oscillating line given by the parametric equations
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above
We see from the figure that this parametric equation curve starts at the point $(1,5)$ and, therefore, matches the end point of the existing curve "TopArc" present in the "inner" chain. However, the parametric equation curve ends at the point $(2,3)$ which does not match the "BottomArc" curve. So, the inner boundary chain remains open.
Attempt to generate a mesh with an open curve chain
An open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.
To create a closed boundary curve we must remove the "BottomArc" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point $(2, 3)$ and end at the point $(-1, 3)$ to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the "BottomArc" from the "inner" chain.
The figure updates to display the "inner" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.
A half-circle arc that joins the points $(2, 3)$ and $(-1, 3)$ has a radius $r=1.5$, is centered at $(0.5, 3)$ and has an angle that vaires from $0$ to $-180$. We construct this circle arc and directly add it to the sandbox_project.
new_bottom_arc = newCircularArcCurve("wideBottomArc", # curve name
+ [0.5, 3.0, 0.0], # center
+ 1.5, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
The updated plot now gives the modified, closed inner curve chain that now contains four curve segments "Line2", "TopArc", "wiggleLine", and "wideBottomArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.13299600000000000
+ Number of nodes = 714
+ Number of Edges = 1308
+ Number of Elements = 596
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00003020 1.15662678 0.12823840 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.01082600 3.14765817 1.34292128 1.00000000 999.99900000 1.00000000
+ Condition 1.00037252 2.59936116 1.22903490 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.02724726 3.74861238 1.64807401 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001734 1.13150266 0.09438571 0.00000000 999.99900000 1.00000000
+ Minimum Angle 31.88018513 89.33451932 67.86550651 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.43850948 157.31718198 114.36070355 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The visualization updates automatically and the background grid is removed after when the mesh is generated.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.
Add the background grid when an outer boundary curve is present.
Visualize an interactive mesh project.
Discuss undo / redo capabilities.
Construct and add parametric spline curves.
Construct and add a curve from parametric equations.
Construct and add straight line segments.
Construct and add circular arc segments.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with modified outer and inner curve chains
+#
+# Create inner / outer boundary chains composed of the four
+# available HOHQMesh curve types.
+#
+# Keywords: outer boundary, inner boundary, parametric equations,
+# circle arcs, cubic spline, curve removal
+using HOHQMesh
+
+# Instantiate the project
+sandbox_project = newProject("sandbox", "out")
+
+# Add the background grid
+addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])
+
+# Create and add the original outer boundary curves
+outer_line1 = newEndPointsLineCurve("Line1", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])
+outer_line2 = newEndPointsLineCurve("Line2", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])
+outer_arc = newCircularArcCurve("Arc", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, "degrees")
+
+addCurveToOuterBoundary!(sandbox_project, outer_line1)
+addCurveToOuterBoundary!(sandbox_project, outer_arc)
+addCurveToOuterBoundary!(sandbox_project, outer_line2)
+
+# Modify the outer boundary to have a spline instead of a straight line
+removeOuterBoundaryCurveWithName!(sandbox_project, "Line2")
+
+spline_data = [ [0.0 -5.0 3.0 0.0]
+ [0.25 -2.0 1.0 0.0]
+ [0.5 -4.0 0.5 0.0]
+ [0.75 -2.0 -3.0 0.0]
+ [1.0 0.0 -7.0 0.0] ]
+outer_spline = newSplineCurve("Spline", 5, spline_data)
+addCurveToOuterBoundary!(sandbox_project, outer_spline)
+
+# Create and add the inner boundary curves
+inner_line1 = newEndPointsLineCurve("Line1", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])
+inner_line2 = newEndPointsLineCurve("Line2", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])
+inner_bottom_arc = newCircularArcCurve("BottomArc", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, "radians")
+inner_top_arc = newCircularArcCurve("TopArc", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, "degrees")
+
+addCurveToInnerBoundary!(sandbox_project, inner_line1, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_line2, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_top_arc, "inner")
+
+# Generate a mesh
+generate_mesh(sandbox_project)
+
+# Delete the existing mesh before modifying the inner boundary curve chain
+remove_mesh!(sandbox_project)
+
+# Modify the inner boundary curve with an oscillatory line and a new circle arc
+removeInnerBoundaryCurve!(sandbox_project, "Line1", "inner")
+removeInnerBoundaryCurve!(sandbox_project, "BottomArc", "inner")
+
+xEqn = "x(t) = t + 1"
+yEqn = "y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)"
+zEqn = "z(t) = 0.0"
+inner_eqn = newParametricEquationCurve("wiggleLine", xEqn, yEqn, zEqn)
+
+new_bottom_arc = newCircularArcCurve("wideBottomArc", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, "radians")
+
+addCurveToInnerBoundary!(sandbox_project, inner_eqn, "inner")
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
+
+# Regenerate the final mesh
+generate_mesh(sandbox_project)
Settings
This document was generated with Documenter.jl version 0.27.19 on Friday 24 June 2022. Using Julia version 1.6.6.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.
The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "TheBlob" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
The following commands create a new curve for the parametric equations above
The name of this curve is assigned to be "Blob". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for blob_project to have elements with side length two in each direction
addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])
We next visualize the outer boundary curve and background grid with the following
plotProject!(blob_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "Blob" labeled in the figure by O.1.
From the visualization we see that the background grid is likely too coarse to produce a "good" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction
setBackgroundGridSize!(blob_project, 0.5, 0.5)
Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.
The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.
We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:
TheBlob.control: A HOHQMesh control file for the current project.
TheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
TheBlob.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.10612399999999998
+ Number of nodes = 481
+ Number of Edges = 895
+ Number of Elements = 417
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025346 0.36181966 0.11936327 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002883 2.58066393 1.26340310 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.11480166 1.18583253 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006177 4.80707901 1.51313656 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011326 0.28172540 0.10292251 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.30873612 89.99827738 73.08079323 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132792 156.87642432 109.37004979 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point $(-4, 0)$ is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with
Above we create a circular refinement region centered at the point $(-4, -0.5)$ with a desired resolution size $0.4$ and a radius of $1.0$. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.
With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.11373499999999999
+ Number of nodes = 505
+ Number of Edges = 940
+ Number of Elements = 438
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025346 0.36181966 0.11412658 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002884 2.47585614 1.26424390 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.11480166 1.18425870 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006177 4.80707901 1.51413601 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011326 0.28172540 0.09814547 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.30873612 89.99827901 72.79596483 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132782 156.87642433 109.63912468 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.
Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.
Define a curved outer boundary using parametric equations.
Add and adjust the background grid.
Visualize an interactive mesh project.
Add manual refinement to a local region of the domain.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with a curved outer boundary
+#
+# Create an outer boundary from a set of parametric equations.
+# Add manual refinement in a small region around the point (-4, -0.5).
+#
+# Keywords: outer boundary, parametric equations, refinement center
+using HOHQMesh
+
+# Instantiate the project
+blob_project = newProject("TheBlob", "out")
+
+# Create and add the outer boundary curve
+xEqn = "x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3"
+yEqn = "y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2"
+zEqn = "z(t) = 0.0"
+blob = newParametricEquationCurve("Blob", xEqn, yEqn, zEqn)
+addCurveToOuterBoundary!(blob_project, blob)
+
+# Add the background grid
+addBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])
+
+# Create and add the refinement region
+center = newRefinementCenter("region", "smooth", [-4.0, -0.5, 0.0], 0.4, 1.0)
+addRefinementRegion!(blob_project, center)
+
+# Generate the mesh
+generate_mesh(blob_project)
Settings
This document was generated with Documenter.jl version 0.27.19 on Friday 24 June 2022. Using Julia version 1.6.6.
For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.
For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.
This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.
This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.
This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line "curves".
This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve "chain" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line "curves". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "spline_curves" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.
The outer boundary curve for this tutorial is a circle of radius $r=4$ centered at the point $(0, -1)$. We define this circular curve with the function newCircularArcCurve as follows
circ = newCircularArcCurve("outerCircle", # curve name
+ [0.0, -1.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circ is assigned to be "outerCircle". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circ curve is then added to the spline_project as an outer boundary curve with
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for spline_project to have elements with side length $0.6$ in each direction
We next visualize the outer boundary curve and background grid with the following
plotProject!(spline_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "outerCircle" labeled in the figure by O.1.
A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots $t_j$, $x_j$, $y_j$, $z_j$ where $j$ indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder
We create a parametric spline curve from a file with
The name of the curve stored in the dictionary spline1 is assigned to be "big_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline1 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve "big_spline" labeled in the figure by 1.1.
Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.
Below, we construct another parametric spline using this strategy that consists of five data points
The name of the curve stored in the dictionary spline2 is assigned to be "small_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline2 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner2" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve "small_spline" labeled in the figure by 2.1.
Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with
edge1 = newEndPointsLineCurve("triangle", # curve name
+ [-2.3, -1.0, 0.0], # start point
+ [-1.7, -1.0, 0.0]) # end point
+
+edge2 = newEndPointsLineCurve("triangle", # curve name
+ [-1.7, -1.0, 0.0], # start point
+ [-2.0, -0.4, 0.0]) # end point
+
+edge3 = newEndPointsLineCurve("triangle", # curve name
+ [-2.0, -0.4, 0.0], # start point
+ [-2.3, -1.0, 0.0]) # end point
Here, each edge of the curve is given the same name "triangle" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.
The inner boundary chain name "inner3" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called "triangle" labeled in the figure by 3.1, 3.2, and 3.3.
With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:
spline_curves.control: A HOHQMesh control file for the current project.
spline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
spline_curves.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(spline_project)
+ 1 chevron elements removed from mesh.
+ 1 chevron elements removed from mesh.
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.29613000000000000
+ Number of nodes = 1177
+ Number of Edges = 2225
+ Number of Elements = 1047
+ Number of Subdivisions = 4
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00006214 0.15607014 0.04505181 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00008989 2.78073390 1.23192911 1.00000000 999.99900000 1.00000000
+ Condition 1.00000055 3.81350981 1.15526066 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00014319 6.76310951 1.46264239 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001495 0.10424741 0.03955903 0.00000000 999.99900000 1.00000000
+ Minimum Angle 37.25504203 89.96195708 74.41060580 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.03105286 157.27881545 107.90994073 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of "bad" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the "big_spline" curve. We decide that we are satisfied with the overall mesh quality.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "box_two_circles" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.
When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.
For the box_project we first query the current values for the polynomial order and the mesh output format
We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be $4$ and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.
The domain for this tutorial is a rectangular box with the bounds $[0,30]\times[0,15]$. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:
Set the lower left corner point of the domain $(x_0, y_0)$, define the element size in each spatial direction $\Delta x$ and $\Delta y$, and the number of steps taken in each direction $N_x, N_y$. The resulting background grid will have the extent $[x_0, x_0 + N_x \Delta x]$ by $[y_0, y_0 + N_y \Delta y]$. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands
Set the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box $[0,30]\times[0,15]$ we use
Next, we add the two circular inner boundary curves with different radii.
The first circle will have radius $r=2$ and be centered at the point $(4, 4)$. We define this circular curve with the function newCircularArcCurve as follows
circle1 = newCircularArcCurve("circle1", # curve name
+ [4.0, 4.0, 0.0], # circle center
+ 2.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be "circle1". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circle1 curve is then added to the box_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called "inner1" and it contains a single curve "circle1" labeled in the figure by 1.1.
With analogous steps we create another circular curve with radius $r=4$, centered at $(20, 9)$ and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.
circle2 = newCircularArcCurve("circle2", # curve name
+ [20.0, 9.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 2.0 * pi, # end angle
+ "radians") # angle units
+addCurveToInnerBoundary!(box_project, circle2, "inner2")
Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called "inner2" and it contains a single curve "circle2" labeled in the figure by 2.1.
With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:
box_two_circles.control: A HOHQMesh control file for the current project.
box_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
box_two_circles.inp: A mesh file with format ABAQUS that was set above.
To do this we execute the command
generate_mesh(box_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 3.5553999999999995E-002
+ Number of nodes = 498
+ Number of Edges = 921
+ Number of Elements = 422
+ Number of Subdivisions = 0
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.34513058 1.15383206 0.91833833 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00000004 1.71083844 1.08733476 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 1.46558793 1.04922640 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00000006 2.43503343 1.16700825 1.00000000 4.00000000 1.00000000
+ Jacobian 0.17863168 1.07210721 0.86801359 0.00000000 999.99900000 1.00000000
+ Minimum Angle 50.56155029 89.99999787 83.84466557 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00000259 136.97479459 96.69930735 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.
From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.
This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples folder constructs an identical example mesh as shown in the Guided tour using generic function calls.
A thorough description of the functions can be found in the API section.
The general workflow of the interactive mesh functionality within a REPL session is
c = new(name, startLocation [x,y,z],endLocation [x,y,z]) *Straight Line*
+ c = new(name,center [x,y,z],radius, startAngle, endAngle) *Circular Arc*
+ c = new(name, xEqn, yEqn, zEqn) *Parametric equation*
+ c = new(name, dataFile) *Spline with data from a file*
+ c = new(name, nKnots, knotsMatrix) *Spline with given knot values*
Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.
All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.
HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).
HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.
Developer Certificate of Origin
+Version 1.1
+
+Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+1 Letterman Drive
+Suite D4700
+San Francisco, CA, 94129
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+
+Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+(a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+(b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+(c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+(d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 13 October 2023. Using Julia version 1.6.7.
When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:
Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.
If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.
Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like Juno). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.
Set the new version number in Project.toml according to the Julian version of semver. Commit and push.
Comment @JuliaRegistrator register on the commit setting the version number.
JuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.
Increment the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.
You can build the documentation of HOHQMesh.jl locally by running
julia --project=docs -e 'using Pkg; Pkg.instantiate(); include("docs/make.jl")'
from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 13 October 2023. Using Julia version 1.6.7.
In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.
All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).
If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.
git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git
+# get latest main from the main repo
+git checkout main
+git pull
+# create a new branch for a cool new feature, bug fix, ...
+git checkout -b YOUR_BRANCH_NAME
+# do some work and push it to your fork
+git push -u myfork
+# go to https://github.com/trixi-framework/HOHQMesh.jl/pull
+# and create a PR from your new branch
Why using pull requests?
Immediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.
With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.
Avoid committing unwanted files
When you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.
For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:
Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.
Execute git fetch to get the latest changes from the repository.
Make sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.
Merge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.
In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.
If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should
merge the current main to your branch
run tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs
properly comment your code
delete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)
remove debug statements
add a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)
After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.
Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.
Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.
Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).
Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:
Update your clone by running git fetch.
Check out main using git checkout main.
Delete merged branch locally with git branch -d yourbranch.
Remove local references to deleted remote branch by executing git remote prune origin.
You can now proceed with your next changes by starting again at the top.
Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):
If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running
git reset HEAD~
This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.
If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.
Large files
You should never try to fix this yourself, as it potentially disrupts/destroys the work of others!
Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):
Tell everyone to commit and push their changes to the repository.
Fix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.
Perform the following steps to clean up the Git repository:
cd /tmp
+
+# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/
+
+# Get fresh clone of repo (so you can throw it away in case there is a problem)
+git clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git
+
+# Clean up repo of all files larger than 10M
+java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git
+
+# Enter repo
+cd Trixi.jl.git
+
+# Clean up reflog and force aggressive garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
+
+# Push changes
+git push
+
+# Delete clone
+rm -rf HOHQMesh.jl.git
Tell everyone to clean up their local working copies by performing the following steps (also do this yourself):
# Enter repo
+cd HOHQMesh.jl
+
+# Get current changes
+git fetch
+
+# Check out the fixed branch
+git checkout branchname
+
+# IMPORTANT: Do a rebase instead of a pull!
+git rebase
+
+# Clean reflog and force garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
IMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 13 October 2023. Using Julia version 1.6.7.
diff --git a/v0.2.1/guided-tour/index.html b/v0.2.1/guided-tour/index.html
new file mode 100644
index 00000000..c2b933f7
--- /dev/null
+++ b/v0.2.1/guided-tour/index.html
@@ -0,0 +1,62 @@
+
+Guided tour · HOHQMesh.jl
In this brief overview, we highlight two scripts from the examples folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.
A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute
A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute
For completeness, we provide the example script and walk-through each step in the construction of the Project below.
using HOHQMesh
+
+# Create a new project with the name "IceCreamCone", which will also be the
+# name of the mesh, plot and stats files, written to output folder `out`.
+
+p = newProject("IceCreamCone", "out")
+
+# Outer boundary for this example mesh is a complete circle. Add it into the project.
+
+circ = newCircularArcCurve("outerCircle", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, "degrees")
+addCurveToOuterBoundary!(p, circ)
+
+# Inner boundary is three curves. Two straight lines and a circular arc.
+# Note the three curve are connected to ensure a counter-clockwise orientation
+# as required by HOHQMesh
+
+# Create the three interior curves. The individual names of each curve in the inner
+# chain are used internally by HOHQMesh and are output as the given boundary names in
+# the mesh file.
+
+cone1 = newEndPointsLineCurve("cone1", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])
+iceCream = newCircularArcCurve("iceCream", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, "degrees")
+cone2 = newEndPointsLineCurve("cone2", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])
+
+# Assemble the three curve in a closed chain oriented counter-clockwise. The chain
+# name `IceCreamCone` is only used internally by HOHQMesh.
+
+addCurveToInnerBoundary!(p, cone1, "IceCreamCone")
+addCurveToInnerBoundary!(p, iceCream, "IceCreamCone")
+addCurveToInnerBoundary!(p, cone2, "IceCreamCone")
+
+# Adjust some `RunParameters` and overwrite the defaults values. In this case, we
+# set a new value for the boundary order polynomial representation and adjust the
+# output mesh file format to be `sem`
+
+setPolynomialOrder!(p, 4)
+setPlotFileFormat!(p, "sem")
+
+# A background grid is required for the mesh generation. In this example we lay a
+# background grid of Cartesian boxes with size 0.5.
+
+addBackgroundGrid!(p, [0.5, 0.5, 0.0])
+
+# Plot the project model curves and background grid
+
+if isdefined(Main, :Makie)
+ plotProject!(p, MODEL+GRID)
+ @info "Press enter to generate the mesh and update the plot."
+ readline()
+ else # Throw an informational message about plotting to the user
+ @info "To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again."
+ end
+
+# Generate the mesh. This produces the mesh and TecPlot files `AllFeatures.mesh` and `AllFeatures.tec`
+# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is
+# updated with the mesh that was generated.
+
+generate_mesh(p)
+
+# After the mesh successfully generates mesh statistics, such as the number of corner nodes,
+# the number of elements etc., are printed to the REPL
The first line creates a new project, where the mesh and plot file names will be derived from the project name, "IceCreamCone" written to the specified folder.
To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:
Parametric equations
Cubic Splines
Lines defined by their end points
Circular arcs
In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.
Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, "IceCreamCone" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.
For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script sets the polynomial order (default = 5) and the plot file format (default = "skeleton").
One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, so only the mesh size needs to be specified using
The example sets the background mesh size to be 0.1 in the x and y directions. The z component is ignored.
The script finishes by generating the quad mesh and plotting the results, as shown below
Finally, the script returns the project so that it can be edited further, if desired.
To save a control file for HOHQMesh, simply invoke
saveProject(proj::Project, outFile::String)
where outFile is the name of the control file (traditionally with a .control extension). saveProject is automatically called when a mesh is generated.
Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 13 October 2023. Using Julia version 1.6.7.
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.
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.
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
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.,
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.
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.
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.
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.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 13 October 2023. Using Julia version 1.6.7.
The supplied name will be the default name of the mesh and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.
The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.
If the model is modified and you want to re-plot with the new values, invoke
updatePlot!(proj::Project, options)
but generally the plot will be updated automatically as you build the model.
HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.
The available mesh file formats are "ISM", "ISM-V2", or "ABAQUS". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.
The plot file (which can be viewed with something like VisIt or ParaView) format is either "skeleton" or "sem". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.
By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with
A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available here.
To change the defaults, the smoother parameters can be set/enquired with the functions
There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must to be specified after a new project has been created.
Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.
Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g a sharp corner).
where name labels the refinement region, the type is either "smooth" or "sharp", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.
The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a "chain" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.
The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.
The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.
See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.
Returns a new set of parametric equation. Equations must be of the form
<function name>(<argument>) = ...
The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
A cubic spline is defined by an array of knots, $t_j$, $x_j$, $y_j$, $z_j$. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the $t$, $x$, $y$, $z$ values, e.g.
The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either "degrees" or "radians". That argument is optional, and defaults to "degrees".
Using the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using
The syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.
The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.
Several scripts are available in the examples folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.
Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.
The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.
To generate a mesh interactively you
Create a project with a user given projectName and folder where any generated files are to be saved
p = newProject(<projectName>, <folder>)
Both of these input arguments are strings.
Create inner and outer boundary curves from the available types
c = newEndPointsLineCurve(<name>, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*
+c = newCircularArcCurve(<name>, center [x, y, z], radius, startAngle, endAngle, units = "degrees" or "radians") *Circular Arc*
+c = newParametricEquationCurve(<name>, xEqn, yEqn, zEqn) *Parametric equation*
+c = newSplineCurve(<name>, dataFile) *Spline with data from a file*
+c = newSpline(<name>, nKnots, knotsMatrix) *Spline with given knot values*
See Defining curves for further details on the different curve type currently supported by HOHQMesh.
The generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.
Add curves to build the model to see what you have added,
addOuterBoundaryCurve!(p, <curveName>) *Add outer boundary curve*
+addInnerBoundaryCurve!(p, <curveName>, <InnerBoundaryName>) *Add curve to an inner boundary*
For a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.
Curves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.
Visualize the project's model, if desired
plotProject!(p, MODEL)
Plots are updated in response to user interactions. However, to update the plot at any time, use
updatePlot!(p, options)
Options are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.
Visualization requirement
The interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.
Set the background grid
When no outer boundary curve is present, the background grid can be set with
addBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])
Or
addBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])
The first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.
When an outer boundary is present the background grid can be set as
addBackgroundGrid!(p, [dx, dy, dz])
where the spacing controls the number of elements in each direction.
Background grid
A background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.
Adjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by
setPolynomialOrder!(p, order)
The background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately
The mesh file will be saved in <folder> with the name <projectName>.mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name <projectName>.control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.
All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 13 October 2023. Using Julia version 1.6.7.
Copyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-Lakemper
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 13 October 2023. Using Julia version 1.6.7.
Add the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version
Add the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.
Add an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.
Return a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.
Generate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.
You can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.
You can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
Generate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.
This function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
getCurveType(crv::Dic{String,Any})
+
+Get the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,
+`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.
Get the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.
Set the file format for the plot file. Acceptable choices are "sem", which includes interior nodes and boundary nodes and "skeleton", which includes only the corner nodes.
This document was generated with Documenter.jl version 0.27.25 on Friday 13 October 2023. Using Julia version 1.6.7.
diff --git a/v0.2.1/search_index.js b/v0.2.1/search_index.js
new file mode 100644
index 00000000..c6397b52
--- /dev/null
+++ b/v0.2.1/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"contributing/#Contributing","page":"Contributing","title":"Contributing","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.","category":"page"},{"location":"contributing/#Developer-Certificate-of-Origin-(Version-1.1)","page":"Contributing","title":"Developer Certificate of Origin (Version 1.1)","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"The following text was taken from https://developercertificate.org:","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"Developer Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n1 Letterman Drive\nSuite D4700\nSan Francisco, CA, 94129\n\nEveryone is permitted to copy and distribute verbatim copies of this\nlicense document, but changing it is not allowed.\n\n\nDeveloper's Certificate of Origin 1.1\n\nBy making a contribution to this project, I certify that:\n\n(a) The contribution was created in whole or in part by me and I\n have the right to submit it under the open source license\n indicated in the file; or\n\n(b) The contribution is based upon previous work that, to the best\n of my knowledge, is covered under an appropriate open source\n license and I have the right under that license to submit that\n work with modifications, whether created in whole or in part\n by me, under the same open source license (unless I am\n permitted to submit under a different license), as indicated\n in the file; or\n\n(c) The contribution was provided directly to me by some other\n person who certified (a), (b) or (c) and I have not modified\n it.\n\n(d) I understand and agree that this project and the contribution\n are public and that a record of the contribution (including all\n personal information I submit with it, including my sign-off) is\n maintained indefinitely and may be redistributed consistent with\n this project or the open source license(s) involved.","category":"page"},{"location":"development/#Development","page":"Development","title":"Development","text":"","category":"section"},{"location":"development/#Text-editors","page":"Development","title":"Text editors","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:","category":"page"},{"location":"development/#VS-Code","page":"Development","title":"VS Code","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.","category":"page"},{"location":"development/#Juno","page":"Development","title":"Juno","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.","category":"page"},{"location":"development/#Vim-or-Emacs","page":"Development","title":"Vim or Emacs","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like Juno). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.","category":"page"},{"location":"development/#Releasing-a-new-version-of-HOHQMesh","page":"Development","title":"Releasing a new version of HOHQMesh","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Check whether everything is okay, tests pass etc.\nSet the new version number in Project.toml according to the Julian version of semver. Commit and push.\nComment @JuliaRegistrator register on the commit setting the version number.\nJuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.\nIncrement the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.","category":"page"},{"location":"development/#Preview-the-documentation","page":"Development","title":"Preview the documentation","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"You can build the documentation of HOHQMesh.jl locally by running","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"julia --project=docs -e 'using Pkg; Pkg.instantiate(); include(\"docs/make.jl\")'","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).","category":"page"},{"location":"tutorials/straight_outer_boundary/#Straight-sided-outer-boundary","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples folder.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Synopsis","page":"Straight-sided outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Initialization","page":"Straight-sided outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We create a new project with the name \"box_two_circles\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_project = newProject(\"box_two_circles\", \"out\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Adjusting-project-parameters","page":"Straight-sided outer boundary","title":"Adjusting project parameters","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"For the box_project we first query the current values for the polynomial order and the mesh output format","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> getPolynomialOrder(box_project)\n5\n\njulia> getMeshFileFormat(box_project)\n\"ISM-V2\"","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be 4 and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"setPolynomialOrder!(box_project, 4)\nsetMeshFileFormat!(box_project, \"ABAQUS\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-background-grid","page":"Straight-sided outer boundary","title":"Add the background grid","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The domain for this tutorial is a rectangular box with the bounds 030times015. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Set the lower left corner point of the domain (x_0 y_0), define the element size in each spatial direction Delta x and Delta y, and the number of steps taken in each direction N_x N_y. The resulting background grid will have the extent x_0 x_0 + N_x Delta x by y_0 y_0 + N_y Delta y. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands\nlower_left = [0.0, 0.0, 0.0]\nspacing = [1.0, 1.0, 0.0]\nnum_intervals = [30, 15, 0]\naddBackgroundGrid!(box_project, lower_left, spacing, num_intervals)\nSet the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box 030times015 we use\nbounds = [15.0, 0.0, 0.0, 30.0]\nN = [30, 15, 0]\naddBackgroundGrid!(box_project, bounds, N)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we visualize the box_project to ensure that the background grid has been added correctly.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"plotProject!(box_project, GRID)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use the keyword and GRID to indicate that we want the background grid to be included in the visualization.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: background)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-inner-boundaries","page":"Straight-sided outer boundary","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we add the two circular inner boundary curves with different radii.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The first circle will have radius r=2 and be centered at the point (4 4). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle1 = newCircularArcCurve(\"circle1\", # curve name\n [4.0, 4.0, 0.0], # circle center\n 2.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be \"circle1\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The new circle1 curve is then added to the box_project as an inner boundary curve with","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"addCurveToInnerBoundary!(box_project, circle1, \"inner1\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called \"inner1\" and it contains a single curve \"circle1\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: first_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With analogous steps we create another circular curve with radius r=4, centered at (20 9) and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle2 = newCircularArcCurve(\"circle2\", # curve name\n [20.0, 9.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 2.0 * pi, # end angle\n \"radians\") # angle units\naddCurveToInnerBoundary!(box_project, circle2, \"inner2\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called \"inner2\" and it contains a single curve \"circle2\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: second_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Generate-the-mesh","page":"Straight-sided outer boundary","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_two_circles.control: A HOHQMesh control file for the current project.\nbox_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nbox_two_circles.inp: A mesh file with format ABAQUS that was set above.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"generate_mesh(box_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 3.5553999999999995E-002\n Number of nodes = 498\n Number of Edges = 921\n Number of Elements = 422\n Number of Subdivisions = 0\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.34513058 1.15383206 0.91833833 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00000004 1.71083844 1.08733476 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 1.46558793 1.04922640 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00000006 2.43503343 1.16700825 1.00000000 4.00000000 1.00000000\n Jacobian 0.17863168 1.07210721 0.86801359 0.00000000 999.99900000 1.00000000\n Minimum Angle 50.56155029 89.99999787 83.84466557 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00000259 136.97479459 96.69930735 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: final_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Summary","page":"Straight-sided outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"github-git/#GitHub-and-Git","page":"GitHub & Git","title":"GitHub & Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This page contains information on how to use GitHub and Git when developing HOHQMesh.","category":"page"},{"location":"github-git/#Development-workflow","page":"GitHub & Git","title":"Development workflow","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For adding modifications to HOHQMesh, we generally follow these steps:","category":"page"},{"location":"github-git/#Create-an-issue-(optional)","page":"GitHub & Git","title":"Create an issue (optional)","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.","category":"page"},{"location":"github-git/#Create-a-branch-and-*immediately*-create-a-pull-request","page":"GitHub & Git","title":"Create a branch and immediately create a pull request","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git\n# get latest main from the main repo\ngit checkout main\ngit pull\n# create a new branch for a cool new feature, bug fix, ...\ngit checkout -b YOUR_BRANCH_NAME\n# do some work and push it to your fork\ngit push -u myfork\n# go to https://github.com/trixi-framework/HOHQMesh.jl/pull\n# and create a PR from your new branch","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"info: Why using pull requests?\nImmediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.","category":"page"},{"location":"github-git/#Make-changes","page":"GitHub & Git","title":"Make changes","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"warning: Avoid committing unwanted files\nWhen you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.","category":"page"},{"location":"github-git/#Keep-your-branch-in-sync-with-main","page":"GitHub & Git","title":"Keep your branch in sync with main","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.\nExecute git fetch to get the latest changes from the repository.\nMake sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.\nMerge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.","category":"page"},{"location":"github-git/#Prepare-for-review","page":"GitHub & Git","title":"Prepare for review","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"merge the current main to your branch\nrun tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs\nproperly comment your code\ndelete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)\nremove debug statements\nadd a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.","category":"page"},{"location":"github-git/#Get-reviewed","page":"GitHub & Git","title":"Get reviewed","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.","category":"page"},{"location":"github-git/#Merge-branch","page":"GitHub & Git","title":"Merge branch","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).","category":"page"},{"location":"github-git/#Update-your-working-copy","page":"GitHub & Git","title":"Update your working copy","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Update your clone by running git fetch.\nCheck out main using git checkout main.\nDelete merged branch locally with git branch -d yourbranch.\nRemove local references to deleted remote branch by executing git remote prune origin.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"You can now proceed with your next changes by starting again at the top.","category":"page"},{"location":"github-git/#Using-Git","page":"GitHub & Git","title":"Using Git","text":"","category":"section"},{"location":"github-git/#Resources-for-learning-Git","page":"GitHub & Git","title":"Resources for learning Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Git Handbook by GitHub\nLearn Git Branching","category":"page"},{"location":"github-git/#Tips-and-tricks","page":"GitHub & Git","title":"Tips and tricks","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This is an unordered collection of different tips and tricks that can be helpful while working with Git. As usual, your mileage might vary.","category":"page"},{"location":"github-git/#Undo-last-commit","page":"GitHub & Git","title":"Undo last commit","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git reset HEAD~","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.","category":"page"},{"location":"github-git/#Remove-large-file-from-repository","page":"GitHub & Git","title":"Remove large file from repository","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"danger: Large files\nYou should never try to fix this yourself, as it potentially disrupts/destroys the work of others!","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Tell everyone to commit and push their changes to the repository.\nFix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.\nPerform the following steps to clean up the Git repository:\ncd /tmp\n\n# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/\n\n# Get fresh clone of repo (so you can throw it away in case there is a problem)\ngit clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git\n\n# Clean up repo of all files larger than 10M\njava -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git\n\n# Enter repo\ncd Trixi.jl.git\n\n# Clean up reflog and force aggressive garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\n\n# Push changes\ngit push\n\n# Delete clone\nrm -rf HOHQMesh.jl.git\nTell everyone to clean up their local working copies by performing the following steps (also do this yourself):\n# Enter repo\ncd HOHQMesh.jl\n\n# Get current changes\ngit fetch\n\n# Check out the fixed branch\ngit checkout branchname\n\n# IMPORTANT: Do a rebase instead of a pull!\ngit rebase\n\n# Clean reflog and force garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\nIMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.","category":"page"},{"location":"interactive-api/#API","page":"API","title":"API","text":"","category":"section"},{"location":"interactive-api/#Project-creation-and-saving","page":"API","title":"Project creation and saving","text":"","category":"section"},{"location":"interactive-api/#New-Project","page":"API","title":"New Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = newProject(name::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied name will be the default name of the mesh and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.","category":"page"},{"location":"interactive-api/#Opening-an-existing-project-file","page":"API","title":"Opening an existing project file","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A project can be created from an existing HOHQMesh control file with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = openProject(fileName::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied fileName will be the name of the project and the generated mesh and plot files will be placed in the supplied folder.","category":"page"},{"location":"interactive-api/#Saving-a-Project","page":"API","title":"Saving a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" saveProject(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"writes a control file to the folder designated when creating the new project. It can be read in again with openProject.","category":"page"},{"location":"interactive-api/#Plotting-a-Project","page":"API","title":"Plotting a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" plotProject!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the model is modified and you want to re-plot with the new values, invoke","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" updatePlot!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"but generally the plot will be updated automatically as you build the model.","category":"page"},{"location":"interactive-api/#Modifying/editing-a-Project","page":"API","title":"Modifying/editing a Project","text":"","category":"section"},{"location":"interactive-api/#Setting-the-name-of-a-Project","page":"API","title":"Setting the name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name is the name under which the mesh, plot, statistics and control files will be written. It can be changed at any time with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setName!(proj::Project,name::String)","category":"page"},{"location":"interactive-api/#Getting-the-current-name-of-a-Project","page":"API","title":"Getting the current name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name can be fetched and printed to the screen with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getName(proj::Project)","category":"page"},{"location":"interactive-api/#Controlling-the-mesh-generation","page":"API","title":"Controlling the mesh generation","text":"","category":"section"},{"location":"interactive-api/#Editing-the-RunParameters","page":"API","title":"Editing the RunParameters","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The run parameters can be enquired and set with these getter/setter pairs:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setPolynomialOrder!(proj::Project, p::Int)\n [Return:Int] getPolynomialOrder(proj::Project)\n [Return:nothing] setMeshFileFormat!(proj::Project, meshFileFormat::String)\n [Return:String] getMeshFileFormat(proj::Project)\n [Return:nothing] setPlotFileFormat!(proj::Project, plotFileFormat::String)\n [Return:String] getPlotFileFormat(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The available mesh file formats are \"ISM\", \"ISM-V2\", or \"ABAQUS\". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot file (which can be viewed with something like VisIt or ParaView) format is either \"skeleton\" or \"sem\". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.","category":"page"},{"location":"interactive-api/#Changing-the-output-file-names","page":"API","title":"Changing the output file names","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setName!(proj::Project,name::String)\n [Return:String] getName(proj::Project)\n [Return:nothing] setFolder!(proj::Project,folder::String)\n [Return:String] getFolder(proj::Project)","category":"page"},{"location":"interactive-api/#Smoothing-operations","page":"API","title":"Smoothing operations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available here.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To change the defaults, the smoother parameters can be set/enquired with the functions","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setSmoothingStatus!(proj::Project, status::String)\n [Return:String] getSmoothingStatus(proj::Project)\n [Return:nothing] setSmoothingType!(proj::Project, type::String)\n [Return:String] getSmoothingType(proj::Project)\n [Return:nothing] setSmoothingIterations!(proj::Project, iterations::Int)\n [Return:Int] getSmoothingIterations(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The smooth status is either \"ON\" or \"OFF\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To remove the smoother altogether, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] removeSpringSmoother!(proj::Project)","category":"page"},{"location":"interactive-api/#Adding-the-background-grid","page":"API","title":"Adding the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must to be specified after a new project has been created.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addBackgroundGrid!(proj::Project,\n x0::Array{Float64},\n dx::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n box::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n bgSize::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.","category":"page"},{"location":"interactive-api/#Changing-the-background-grid","page":"API","title":"Changing the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The size of an existing background grid in a Project can be adjusted with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setBackgroundGridSize!(proj::Project,\n dx::Float64,\n dy::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If a plot is present it will be updated automatically.","category":"page"},{"location":"interactive-api/#Manual-refinement-regions","page":"API","title":"Manual refinement regions","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g a sharp corner).","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To create a RefinementCenter,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementCenter(name::String,\n type::String,\n x0::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where name labels the refinement region, the type is either \"smooth\" or \"sharp\", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Similarly, one can create a RefinementLine,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementLine(name::String,\n type::String,\n x0::Array{Float64}, x1::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where x0 is the start position and x1 is the end of the line. The name, type, h, and w parameters are the same as for a RefinementCenter.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To add a refinement region to the project,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addRefinementRegion!(proj::Project, r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To get a reference to a refinement region with a given name, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] getRefinementRegion(proj::Project, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to get a list of all the refinement regions,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Array{Dict{String,Any}}] array = allRefinementRegions(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"A refinement region can be edited by using the following:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementType!(r::Dict{String,Any}, type::String)\n [Return:String] getRefinementType(r::Dict{String,Any})\n [Return:nothing] setRefinementLocation!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementLocation(r::Dict{String,Any})\n [Return:nothing] setRefinementGridSize!(r::Dict{String,Any}, h::Float64)\n [Return:Float64] getRefinementGridSize(r::Dict{String,Any})\n [Return:nothing] setRefinementWidth!(r::Dict{String,Any}, w::Float64)\n [Return:Float64] getRefinementWidth(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where r is a dictionary returned by newRefinementCenter!, newRefinementLine!, or getRefinementRegion.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To further edit a RefinementLine, use the methods","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementStart!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementStart(r::Dict{String,Any})\n [Return:nothing] setRefinementEnd!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementEnd(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Boundary-curves","page":"API","title":"Boundary curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a \"chain\" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.","category":"page"},{"location":"interactive-api/#Defining-curves","page":"API","title":"Defining curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Four curve types can be added to the outer and inner boundary curve chains. They are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"interactive-api/#Parametric-equations","page":"API","title":"Parametric equations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Creating a new curve equation","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\")","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Returns a new set of parametric equation. Equations must be of the form","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" () = ...","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" xEqn = \"x(t) = 4*cos(2*pi*t) - 0.6*cos(8*pi*t)^3\"\n yEqn = \"y(t) = 4*sin(2*pi*t) - 0.5*sin(11*pi*t)^2\"\n zEqn = \"z(t) = 0.0\"\n blob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The z-Equation is optional, but for now must define zero for z by default.","category":"page"},{"location":"interactive-api/#Cubic-spline-curve","page":"API","title":"Cubic spline curve","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A cubic spline is defined by an array of knots, t_j, x_j, y_j, z_j. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the t, x, y, z values, e.g.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" 9\n 0.000000000000000 -3.50000000000000 3.50000000000000 0.0\n 3.846153846153846E-002 -3.20000000000000 5.00000000000 0.0\n 7.692307692307693E-002 -2.00000000000000 6.00000000000 0.0\n 0.769230769230769 0.000000000000000 -1.00000000000000 0.0\n 0.807692307692308 -1.00000000000000 -1.00000000000000 0.0\n 0.846153846153846 -2.00000000000000 -0.800000000000000 0.0\n 0.884615384615385 -2.50000000000000 0.000000000000000 0.0\n 0.923076923076923 -3.00000000000000 1.00000000000000 0.0\n 1.00000000000000 -3.50000000000000 3.50000000000000 0.0","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"or by constructing the required nKnots x 4 array and supplying it to the new procedure. The respective constructors for a spline curve are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newSplineCurve(name::String,\n dataFile::String)\n [Return:Dict{String,Any}] newSplineCurve(name::String,\n nKnots::Int,\n data::Matrix{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the spline curve is to be closed. The last data point must be the same as the first.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n ex_spline = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"interactive-api/#Line-defined-by-end-points","page":"API","title":"Line defined by end points","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A straight line is constructed with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newEndPointsLineCurve(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The xStart and xEnd are arrays of the form [x, y, z]. The z component should be zero and for now is ignored.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" line1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])","category":"page"},{"location":"interactive-api/#Circular-arc","page":"API","title":"Circular arc","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newCircularArcCurve(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either \"degrees\" or \"radians\". That argument is optional, and defaults to \"degrees\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" halfCircle = newCircularArcCurve(\"Dome\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")","category":"page"},{"location":"interactive-api/#Adding-and-removing-outer-and-inner-boundaries","page":"API","title":"Adding and removing outer and inner boundaries","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Adding an outer boundary curve\nUsing the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using\n[Return:nothing] addCurveToOuterBoundary!(proj::Project,\n crv::Dict{String,Any})\ncrv is the dictionary that represents the curve.\nExample:\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\nAdding an inner boundary curve\nThe syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.\n[Return:nothing] addCurveToInnerBoundary!(proj::Project,\n crv::Dict{String,Any},\n chainName::String)\nExample:\nline1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\naddCurveToInnerBoundary!(p, line1, \"interior_curve\")\nTo edit curves they can be accessed by the name:\n[Return:Dict{String,Any}] getInnerBoundaryCurve(proj::Project,\n curveName::String,\n chainName::String)\n[Return:Dict{String,Any}] getOuterBoundaryCurveWithName(proj::Project,\n name::String)\nDeleting boundary curves\nThe entire outer boundary or an entire inner boundary can be removed from the project.\n[Return:nothing] removeOuterBoundary!(proj::Project)\n[Return:nothing] removeInnerBoundary!(proj::Project, chainName::String)\nAlternatively, individual pieces of the boundary curve chains can be removed.\n[Return:nothing] removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n[Return:nothing] removeInnerBoundaryCurve!(proj::Project,\n name::String,\n chainName::String)\nAs in HOHQMesh the project can have only one outer boundary chain, so the removal does not require a specific chainName.","category":"page"},{"location":"interactive-api/#Editing-curves","page":"API","title":"Editing curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"You can determine the type of a curve by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getCurveType(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"For any of the curves, their name can be changed by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setCurveName!(crv::Dict{String,Any}, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"and checked by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" getCurveName(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Otherwise there are special functions to change the parameters of curves","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setXEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setYEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setZEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcUnits!(arc::Dict{String,Any}, units::String)\n [Return:nothing] setArcCenter!(arc::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n [Return:String] getXEqn(crv::Dict{String,Any})\n [Return:String] getYEqn(crv::Dict{String,Any})\n [Return:String] getZEqn(crv::Dict{String,Any})\n [Return:Array{Float64}] getStartPoint(crv::Dict{String,Any})\n [Return:Array{Float64}] getEndPoint(crv::Dict{String,Any})\n [Return:String] getArcUnits(arc::Dict{String,Any})\n [Return:Array{Float64}] getArcCenter(arc::Dict{String,Any})\n [Return:Float64] getArcStartAngle(arc::Dict{String,Any})\n [Return:Float64] getArcEndAngle(arc::Dict{String,Any})\n [Return:Float64] getArcRadius(arc::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Undo/redo","page":"API","title":"Undo/redo","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The interactive mesh functionality has unlimited undo/redo for most actions.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"In interactive mode, actions can be undone by the commands","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undo()\n [Return:String] redo()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where the return string contains the name of the action performed.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To find out what the next actions are, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undoActionName()\n [Return:String] redoActionName()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to clear the undo stack, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] clearUndoRedo()","category":"page"},{"location":"tutorials/curved_outer_boundary/#Curved-outer-boundary","page":"Curved outer boundary","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Synopsis","page":"Curved outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initialization","page":"Curved outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We create a new project with the name \"TheBlob\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"blob_project = newProject(\"TheBlob\", \"out\")","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-the-outer-boundary","page":"Curved outer boundary","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary curve for the domain of interest in this tutorial is given by the parametric equations","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":" beginaligned\n x(t) = 4cos(2 pi t) - frac35cos^3(8 pi t)02cm\n y(t) = 4sin(2 pi t) - frac12sin^2(11 pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"xEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The name of this curve is assigned to be \"Blob\". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addCurveToOuterBoundary!(blob_project, blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-a-background-grid","page":"Curved outer boundary","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for blob_project to have elements with side length two in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"plotProject!(blob_project, MODEL+GRID)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"Blob\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: coarse_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From the visualization we see that the background grid is likely too coarse to produce a \"good\" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"setBackgroundGridSize!(blob_project, 0.5, 0.5)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: fine_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initial-mesh-and-user-adjustments","page":"Curved outer boundary","title":"Initial mesh and user adjustments","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"TheBlob.control: A HOHQMesh control file for the current project.\nTheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nTheBlob.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.10612399999999998\n Number of nodes = 481\n Number of Edges = 895\n Number of Elements = 417\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025346 0.36181966 0.11936327 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002883 2.58066393 1.26340310 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.11480166 1.18583253 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006177 4.80707901 1.51313656 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011326 0.28172540 0.10292251 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.30873612 89.99827738 73.08079323 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132792 156.87642432 109.37004979 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: initial_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point (-4 0) is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"center = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Above we create a circular refinement region centered at the point (-4 -05) with a desired resolution size 04 and a radius of 10. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: refinement_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Final-mesh","page":"Curved outer boundary","title":"Final mesh","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.11373499999999999\n Number of nodes = 505\n Number of Edges = 940\n Number of Elements = 438\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025346 0.36181966 0.11412658 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002884 2.47585614 1.26424390 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.11480166 1.18425870 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006177 4.80707901 1.51413601 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011326 0.28172540 0.09814547 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.30873612 89.99827901 72.79596483 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132782 156.87642433 109.63912468 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: final_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Summary","page":"Curved outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"# Interactive mesh with a curved outer boundary\n#\n# Create an outer boundary from a set of parametric equations.\n# Add manual refinement in a small region around the point (-4, -0.5).\n#\n# Keywords: outer boundary, parametric equations, refinement center\nusing HOHQMesh\n\n# Instantiate the project\nblob_project = newProject(\"TheBlob\", \"out\")\n\n# Create and add the outer boundary curve\nxEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)\naddCurveToOuterBoundary!(blob_project, blob)\n\n# Add the background grid\naddBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])\n\n# Create and add the refinement region\ncenter = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)\n\n# Generate the mesh\ngenerate_mesh(blob_project)","category":"page"},{"location":"tutorials/create_edit_curves/#Creating-and-editing-curves","page":"Creating and editing curves","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a \"chain\" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/create_edit_curves/#Synopsis","page":"Creating and editing curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/#Initialization","page":"Creating and editing curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a new project with the name \"sandbox\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox_project = newProject(\"sandbox\", \"out\")","category":"page"},{"location":"tutorials/create_edit_curves/#Add-the-outer-boundary-chain","page":"Creating and editing curves","title":"Add the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We first create the outer boundary curve chain that is composed of three pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (0 -7) to (5 3).\nHalf-circle arc of radius r=5 centered at (0 3).\nStraight line segment from (-5 3) to (0 -7).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [0.0, -7.0, 0.0], # start point\n [5.0, 3.0, 0.0]) # end point\n\nouter_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-5.0, 3.0, 0.0], # start point\n [0.0, -7.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from 0 to 180 degrees.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_arc = newCircularArcCurve(\"Arc\", # curve name\n [0.0, 3.0, 0.0], # center\n 5.0, # radius\n 0.0, # start angle\n 180.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", and \"Arc\" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-a-background-grid","page":"Creating and editing curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We visualize the outer boundary curve chain and background grid with the following","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"plotProject!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains three curve segments \"Line1\", \"Arc\", and \"Line2\" labeled in the figure by O.1, O.2, and O.3, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-the-outer-boundary-chain","page":"Creating and editing curves","title":"Edit the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the domain boundary requires a curved segment instead of the straight line \"Line2\". We will replace this line segment in the outer boundary chain with a cubic spline.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"First, we remove the \"Line2\" curve from the \"Outer\" chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Outer curve removal\nAlternatively, we can remove the curve \"Line2\" using its index in the \"Outer\" boundary chain.removeOuterBoundaryCurveAtIndex!(sandbox_project, 3)This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The plot automatically updates and we see that the outer boundary is open and contains two segments: \"Line1\" and \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve \"Arc\" and end at the first point of the curve \"Line1\". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. The spline curve constructor newSplineCurve also takes the number of points as an input argument.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"spline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we add the spline curve outer_spline into the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates automatically to display the \"Outer\" boundary chain with the new \"Spline\" curve labeled O.3.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-an-inner-boundary-chain","page":"Creating and editing curves","title":"Add an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a pill shaped inner boundary curve chain composed of four pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (1 5) to (1 3).\nHalf-circle arc of radius r=1 centered at (0 3).\nStraight line segment from (-1 3) to (-1 5).\nHalf-circle arc of radius r=1 centered at (0 5).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Similar to the construction of the \"Outer\" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [1.0, 5.0, 0.0], # start point\n [1.0, 3.0, 0.0]) # end point\n\ninner_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-1.0, 3.0, 0.0], # start point\n [-1.0, 5.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at (0 3) varies from 0 to -180 degrees. The top half-circle arc centered at (0 5) has an angle that varies from 180 to 0 degrees. The construction of the two circle arcs are","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_bottom_arc = newCircularArcCurve(\"BottomArc\", # curve name\n [0.0, 3.0, 0.0], # center\n 1.0, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\n\ninner_top_arc = newCircularArcCurve(\"TopArc\", # curve name\n [0.0, 5.0, 0.0], # center\n 1.0, # radius\n 180.0, # start angle\n 0.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Note, we use \"radians\" to set the angle bounds for inner_bottom_arc and \"degrees\" for the angle bounds of inner_top_arc.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", \"BottomArc\", and \"TopArc\" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This inner boundary chain name \"inner\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments \"Line1\", \"BottomArc\", \"Line2\", and \"TopArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_pill)","category":"page"},{"location":"tutorials/create_edit_curves/#Generate-the-mesh","page":"Creating and editing curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox.control: A HOHQMesh control file for the current project.\nsandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nsandbox.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 8.7928000000000006E-002\n Number of nodes = 513\n Number of Edges = 933\n Number of Elements = 422\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00003020 1.17336756 0.18813064 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00984888 2.32321419 1.31488869 1.00000000 999.99900000 1.00000000\n Condition 1.00041121 2.42894151 1.21101797 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.01674110 3.74861238 1.59495734 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001734 1.13821390 0.14136293 0.00000000 999.99900000 1.00000000\n Minimum Angle 32.20087774 89.35157729 68.75755243 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.60787193 152.53515465 113.36966060 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: initial_mesh)","category":"page"},{"location":"tutorials/create_edit_curves/#Delete-the-existing-mesh","page":"Creating and editing curves","title":"Delete the existing mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"remove_mesh!(sandbox_project)\nupdatePlot!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Additionally, the remove_mesh! command deletes the mesh information from the sandbox_project and sandbox.mesh from the out folder. However, the sandbox.control and sandbox.tec files are still present in out directory.","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-an-inner-boundary-chain","page":"Creating and editing curves","title":"Edit an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the inner boundary actually requires a curved segment instead of the straight line \"Line1\". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We remove the \"Line1\" curve from the inner chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Inner curve removal\nAlternatively, we can remove the curve \"Line1\" using its index in the inner boundary chain.removeInnerBoundaryCurveAtIndex!(sandbox_project, 1, \"inner\")This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: \"BottomArc\", \"Line2\", and \"TopArc\". Note that the index of the remaining curves has changed as shown below.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Brief note about undo / redo\nThe interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.undoActionName()\n\"Remove Inner Boundary Curve\"We can undo the removal of the \"Line1\" curve with undoundo()\n\"Undo Remove Inner Boundary Curve\"In addition to reinstating \"Line1\" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The new inner curve segment will be an oscillating line given by the parametric equations","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":" beginaligned\n x(t) = t + 102cm\n y(t) = -2t + 5 - frac32 cos(pi t) sin(pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"xEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The name of this new curve is assigned to be \"wiggleLine\". We add this new curve to the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The automatically updated figure now shows:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_open_chain)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We see from the figure that this parametric equation curve starts at the point (15) and, therefore, matches the end point of the existing curve \"TopArc\" present in the \"inner\" chain. However, the parametric equation curve ends at the point (23) which does not match the \"BottomArc\" curve. So, the inner boundary chain remains open.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"warning: Attempt to generate a mesh with an open curve chain\nAn open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create a closed boundary curve we must remove the \"BottomArc\" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point (2 3) and end at the point (-1 3) to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the \"BottomArc\" from the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates to display the \"inner\" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_remove_arc)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"A half-circle arc that joins the points (2 3) and (-1 3) has a radius r=15, is centered at (05 3) and has an angle that vaires from 0 to -180. We construct this circle arc and directly add it to the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"new_bottom_arc = newCircularArcCurve(\"wideBottomArc\", # curve name\n [0.5, 3.0, 0.0], # center\n 1.5, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The updated plot now gives the modified, closed inner curve chain that now contains four curve segments \"Line2\", \"TopArc\", \"wiggleLine\", and \"wideBottomArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/#Regenerate-the-mesh","page":"Creating and editing curves","title":"Regenerate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.13299600000000000\n Number of nodes = 714\n Number of Edges = 1308\n Number of Elements = 596\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00003020 1.15662678 0.12823840 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.01082600 3.14765817 1.34292128 1.00000000 999.99900000 1.00000000\n Condition 1.00037252 2.59936116 1.22903490 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.02724726 3.74861238 1.64807401 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001734 1.13150266 0.09438571 0.00000000 999.99900000 1.00000000\n Minimum Angle 31.88018513 89.33451932 67.86550651 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.43850948 157.31718198 114.36070355 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: zoom_corner)","category":"page"},{"location":"tutorials/create_edit_curves/#Summary","page":"Creating and editing curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"# Interactive mesh with modified outer and inner curve chains\n#\n# Create inner / outer boundary chains composed of the four\n# available HOHQMesh curve types.\n#\n# Keywords: outer boundary, inner boundary, parametric equations,\n# circle arcs, cubic spline, curve removal\nusing HOHQMesh\n\n# Instantiate the project\nsandbox_project = newProject(\"sandbox\", \"out\")\n\n# Add the background grid\naddBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])\n\n# Create and add the original outer boundary curves\nouter_line1 = newEndPointsLineCurve(\"Line1\", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])\nouter_line2 = newEndPointsLineCurve(\"Line2\", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])\nouter_arc = newCircularArcCurve(\"Arc\", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, \"degrees\")\n\naddCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)\n\n# Modify the outer boundary to have a spline instead of a straight line\nremoveOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")\n\nspline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)\naddCurveToOuterBoundary!(sandbox_project, outer_spline)\n\n# Create and add the inner boundary curves\ninner_line1 = newEndPointsLineCurve(\"Line1\", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])\ninner_line2 = newEndPointsLineCurve(\"Line2\", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])\ninner_bottom_arc = newCircularArcCurve(\"BottomArc\", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, \"radians\")\ninner_top_arc = newCircularArcCurve(\"TopArc\", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, \"degrees\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")\n\n# Generate a mesh\ngenerate_mesh(sandbox_project)\n\n# Delete the existing mesh before modifying the inner boundary curve chain\nremove_mesh!(sandbox_project)\n\n# Modify the inner boundary curve with an oscillatory line and a new circle arc\nremoveInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")\nremoveInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")\n\nxEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)\n\nnew_bottom_arc = newCircularArcCurve(\"wideBottomArc\", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, \"radians\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")\n\n# Regenerate the final mesh\ngenerate_mesh(sandbox_project)","category":"page"},{"location":"interactive_overview/#InteractiveTool","page":"Overview","title":"Overview","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Several scripts are available in the examples folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.","category":"page"},{"location":"interactive_overview/#Workflow-and-basic-moves","page":"Overview","title":"Workflow and basic moves","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"To generate a mesh interactively you","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Create a project with a user given projectName and folder where any generated files are to be saved\np = newProject(, )\nBoth of these input arguments are strings.\nCreate inner and outer boundary curves from the available types\nc = newEndPointsLineCurve(, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*\nc = newCircularArcCurve(, center [x, y, z], radius, startAngle, endAngle, units = \"degrees\" or \"radians\") *Circular Arc*\nc = newParametricEquationCurve(, xEqn, yEqn, zEqn) *Parametric equation*\nc = newSplineCurve(, dataFile) *Spline with data from a file*\nc = newSpline(, nKnots, knotsMatrix) *Spline with given knot values*\nSee Defining curves for further details on the different curve type currently supported by HOHQMesh.\nThe generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.\nAdd curves to build the model to see what you have added,\naddOuterBoundaryCurve!(p, ) *Add outer boundary curve*\naddInnerBoundaryCurve!(p, , ) *Add curve to an inner boundary*\nFor a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.\nCurves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.\nVisualize the project's model, if desired\nplotProject!(p, MODEL)\nPlots are updated in response to user interactions. However, to update the plot at any time, use\nupdatePlot!(p, options)\nOptions are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.\nnote: Visualization requirement\nThe interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.\nSet the background grid\nWhen no outer boundary curve is present, the background grid can be set with\naddBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])\nOr\naddBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])\nThe first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.\nWhen an outer boundary is present the background grid can be set as\naddBackgroundGrid!(p, [dx, dy, dz])\nwhere the spacing controls the number of elements in each direction.\nnote: Background grid\nA background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.\nAdjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by\nsetPolynomialOrder!(p, order)\nThe background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately\nsetBackgroundGridSize!(p, 0.5, 0.25)\nSee Controlling the mesh generation for details on adjusting parameters already present in the Project.\nGenerate the mesh\ngenerate_mesh(p)\nThe mesh file will be saved in with the name .mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name .control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.","category":"page"},{"location":"interactive_overview/#Advanced","page":"Overview","title":"Advanced","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.","category":"page"},{"location":"testing/#Testing","page":"Testing","title":"Testing","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In Trixi and its related repositories, tests are triggered by","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"each git push to main and\neach git push to any pull request.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test and coverage requirements\nBefore merging a pull request (PR) to main, we require thatthe code passes all functional tests\ncode coverage does not decrease.","category":"page"},{"location":"testing/#Testing-setup","page":"Testing","title":"Testing setup","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> using Pkg; Pkg.test(\"HOHQMesh\")","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> # Run all test for the interactive Curve API\n include(joinpath(\"test\", \"test_curve.jl\"))","category":"page"},{"location":"testing/#Adding-new-tests","page":"Testing","title":"Adding new tests","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test duration\nAs a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).","category":"page"},{"location":"testing/#Test-coverage","page":"Testing","title":"Test coverage","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered \"covered\" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The \"Details\" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Coverage requirements\nIn general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.","category":"page"},{"location":"authors/#Authors","page":"Authors","title":"Authors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.","category":"page"},{"location":"authors/#Principal-Developers","page":"Authors","title":"Principal Developers","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"David A. Kopriva, Florida State University, USA\nAndrew Winters, Linköping University, Sweden","category":"page"},{"location":"authors/#Contributors","page":"Authors","title":"Contributors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"The following people contributed major additions or modifications to HOHQMesh and are listed in alphabetical order:","category":"page"},{"location":"authors/","page":"Authors","title":"Authors","text":"David Kopriva\nHendrik Ranocha\nMichael Schlottke-Lakemper\nAndrew Winters","category":"page"},{"location":"reference/#HOHQMesh.jl-API","page":"Reference","title":"HOHQMesh.jl API","text":"","category":"section"},{"location":"reference/","page":"Reference","title":"Reference","text":"CurrentModule = HOHQMesh","category":"page"},{"location":"reference/","page":"Reference","title":"Reference","text":"Modules = [HOHQMesh]","category":"page"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary named boundaryName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, obj::Dict{String,Any})\n\nAdd a curve to the outer boundary or a refinement reion to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, Array{Float64, N} where N, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})\n\nAdd the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version\n\naddBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nis a lot easier to use.\n\nTODO: Change HOHQMesh and delete this way to specify the domain and use the bounding box one instead.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nAdd the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid(proj::Project, bgSize::Array{Float64})\n\nAdd the background grid block with the grid size to be a 3-vector. Use this when there is an outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, dict::Dict{String,Any})\n\nUsed only for undo/redo.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToInnerBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.addCurveToInnerBoundary!","text":"addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary with name boundaryName. If an inner boundary of that name does not exist, one is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addCurveToOuterBoundary!","text":"addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})\n\nAdd a curve to the outer boundary. The curves must be added in order counter-clockwise\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addInnerBoundaryWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.addInnerBoundaryWithName!","text":"addInnerBoundaryWithName!(proj::Project,name::String)\n\nCreate a new empty inner boundary with the given name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addObserver-Tuple{Any, String, Any}","page":"Reference","title":"HOHQMesh.addObserver","text":"addObserver(observer::Any, note::String, f::Any)\n\nf is the function to be executed (called) when a notification of name note is given.\n\nThe function called upon notification must have the signature f(observer, sender, args...)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addOuterBoundary!","text":"addOuterBoundary!(proj::Project, outerBoundary::Dict{String,Any})\n\nAdd an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegion!","text":"addRefinementRegion!(proj::Project,r::Dict{String,Any})\n\nAdd the refinement region to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegionPoints!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegionPoints!","text":"addRefinementRegionPoints!(proj::Project, r::Dict{String,Any})\n\nCompute and add to the project the plotting points for the refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRunParameters!","page":"Reference","title":"HOHQMesh.addRunParameters!","text":"addRunParameters!(proj::Project,\n plotFormat::String = \"skeleton\",\n meshFileFormat::String = \"ISM-V2\",\n polynomialOrder::Int = 5)\n\nAdd a RUN_PARAMETERS block and set all the parameters in one call.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.addSpringSmoother!","page":"Reference","title":"HOHQMesh.addSpringSmoother!","text":"addSpringSmoother!(status::String, type::String, nIterations::Int)\n\nStatus is either ON or OFF Type is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.bboxUnion-Tuple{Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.bboxUnion","text":"bboxUnion(box1::Array{Float64}, box2::Array{Float64})\n\nReturns the union of two bounding boxes\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.curveBounds-Tuple{Matrix{Float64}}","page":"Reference","title":"HOHQMesh.curveBounds","text":"curveBounds(crvPoints::Array{Float64,2})\n\nFind the bounds of a single curve, discretized as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.emptyBounds-Tuple{}","page":"Reference","title":"HOHQMesh.emptyBounds","text":"emptyBounds()\n\nReturns an array that will always be ignored when unioned with another bounding box.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.examples_dir-Tuple{}","page":"Reference","title":"HOHQMesh.examples_dir","text":"examples_dir()\n\nReturn the path to the directory with some example mesh setups.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.extract_mesh_file_format-Tuple{Any}","page":"Reference","title":"HOHQMesh.extract_mesh_file_format","text":"extract_mesh_file_format(control_file)\n\nReturn a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{Any}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(control_file;\n output_directory=\"out\",\n mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing,\n verbose=false)\n\nGenerate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.\n\nYou can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.\n\nYou can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(proj::Project)\n\nGenerate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.\n\nThis function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getAllRefinementRegions-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getAllRefinementRegions","text":"getAllRefinementRegions(proj::Project)\n\nGet the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcCenter","text":"getArcCenter(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the center of a circular arc as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcEndAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcEndAngle","text":"getArcEndAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcRadius-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcRadius","text":"getArcRadius(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcStartAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcStartAngle","text":"getArcStartAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcUnits-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcUnits","text":"getArcUnits(crv::Dict{String,Any}, units::String)\n\nGet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridLowerLeft-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridLowerLeft","text":"getBackgroundGridLowerLeft(proj::Project)\n\nReturns the [x,y] of the lower left point of the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSize-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSize","text":"getBackgroundGridSize(proj::Project)\n\nReturns the background grid size array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSteps-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSteps","text":"getBackgroundGridSteps(proj::Project)\n\nReturns the [Nx,Ny,Nz] for the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String, boundaryName::String)\n\nGet the curve named curveName from the inner boundary named boundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String)\n\nGet the curve with name curveName from the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveName","text":"getCurveName(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveType","text":"getCurveType(crv::Dic{String,Any})\n\nGet the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,\n`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getEndPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getEndPoint","text":"getEndPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the end point for a line curve as an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundary-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundary","text":"getInnerBoundary(proj::Project, name::String)\n\nGet the chain of curves from the inner boundary with name name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryChainWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryChainWithName","text":"getInnerBoundaryWithName(proj::Project, name::String)\n\nGet the inner boundary CHAIN with the given name. If one does not exist, it is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryCurve","text":"\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getMeshFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getMeshFileFormat","text":"getMeshFileFormat(proj::Project)\n\nReturns the format in which the mesh will be written.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getName-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getName","text":"getName(proj::Project)\n\nReturns the filename to be used by the mesh, plot, control, and stats files.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryChainList-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getOuterBoundaryChainList","text":"getOuterBoundaryChainList(proj::Project)\n\nGet the array of outer boundary curves.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryCurveWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getOuterBoundaryCurveWithName","text":"getOuterBoundaryCurveWithName(proj::Project, name::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPlotFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPlotFileFormat","text":"getPlotFileFormat(proj::Project)\n\nReturns the plot file format.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPolynomialOrder-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPolynomialOrder","text":"getPolynomialOrder(proj::Project)\n\nReturns the polynomial order for boundary curves in the mesh file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementEnd-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementEnd","text":"getRefinementEnd(r::Dict{String,Any})\n\nReturn Array{Float64} of the end location of the refinement line\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementGridSize-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementGridSize","text":"getRefinementGridSize(r::Dict{String,Any})\n\nReturns the grid size,h, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementLocation-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementLocation","text":"getRefinementLocation(r::Dict{String,Any})\n\nReturn Array{Float64} of the location of the refinement center.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementName","text":"getRefinementName(r::Dict{String,Any})\n\nReturn name of the refinement. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"getRefinementRegion(proj::Project, indx)\n\nGet the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"(i,r) = getRefinementRegion(project, name)\n\nGet the refinement region with the given name and its location in the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegionCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementRegionCenter","text":"getRefinementRegionCenter(r::Dict{String,Any})\n\nGet, or compute, the center of the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementStart-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementStart","text":"getRefinementStart (r::Dict{String,Any})\n\nReturn Array{Float64} of the start location of the refinement line. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementType","text":"getRefinementType(r::Dict{String,Any})\n\nReturn the type of refinement, either \"smooth\" or \"sharp\". r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementWidth-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementWidth","text":"getRefinementWidth(r::Dict{String,Any})\n\nReturns the region width,w, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingIterations-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingIterations","text":"getSmoothingIterations(proj::Project)\n\nGet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingStatus-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingStatus","text":"smoothingStatus(proj::Project)\n\nReturns whether the smoother will be \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingType-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingType","text":"getSmoothingType(proj::Project)\n\nReturns either \"LinearSpring\" or \"LinearAndCrossbarSpring\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplineNKnots-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplineNKnots","text":"getSplineNKnots(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplinePoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplinePoints","text":"getSplinePoints(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getStartPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getStartPoint","text":"getStartPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the start point for a line curve as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getXEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getXEqn","text":"getXEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getYEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getYEqn","text":"getYEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getZEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getZEqn","text":"getZEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.hasBackgroundGrid-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.hasBackgroundGrid","text":"hasBackgroundGrid(proj::Project)\n\nTests to see if the project has a backgroundGrid dictionary defined.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.innerBoundaryIndices-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.innerBoundaryIndices","text":"innerBoundaryIndices(proj::Project, curveName::String)\n\nReturns (curveIndex,chainIndex) for the location of the curve named curveName in it's inner boundary chain.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryAtIndex!-Tuple{HOHQMesh.Project, String, Int64, Dict{String, Any}, Vector{Any}, Vector{String}}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryAtIndex!","text":"insertInnerBoundaryAtIndex!(proj::Project, chainName::String, indx::Int, chain::??)\n\nInsert an entire inner boundary. Primarily meant for undo operation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64, String}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryCurveAtIndex!","text":"insertInnerBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any},\n indx::Int, boundaryName::String)\n\nInsert a curve crv into an inner boundary chain boundaryName at the specified index indx.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertOuterBoundaryCurveAtIndex!","text":"insertOuterBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any}, indx::Int)\n\nInsert a curve into the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertRefinementRegion!","text":"insertRefinementRegion!(proj::Project, r::Dict{String,Any}, indx::Int)\n\nUsed by undo()\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelChainIsOK-Tuple{Vector{Dict{String, Any}}, String}","page":"Reference","title":"HOHQMesh.modelChainIsOK","text":"modelChainIsOK(chain::Vector{Dict{String, Any}}, chainName::String)\n\nReturns true if the chain of curves is contiguous and closed; false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelCurvesAreOK-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.modelCurvesAreOK","text":"modelCurvesAreOK(proj::Project)\n\nGo through all curves in the model and make sure they are connected and closed. Also, remove any empty outer / inner boundary chains.\n\nReturns true if all curves are connected and closed, false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)\n\nCreate a new circular arc.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-2","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreate a new parametric equation curve.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-Tuple{String, Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})\n\nCreate a new line defined by its end points.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, nKnots::Int, data::Matrix{Float64})\n\nCreate a spline curve from an array of knots\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, String}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, dataFile::String)\n\nCreate a spline curve from the contents of a data file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newCircularArcCurve","page":"Reference","title":"HOHQMesh.newCircularArcCurve","text":"newCircularArcCurve(name::String, center::Array{Float64},\n startAngle::Float64, endAngle::Float64,\n units::String)\n\nCreates and returns a new circular arc curve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newEndPointsLineCurve-Tuple{String, Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.newEndPointsLineCurve","text":"newEndPointsLineCurve(name::String, xStart::Array{Float64},xEnd::Array[Float64])\n\nCreates and returns a new curve defined by its end points in the form of a Dictionary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newParametricEquationCurve","page":"Reference","title":"HOHQMesh.newParametricEquationCurve","text":"newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreates and returns a new parametricEquationCurve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newProject","text":"newProject(name::String, folder::String)\n\nCreate a new project with the given name. That name will be used for the mesh and plot files in the specified folder.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementCenter-Tuple{String, String, Array{Float64, N} where N, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementCenter","text":"newRefinementCenter(name, type,\n center, meshSize,\n width)\n\nCreate refinement center of type \"smooth\" or \"sharp\" centered at center = [x,y,z] with a mesh size meshSize spread over a radius width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementLine-Tuple{String, String, Array{Float64, N} where N, Array{Float64, N} where N, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementLine","text":"newRefinementLine(name, type,\n start, end,\n meshSize,\n width)\n\nCreate refinement line of type \"smooth\" or \"sharp\" between start = [x,y,z] and end = [x,y,z] with a mesh size meshSize spread over a width width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, nKnots::Int, data::Array{Float64,4})\n\nReturns a spline curve given the number of knots and the array of knots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, dataFile::String)\n\nReturns a spline curve given a data file that contains the number of knots on the first line, and the spline data following that.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.openProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.openProject","text":"openProject(fileName::String, folder::String)\n\nOpen existing project described in the control File.\n\nfolder = folder the control file is in\nfileName = the name of the file\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.postNotificationWithName-Tuple{Any, String, Tuple}","page":"Reference","title":"HOHQMesh.postNotificationWithName","text":"postNotificationWithName(sender::Any, name::String, userInfo::Tuple)\n\nExecutes the function associated with the observer for the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.refinementRegionPoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.refinementRegionPoints","text":"refinementRegionPoints(r::Dict{String,Any})\n\nReturns Array{Float64,2} being the plotting points of a refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String, innerBoundaryName::String)\n\nDelete the curve named curveName from the inner boundary named innerBoundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String)\n\nDelete the curve named curveName from the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeBackgroundGrid!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeBackgroundGrid!","text":"removeBackgroundGrid!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundary!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundary!","text":"removeInnerBoundary!(proj::Project, chainName::String)\n\nRemove an entire inner boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurve!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurve!","text":"removeInnerBoundaryCurve!(proj::Project, name::String, chainName::String)\n\nRemove the curve with name from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurveAtIndex!","text":"removeInnerBoundaryCurveAtIndex!(proj::Project, indx::Int, chainName::String)\n\nRemove the curve at index indx from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundary!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeOuterBoundary!","text":"removeOuterBoundary!(proj::Project)\n\nRemove the outer boundary curve if it exists.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveAtIndex!","text":"removeOuterBoundaryCurveAtIndex!(proj::Project, indx::Int)\n\nRemove a curve from the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveWithName!","text":"removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n\nRemove the named curve in the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRefinementRegion!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeRefinementRegion!","text":"removeRefinementRegion!(proj::Project, name::String)\n\nDelete the named refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRunParameters!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeRunParameters!","text":"removeRunParameters!(proj::Project)\n\nRemove the run parameters block from the project. This is not undo-able.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeSpringSmoother!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeSpringSmoother!","text":"removeSpringSmoother!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove_mesh!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.remove_mesh!","text":"remove_mesh!(proj::Project)\n\nRemove the mesh file from proj.projectDirectory and delete the mesh from the plot\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.saveProject-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.saveProject","text":"saveProject(proj::Project)\n\nproj = Project to be saved\n\nSave a project dictionary to the file path specified when the project was created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcCenter!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setArcCenter!","text":"setArcCenter!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the center of a circular arc.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcEndAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcEndAngle!","text":"setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcRadius!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcRadius!","text":"setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcStartAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcStartAngle!","text":"setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcUnits!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setArcUnits!","text":"setArcUnits(crv::Dict{String,Any}, units::String)\n\nSet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridLowerLeft!-Tuple{HOHQMesh.Project, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setBackgroundGridLowerLeft!","text":"setBackgroundGridLowerLeft!(proj::Project, x0::Array{Float64})\n\nSet the lower left location of the background grid for problems that have no outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSpacing!(proj::Project, dx::Float64, dy::Float64, dz::Float64 = 0.0)\n\nUser facing function\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Array{Float64}, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, dx is passed an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Float64, Float64, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Float64, dy::Float64, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, the new grid size in either direction is passed individually with dxand dy.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSteps!-Tuple{HOHQMesh.Project, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.setBackgroundGridSteps!","text":"setBackgroundGridSteps!(proj::Project, N::Array{Int})\n\nSet how many steps of size setBackgroundGridSpacing in each direction the background grid extends from the lower left.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setCurveName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setCurveName!","text":"setCurveName!(curveDict, name)\n\nSet the name of the curve represented by curveDict.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setEndPoint!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setEndPoint!","text":"setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the end point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setMeshFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setMeshFileFormat!","text":"setMeshFileFormat(proj::Project, meshFileFormat::String)\n\nSet the file format for the mesh file. Acceptable choices are \"ISM\", \"ISM-V2\", or \"ABAQUS\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setName!","text":"setName(proj::Project,name::String)\n\nThe name of the project is the filename to be used by the mesh, plot, and stats files. It is also the name of the control file the tool will produce.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPlotFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setPlotFileFormat!","text":"setPlotFileFormat(proj::Project, plotFileFormat::String)\n\nSet the file format for the plot file. Acceptable choices are \"sem\", which includes interior nodes and boundary nodes and \"skeleton\", which includes only the corner nodes.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPolynomialOrder!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setPolynomialOrder!","text":"setPolynomialOrder(proj::Project, p::Int)\n\nSet the polynomial order for boundary curves in the mesh file to p.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementEnd!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementEnd!","text":"setRefinementEnd!(refinementRegion, location)\n\nSet the end point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementGridSize!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementGridSize!","text":"setRefinementGridSize!(r::Dict{String,Any}, h)\n\nSet the grid size, h for the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementLocation!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementLocation!","text":"setRefinementLocation!(refinementCenter, location)\n\nSet the location of a refinement center to location = [x,y,z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementName!","text":"setRefinementName!(r::Dict{String,Any}, type)\n\nSet a name for the refinement region.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementStart!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementStart!","text":"setRefinementStart!(refinementRegion, location)\n\nSet the start point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementType!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementType!","text":"setRefinementType!(refinementRegion, type)\n\nSet the type, either \"smooth\" or \"sharp\" for the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementWidth!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementWidth!","text":"setRefinementWidth!(r::Dict{String,Any}, width)\n\nSet the width of the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingIterations!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setSmoothingIterations!","text":"setSmoothingIterations!(proj::Project, iterations::Int)\n\nSet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingStatus!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingStatus!","text":"setSmoothingStatus(proj:Project, status::String)\n\nStatus is either \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingType!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingType!","text":"setSmoothingType!(proj:Project, status::String)\n\nType is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplineNKnots!-Tuple{Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.setSplineNKnots!","text":"setSplineNKnots!(spline::Dict{String,Any}, nKnots::Int)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplinePoints!-Tuple{Dict{String, Any}, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.setSplinePoints!","text":"setSplinePoints!(spline::Dict{String,Any},points::Array{Float64,4})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setStartPoint!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setStartPoint!","text":"setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the start point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setXEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setXEqn!","text":"setXEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the x-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setYEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setYEqn!","text":"setYEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the y-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setZEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setZEqn!","text":"setZEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the zEqn-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.unRegisterForNotification-Tuple{Any, String}","page":"Reference","title":"HOHQMesh.unRegisterForNotification","text":"unRegisterForNotification(observer::Any, note::String)\n\nRemove the observer from being notified by the notification note\n\n\n\n\n\n","category":"method"},{"location":"tutorials/spline_curves/#Spline-curves","page":"Spline curves","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line \"curves\". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.","category":"page"},{"location":"tutorials/spline_curves/#Synopsis","page":"Spline curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/spline_curves/#Initialization","page":"Spline curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a new project with the name \"spline_curves\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_project = newProject(\"spline_curves\", \"out\")","category":"page"},{"location":"tutorials/spline_curves/#Add-the-outer-boundary","page":"Spline curves","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The outer boundary curve for this tutorial is a circle of radius r=4 centered at the point (0 -1). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"circ = newCircularArcCurve(\"outerCircle\", # curve name\n [0.0, -1.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circ is assigned to be \"outerCircle\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new circ curve is then added to the spline_project as an outer boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToOuterBoundary!(spline_project, circ)","category":"page"},{"location":"tutorials/spline_curves/#Add-a-background-grid","page":"Spline curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for spline_project to have elements with side length 06 in each direction","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addBackgroundGrid!(spline_project, [0.6, 0.6, 0.0])","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"plotProject!(spline_project, MODEL+GRID)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"outerCircle\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/spline_curves/#Add-the-inner-boundaries","page":"Spline curves","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The domain of this tutorial will contain three inner boundary curves:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Cubic spline curve created from data points read in from a file.\nCubic spline curve created from points directly given in the code.\nTriangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-with-data-from-a-file","page":"Spline curves","title":"Cubic spline with data from a file","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots t_j, x_j, y_j, z_j where j indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a parametric spline curve from a file with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline1 = newSplineCurve(\"big_spline\", joinpath(@__DIR__, \"examples\", \"test_spline_curve_data.txt\"))","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline1 is assigned to be \"big_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline1 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline1, \"inner1\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve \"big_spline\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: one_curve)","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-from-data-in-Julia","page":"Spline curves","title":"Cubic spline from data in Julia","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Below, we construct another parametric spline using this strategy that consists of five data points","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n\nspline2 = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline2 is assigned to be \"small_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline2 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline2, \"inner2\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner2\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve \"small_spline\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: two_curves)","category":"page"},{"location":"tutorials/spline_curves/#Triangular-shape","page":"Spline curves","title":"Triangular shape","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"edge1 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.3, -1.0, 0.0], # start point\n [-1.7, -1.0, 0.0]) # end point\n\nedge2 = newEndPointsLineCurve(\"triangle\", # curve name\n [-1.7, -1.0, 0.0], # start point\n [-2.0, -0.4, 0.0]) # end point\n\nedge3 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.0, -0.4, 0.0], # start point\n [-2.3, -1.0, 0.0]) # end point","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, each edge of the curve is given the same name \"triangle\" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, edge1, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge2, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge3, \"inner3\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The inner boundary chain name \"inner3\" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called \"triangle\" labeled in the figure by 3.1, 3.2, and 3.3.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: three_curves)","category":"page"},{"location":"tutorials/spline_curves/#Generate-the-mesh","page":"Spline curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_curves.control: A HOHQMesh control file for the current project.\nspline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nspline_curves.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"generate_mesh(spline_project)\n 1 chevron elements removed from mesh.\n 1 chevron elements removed from mesh.\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.29613000000000000\n Number of nodes = 1177\n Number of Edges = 2225\n Number of Elements = 1047\n Number of Subdivisions = 4\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00006214 0.15607014 0.04505181 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00008989 2.78073390 1.23192911 1.00000000 999.99900000 1.00000000\n Condition 1.00000055 3.81350981 1.15526066 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00014319 6.76310951 1.46264239 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001495 0.10424741 0.03955903 0.00000000 999.99900000 1.00000000\n Minimum Angle 37.25504203 89.96195708 74.41060580 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.03105286 157.27881545 107.90994073 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of \"bad\" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: final_spline)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the \"big_spline\" curve. We decide that we are satisfied with the overall mesh quality.","category":"page"},{"location":"tutorials/spline_curves/#Summary","page":"Spline curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#Tutorials","page":"Overview","title":"Tutorials for HOHQMesh.jl","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"The tutorial section for HOHQMesh.jl provides step-by-step commands and accompanying explanations for the major features of the interactive mesh generation tools.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.","category":"page"},{"location":"tutorials/introduction/#[Straight-sided-outer-boundary](@ref)","page":"Overview","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.","category":"page"},{"location":"tutorials/introduction/#Synopsis","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/introduction/#[Curved-outer-boundary](@ref)","page":"Overview","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.","category":"page"},{"location":"tutorials/introduction/#Synopsis-2","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/introduction/#[Spline-curves](@ref)","page":"Overview","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/introduction/#Synopsis-3","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#[Creating-and-editing-curves](@ref)","page":"Overview","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve \"chain\" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.","category":"page"},{"location":"tutorials/introduction/#Synopsis-4","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"guided-tour/#Guided-tour","page":"Guided tour","title":"Guided tour","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In this brief overview, we highlight two scripts from the examples folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"See the HOHQMesh documentation for more details about its terminology and capabilities.","category":"page"},{"location":"guided-tour/#Mesh-from-a-control-file","page":"Guided tour","title":"Mesh from a control file","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_from_control_file.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"This command will create mesh and plot files in the out directory.","category":"page"},{"location":"guided-tour/#Build-a-mesh-from-scratch","page":"Guided tour","title":"Build a mesh from scratch","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_boundary.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For completeness, we provide the example script and walk-through each step in the construction of the Project below.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"using HOHQMesh\n\n# Create a new project with the name \"IceCreamCone\", which will also be the\n# name of the mesh, plot and stats files, written to output folder `out`.\n\np = newProject(\"IceCreamCone\", \"out\")\n\n# Outer boundary for this example mesh is a complete circle. Add it into the project.\n\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\n\n# Inner boundary is three curves. Two straight lines and a circular arc.\n# Note the three curve are connected to ensure a counter-clockwise orientation\n# as required by HOHQMesh\n\n# Create the three interior curves. The individual names of each curve in the inner\n# chain are used internally by HOHQMesh and are output as the given boundary names in\n# the mesh file.\n\ncone1 = newEndPointsLineCurve(\"cone1\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\niceCream = newCircularArcCurve(\"iceCream\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")\ncone2 = newEndPointsLineCurve(\"cone2\", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])\n\n# Assemble the three curve in a closed chain oriented counter-clockwise. The chain\n# name `IceCreamCone` is only used internally by HOHQMesh.\n\naddCurveToInnerBoundary!(p, cone1, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, iceCream, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, cone2, \"IceCreamCone\")\n\n# Adjust some `RunParameters` and overwrite the defaults values. In this case, we\n# set a new value for the boundary order polynomial representation and adjust the\n# output mesh file format to be `sem`\n\nsetPolynomialOrder!(p, 4)\nsetPlotFileFormat!(p, \"sem\")\n\n# A background grid is required for the mesh generation. In this example we lay a\n# background grid of Cartesian boxes with size 0.5.\n\naddBackgroundGrid!(p, [0.5, 0.5, 0.0])\n\n# Plot the project model curves and background grid\n\nif isdefined(Main, :Makie)\n plotProject!(p, MODEL+GRID)\n @info \"Press enter to generate the mesh and update the plot.\"\n readline()\n else # Throw an informational message about plotting to the user\n @info \"To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again.\"\n end\n\n# Generate the mesh. This produces the mesh and TecPlot files `AllFeatures.mesh` and `AllFeatures.tec`\n# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is\n# updated with the mesh that was generated.\n\ngenerate_mesh(p)\n\n# After the mesh successfully generates mesh statistics, such as the number of corner nodes,\n# the number of elements etc., are printed to the REPL","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The first line creates a new project, where the mesh and plot file names will be derived from the project name, \"IceCreamCone\" written to the specified folder.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, \"IceCreamCone\" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script sets the polynomial order (default = 5) and the plot file format (default = \"skeleton\").","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, so only the mesh size needs to be specified using","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"addBackgroundGrid!(proj::Project, bgSize::Array{Float64})","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The example sets the background mesh size to be 0.1 in the x and y directions. The z component is ignored.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The script finishes by generating the quad mesh and plotting the results, as shown below","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"(Image: iceCreamCone)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Finally, the script returns the project so that it can be edited further, if desired.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To save a control file for HOHQMesh, simply invoke","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"saveProject(proj::Project, outFile::String)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"where outFile is the name of the control file (traditionally with a .control extension). saveProject is automatically called when a mesh is generated.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.","category":"page"},{"location":"license/#License","page":"License","title":"License","text":"","category":"section"},{"location":"license/","page":"License","title":"License","text":"MIT LicenseCopyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-LakemperPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"CheatSheet/#Commands-Cheat-Sheet","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples folder constructs an identical example mesh as shown in the Guided tour using generic function calls.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"A thorough description of the functions can be found in the API section.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The general workflow of the interactive mesh functionality within a REPL session is","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Create a project\nAdd boundary curves\nAdd a background grid\nAdd manual refinement (if desired)\nGenerate mesh","category":"page"},{"location":"CheatSheet/#Project","page":"Commands Cheat Sheet","title":"Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" p = newProject(, )","category":"page"},{"location":"CheatSheet/#cs-plotting","page":"Commands Cheat Sheet","title":"Plotting","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" plotProject!(p, options)\n updatePlot!(p, options)","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The options are any sum of MODEL, GRID, REFINEMENTS, and MESH.","category":"page"},{"location":"CheatSheet/#Curves","page":"Commands Cheat Sheet","title":"Curves","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" c = new(name, startLocation [x,y,z],endLocation [x,y,z]) *Straight Line*\n c = new(name,center [x,y,z],radius, startAngle, endAngle) *Circular Arc*\n c = new(name, xEqn, yEqn, zEqn) *Parametric equation*\n c = new(name, dataFile) *Spline with data from a file*\n c = new(name, nKnots, knotsMatrix) *Spline with given knot values*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#cs-manual-refinement","page":"Commands Cheat Sheet","title":"Manual Refinement","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" r = newRefinementCenter(name, center, gridSize, radius)\n r = newRefinementLine(name, type, startPoint, endPoint, gridSize, width)","category":"page"},{"location":"CheatSheet/#Adding-to-a-Project","page":"Commands Cheat Sheet","title":"Adding to a Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" add!(p, c) *Add outer boundary curve*\n add!(p, c, ) *Add curve to an inner boundary*\n add!(p, r) *Add refinement region*\n\n addBackgroundGrid!(p, [top, left, bottom, right], [nX, nY, nZ]) *No outer boundary*\n addBackgroundGrid!(p, [dx, dy, dz]) *If an outer boundary is present*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function add!, which is a shortcut to the full functions, e.g. addOuterBoundaryCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#Accessing-items","page":"Commands Cheat Sheet","title":"Accessing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" crv = getCurve(p, curveName) *Get a curve in the outer boundary*\n crv = getCurve(p, curveName, boundaryName) *Get a curve in an inner boundary*\n indx, chain = getChain(p, boundaryName) *Get a complete inner boundary curve*\n r = getRefinementRegion(p, name)","category":"page"},{"location":"CheatSheet/#Removing-from-Project","page":"Commands Cheat Sheet","title":"Removing from Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" removeOuterboundary!(p) *Entire outer boundary curve*\n removeInnerBoundary!(p, innerBoundaryName) *Entire inner boundary curve*\n remove!(p, name) *Curve in outer boundary*\n remove!(p, name, innerBoundaryName) *Curve in inner boundary*\n removeRefinementRegion!(p, name)","category":"page"},{"location":"CheatSheet/#Editing-items","page":"Commands Cheat Sheet","title":"Editing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.","category":"page"},{"location":"CheatSheet/#Meshing","page":"Commands Cheat Sheet","title":"Meshing","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" generate_mesh(p)\n remove_mesh!(p)","category":"page"},{"location":"#HOHQMesh.jl","page":"Home","title":"HOHQMesh.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6 and above.","category":"page"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> import Pkg; Pkg.add(\"HOHQMesh\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the Julia REPL, you can load HOHQMesh with","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using HOHQMesh","category":"page"},{"location":"","page":"Home","title":"Home","text":"and then happily generate away!","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> control_file = joinpath(HOHQMesh.examples_dir(), \"GingerbreadMan.control\")\n\njulia> output = generate_mesh(control_file)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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,","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: gingerbreadman_with_edges_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"while the 3D file Snake.control produces this mesh:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: snake_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.,","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_box_two_circles.jl\"))","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using Pkg; Pkg.add(\"GLMakie\")\njulia> using GLMakie","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: box_two_circles)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Further explanation of the interactive functionality can be found here. Additional examples are available in the Tutorials.","category":"page"},{"location":"#authors-index-md","page":"Home","title":"Authors","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#License-and-contributing","page":"Home","title":"License and contributing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Acknowledgements","page":"Home","title":"Acknowledgements","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"}]
+}
diff --git a/v0.2.1/siteinfo.js b/v0.2.1/siteinfo.js
new file mode 100644
index 00000000..c32ac74c
--- /dev/null
+++ b/v0.2.1/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.2.1";
diff --git a/v0.2.1/testing/index.html b/v0.2.1/testing/index.html
new file mode 100644
index 00000000..e239a824
--- /dev/null
+++ b/v0.2.1/testing/index.html
@@ -0,0 +1,3 @@
+
+Testing · HOHQMesh.jl
During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In Trixi and its related repositories, tests are triggered by
each git push to main and
each git push to any pull request.
Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.
Test and coverage requirements
Before merging a pull request (PR) to main, we require that
The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing
julia> using Pkg; Pkg.test("HOHQMesh")
in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,
julia> # Run all test for the interactive Curve API
+ include(joinpath("test", "test_curve.jl"))
We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.
Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.
When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).
Test duration
As a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).
In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered "covered" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The "Details" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.
Coverage requirements
In general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 13 October 2023. Using Julia version 1.6.7.
diff --git a/v0.2.1/tutorials/create_edit_curves/index.html b/v0.2.1/tutorials/create_edit_curves/index.html
new file mode 100644
index 00000000..6353a80a
--- /dev/null
+++ b/v0.2.1/tutorials/create_edit_curves/index.html
@@ -0,0 +1,166 @@
+
+Creating and editing curves · HOHQMesh.jl
The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a "chain" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "sandbox" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.
We first create the outer boundary curve chain that is composed of three pieces
Straight line segment from $(0, -7)$ to $(5, 3)$.
Half-circle arc of radius $r=5$ centered at $(0, 3)$.
Straight line segment from $(-5, 3)$ to $(0, -7)$.
Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
outer_line1 = newEndPointsLineCurve("Line1", # curve name
+ [0.0, -7.0, 0.0], # start point
+ [5.0, 3.0, 0.0]) # end point
+
+outer_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-5.0, 3.0, 0.0], # start point
+ [0.0, -7.0, 0.0]) # end point
To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from $0$ to $180$ degrees.
outer_arc = newCircularArcCurve("Arc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 5.0, # radius
+ 0.0, # start angle
+ 180.0, # end angle
+ "degrees") # units for angle
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be "Arc".
The curve names "Line1", "Line2", and "Arc" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.
The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction
We visualize the outer boundary curve chain and background grid with the following
plotProject!(sandbox_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains three curve segments "Line1", "Arc", and "Line2" labeled in the figure by O.1, O.2, and O.3, respectively.
Suppose that the domain boundary requires a curved segment instead of the straight line "Line2". We will replace this line segment in the outer boundary chain with a cubic spline.
First, we remove the "Line2" curve from the "Outer" chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
The plot automatically updates and we see that the outer boundary is open and contains two segments: "Line1" and "Arc".
Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve "Arc" and end at the first point of the curve "Line1". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. The spline curve constructor newSplineCurve also takes the number of points as an input argument.
We create a pill shaped inner boundary curve chain composed of four pieces
Straight line segment from $(1, 5)$ to $(1, 3)$.
Half-circle arc of radius $r=1$ centered at $(0, 3)$.
Straight line segment from $(-1, 3)$ to $(-1, 5)$.
Half-circle arc of radius $r=1$ centered at $(0, 5)$.
Similar to the construction of the "Outer" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
inner_line1 = newEndPointsLineCurve("Line1", # curve name
+ [1.0, 5.0, 0.0], # start point
+ [1.0, 3.0, 0.0]) # end point
+
+inner_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-1.0, 3.0, 0.0], # start point
+ [-1.0, 5.0, 0.0]) # end point
To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at $(0, 3)$ varies from $0$ to $-180$ degrees. The top half-circle arc centered at $(0, 5)$ has an angle that varies from $180$ to $0$ degrees. The construction of the two circle arcs are
inner_bottom_arc = newCircularArcCurve("BottomArc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 1.0, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+
+inner_top_arc = newCircularArcCurve("TopArc", # curve name
+ [0.0, 5.0, 0.0], # center
+ 1.0, # radius
+ 180.0, # start angle
+ 0.0, # end angle
+ "degrees") # units for angle
Note, we use "radians" to set the angle bounds for inner_bottom_arc and "degrees" for the angle bounds of inner_top_arc.
The curve names "Line1", "Line2", "BottomArc", and "TopArc" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.
The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.
This inner boundary chain name "inner" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments "Line1", "BottomArc", "Line2", and "TopArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:
sandbox.control: A HOHQMesh control file for the current project.
sandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
sandbox.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 8.7928000000000006E-002
+ Number of nodes = 513
+ Number of Edges = 933
+ Number of Elements = 422
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00003020 1.17336756 0.18813064 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00984888 2.32321419 1.31488869 1.00000000 999.99900000 1.00000000
+ Condition 1.00041121 2.42894151 1.21101797 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.01674110 3.74861238 1.59495734 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001734 1.13821390 0.14136293 0.00000000 999.99900000 1.00000000
+ Minimum Angle 32.20087774 89.35157729 68.75755243 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.60787193 152.53515465 113.36966060 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.
Additionally, the remove_mesh! command deletes the mesh information from the sandbox_project and sandbox.mesh from the out folder. However, the sandbox.control and sandbox.tec files are still present in out directory.
Suppose that the inner boundary actually requires a curved segment instead of the straight line "Line1". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.
We remove the "Line1" curve from the inner chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: "BottomArc", "Line2", and "TopArc". Note that the index of the remaining curves has changed as shown below.
Brief note about undo / redo
The interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.
undoActionName()
+"Remove Inner Boundary Curve"
We can undo the removal of the "Line1" curve with undo
undo()
+"Undo Remove Inner Boundary Curve"
In addition to reinstating "Line1" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.
Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.
The new inner curve segment will be an oscillating line given by the parametric equations
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above
We see from the figure that this parametric equation curve starts at the point $(1,5)$ and, therefore, matches the end point of the existing curve "TopArc" present in the "inner" chain. However, the parametric equation curve ends at the point $(2,3)$ which does not match the "BottomArc" curve. So, the inner boundary chain remains open.
Attempt to generate a mesh with an open curve chain
An open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.
To create a closed boundary curve we must remove the "BottomArc" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point $(2, 3)$ and end at the point $(-1, 3)$ to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the "BottomArc" from the "inner" chain.
The figure updates to display the "inner" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.
A half-circle arc that joins the points $(2, 3)$ and $(-1, 3)$ has a radius $r=1.5$, is centered at $(0.5, 3)$ and has an angle that vaires from $0$ to $-180$. We construct this circle arc and directly add it to the sandbox_project.
new_bottom_arc = newCircularArcCurve("wideBottomArc", # curve name
+ [0.5, 3.0, 0.0], # center
+ 1.5, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
The updated plot now gives the modified, closed inner curve chain that now contains four curve segments "Line2", "TopArc", "wiggleLine", and "wideBottomArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.13299600000000000
+ Number of nodes = 714
+ Number of Edges = 1308
+ Number of Elements = 596
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00003020 1.15662678 0.12823840 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.01082600 3.14765817 1.34292128 1.00000000 999.99900000 1.00000000
+ Condition 1.00037252 2.59936116 1.22903490 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.02724726 3.74861238 1.64807401 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001734 1.13150266 0.09438571 0.00000000 999.99900000 1.00000000
+ Minimum Angle 31.88018513 89.33451932 67.86550651 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.43850948 157.31718198 114.36070355 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The visualization updates automatically and the background grid is removed after when the mesh is generated.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.
Add the background grid when an outer boundary curve is present.
Visualize an interactive mesh project.
Discuss undo / redo capabilities.
Construct and add parametric spline curves.
Construct and add a curve from parametric equations.
Construct and add straight line segments.
Construct and add circular arc segments.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with modified outer and inner curve chains
+#
+# Create inner / outer boundary chains composed of the four
+# available HOHQMesh curve types.
+#
+# Keywords: outer boundary, inner boundary, parametric equations,
+# circle arcs, cubic spline, curve removal
+using HOHQMesh
+
+# Instantiate the project
+sandbox_project = newProject("sandbox", "out")
+
+# Add the background grid
+addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])
+
+# Create and add the original outer boundary curves
+outer_line1 = newEndPointsLineCurve("Line1", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])
+outer_line2 = newEndPointsLineCurve("Line2", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])
+outer_arc = newCircularArcCurve("Arc", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, "degrees")
+
+addCurveToOuterBoundary!(sandbox_project, outer_line1)
+addCurveToOuterBoundary!(sandbox_project, outer_arc)
+addCurveToOuterBoundary!(sandbox_project, outer_line2)
+
+# Modify the outer boundary to have a spline instead of a straight line
+removeOuterBoundaryCurveWithName!(sandbox_project, "Line2")
+
+spline_data = [ [0.0 -5.0 3.0 0.0]
+ [0.25 -2.0 1.0 0.0]
+ [0.5 -4.0 0.5 0.0]
+ [0.75 -2.0 -3.0 0.0]
+ [1.0 0.0 -7.0 0.0] ]
+outer_spline = newSplineCurve("Spline", 5, spline_data)
+addCurveToOuterBoundary!(sandbox_project, outer_spline)
+
+# Create and add the inner boundary curves
+inner_line1 = newEndPointsLineCurve("Line1", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])
+inner_line2 = newEndPointsLineCurve("Line2", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])
+inner_bottom_arc = newCircularArcCurve("BottomArc", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, "radians")
+inner_top_arc = newCircularArcCurve("TopArc", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, "degrees")
+
+addCurveToInnerBoundary!(sandbox_project, inner_line1, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_line2, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_top_arc, "inner")
+
+# Generate a mesh
+generate_mesh(sandbox_project)
+
+# Delete the existing mesh before modifying the inner boundary curve chain
+remove_mesh!(sandbox_project)
+
+# Modify the inner boundary curve with an oscillatory line and a new circle arc
+removeInnerBoundaryCurve!(sandbox_project, "Line1", "inner")
+removeInnerBoundaryCurve!(sandbox_project, "BottomArc", "inner")
+
+xEqn = "x(t) = t + 1"
+yEqn = "y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)"
+zEqn = "z(t) = 0.0"
+inner_eqn = newParametricEquationCurve("wiggleLine", xEqn, yEqn, zEqn)
+
+new_bottom_arc = newCircularArcCurve("wideBottomArc", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, "radians")
+
+addCurveToInnerBoundary!(sandbox_project, inner_eqn, "inner")
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
+
+# Regenerate the final mesh
+generate_mesh(sandbox_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 13 October 2023. Using Julia version 1.6.7.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.
The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "TheBlob" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
The following commands create a new curve for the parametric equations above
The name of this curve is assigned to be "Blob". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for blob_project to have elements with side length two in each direction
addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])
We next visualize the outer boundary curve and background grid with the following
plotProject!(blob_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "Blob" labeled in the figure by O.1.
From the visualization we see that the background grid is likely too coarse to produce a "good" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction
setBackgroundGridSize!(blob_project, 0.5, 0.5)
Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.
The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.
We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:
TheBlob.control: A HOHQMesh control file for the current project.
TheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
TheBlob.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.10612399999999998
+ Number of nodes = 481
+ Number of Edges = 895
+ Number of Elements = 417
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025346 0.36181966 0.11936327 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002883 2.58066393 1.26340310 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.11480166 1.18583253 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006177 4.80707901 1.51313656 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011326 0.28172540 0.10292251 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.30873612 89.99827738 73.08079323 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132792 156.87642432 109.37004979 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point $(-4, 0)$ is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with
Above we create a circular refinement region centered at the point $(-4, -0.5)$ with a desired resolution size $0.4$ and a radius of $1.0$. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.
With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.11373499999999999
+ Number of nodes = 505
+ Number of Edges = 940
+ Number of Elements = 438
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025346 0.36181966 0.11412658 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002884 2.47585614 1.26424390 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.11480166 1.18425870 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006177 4.80707901 1.51413601 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011326 0.28172540 0.09814547 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.30873612 89.99827901 72.79596483 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132782 156.87642433 109.63912468 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.
Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.
Define a curved outer boundary using parametric equations.
Add and adjust the background grid.
Visualize an interactive mesh project.
Add manual refinement to a local region of the domain.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with a curved outer boundary
+#
+# Create an outer boundary from a set of parametric equations.
+# Add manual refinement in a small region around the point (-4, -0.5).
+#
+# Keywords: outer boundary, parametric equations, refinement center
+using HOHQMesh
+
+# Instantiate the project
+blob_project = newProject("TheBlob", "out")
+
+# Create and add the outer boundary curve
+xEqn = "x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3"
+yEqn = "y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2"
+zEqn = "z(t) = 0.0"
+blob = newParametricEquationCurve("Blob", xEqn, yEqn, zEqn)
+addCurveToOuterBoundary!(blob_project, blob)
+
+# Add the background grid
+addBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])
+
+# Create and add the refinement region
+center = newRefinementCenter("region", "smooth", [-4.0, -0.5, 0.0], 0.4, 1.0)
+addRefinementRegion!(blob_project, center)
+
+# Generate the mesh
+generate_mesh(blob_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 13 October 2023. Using Julia version 1.6.7.
For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.
For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.
This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.
This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.
This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line "curves".
This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve "chain" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line "curves". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "spline_curves" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.
The outer boundary curve for this tutorial is a circle of radius $r=4$ centered at the point $(0, -1)$. We define this circular curve with the function newCircularArcCurve as follows
circ = newCircularArcCurve("outerCircle", # curve name
+ [0.0, -1.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circ is assigned to be "outerCircle". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circ curve is then added to the spline_project as an outer boundary curve with
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for spline_project to have elements with side length $0.6$ in each direction
We next visualize the outer boundary curve and background grid with the following
plotProject!(spline_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "outerCircle" labeled in the figure by O.1.
A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots $t_j$, $x_j$, $y_j$, $z_j$ where $j$ indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder
We create a parametric spline curve from a file with
The name of the curve stored in the dictionary spline1 is assigned to be "big_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline1 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve "big_spline" labeled in the figure by 1.1.
Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.
Below, we construct another parametric spline using this strategy that consists of five data points
The name of the curve stored in the dictionary spline2 is assigned to be "small_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline2 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner2" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve "small_spline" labeled in the figure by 2.1.
Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with
edge1 = newEndPointsLineCurve("triangle", # curve name
+ [-2.3, -1.0, 0.0], # start point
+ [-1.7, -1.0, 0.0]) # end point
+
+edge2 = newEndPointsLineCurve("triangle", # curve name
+ [-1.7, -1.0, 0.0], # start point
+ [-2.0, -0.4, 0.0]) # end point
+
+edge3 = newEndPointsLineCurve("triangle", # curve name
+ [-2.0, -0.4, 0.0], # start point
+ [-2.3, -1.0, 0.0]) # end point
Here, each edge of the curve is given the same name "triangle" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.
The inner boundary chain name "inner3" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called "triangle" labeled in the figure by 3.1, 3.2, and 3.3.
With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:
spline_curves.control: A HOHQMesh control file for the current project.
spline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
spline_curves.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(spline_project)
+ 1 chevron elements removed from mesh.
+ 1 chevron elements removed from mesh.
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.29613000000000000
+ Number of nodes = 1177
+ Number of Edges = 2225
+ Number of Elements = 1047
+ Number of Subdivisions = 4
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00006214 0.15607014 0.04505181 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00008989 2.78073390 1.23192911 1.00000000 999.99900000 1.00000000
+ Condition 1.00000055 3.81350981 1.15526066 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00014319 6.76310951 1.46264239 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001495 0.10424741 0.03955903 0.00000000 999.99900000 1.00000000
+ Minimum Angle 37.25504203 89.96195708 74.41060580 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.03105286 157.27881545 107.90994073 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of "bad" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the "big_spline" curve. We decide that we are satisfied with the overall mesh quality.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "box_two_circles" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.
When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.
For the box_project we first query the current values for the polynomial order and the mesh output format
We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be $4$ and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.
The domain for this tutorial is a rectangular box with the bounds $[0,30]\times[0,15]$. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:
Set the lower left corner point of the domain $(x_0, y_0)$, define the element size in each spatial direction $\Delta x$ and $\Delta y$, and the number of steps taken in each direction $N_x, N_y$. The resulting background grid will have the extent $[x_0, x_0 + N_x \Delta x]$ by $[y_0, y_0 + N_y \Delta y]$. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands
Set the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box $[0,30]\times[0,15]$ we use
Next, we add the two circular inner boundary curves with different radii.
The first circle will have radius $r=2$ and be centered at the point $(4, 4)$. We define this circular curve with the function newCircularArcCurve as follows
circle1 = newCircularArcCurve("circle1", # curve name
+ [4.0, 4.0, 0.0], # circle center
+ 2.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be "circle1". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circle1 curve is then added to the box_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called "inner1" and it contains a single curve "circle1" labeled in the figure by 1.1.
With analogous steps we create another circular curve with radius $r=4$, centered at $(20, 9)$ and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.
circle2 = newCircularArcCurve("circle2", # curve name
+ [20.0, 9.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 2.0 * pi, # end angle
+ "radians") # angle units
+addCurveToInnerBoundary!(box_project, circle2, "inner2")
Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called "inner2" and it contains a single curve "circle2" labeled in the figure by 2.1.
With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:
box_two_circles.control: A HOHQMesh control file for the current project.
box_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
box_two_circles.inp: A mesh file with format ABAQUS that was set above.
To do this we execute the command
generate_mesh(box_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 3.5553999999999995E-002
+ Number of nodes = 498
+ Number of Edges = 921
+ Number of Elements = 422
+ Number of Subdivisions = 0
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.34513058 1.15383206 0.91833833 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00000004 1.71083844 1.08733476 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 1.46558793 1.04922640 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00000006 2.43503343 1.16700825 1.00000000 4.00000000 1.00000000
+ Jacobian 0.17863168 1.07210721 0.86801359 0.00000000 999.99900000 1.00000000
+ Minimum Angle 50.56155029 89.99999787 83.84466557 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00000259 136.97479459 96.69930735 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.
From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.
This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples/ folder constructs an identical example mesh as shown in the Guided tour using generic function calls.
A thorough description of the functions can be found in the API section.
The general workflow of the interactive mesh functionality within a REPL session is
c = new(name, startLocation [x,y,z], endLocation [x,y,z]) *Straight Line*
+ c = new(name, center [x,y,z], radius, startAngle, endAngle) *Circular Arc*
+ c = new(name, xEqn, yEqn, zEqn) *Parametric equation*
+ c = new(name, dataFile) *Spline with data from a file*
+ c = new(name, nKnots, knotsMatrix) *Spline with given knot values*
Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.
All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.
HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).
HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.
Developer Certificate of Origin
+Version 1.1
+
+Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+1 Letterman Drive
+Suite D4700
+San Francisco, CA, 94129
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+
+Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+(a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+(b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+(c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+(d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
Settings
This document was generated with Documenter.jl version 0.27.25 on Monday 8 January 2024. Using Julia version 1.6.7.
When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:
Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.
If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.
Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like VS Code with the Julia extension). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.
Set the new version number in Project.toml according to the Julian version of semver. Commit and push.
Comment @JuliaRegistrator register on the commit setting the version number.
JuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.
Increment the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.
You can build the documentation of HOHQMesh.jl locally by running
julia --project=docs -e 'using Pkg; Pkg.instantiate(); include("docs/make.jl")'
from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).
Settings
This document was generated with Documenter.jl version 0.27.25 on Monday 8 January 2024. Using Julia version 1.6.7.
In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.
All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).
If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.
git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git
+# get latest main from the main repo
+git checkout main
+git pull
+# create a new branch for a cool new feature, bug fix, ...
+git checkout -b YOUR_BRANCH_NAME
+# do some work and push it to your fork
+git push -u myfork
+# go to https://github.com/trixi-framework/HOHQMesh.jl/pull
+# and create a PR from your new branch
Why using pull requests?
Immediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.
With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.
Avoid committing unwanted files
When you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.
For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:
Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.
Execute git fetch to get the latest changes from the repository.
Make sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.
Merge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.
In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.
If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should
merge the current main to your branch
run tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs
properly comment your code
delete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)
remove debug statements
add a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)
After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.
Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.
Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.
Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).
Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:
Update your clone by running git fetch.
Check out main using git checkout main.
Delete merged branch locally with git branch -d yourbranch.
Remove local references to deleted remote branch by executing git remote prune origin.
You can now proceed with your next changes by starting again at the top.
Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):
If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running
git reset HEAD~
This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.
If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.
Large files
You should never try to fix this yourself, as it potentially disrupts/destroys the work of others!
Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):
Tell everyone to commit and push their changes to the repository.
Fix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.
Perform the following steps to clean up the Git repository:
cd /tmp
+
+# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/
+
+# Get fresh clone of repo (so you can throw it away in case there is a problem)
+git clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git
+
+# Clean up repo of all files larger than 10M
+java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git
+
+# Enter repo
+cd HOHQMesh.jl.git
+
+# Clean up reflog and force aggressive garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
+
+# Push changes
+git push
+
+# Delete clone
+rm -rf HOHQMesh.jl.git
Tell everyone to clean up their local working copies by performing the following steps (also do this yourself):
# Enter repo
+cd HOHQMesh.jl
+
+# Get current changes
+git fetch
+
+# Check out the fixed branch
+git checkout branchname
+
+# IMPORTANT: Do a rebase instead of a pull!
+git rebase
+
+# Clean reflog and force garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
IMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.
Settings
This document was generated with Documenter.jl version 0.27.25 on Monday 8 January 2024. Using Julia version 1.6.7.
diff --git a/v0.2.2/guided-tour/index.html b/v0.2.2/guided-tour/index.html
new file mode 100644
index 00000000..ef9d6cf0
--- /dev/null
+++ b/v0.2.2/guided-tour/index.html
@@ -0,0 +1,62 @@
+
+Guided tour · HOHQMesh.jl
In this brief overview, we highlight two scripts from the examples/ folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.
A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute
A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute
For completeness, we provide the example script and walk-through each step in the construction of the Project below.
using HOHQMesh
+
+# Create a new project with the name "IceCreamCone", which will also be the
+# name of the mesh, plot and stats files, written to output folder `out`.
+
+p = newProject("IceCreamCone", "out")
+
+# Outer boundary for this example mesh is a complete circle. Add it into the project.
+
+circ = newCircularArcCurve("outerCircle", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, "degrees")
+addCurveToOuterBoundary!(p, circ)
+
+# Inner boundary is three curves. Two straight lines and a circular arc.
+# Note the three curve are connected to ensure a counter-clockwise orientation
+# as required by HOHQMesh
+
+# Create the three interior curves. The individual names of each curve in the inner
+# chain are used internally by HOHQMesh and are output as the given boundary names in
+# the mesh file.
+
+cone1 = newEndPointsLineCurve("cone1", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])
+iceCream = newCircularArcCurve("iceCream", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, "degrees")
+cone2 = newEndPointsLineCurve("cone2", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])
+
+# Assemble the three curve in a closed chain oriented counter-clockwise. The chain
+# name `IceCreamCone` is only used internally by HOHQMesh.
+
+addCurveToInnerBoundary!(p, cone1, "IceCreamCone")
+addCurveToInnerBoundary!(p, iceCream, "IceCreamCone")
+addCurveToInnerBoundary!(p, cone2, "IceCreamCone")
+
+# Adjust some `RunParameters` and overwrite the defaults values. In this case, we
+# set a new value for the boundary order polynomial representation and adjust the
+# output mesh file format to be `sem`
+
+setPolynomialOrder!(p, 4)
+setPlotFileFormat!(p, "sem")
+
+# A background grid is required for the mesh generation. In this example we lay a
+# background grid of Cartesian boxes with size 0.5.
+
+addBackgroundGrid!(p, [0.5, 0.5, 0.0])
+
+# Plot the project model curves and background grid
+
+if isdefined(Main, :Makie)
+ plotProject!(p, MODEL+GRID)
+ @info "Press enter to generate the mesh and update the plot."
+ readline()
+ else # Throw an informational message about plotting to the user
+ @info "To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again."
+ end
+
+# Generate the mesh. This produces the mesh and TecPlot files `IceCreamCone.mesh` and `IceCreamCone.tec`
+# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is
+# updated with the mesh that was generated.
+
+generate_mesh(p)
+
+# After the mesh successfully generates mesh statistics, such as the number of corner nodes,
+# the number of elements etc., are printed to the REPL
The first line creates a new project, where the mesh and plot file names will be derived from the project name, "IceCreamCone" written to the specified folder.
To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:
Parametric equations
Cubic Splines
Lines defined by their end points
Circular arcs
In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.
Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, "IceCreamCone" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.
For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script resets the polynomial order (default = 5) and the plot file format (default = "skeleton").
One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, only the mesh size needs to be specified using
The example sets the background mesh size to be 0.5 in the x and y directions. The z component is ignored.
The script finishes by generating the quad mesh and plotting the results, as shown below
Finally, the script returns the project so that it can be edited further, if desired.
To save a control file for HOHQMesh, simply invoke
saveProject(proj::Project)
where the name of the control file (traditionally with a .control extension) matches the name of the project proj. saveProject is automatically called when a mesh is generated.
Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.
Settings
This document was generated with Documenter.jl version 0.27.25 on Monday 8 January 2024. Using Julia version 1.6.7.
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.
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.
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
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.,
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.
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.
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.
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.
Settings
This document was generated with Documenter.jl version 0.27.25 on Monday 8 January 2024. Using Julia version 1.6.7.
The supplied name will be the default name of the control, mesh, and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.
The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.
If the model is modified and you want to re-plot with the new values, invoke
updatePlot!(proj::Project, options)
but generally the plot will be updated automatically as you build the model.
HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.
The available mesh file formats are "ISM", "ISM-V2", or "ABAQUS". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.
The plot file (which can be viewed with something like VisIt or ParaView) format is either "skeleton" or "sem". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.
By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with
A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available in the documentation.
To change the defaults, the smoother parameters can be set/enquired with the functions
There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must be specified after a new project has been created.
Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.
Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).
where name labels the refinement region, the type is either "smooth" or "sharp", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.
The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a "chain" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.
The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.
The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.
See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.
Returns a new set of parametric equation. Equations must be of the form
<function name>(<argument>) = ...
The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
A cubic spline is defined by an array of knots, $t_j$, $x_j$, $y_j$, $z_j$. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the $t$, $x$, $y$, $z$ values, e.g.
The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either "degrees" or "radians". That argument is optional, and defaults to "degrees".
Using the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using
The syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.
The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.
Several scripts are available in the examples/ folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.
Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.
The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.
To generate a mesh interactively you
Create a project with a user given projectName and folder where any generated files are to be saved
p = newProject(<projectName>, <folder>)
Both of these input arguments are strings.
Create inner and outer boundary curves from the available types
c = newEndPointsLineCurve(<name>, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*
+c = newCircularArcCurve(<name>, center [x, y, z], radius, startAngle, endAngle, units = "degrees" or "radians") *Circular Arc*
+c = newParametricEquationCurve(<name>, xEqn, yEqn, zEqn) *Parametric equation*
+c = newSplineCurve(<name>, dataFile) *Spline with data from a file*
+c = newSpline(<name>, nKnots, knotsMatrix) *Spline with given knot values*
See Defining curves for further details on the different curve type currently supported by HOHQMesh.
The generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.
Add curves to build the model to see what you have added,
addOuterBoundaryCurve!(p, <curveName>) *Add outer boundary curve*
+addInnerBoundaryCurve!(p, <curveName>, <InnerBoundaryName>) *Add curve to an inner boundary*
For a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.
Curves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.
Visualize the project's model, if desired
plotProject!(p, MODEL)
Plots are updated in response to user interactions. However, to update the plot at any time, use
updatePlot!(p, options)
Options are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.
Visualization requirement
The interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.
Set the background grid
When no outer boundary curve is present, the background grid can be set with
addBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])
Or
addBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])
The first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.
When an outer boundary is present the background grid can be set as
addBackgroundGrid!(p, [dx, dy, dz])
where the spacing controls the number of elements in each direction.
Background grid
A background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.
Adjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by
setPolynomialOrder!(p, order)
The background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately
The mesh file will be saved in <folder> with the name <projectName>.mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name <projectName>.control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.
All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.
Settings
This document was generated with Documenter.jl version 0.27.25 on Monday 8 January 2024. Using Julia version 1.6.7.
Copyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-Lakemper
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Settings
This document was generated with Documenter.jl version 0.27.25 on Monday 8 January 2024. Using Julia version 1.6.7.
Add the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version
Add the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.
Add an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.
Return a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.
Generate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.
You can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.
You can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
Generate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.
This function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
getCurveType(crv::Dic{String,Any})
+
+Get the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,
+`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.
Get the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.
Set the file format for the plot file. Acceptable choices are "sem", which includes interior nodes and boundary nodes and "skeleton", which includes only the corner nodes.
This document was generated with Documenter.jl version 0.27.25 on Monday 8 January 2024. Using Julia version 1.6.7.
diff --git a/v0.2.2/search_index.js b/v0.2.2/search_index.js
new file mode 100644
index 00000000..8b388b29
--- /dev/null
+++ b/v0.2.2/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"contributing/#Contributing","page":"Contributing","title":"Contributing","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.","category":"page"},{"location":"contributing/#Developer-Certificate-of-Origin-(Version-1.1)","page":"Contributing","title":"Developer Certificate of Origin (Version 1.1)","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"The following text was taken from https://developercertificate.org:","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"Developer Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n1 Letterman Drive\nSuite D4700\nSan Francisco, CA, 94129\n\nEveryone is permitted to copy and distribute verbatim copies of this\nlicense document, but changing it is not allowed.\n\n\nDeveloper's Certificate of Origin 1.1\n\nBy making a contribution to this project, I certify that:\n\n(a) The contribution was created in whole or in part by me and I\n have the right to submit it under the open source license\n indicated in the file; or\n\n(b) The contribution is based upon previous work that, to the best\n of my knowledge, is covered under an appropriate open source\n license and I have the right under that license to submit that\n work with modifications, whether created in whole or in part\n by me, under the same open source license (unless I am\n permitted to submit under a different license), as indicated\n in the file; or\n\n(c) The contribution was provided directly to me by some other\n person who certified (a), (b) or (c) and I have not modified\n it.\n\n(d) I understand and agree that this project and the contribution\n are public and that a record of the contribution (including all\n personal information I submit with it, including my sign-off) is\n maintained indefinitely and may be redistributed consistent with\n this project or the open source license(s) involved.","category":"page"},{"location":"development/#Development","page":"Development","title":"Development","text":"","category":"section"},{"location":"development/#Text-editors","page":"Development","title":"Text editors","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:","category":"page"},{"location":"development/#VS-Code","page":"Development","title":"VS Code","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.","category":"page"},{"location":"development/#Juno","page":"Development","title":"Juno","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.","category":"page"},{"location":"development/#Vim-or-Emacs","page":"Development","title":"Vim or Emacs","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like VS Code with the Julia extension). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.","category":"page"},{"location":"development/#Releasing-a-new-version-of-HOHQMesh","page":"Development","title":"Releasing a new version of HOHQMesh","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Check whether everything is okay, tests pass etc.\nSet the new version number in Project.toml according to the Julian version of semver. Commit and push.\nComment @JuliaRegistrator register on the commit setting the version number.\nJuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.\nIncrement the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.","category":"page"},{"location":"development/#Preview-the-documentation","page":"Development","title":"Preview the documentation","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"You can build the documentation of HOHQMesh.jl locally by running","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"julia --project=docs -e 'using Pkg; Pkg.instantiate(); include(\"docs/make.jl\")'","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).","category":"page"},{"location":"tutorials/straight_outer_boundary/#Straight-sided-outer-boundary","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples/ folder.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Synopsis","page":"Straight-sided outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Initialization","page":"Straight-sided outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We create a new project with the name \"box_two_circles\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_project = newProject(\"box_two_circles\", \"out\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Adjusting-project-parameters","page":"Straight-sided outer boundary","title":"Adjusting project parameters","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"For the box_project we first query the current values for the polynomial order and the mesh output format","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> getPolynomialOrder(box_project)\n5\n\njulia> getMeshFileFormat(box_project)\n\"ISM-V2\"","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be 4 and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"setPolynomialOrder!(box_project, 4)\nsetMeshFileFormat!(box_project, \"ABAQUS\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-background-grid","page":"Straight-sided outer boundary","title":"Add the background grid","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The domain for this tutorial is a rectangular box with the bounds 030times015. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Set the lower left corner point of the domain (x_0 y_0), define the element size in each spatial direction Delta x and Delta y, and the number of steps taken in each direction N_x N_y. The resulting background grid will have the extent x_0 x_0 + N_x Delta x by y_0 y_0 + N_y Delta y. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands\nlower_left = [0.0, 0.0, 0.0]\nspacing = [1.0, 1.0, 0.0]\nnum_intervals = [30, 15, 0]\naddBackgroundGrid!(box_project, lower_left, spacing, num_intervals)\nSet the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box 030times015 we use\nbounds = [15.0, 0.0, 0.0, 30.0]\nN = [30, 15, 0]\naddBackgroundGrid!(box_project, bounds, N)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we visualize the box_project to ensure that the background grid has been added correctly.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"plotProject!(box_project, GRID)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use the keyword and GRID to indicate that we want the background grid to be included in the visualization.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: background)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-inner-boundaries","page":"Straight-sided outer boundary","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we add the two circular inner boundary curves with different radii.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The first circle will have radius r=2 and be centered at the point (4 4). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle1 = newCircularArcCurve(\"circle1\", # curve name\n [4.0, 4.0, 0.0], # circle center\n 2.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be \"circle1\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The new circle1 curve is then added to the box_project as an inner boundary curve with","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"addCurveToInnerBoundary!(box_project, circle1, \"inner1\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called \"inner1\" and it contains a single curve \"circle1\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: first_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With analogous steps we create another circular curve with radius r=4, centered at (20 9) and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle2 = newCircularArcCurve(\"circle2\", # curve name\n [20.0, 9.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 2.0 * pi, # end angle\n \"radians\") # angle units\naddCurveToInnerBoundary!(box_project, circle2, \"inner2\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called \"inner2\" and it contains a single curve \"circle2\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: second_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Generate-the-mesh","page":"Straight-sided outer boundary","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_two_circles.control: A HOHQMesh control file for the current project.\nbox_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nbox_two_circles.inp: A mesh file with format ABAQUS that was set above.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"generate_mesh(box_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 2.9116999999999997E-002\n Number of nodes = 498\n Number of Edges = 921\n Number of Elements = 422\n Number of Subdivisions = 0\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.34513977 1.15385313 0.91833886 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00000004 1.71084672 1.08736698 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 1.46547984 1.04928616 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00000006 2.43578615 1.16710823 1.00000000 4.00000000 1.00000000\n Jacobian 0.17854786 1.07210200 0.86801191 0.00000000 999.99900000 1.00000000\n Minimum Angle 50.57680338 89.99999787 83.84338772 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00000259 136.97085026 96.70176380 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: final_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Summary","page":"Straight-sided outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"github-git/#GitHub-and-Git","page":"GitHub & Git","title":"GitHub & Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This page contains information on how to use GitHub and Git when developing HOHQMesh.","category":"page"},{"location":"github-git/#Development-workflow","page":"GitHub & Git","title":"Development workflow","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For adding modifications to HOHQMesh, we generally follow these steps:","category":"page"},{"location":"github-git/#Create-an-issue-(optional)","page":"GitHub & Git","title":"Create an issue (optional)","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.","category":"page"},{"location":"github-git/#Create-a-branch-and-*immediately*-create-a-pull-request","page":"GitHub & Git","title":"Create a branch and immediately create a pull request","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git\n# get latest main from the main repo\ngit checkout main\ngit pull\n# create a new branch for a cool new feature, bug fix, ...\ngit checkout -b YOUR_BRANCH_NAME\n# do some work and push it to your fork\ngit push -u myfork\n# go to https://github.com/trixi-framework/HOHQMesh.jl/pull\n# and create a PR from your new branch","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"info: Why using pull requests?\nImmediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.","category":"page"},{"location":"github-git/#Make-changes","page":"GitHub & Git","title":"Make changes","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"warning: Avoid committing unwanted files\nWhen you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.","category":"page"},{"location":"github-git/#Keep-your-branch-in-sync-with-main","page":"GitHub & Git","title":"Keep your branch in sync with main","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.\nExecute git fetch to get the latest changes from the repository.\nMake sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.\nMerge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.","category":"page"},{"location":"github-git/#Prepare-for-review","page":"GitHub & Git","title":"Prepare for review","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"merge the current main to your branch\nrun tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs\nproperly comment your code\ndelete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)\nremove debug statements\nadd a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.","category":"page"},{"location":"github-git/#Get-reviewed","page":"GitHub & Git","title":"Get reviewed","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.","category":"page"},{"location":"github-git/#Merge-branch","page":"GitHub & Git","title":"Merge branch","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).","category":"page"},{"location":"github-git/#Update-your-working-copy","page":"GitHub & Git","title":"Update your working copy","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Update your clone by running git fetch.\nCheck out main using git checkout main.\nDelete merged branch locally with git branch -d yourbranch.\nRemove local references to deleted remote branch by executing git remote prune origin.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"You can now proceed with your next changes by starting again at the top.","category":"page"},{"location":"github-git/#Using-Git","page":"GitHub & Git","title":"Using Git","text":"","category":"section"},{"location":"github-git/#Resources-for-learning-Git","page":"GitHub & Git","title":"Resources for learning Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Git Handbook by GitHub\nLearn Git Branching","category":"page"},{"location":"github-git/#Tips-and-tricks","page":"GitHub & Git","title":"Tips and tricks","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This is an unordered collection of different tips and tricks that can be helpful while working with Git. As usual, your mileage might vary.","category":"page"},{"location":"github-git/#Undo-last-commit","page":"GitHub & Git","title":"Undo last commit","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git reset HEAD~","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.","category":"page"},{"location":"github-git/#Remove-large-file-from-repository","page":"GitHub & Git","title":"Remove large file from repository","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"danger: Large files\nYou should never try to fix this yourself, as it potentially disrupts/destroys the work of others!","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Tell everyone to commit and push their changes to the repository.\nFix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.\nPerform the following steps to clean up the Git repository:\ncd /tmp\n\n# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/\n\n# Get fresh clone of repo (so you can throw it away in case there is a problem)\ngit clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git\n\n# Clean up repo of all files larger than 10M\njava -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git\n\n# Enter repo\ncd HOHQMesh.jl.git\n\n# Clean up reflog and force aggressive garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\n\n# Push changes\ngit push\n\n# Delete clone\nrm -rf HOHQMesh.jl.git\nTell everyone to clean up their local working copies by performing the following steps (also do this yourself):\n# Enter repo\ncd HOHQMesh.jl\n\n# Get current changes\ngit fetch\n\n# Check out the fixed branch\ngit checkout branchname\n\n# IMPORTANT: Do a rebase instead of a pull!\ngit rebase\n\n# Clean reflog and force garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\nIMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.","category":"page"},{"location":"interactive-api/#API","page":"API","title":"API","text":"","category":"section"},{"location":"interactive-api/#Project-creation-and-saving","page":"API","title":"Project creation and saving","text":"","category":"section"},{"location":"interactive-api/#New-Project","page":"API","title":"New Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = newProject(name::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied name will be the default name of the control, mesh, and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.","category":"page"},{"location":"interactive-api/#Opening-an-existing-project-file","page":"API","title":"Opening an existing project file","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A project can be created from an existing HOHQMesh control file with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = openProject(fileName::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied fileName will be the name of the project and the generated mesh and plot files will be placed in the supplied folder.","category":"page"},{"location":"interactive-api/#Saving-a-Project","page":"API","title":"Saving a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" saveProject(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"writes a control file to the folder designated when creating the new project. It can be read in again with openProject.","category":"page"},{"location":"interactive-api/#Plotting-a-Project","page":"API","title":"Plotting a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" plotProject!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the model is modified and you want to re-plot with the new values, invoke","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" updatePlot!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"but generally the plot will be updated automatically as you build the model.","category":"page"},{"location":"interactive-api/#Modifying/editing-a-Project","page":"API","title":"Modifying/editing a Project","text":"","category":"section"},{"location":"interactive-api/#Setting-the-name-of-a-Project","page":"API","title":"Setting the name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name is the name under which the mesh, plot, statistics and control files will be written. It can be changed at any time with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setName!(proj::Project,name::String)","category":"page"},{"location":"interactive-api/#Getting-the-current-name-of-a-Project","page":"API","title":"Getting the current name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name can be fetched and printed to the screen with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getName(proj::Project)","category":"page"},{"location":"interactive-api/#Controlling-the-mesh-generation","page":"API","title":"Controlling the mesh generation","text":"","category":"section"},{"location":"interactive-api/#Editing-the-RunParameters","page":"API","title":"Editing the RunParameters","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The run parameters can be enquired and set with these getter/setter pairs:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setPolynomialOrder!(proj::Project, p::Int)\n [Return:Int] getPolynomialOrder(proj::Project)\n [Return:nothing] setMeshFileFormat!(proj::Project, meshFileFormat::String)\n [Return:String] getMeshFileFormat(proj::Project)\n [Return:nothing] setPlotFileFormat!(proj::Project, plotFileFormat::String)\n [Return:String] getPlotFileFormat(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The available mesh file formats are \"ISM\", \"ISM-V2\", or \"ABAQUS\". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot file (which can be viewed with something like VisIt or ParaView) format is either \"skeleton\" or \"sem\". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.","category":"page"},{"location":"interactive-api/#Changing-the-output-file-names","page":"API","title":"Changing the output file names","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setName!(proj::Project,name::String)\n [Return:String] getName(proj::Project)\n [Return:nothing] setFolder!(proj::Project,folder::String)\n [Return:String] getFolder(proj::Project)","category":"page"},{"location":"interactive-api/#Smoothing-operations","page":"API","title":"Smoothing operations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available in the documentation.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To change the defaults, the smoother parameters can be set/enquired with the functions","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setSmoothingStatus!(proj::Project, status::String)\n [Return:String] getSmoothingStatus(proj::Project)\n [Return:nothing] setSmoothingType!(proj::Project, type::String)\n [Return:String] getSmoothingType(proj::Project)\n [Return:nothing] setSmoothingIterations!(proj::Project, iterations::Int)\n [Return:Int] getSmoothingIterations(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The smooth status is either \"ON\" or \"OFF\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To remove the smoother altogether, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] removeSpringSmoother!(proj::Project)","category":"page"},{"location":"interactive-api/#Adding-the-background-grid","page":"API","title":"Adding the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must be specified after a new project has been created.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addBackgroundGrid!(proj::Project,\n x0::Array{Float64},\n dx::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n box::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n bgSize::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.","category":"page"},{"location":"interactive-api/#Changing-the-background-grid","page":"API","title":"Changing the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The size of an existing background grid in a Project can be adjusted with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setBackgroundGridSize!(proj::Project,\n dx::Float64,\n dy::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If a plot is present it will be updated automatically.","category":"page"},{"location":"interactive-api/#Manual-refinement-regions","page":"API","title":"Manual refinement regions","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To create a RefinementCenter,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementCenter(name::String,\n type::String,\n x0::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where name labels the refinement region, the type is either \"smooth\" or \"sharp\", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Similarly, one can create a RefinementLine,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementLine(name::String,\n type::String,\n x0::Array{Float64}, x1::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where x0 is the start position and x1 is the end of the line. The name, type, h, and w parameters are the same as for a RefinementCenter.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To add a refinement region to the project,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addRefinementRegion!(proj::Project, r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To get a reference to a refinement region with a given name, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] getRefinementRegion(proj::Project, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to get a list of all the refinement regions,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Array{Dict{String,Any}}] array = allRefinementRegions(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"A refinement region can be edited by using the following:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementType!(r::Dict{String,Any}, type::String)\n [Return:String] getRefinementType(r::Dict{String,Any})\n [Return:nothing] setRefinementLocation!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementLocation(r::Dict{String,Any})\n [Return:nothing] setRefinementGridSize!(r::Dict{String,Any}, h::Float64)\n [Return:Float64] getRefinementGridSize(r::Dict{String,Any})\n [Return:nothing] setRefinementWidth!(r::Dict{String,Any}, w::Float64)\n [Return:Float64] getRefinementWidth(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where r is a dictionary returned by newRefinementCenter!, newRefinementLine!, or getRefinementRegion.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To further edit a RefinementLine, use the methods","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementStart!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementStart(r::Dict{String,Any})\n [Return:nothing] setRefinementEnd!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementEnd(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Boundary-curves","page":"API","title":"Boundary curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a \"chain\" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.","category":"page"},{"location":"interactive-api/#Defining-curves","page":"API","title":"Defining curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Four curve types can be added to the outer and inner boundary curve chains. They are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"interactive-api/#Parametric-equations","page":"API","title":"Parametric equations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Creating a new curve equation","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\")","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Returns a new set of parametric equation. Equations must be of the form","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" () = ...","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" xEqn = \"x(t) = 4*cos(2*pi*t) - 0.6*cos(8*pi*t)^3\"\n yEqn = \"y(t) = 4*sin(2*pi*t) - 0.5*sin(11*pi*t)^2\"\n zEqn = \"z(t) = 0.0\"\n blob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The z-Equation is optional, but for now must define zero for z by default.","category":"page"},{"location":"interactive-api/#Cubic-spline-curve","page":"API","title":"Cubic spline curve","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A cubic spline is defined by an array of knots, t_j, x_j, y_j, z_j. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the t, x, y, z values, e.g.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" 9\n 0.000000000000000 -3.50000000000000 3.50000000000000 0.0\n 3.846153846153846E-002 -3.20000000000000 5.00000000000 0.0\n 7.692307692307693E-002 -2.00000000000000 6.00000000000 0.0\n 0.769230769230769 0.000000000000000 -1.00000000000000 0.0\n 0.807692307692308 -1.00000000000000 -1.00000000000000 0.0\n 0.846153846153846 -2.00000000000000 -0.800000000000000 0.0\n 0.884615384615385 -2.50000000000000 0.000000000000000 0.0\n 0.923076923076923 -3.00000000000000 1.00000000000000 0.0\n 1.00000000000000 -3.50000000000000 3.50000000000000 0.0","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"or by constructing the required nKnots x 4 array and supplying it to the new procedure. The respective constructors for a spline curve are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newSplineCurve(name::String,\n dataFile::String)\n [Return:Dict{String,Any}] newSplineCurve(name::String,\n nKnots::Int,\n data::Matrix{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the spline curve is to be closed. The last data point must be the same as the first.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n ex_spline = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"interactive-api/#Line-defined-by-end-points","page":"API","title":"Line defined by end points","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A straight line is constructed with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newEndPointsLineCurve(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The xStart and xEnd are arrays of the form [x, y, z]. The z component should be zero and for now is ignored.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" line1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])","category":"page"},{"location":"interactive-api/#Circular-arc","page":"API","title":"Circular arc","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newCircularArcCurve(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either \"degrees\" or \"radians\". That argument is optional, and defaults to \"degrees\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" halfCircle = newCircularArcCurve(\"Dome\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")","category":"page"},{"location":"interactive-api/#Adding-and-removing-outer-and-inner-boundaries","page":"API","title":"Adding and removing outer and inner boundaries","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Adding an outer boundary curve\nUsing the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using\n[Return:nothing] addCurveToOuterBoundary!(proj::Project,\n crv::Dict{String,Any})\ncrv is the dictionary that represents the curve.\nExample:\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\nAdding an inner boundary curve\nThe syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.\n[Return:nothing] addCurveToInnerBoundary!(proj::Project,\n crv::Dict{String,Any},\n chainName::String)\nExample:\nline1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\naddCurveToInnerBoundary!(p, line1, \"interior_curve\")\nTo edit curves they can be accessed by the name:\n[Return:Dict{String,Any}] getInnerBoundaryCurve(proj::Project,\n curveName::String,\n chainName::String)\n[Return:Dict{String,Any}] getOuterBoundaryCurveWithName(proj::Project,\n name::String)\nDeleting boundary curves\nThe entire outer boundary or an entire inner boundary can be removed from the project.\n[Return:nothing] removeOuterBoundary!(proj::Project)\n[Return:nothing] removeInnerBoundary!(proj::Project, chainName::String)\nAlternatively, individual pieces of the boundary curve chains can be removed.\n[Return:nothing] removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n[Return:nothing] removeInnerBoundaryCurve!(proj::Project,\n name::String,\n chainName::String)\nAs in HOHQMesh the project can have only one outer boundary chain, so the removal does not require a specific chainName.","category":"page"},{"location":"interactive-api/#Editing-curves","page":"API","title":"Editing curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"You can determine the type of a curve by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getCurveType(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"For any of the curves, their name can be changed by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setCurveName!(crv::Dict{String,Any}, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"and checked by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" getCurveName(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Otherwise there are special functions to change the parameters of curves","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setXEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setYEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setZEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcUnits!(arc::Dict{String,Any}, units::String)\n [Return:nothing] setArcCenter!(arc::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n [Return:String] getXEqn(crv::Dict{String,Any})\n [Return:String] getYEqn(crv::Dict{String,Any})\n [Return:String] getZEqn(crv::Dict{String,Any})\n [Return:Array{Float64}] getStartPoint(crv::Dict{String,Any})\n [Return:Array{Float64}] getEndPoint(crv::Dict{String,Any})\n [Return:String] getArcUnits(arc::Dict{String,Any})\n [Return:Array{Float64}] getArcCenter(arc::Dict{String,Any})\n [Return:Float64] getArcStartAngle(arc::Dict{String,Any})\n [Return:Float64] getArcEndAngle(arc::Dict{String,Any})\n [Return:Float64] getArcRadius(arc::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Undo/redo","page":"API","title":"Undo/redo","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The interactive mesh functionality has unlimited undo/redo for most actions.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"In interactive mode, actions can be undone by the commands","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undo()\n [Return:String] redo()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where the return string contains the name of the action performed.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To find out what the next actions are, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undoActionName()\n [Return:String] redoActionName()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to clear the undo stack, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] clearUndoRedo()","category":"page"},{"location":"tutorials/curved_outer_boundary/#Curved-outer-boundary","page":"Curved outer boundary","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Synopsis","page":"Curved outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initialization","page":"Curved outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We create a new project with the name \"TheBlob\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"blob_project = newProject(\"TheBlob\", \"out\")","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-the-outer-boundary","page":"Curved outer boundary","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary curve for the domain of interest in this tutorial is given by the parametric equations","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":" beginaligned\n x(t) = 4cos(2 pi t) - frac35cos^3(8 pi t)02cm\n y(t) = 4sin(2 pi t) - frac12sin^2(11 pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"xEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The name of this curve is assigned to be \"Blob\". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addCurveToOuterBoundary!(blob_project, blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-a-background-grid","page":"Curved outer boundary","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for blob_project to have elements with side length two in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"plotProject!(blob_project, MODEL+GRID)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"Blob\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: coarse_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From the visualization we see that the background grid is likely too coarse to produce a \"good\" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"setBackgroundGridSize!(blob_project, 0.5, 0.5)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: fine_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initial-mesh-and-user-adjustments","page":"Curved outer boundary","title":"Initial mesh and user adjustments","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"TheBlob.control: A HOHQMesh control file for the current project.\nTheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nTheBlob.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 8.4328000000000000E-002\n Number of nodes = 479\n Number of Edges = 895\n Number of Elements = 417\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025286 0.36208840 0.11936333 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002882 2.58443761 1.26335838 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.12867591 1.18585825 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006176 4.77438730 1.51314025 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011275 0.28170345 0.10292806 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.38249259 89.99827733 73.08294187 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132795 156.98701187 109.36585212 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: initial_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point (-4 0) is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"center = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Above we create a circular refinement region centered at the point (-4 -05) with a desired resolution size 04 and a radius of 10. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: refinement_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Final-mesh","page":"Curved outer boundary","title":"Final mesh","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 9.2778999999999986E-002\n Number of nodes = 503\n Number of Edges = 940\n Number of Elements = 438\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025286 0.36208840 0.11412688 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002883 2.47056840 1.26416662 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.12867592 1.18429212 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006176 4.77438730 1.51407242 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011275 0.28170345 0.09814903 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.38249259 89.99827897 72.80049710 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132784 156.98701188 109.63478104 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: final_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Summary","page":"Curved outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"# Interactive mesh with a curved outer boundary\n#\n# Create an outer boundary from a set of parametric equations.\n# Add manual refinement in a small region around the point (-4, -0.5).\n#\n# Keywords: outer boundary, parametric equations, refinement center\nusing HOHQMesh\n\n# Instantiate the project\nblob_project = newProject(\"TheBlob\", \"out\")\n\n# Create and add the outer boundary curve\nxEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)\naddCurveToOuterBoundary!(blob_project, blob)\n\n# Add the background grid\naddBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])\n\n# Create and add the refinement region\ncenter = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)\n\n# Generate the mesh\ngenerate_mesh(blob_project)","category":"page"},{"location":"tutorials/create_edit_curves/#Creating-and-editing-curves","page":"Creating and editing curves","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a \"chain\" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/create_edit_curves/#Synopsis","page":"Creating and editing curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/#Initialization","page":"Creating and editing curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a new project with the name \"sandbox\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox_project = newProject(\"sandbox\", \"out\")","category":"page"},{"location":"tutorials/create_edit_curves/#Add-the-outer-boundary-chain","page":"Creating and editing curves","title":"Add the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We first create the outer boundary curve chain that is composed of three pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (0 -7) to (5 3).\nHalf-circle arc of radius r=5 centered at (0 3).\nStraight line segment from (-5 3) to (0 -7).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [0.0, -7.0, 0.0], # start point\n [5.0, 3.0, 0.0]) # end point\n\nouter_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-5.0, 3.0, 0.0], # start point\n [0.0, -7.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from 0 to 180 degrees.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_arc = newCircularArcCurve(\"Arc\", # curve name\n [0.0, 3.0, 0.0], # center\n 5.0, # radius\n 0.0, # start angle\n 180.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", and \"Arc\" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-a-background-grid","page":"Creating and editing curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We visualize the outer boundary curve chain and background grid with the following","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"plotProject!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains three curve segments \"Line1\", \"Arc\", and \"Line2\" labeled in the figure by O.1, O.2, and O.3, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-the-outer-boundary-chain","page":"Creating and editing curves","title":"Edit the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the domain boundary requires a curved segment instead of the straight line \"Line2\". We will replace this line segment in the outer boundary chain with a cubic spline.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"First, we remove the \"Line2\" curve from the \"Outer\" chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Outer curve removal\nAlternatively, we can remove the curve \"Line2\" using its index in the \"Outer\" boundary chain.removeOuterBoundaryCurveAtIndex!(sandbox_project, 3)This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The plot automatically updates and we see that the outer boundary is open and contains two segments: \"Line1\" and \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve \"Arc\" and end at the first point of the curve \"Line1\". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. The spline curve constructor newSplineCurve also takes the number of points as an input argument.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"spline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we add the spline curve outer_spline into the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates automatically to display the \"Outer\" boundary chain with the new \"Spline\" curve labeled O.3.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-an-inner-boundary-chain","page":"Creating and editing curves","title":"Add an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a pill shaped inner boundary curve chain composed of four pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (1 5) to (1 3).\nHalf-circle arc of radius r=1 centered at (0 3).\nStraight line segment from (-1 3) to (-1 5).\nHalf-circle arc of radius r=1 centered at (0 5).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Similar to the construction of the \"Outer\" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [1.0, 5.0, 0.0], # start point\n [1.0, 3.0, 0.0]) # end point\n\ninner_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-1.0, 3.0, 0.0], # start point\n [-1.0, 5.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at (0 3) varies from 0 to -180 degrees. The top half-circle arc centered at (0 5) has an angle that varies from 180 to 0 degrees. The construction of the two circle arcs are","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_bottom_arc = newCircularArcCurve(\"BottomArc\", # curve name\n [0.0, 3.0, 0.0], # center\n 1.0, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\n\ninner_top_arc = newCircularArcCurve(\"TopArc\", # curve name\n [0.0, 5.0, 0.0], # center\n 1.0, # radius\n 180.0, # start angle\n 0.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Note, we use \"radians\" to set the angle bounds for inner_bottom_arc and \"degrees\" for the angle bounds of inner_top_arc.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", \"BottomArc\", and \"TopArc\" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This inner boundary chain name \"inner\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments \"Line1\", \"BottomArc\", \"Line2\", and \"TopArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_pill)","category":"page"},{"location":"tutorials/create_edit_curves/#Generate-the-mesh","page":"Creating and editing curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox.control: A HOHQMesh control file for the current project.\nsandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nsandbox.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 7.5414000000000009E-002\n Number of nodes = 511\n Number of Edges = 933\n Number of Elements = 422\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00002932 1.17335568 0.18813138 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00953438 2.30790024 1.31439620 1.00000000 999.99900000 1.00000000\n Condition 1.00041663 2.41773865 1.21024584 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.01673809 3.68828437 1.59413340 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001750 1.13820387 0.14143901 0.00000000 999.99900000 1.00000000\n Minimum Angle 32.22733574 89.35690571 68.75321248 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.61089476 152.37947944 113.36221513 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: initial_mesh)","category":"page"},{"location":"tutorials/create_edit_curves/#Delete-the-existing-mesh","page":"Creating and editing curves","title":"Delete the existing mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"remove_mesh!(sandbox_project)\nupdatePlot!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Additionally, the remove_mesh! command deletes the mesh information from the sandbox_project and sandbox.mesh from the out folder. However, the sandbox.control and sandbox.tec files are still present in out directory.","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-an-inner-boundary-chain","page":"Creating and editing curves","title":"Edit an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the inner boundary actually requires a curved segment instead of the straight line \"Line1\". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We remove the \"Line1\" curve from the inner chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Inner curve removal\nAlternatively, we can remove the curve \"Line1\" using its index in the inner boundary chain.removeInnerBoundaryCurveAtIndex!(sandbox_project, 1, \"inner\")This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: \"BottomArc\", \"Line2\", and \"TopArc\". Note that the index of the remaining curves has changed as shown below.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Brief note about undo / redo\nThe interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.undoActionName()\n\"Remove Inner Boundary Curve\"We can undo the removal of the \"Line1\" curve with undoundo()\n\"Undo Remove Inner Boundary Curve\"In addition to reinstating \"Line1\" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The new inner curve segment will be an oscillating line given by the parametric equations","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":" beginaligned\n x(t) = t + 102cm\n y(t) = -2t + 5 - frac32 cos(pi t) sin(pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"xEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The name of this new curve is assigned to be \"wiggleLine\". We add this new curve to the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The automatically updated figure now shows:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_open_chain)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We see from the figure that this parametric equation curve starts at the point (15) and, therefore, matches the end point of the existing curve \"TopArc\" present in the \"inner\" chain. However, the parametric equation curve ends at the point (23) which does not match the \"BottomArc\" curve. So, the inner boundary chain remains open.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"warning: Attempt to generate a mesh with an open curve chain\nAn open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create a closed boundary curve we must remove the \"BottomArc\" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point (2 3) and end at the point (-1 3) to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the \"BottomArc\" from the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates to display the \"inner\" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_remove_arc)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"A half-circle arc that joins the points (2 3) and (-1 3) has a radius r=15, is centered at (05 3) and has an angle that vaires from 0 to -180. We construct this circle arc and directly add it to the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"new_bottom_arc = newCircularArcCurve(\"wideBottomArc\", # curve name\n [0.5, 3.0, 0.0], # center\n 1.5, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The updated plot now gives the modified, closed inner curve chain that now contains four curve segments \"Line2\", \"TopArc\", \"wiggleLine\", and \"wideBottomArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/#Regenerate-the-mesh","page":"Creating and editing curves","title":"Regenerate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.11353599999999998\n Number of nodes = 712\n Number of Edges = 1308\n Number of Elements = 596\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00002932 1.15661960 0.12823902 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.01050856 3.14732001 1.34260027 1.00000000 999.99900000 1.00000000\n Condition 1.00037771 2.59434067 1.22850175 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.02744717 3.68828437 1.64751502 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001750 1.13149451 0.09443920 0.00000000 999.99900000 1.00000000\n Minimum Angle 31.87236189 89.33988565 67.86178629 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.44177106 157.27121105 114.35699650 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: zoom_corner)","category":"page"},{"location":"tutorials/create_edit_curves/#Summary","page":"Creating and editing curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"# Interactive mesh with modified outer and inner curve chains\n#\n# Create inner / outer boundary chains composed of the four\n# available HOHQMesh curve types.\n#\n# Keywords: outer boundary, inner boundary, parametric equations,\n# circle arcs, cubic spline, curve removal\nusing HOHQMesh\n\n# Instantiate the project\nsandbox_project = newProject(\"sandbox\", \"out\")\n\n# Add the background grid\naddBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])\n\n# Create and add the original outer boundary curves\nouter_line1 = newEndPointsLineCurve(\"Line1\", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])\nouter_line2 = newEndPointsLineCurve(\"Line2\", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])\nouter_arc = newCircularArcCurve(\"Arc\", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, \"degrees\")\n\naddCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)\n\n# Modify the outer boundary to have a spline instead of a straight line\nremoveOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")\n\nspline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)\naddCurveToOuterBoundary!(sandbox_project, outer_spline)\n\n# Create and add the inner boundary curves\ninner_line1 = newEndPointsLineCurve(\"Line1\", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])\ninner_line2 = newEndPointsLineCurve(\"Line2\", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])\ninner_bottom_arc = newCircularArcCurve(\"BottomArc\", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, \"radians\")\ninner_top_arc = newCircularArcCurve(\"TopArc\", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, \"degrees\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")\n\n# Generate a mesh\ngenerate_mesh(sandbox_project)\n\n# Delete the existing mesh before modifying the inner boundary curve chain\nremove_mesh!(sandbox_project)\n\n# Modify the inner boundary curve with an oscillatory line and a new circle arc\nremoveInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")\nremoveInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")\n\nxEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)\n\nnew_bottom_arc = newCircularArcCurve(\"wideBottomArc\", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, \"radians\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")\n\n# Regenerate the final mesh\ngenerate_mesh(sandbox_project)","category":"page"},{"location":"interactive_overview/#InteractiveTool","page":"Overview","title":"Overview","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Several scripts are available in the examples/ folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.","category":"page"},{"location":"interactive_overview/#Workflow-and-basic-moves","page":"Overview","title":"Workflow and basic moves","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"To generate a mesh interactively you","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Create a project with a user given projectName and folder where any generated files are to be saved\np = newProject(, )\nBoth of these input arguments are strings.\nCreate inner and outer boundary curves from the available types\nc = newEndPointsLineCurve(, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*\nc = newCircularArcCurve(, center [x, y, z], radius, startAngle, endAngle, units = \"degrees\" or \"radians\") *Circular Arc*\nc = newParametricEquationCurve(, xEqn, yEqn, zEqn) *Parametric equation*\nc = newSplineCurve(, dataFile) *Spline with data from a file*\nc = newSpline(, nKnots, knotsMatrix) *Spline with given knot values*\nSee Defining curves for further details on the different curve type currently supported by HOHQMesh.\nThe generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.\nAdd curves to build the model to see what you have added,\naddOuterBoundaryCurve!(p, ) *Add outer boundary curve*\naddInnerBoundaryCurve!(p, , ) *Add curve to an inner boundary*\nFor a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.\nCurves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.\nVisualize the project's model, if desired\nplotProject!(p, MODEL)\nPlots are updated in response to user interactions. However, to update the plot at any time, use\nupdatePlot!(p, options)\nOptions are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.\nnote: Visualization requirement\nThe interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.\nSet the background grid\nWhen no outer boundary curve is present, the background grid can be set with\naddBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])\nOr\naddBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])\nThe first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.\nWhen an outer boundary is present the background grid can be set as\naddBackgroundGrid!(p, [dx, dy, dz])\nwhere the spacing controls the number of elements in each direction.\nnote: Background grid\nA background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.\nAdjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by\nsetPolynomialOrder!(p, order)\nThe background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately\nsetBackgroundGridSize!(p, 0.5, 0.25)\nSee Controlling the mesh generation for details on adjusting parameters already present in the Project.\nGenerate the mesh\ngenerate_mesh(p)\nThe mesh file will be saved in with the name .mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name .control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.","category":"page"},{"location":"interactive_overview/#Advanced","page":"Overview","title":"Advanced","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.","category":"page"},{"location":"testing/#Testing","page":"Testing","title":"Testing","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In HOHQMesh and its related repositories, tests are triggered by","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"each git push to main and\neach git push to any pull request.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test and coverage requirements\nBefore merging a pull request (PR) to main, we require thatthe code passes all functional tests\ncode coverage does not decrease.","category":"page"},{"location":"testing/#Testing-setup","page":"Testing","title":"Testing setup","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> using Pkg; Pkg.test(\"HOHQMesh\")","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> # Run all test for the interactive Curve API\n include(joinpath(\"test\", \"test_curve.jl\"))","category":"page"},{"location":"testing/#Adding-new-tests","page":"Testing","title":"Adding new tests","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test duration\nAs a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).","category":"page"},{"location":"testing/#Test-coverage","page":"Testing","title":"Test coverage","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered \"covered\" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The \"Details\" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Coverage requirements\nIn general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.","category":"page"},{"location":"authors/#Authors","page":"Authors","title":"Authors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.","category":"page"},{"location":"authors/#Principal-Developers","page":"Authors","title":"Principal Developers","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"David A. Kopriva, Florida State University, USA\nAndrew Winters, Linköping University, Sweden","category":"page"},{"location":"authors/#Contributors","page":"Authors","title":"Contributors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"The following people contributed major additions or modifications to HOHQMesh and are listed in alphabetical order:","category":"page"},{"location":"authors/","page":"Authors","title":"Authors","text":"David Kopriva\nHendrik Ranocha\nMichael Schlottke-Lakemper\nAndrew Winters","category":"page"},{"location":"reference/#HOHQMesh.jl-API","page":"Reference","title":"HOHQMesh.jl API","text":"","category":"section"},{"location":"reference/","page":"Reference","title":"Reference","text":"CurrentModule = HOHQMesh","category":"page"},{"location":"reference/","page":"Reference","title":"Reference","text":"Modules = [HOHQMesh]","category":"page"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary named boundaryName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, obj::Dict{String,Any})\n\nAdd a curve to the outer boundary or a refinement reion to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, Array{Float64, N} where N, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})\n\nAdd the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version\n\naddBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nis a lot easier to use.\n\nTODO: Change HOHQMesh and delete this way to specify the domain and use the bounding box one instead.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nAdd the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid(proj::Project, bgSize::Array{Float64})\n\nAdd the background grid block with the grid size to be a 3-vector. Use this when there is an outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, dict::Dict{String,Any})\n\nUsed only for undo/redo.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToInnerBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.addCurveToInnerBoundary!","text":"addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary with name boundaryName. If an inner boundary of that name does not exist, one is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addCurveToOuterBoundary!","text":"addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})\n\nAdd a curve to the outer boundary. The curves must be added in order counter-clockwise\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addInnerBoundaryWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.addInnerBoundaryWithName!","text":"addInnerBoundaryWithName!(proj::Project,name::String)\n\nCreate a new empty inner boundary with the given name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addObserver-Tuple{Any, String, Any}","page":"Reference","title":"HOHQMesh.addObserver","text":"addObserver(observer::Any, note::String, f::Any)\n\nf is the function to be executed (called) when a notification of name note is given.\n\nThe function called upon notification must have the signature f(observer, sender, args...)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addOuterBoundary!","text":"addOuterBoundary!(proj::Project, outerBoundary::Dict{String,Any})\n\nAdd an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegion!","text":"addRefinementRegion!(proj::Project,r::Dict{String,Any})\n\nAdd the refinement region to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegionPoints!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegionPoints!","text":"addRefinementRegionPoints!(proj::Project, r::Dict{String,Any})\n\nCompute and add to the project the plotting points for the refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRunParameters!","page":"Reference","title":"HOHQMesh.addRunParameters!","text":"addRunParameters!(proj::Project,\n plotFormat::String = \"skeleton\",\n meshFileFormat::String = \"ISM-V2\",\n polynomialOrder::Int = 5)\n\nAdd a RUN_PARAMETERS block and set all the parameters in one call.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.addSpringSmoother!","page":"Reference","title":"HOHQMesh.addSpringSmoother!","text":"addSpringSmoother!(status::String, type::String, nIterations::Int)\n\nStatus is either ON or OFF Type is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.bboxUnion-Tuple{Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.bboxUnion","text":"bboxUnion(box1::Array{Float64}, box2::Array{Float64})\n\nReturns the union of two bounding boxes\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.curveBounds-Tuple{Matrix{Float64}}","page":"Reference","title":"HOHQMesh.curveBounds","text":"curveBounds(crvPoints::Array{Float64,2})\n\nFind the bounds of a single curve, discretized as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.emptyBounds-Tuple{}","page":"Reference","title":"HOHQMesh.emptyBounds","text":"emptyBounds()\n\nReturns an array that will always be ignored when unioned with another bounding box.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.examples_dir-Tuple{}","page":"Reference","title":"HOHQMesh.examples_dir","text":"examples_dir()\n\nReturn the path to the directory with some example mesh setups.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.extract_mesh_file_format-Tuple{Any}","page":"Reference","title":"HOHQMesh.extract_mesh_file_format","text":"extract_mesh_file_format(control_file)\n\nReturn a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{Any}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(control_file;\n output_directory=\"out\",\n mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing,\n verbose=false)\n\nGenerate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.\n\nYou can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.\n\nYou can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(proj::Project)\n\nGenerate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.\n\nThis function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getAllRefinementRegions-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getAllRefinementRegions","text":"getAllRefinementRegions(proj::Project)\n\nGet the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcCenter","text":"getArcCenter(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the center of a circular arc as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcEndAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcEndAngle","text":"getArcEndAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcRadius-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcRadius","text":"getArcRadius(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcStartAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcStartAngle","text":"getArcStartAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcUnits-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcUnits","text":"getArcUnits(crv::Dict{String,Any}, units::String)\n\nGet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridLowerLeft-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridLowerLeft","text":"getBackgroundGridLowerLeft(proj::Project)\n\nReturns the [x,y] of the lower left point of the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSize-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSize","text":"getBackgroundGridSize(proj::Project)\n\nReturns the background grid size array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSteps-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSteps","text":"getBackgroundGridSteps(proj::Project)\n\nReturns the [Nx,Ny,Nz] for the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String, boundaryName::String)\n\nGet the curve named curveName from the inner boundary named boundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String)\n\nGet the curve with name curveName from the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveName","text":"getCurveName(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveType","text":"getCurveType(crv::Dic{String,Any})\n\nGet the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,\n`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getEndPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getEndPoint","text":"getEndPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the end point for a line curve as an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundary-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundary","text":"getInnerBoundary(proj::Project, name::String)\n\nGet the chain of curves from the inner boundary with name name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryChainWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryChainWithName","text":"getInnerBoundaryWithName(proj::Project, name::String)\n\nGet the inner boundary CHAIN with the given name. If one does not exist, it is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryCurve","text":"\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getMeshFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getMeshFileFormat","text":"getMeshFileFormat(proj::Project)\n\nReturns the format in which the mesh will be written.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getName-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getName","text":"getName(proj::Project)\n\nReturns the filename to be used by the mesh, plot, control, and stats files.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryChainList-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getOuterBoundaryChainList","text":"getOuterBoundaryChainList(proj::Project)\n\nGet the array of outer boundary curves.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryCurveWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getOuterBoundaryCurveWithName","text":"getOuterBoundaryCurveWithName(proj::Project, name::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPlotFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPlotFileFormat","text":"getPlotFileFormat(proj::Project)\n\nReturns the plot file format.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPolynomialOrder-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPolynomialOrder","text":"getPolynomialOrder(proj::Project)\n\nReturns the polynomial order for boundary curves in the mesh file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementEnd-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementEnd","text":"getRefinementEnd(r::Dict{String,Any})\n\nReturn Array{Float64} of the end location of the refinement line\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementGridSize-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementGridSize","text":"getRefinementGridSize(r::Dict{String,Any})\n\nReturns the grid size,h, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementLocation-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementLocation","text":"getRefinementLocation(r::Dict{String,Any})\n\nReturn Array{Float64} of the location of the refinement center.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementName","text":"getRefinementName(r::Dict{String,Any})\n\nReturn name of the refinement. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"getRefinementRegion(proj::Project, indx)\n\nGet the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"(i,r) = getRefinementRegion(project, name)\n\nGet the refinement region with the given name and its location in the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegionCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementRegionCenter","text":"getRefinementRegionCenter(r::Dict{String,Any})\n\nGet, or compute, the center of the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementStart-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementStart","text":"getRefinementStart (r::Dict{String,Any})\n\nReturn Array{Float64} of the start location of the refinement line. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementType","text":"getRefinementType(r::Dict{String,Any})\n\nReturn the type of refinement, either \"smooth\" or \"sharp\". r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementWidth-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementWidth","text":"getRefinementWidth(r::Dict{String,Any})\n\nReturns the region width,w, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingIterations-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingIterations","text":"getSmoothingIterations(proj::Project)\n\nGet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingStatus-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingStatus","text":"smoothingStatus(proj::Project)\n\nReturns whether the smoother will be \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingType-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingType","text":"getSmoothingType(proj::Project)\n\nReturns either \"LinearSpring\" or \"LinearAndCrossbarSpring\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplineNKnots-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplineNKnots","text":"getSplineNKnots(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplinePoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplinePoints","text":"getSplinePoints(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getStartPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getStartPoint","text":"getStartPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the start point for a line curve as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getXEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getXEqn","text":"getXEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getYEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getYEqn","text":"getYEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getZEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getZEqn","text":"getZEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.hasBackgroundGrid-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.hasBackgroundGrid","text":"hasBackgroundGrid(proj::Project)\n\nTests to see if the project has a backgroundGrid dictionary defined.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.innerBoundaryIndices-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.innerBoundaryIndices","text":"innerBoundaryIndices(proj::Project, curveName::String)\n\nReturns (curveIndex,chainIndex) for the location of the curve named curveName in it's inner boundary chain.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryAtIndex!-Tuple{HOHQMesh.Project, String, Int64, Dict{String, Any}, Vector{Any}, Vector{String}}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryAtIndex!","text":"insertInnerBoundaryAtIndex!(proj::Project, chainName::String, indx::Int, chain::??)\n\nInsert an entire inner boundary. Primarily meant for undo operation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64, String}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryCurveAtIndex!","text":"insertInnerBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any},\n indx::Int, boundaryName::String)\n\nInsert a curve crv into an inner boundary chain boundaryName at the specified index indx.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertOuterBoundaryCurveAtIndex!","text":"insertOuterBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any}, indx::Int)\n\nInsert a curve into the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertRefinementRegion!","text":"insertRefinementRegion!(proj::Project, r::Dict{String,Any}, indx::Int)\n\nUsed by undo()\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelChainIsOK-Tuple{Vector{Dict{String, Any}}, String}","page":"Reference","title":"HOHQMesh.modelChainIsOK","text":"modelChainIsOK(chain::Vector{Dict{String, Any}}, chainName::String)\n\nReturns true if the chain of curves is contiguous and closed; false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelCurvesAreOK-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.modelCurvesAreOK","text":"modelCurvesAreOK(proj::Project)\n\nGo through all curves in the model and make sure they are connected and closed. Also, remove any empty outer / inner boundary chains.\n\nReturns true if all curves are connected and closed, false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)\n\nCreate a new circular arc.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-2","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreate a new parametric equation curve.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-Tuple{String, Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})\n\nCreate a new line defined by its end points.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, nKnots::Int, data::Matrix{Float64})\n\nCreate a spline curve from an array of knots\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, String}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, dataFile::String)\n\nCreate a spline curve from the contents of a data file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newCircularArcCurve","page":"Reference","title":"HOHQMesh.newCircularArcCurve","text":"newCircularArcCurve(name::String, center::Array{Float64},\n startAngle::Float64, endAngle::Float64,\n units::String)\n\nCreates and returns a new circular arc curve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newEndPointsLineCurve-Tuple{String, Array{Float64, N} where N, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.newEndPointsLineCurve","text":"newEndPointsLineCurve(name::String, xStart::Array{Float64},xEnd::Array[Float64])\n\nCreates and returns a new curve defined by its end points in the form of a Dictionary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newParametricEquationCurve","page":"Reference","title":"HOHQMesh.newParametricEquationCurve","text":"newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreates and returns a new parametricEquationCurve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newProject","text":"newProject(name::String, folder::String)\n\nCreate a new project with the given name. That name will be used for the mesh and plot files in the specified folder.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementCenter-Tuple{String, String, Array{Float64, N} where N, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementCenter","text":"newRefinementCenter(name, type,\n center, meshSize,\n width)\n\nCreate refinement center of type \"smooth\" or \"sharp\" centered at center = [x,y,z] with a mesh size meshSize spread over a radius width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementLine-Tuple{String, String, Array{Float64, N} where N, Array{Float64, N} where N, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementLine","text":"newRefinementLine(name, type,\n start, end,\n meshSize,\n width)\n\nCreate refinement line of type \"smooth\" or \"sharp\" between start = [x,y,z] and end = [x,y,z] with a mesh size meshSize spread over a width width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, nKnots::Int, data::Array{Float64,4})\n\nReturns a spline curve given the number of knots and the array of knots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, dataFile::String)\n\nReturns a spline curve given a data file that contains the number of knots on the first line, and the spline data following that.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.openProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.openProject","text":"openProject(fileName::String, folder::String)\n\nOpen existing project described in the control File.\n\nfolder = folder the control file is in\nfileName = the name of the file\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.postNotificationWithName-Tuple{Any, String, Tuple}","page":"Reference","title":"HOHQMesh.postNotificationWithName","text":"postNotificationWithName(sender::Any, name::String, userInfo::Tuple)\n\nExecutes the function associated with the observer for the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.refinementRegionPoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.refinementRegionPoints","text":"refinementRegionPoints(r::Dict{String,Any})\n\nReturns Array{Float64,2} being the plotting points of a refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String, innerBoundaryName::String)\n\nDelete the curve named curveName from the inner boundary named innerBoundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String)\n\nDelete the curve named curveName from the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeBackgroundGrid!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeBackgroundGrid!","text":"removeBackgroundGrid!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundary!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundary!","text":"removeInnerBoundary!(proj::Project, chainName::String)\n\nRemove an entire inner boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurve!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurve!","text":"removeInnerBoundaryCurve!(proj::Project, name::String, chainName::String)\n\nRemove the curve with name from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurveAtIndex!","text":"removeInnerBoundaryCurveAtIndex!(proj::Project, indx::Int, chainName::String)\n\nRemove the curve at index indx from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundary!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeOuterBoundary!","text":"removeOuterBoundary!(proj::Project)\n\nRemove the outer boundary curve if it exists.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveAtIndex!","text":"removeOuterBoundaryCurveAtIndex!(proj::Project, indx::Int)\n\nRemove a curve from the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveWithName!","text":"removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n\nRemove the named curve in the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRefinementRegion!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeRefinementRegion!","text":"removeRefinementRegion!(proj::Project, name::String)\n\nDelete the named refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRunParameters!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeRunParameters!","text":"removeRunParameters!(proj::Project)\n\nRemove the run parameters block from the project. This is not undo-able.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeSpringSmoother!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeSpringSmoother!","text":"removeSpringSmoother!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove_mesh!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.remove_mesh!","text":"remove_mesh!(proj::Project)\n\nRemove the mesh file from proj.projectDirectory and delete the mesh from the plot\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.saveProject-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.saveProject","text":"saveProject(proj::Project)\n\nproj = Project to be saved\n\nSave a project dictionary to the file path specified when the project was created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcCenter!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setArcCenter!","text":"setArcCenter!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the center of a circular arc.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcEndAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcEndAngle!","text":"setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcRadius!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcRadius!","text":"setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcStartAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcStartAngle!","text":"setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcUnits!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setArcUnits!","text":"setArcUnits(crv::Dict{String,Any}, units::String)\n\nSet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridLowerLeft!-Tuple{HOHQMesh.Project, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setBackgroundGridLowerLeft!","text":"setBackgroundGridLowerLeft!(proj::Project, x0::Array{Float64})\n\nSet the lower left location of the background grid for problems that have no outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSpacing!(proj::Project, dx::Float64, dy::Float64, dz::Float64 = 0.0)\n\nUser facing function\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Array{Float64, N} where N, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Array{Float64}, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, dx is passed an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Float64, Float64, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Float64, dy::Float64, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, the new grid size in either direction is passed individually with dxand dy.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSteps!-Tuple{HOHQMesh.Project, Array{Int64, N} where N}","page":"Reference","title":"HOHQMesh.setBackgroundGridSteps!","text":"setBackgroundGridSteps!(proj::Project, N::Array{Int})\n\nSet how many steps of size setBackgroundGridSpacing in each direction the background grid extends from the lower left.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setCurveName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setCurveName!","text":"setCurveName!(curveDict, name)\n\nSet the name of the curve represented by curveDict.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setEndPoint!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setEndPoint!","text":"setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the end point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setMeshFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setMeshFileFormat!","text":"setMeshFileFormat(proj::Project, meshFileFormat::String)\n\nSet the file format for the mesh file. Acceptable choices are \"ISM\", \"ISM-V2\", or \"ABAQUS\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setName!","text":"setName(proj::Project,name::String)\n\nThe name of the project is the filename to be used by the mesh, plot, and stats files. It is also the name of the control file the tool will produce.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPlotFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setPlotFileFormat!","text":"setPlotFileFormat(proj::Project, plotFileFormat::String)\n\nSet the file format for the plot file. Acceptable choices are \"sem\", which includes interior nodes and boundary nodes and \"skeleton\", which includes only the corner nodes.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPolynomialOrder!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setPolynomialOrder!","text":"setPolynomialOrder(proj::Project, p::Int)\n\nSet the polynomial order for boundary curves in the mesh file to p.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementEnd!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementEnd!","text":"setRefinementEnd!(refinementRegion, location)\n\nSet the end point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementGridSize!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementGridSize!","text":"setRefinementGridSize!(r::Dict{String,Any}, h)\n\nSet the grid size, h for the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementLocation!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementLocation!","text":"setRefinementLocation!(refinementCenter, location)\n\nSet the location of a refinement center to location = [x,y,z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementName!","text":"setRefinementName!(r::Dict{String,Any}, type)\n\nSet a name for the refinement region.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementStart!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setRefinementStart!","text":"setRefinementStart!(refinementRegion, location)\n\nSet the start point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementType!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementType!","text":"setRefinementType!(refinementRegion, type)\n\nSet the type, either \"smooth\" or \"sharp\" for the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementWidth!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementWidth!","text":"setRefinementWidth!(r::Dict{String,Any}, width)\n\nSet the width of the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingIterations!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setSmoothingIterations!","text":"setSmoothingIterations!(proj::Project, iterations::Int)\n\nSet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingStatus!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingStatus!","text":"setSmoothingStatus(proj:Project, status::String)\n\nStatus is either \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingType!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingType!","text":"setSmoothingType!(proj:Project, status::String)\n\nType is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplineNKnots!-Tuple{Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.setSplineNKnots!","text":"setSplineNKnots!(spline::Dict{String,Any}, nKnots::Int)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplinePoints!-Tuple{Dict{String, Any}, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.setSplinePoints!","text":"setSplinePoints!(spline::Dict{String,Any},points::Array{Float64,4})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setStartPoint!-Tuple{Dict{String, Any}, Array{Float64, N} where N}","page":"Reference","title":"HOHQMesh.setStartPoint!","text":"setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the start point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setXEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setXEqn!","text":"setXEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the x-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setYEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setYEqn!","text":"setYEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the y-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setZEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setZEqn!","text":"setZEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the zEqn-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.unRegisterForNotification-Tuple{Any, String}","page":"Reference","title":"HOHQMesh.unRegisterForNotification","text":"unRegisterForNotification(observer::Any, note::String)\n\nRemove the observer from being notified by the notification note\n\n\n\n\n\n","category":"method"},{"location":"tutorials/spline_curves/#Spline-curves","page":"Spline curves","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line \"curves\". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.","category":"page"},{"location":"tutorials/spline_curves/#Synopsis","page":"Spline curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/spline_curves/#Initialization","page":"Spline curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a new project with the name \"spline_curves\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_project = newProject(\"spline_curves\", \"out\")","category":"page"},{"location":"tutorials/spline_curves/#Add-the-outer-boundary","page":"Spline curves","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The outer boundary curve for this tutorial is a circle of radius r=4 centered at the point (0 -1). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"circ = newCircularArcCurve(\"outerCircle\", # curve name\n [0.0, -1.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circ is assigned to be \"outerCircle\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new circ curve is then added to the spline_project as an outer boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToOuterBoundary!(spline_project, circ)","category":"page"},{"location":"tutorials/spline_curves/#Add-a-background-grid","page":"Spline curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for spline_project to have elements with side length 06 in each direction","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addBackgroundGrid!(spline_project, [0.6, 0.6, 0.0])","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"plotProject!(spline_project, MODEL+GRID)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"outerCircle\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/spline_curves/#Add-the-inner-boundaries","page":"Spline curves","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The domain of this tutorial will contain three inner boundary curves:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Cubic spline curve created from data points read in from a file.\nCubic spline curve created from points directly given in the code.\nTriangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-with-data-from-a-file","page":"Spline curves","title":"Cubic spline with data from a file","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots t_j, x_j, y_j, z_j where j indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a parametric spline curve from a file with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline1 = newSplineCurve(\"big_spline\", joinpath(@__DIR__, \"examples\", \"test_spline_curve_data.txt\"))","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline1 is assigned to be \"big_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline1 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline1, \"inner1\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve \"big_spline\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: one_curve)","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-from-data-in-Julia","page":"Spline curves","title":"Cubic spline from data in Julia","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Below, we construct another parametric spline using this strategy that consists of five data points","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n\nspline2 = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline2 is assigned to be \"small_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline2 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline2, \"inner2\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner2\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve \"small_spline\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: two_curves)","category":"page"},{"location":"tutorials/spline_curves/#Triangular-shape","page":"Spline curves","title":"Triangular shape","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"edge1 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.3, -1.0, 0.0], # start point\n [-1.7, -1.0, 0.0]) # end point\n\nedge2 = newEndPointsLineCurve(\"triangle\", # curve name\n [-1.7, -1.0, 0.0], # start point\n [-2.0, -0.4, 0.0]) # end point\n\nedge3 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.0, -0.4, 0.0], # start point\n [-2.3, -1.0, 0.0]) # end point","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, each edge of the curve is given the same name \"triangle\" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, edge1, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge2, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge3, \"inner3\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The inner boundary chain name \"inner3\" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called \"triangle\" labeled in the figure by 3.1, 3.2, and 3.3.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: three_curves)","category":"page"},{"location":"tutorials/spline_curves/#Generate-the-mesh","page":"Spline curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_curves.control: A HOHQMesh control file for the current project.\nspline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nspline_curves.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"generate_mesh(spline_project)\n 1 chevron elements removed from mesh.\n 1 chevron elements removed from mesh.\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.25359100000000001\n Number of nodes = 1176\n Number of Edges = 2225\n Number of Elements = 1047\n Number of Subdivisions = 4\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00006209 0.15607019 0.04505180 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00008965 2.78091496 1.23178864 1.00000000 999.99900000 1.00000000\n Condition 1.00000055 3.82171291 1.15535543 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00014261 6.78201663 1.46249737 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001491 0.10424647 0.03955817 0.00000000 999.99900000 1.00000000\n Minimum Angle 37.24189766 89.96174556 74.42003031 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.03128071 157.35065162 107.91806148 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of \"bad\" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: final_spline)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the \"big_spline\" curve. We decide that we are satisfied with the overall mesh quality.","category":"page"},{"location":"tutorials/spline_curves/#Summary","page":"Spline curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#Tutorials","page":"Overview","title":"Tutorials for HOHQMesh.jl","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"The tutorial section for HOHQMesh.jl provides step-by-step commands and accompanying explanations for the major features of the interactive mesh generation tools.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.","category":"page"},{"location":"tutorials/introduction/#[Straight-sided-outer-boundary](@ref)","page":"Overview","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.","category":"page"},{"location":"tutorials/introduction/#Synopsis","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/introduction/#[Curved-outer-boundary](@ref)","page":"Overview","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.","category":"page"},{"location":"tutorials/introduction/#Synopsis-2","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/introduction/#[Spline-curves](@ref)","page":"Overview","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/introduction/#Synopsis-3","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#[Creating-and-editing-curves](@ref)","page":"Overview","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve \"chain\" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.","category":"page"},{"location":"tutorials/introduction/#Synopsis-4","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"guided-tour/#Guided-tour","page":"Guided tour","title":"Guided tour","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In this brief overview, we highlight two scripts from the examples/ folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"See the HOHQMesh documentation for more details about its terminology and capabilities.","category":"page"},{"location":"guided-tour/#Mesh-from-a-control-file","page":"Guided tour","title":"Mesh from a control file","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_from_control_file.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"This command will create mesh and plot files in the out directory.","category":"page"},{"location":"guided-tour/#Build-a-mesh-from-scratch","page":"Guided tour","title":"Build a mesh from scratch","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_boundary.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For completeness, we provide the example script and walk-through each step in the construction of the Project below.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"using HOHQMesh\n\n# Create a new project with the name \"IceCreamCone\", which will also be the\n# name of the mesh, plot and stats files, written to output folder `out`.\n\np = newProject(\"IceCreamCone\", \"out\")\n\n# Outer boundary for this example mesh is a complete circle. Add it into the project.\n\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\n\n# Inner boundary is three curves. Two straight lines and a circular arc.\n# Note the three curve are connected to ensure a counter-clockwise orientation\n# as required by HOHQMesh\n\n# Create the three interior curves. The individual names of each curve in the inner\n# chain are used internally by HOHQMesh and are output as the given boundary names in\n# the mesh file.\n\ncone1 = newEndPointsLineCurve(\"cone1\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\niceCream = newCircularArcCurve(\"iceCream\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")\ncone2 = newEndPointsLineCurve(\"cone2\", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])\n\n# Assemble the three curve in a closed chain oriented counter-clockwise. The chain\n# name `IceCreamCone` is only used internally by HOHQMesh.\n\naddCurveToInnerBoundary!(p, cone1, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, iceCream, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, cone2, \"IceCreamCone\")\n\n# Adjust some `RunParameters` and overwrite the defaults values. In this case, we\n# set a new value for the boundary order polynomial representation and adjust the\n# output mesh file format to be `sem`\n\nsetPolynomialOrder!(p, 4)\nsetPlotFileFormat!(p, \"sem\")\n\n# A background grid is required for the mesh generation. In this example we lay a\n# background grid of Cartesian boxes with size 0.5.\n\naddBackgroundGrid!(p, [0.5, 0.5, 0.0])\n\n# Plot the project model curves and background grid\n\nif isdefined(Main, :Makie)\n plotProject!(p, MODEL+GRID)\n @info \"Press enter to generate the mesh and update the plot.\"\n readline()\n else # Throw an informational message about plotting to the user\n @info \"To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again.\"\n end\n\n# Generate the mesh. This produces the mesh and TecPlot files `IceCreamCone.mesh` and `IceCreamCone.tec`\n# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is\n# updated with the mesh that was generated.\n\ngenerate_mesh(p)\n\n# After the mesh successfully generates mesh statistics, such as the number of corner nodes,\n# the number of elements etc., are printed to the REPL","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The first line creates a new project, where the mesh and plot file names will be derived from the project name, \"IceCreamCone\" written to the specified folder.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, \"IceCreamCone\" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script resets the polynomial order (default = 5) and the plot file format (default = \"skeleton\").","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, only the mesh size needs to be specified using","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"addBackgroundGrid!(proj::Project, bgSize::Array{Float64})","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The example sets the background mesh size to be 0.5 in the x and y directions. The z component is ignored.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The script finishes by generating the quad mesh and plotting the results, as shown below","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"(Image: iceCreamCone)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Finally, the script returns the project so that it can be edited further, if desired.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To save a control file for HOHQMesh, simply invoke","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"saveProject(proj::Project)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"where the name of the control file (traditionally with a .control extension) matches the name of the project proj. saveProject is automatically called when a mesh is generated.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.","category":"page"},{"location":"license/#License","page":"License","title":"License","text":"","category":"section"},{"location":"license/","page":"License","title":"License","text":"MIT LicenseCopyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-LakemperPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"CheatSheet/#Commands-Cheat-Sheet","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples/ folder constructs an identical example mesh as shown in the Guided tour using generic function calls.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"A thorough description of the functions can be found in the API section.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The general workflow of the interactive mesh functionality within a REPL session is","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Create a project\nAdd boundary curves\nAdd a background grid\nAdd manual refinement (if desired)\nGenerate mesh","category":"page"},{"location":"CheatSheet/#Project","page":"Commands Cheat Sheet","title":"Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" p = newProject(, )","category":"page"},{"location":"CheatSheet/#cs-plotting","page":"Commands Cheat Sheet","title":"Plotting","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" plotProject!(p, options)\n updatePlot!(p, options)","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The options are any sum of MODEL, GRID, REFINEMENTS, and MESH.","category":"page"},{"location":"CheatSheet/#Curves","page":"Commands Cheat Sheet","title":"Curves","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" c = new(name, startLocation [x,y,z], endLocation [x,y,z]) *Straight Line*\n c = new(name, center [x,y,z], radius, startAngle, endAngle) *Circular Arc*\n c = new(name, xEqn, yEqn, zEqn) *Parametric equation*\n c = new(name, dataFile) *Spline with data from a file*\n c = new(name, nKnots, knotsMatrix) *Spline with given knot values*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#cs-manual-refinement","page":"Commands Cheat Sheet","title":"Manual Refinement","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" r = newRefinementCenter(name, type, center, gridSize, radius)\n r = newRefinementLine(name, type, startPoint, endPoint, gridSize, width)","category":"page"},{"location":"CheatSheet/#Adding-to-a-Project","page":"Commands Cheat Sheet","title":"Adding to a Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" add!(p, c) *Add outer boundary curve*\n add!(p, c, ) *Add curve to an inner boundary*\n add!(p, r) *Add refinement region*\n\n addBackgroundGrid!(p, [top, left, bottom, right], [nX, nY, nZ]) *No outer boundary*\n addBackgroundGrid!(p, [dx, dy, dz]) *If an outer boundary is present*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function add!, which is a shortcut to the full functions, e.g. addOuterBoundaryCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#Accessing-items","page":"Commands Cheat Sheet","title":"Accessing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" crv = getCurve(p, curveName) *Get a curve in the outer boundary*\n crv = getCurve(p, curveName, boundaryName) *Get a curve in an inner boundary*\n indx, chain = getChain(p, boundaryName) *Get a complete inner boundary curve*\n r = getRefinementRegion(p, name)","category":"page"},{"location":"CheatSheet/#Removing-from-Project","page":"Commands Cheat Sheet","title":"Removing from Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" removeOuterBoundary!(p) *Entire outer boundary curve*\n removeInnerBoundary!(p, innerBoundaryName) *Entire inner boundary curve*\n remove!(p, name) *Curve in outer boundary*\n remove!(p, name, innerBoundaryName) *Curve in inner boundary*\n removeRefinementRegion!(p, name)","category":"page"},{"location":"CheatSheet/#Editing-items","page":"Commands Cheat Sheet","title":"Editing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.","category":"page"},{"location":"CheatSheet/#Meshing","page":"Commands Cheat Sheet","title":"Meshing","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" generate_mesh(p)\n remove_mesh!(p)","category":"page"},{"location":"#HOHQMesh.jl","page":"Home","title":"HOHQMesh.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6 and above.","category":"page"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> import Pkg; Pkg.add(\"HOHQMesh\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the Julia REPL, you can load HOHQMesh with","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using HOHQMesh","category":"page"},{"location":"","page":"Home","title":"Home","text":"and then happily generate away!","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> control_file = joinpath(HOHQMesh.examples_dir(), \"GingerbreadMan.control\")\n\njulia> output = generate_mesh(control_file)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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,","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: gingerbreadman_with_edges_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"while the 3D file Snake.control produces this mesh:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: snake_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.,","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_box_two_circles.jl\"))","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using Pkg; Pkg.add(\"GLMakie\")\njulia> using GLMakie","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: box_two_circles)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Further explanation of the interactive functionality can be found here. Additional examples are available in the Tutorials.","category":"page"},{"location":"#authors-index-md","page":"Home","title":"Authors","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#License-and-contributing","page":"Home","title":"License and contributing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Acknowledgements","page":"Home","title":"Acknowledgements","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"}]
+}
diff --git a/v0.2.2/siteinfo.js b/v0.2.2/siteinfo.js
new file mode 100644
index 00000000..c12bcffe
--- /dev/null
+++ b/v0.2.2/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.2.2";
diff --git a/v0.2.2/testing/index.html b/v0.2.2/testing/index.html
new file mode 100644
index 00000000..6ae183b8
--- /dev/null
+++ b/v0.2.2/testing/index.html
@@ -0,0 +1,3 @@
+
+Testing · HOHQMesh.jl
During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In HOHQMesh and its related repositories, tests are triggered by
each git push to main and
each git push to any pull request.
Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.
Test and coverage requirements
Before merging a pull request (PR) to main, we require that
The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing
julia> using Pkg; Pkg.test("HOHQMesh")
in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,
julia> # Run all test for the interactive Curve API
+ include(joinpath("test", "test_curve.jl"))
We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.
Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.
When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).
Test duration
As a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).
In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered "covered" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The "Details" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.
Coverage requirements
In general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.
Settings
This document was generated with Documenter.jl version 0.27.25 on Monday 8 January 2024. Using Julia version 1.6.7.
diff --git a/v0.2.2/tutorials/create_edit_curves/index.html b/v0.2.2/tutorials/create_edit_curves/index.html
new file mode 100644
index 00000000..870496d3
--- /dev/null
+++ b/v0.2.2/tutorials/create_edit_curves/index.html
@@ -0,0 +1,166 @@
+
+Creating and editing curves · HOHQMesh.jl
The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a "chain" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "sandbox" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.
We first create the outer boundary curve chain that is composed of three pieces
Straight line segment from $(0, -7)$ to $(5, 3)$.
Half-circle arc of radius $r=5$ centered at $(0, 3)$.
Straight line segment from $(-5, 3)$ to $(0, -7)$.
Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
outer_line1 = newEndPointsLineCurve("Line1", # curve name
+ [0.0, -7.0, 0.0], # start point
+ [5.0, 3.0, 0.0]) # end point
+
+outer_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-5.0, 3.0, 0.0], # start point
+ [0.0, -7.0, 0.0]) # end point
To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from $0$ to $180$ degrees.
outer_arc = newCircularArcCurve("Arc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 5.0, # radius
+ 0.0, # start angle
+ 180.0, # end angle
+ "degrees") # units for angle
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be "Arc".
The curve names "Line1", "Line2", and "Arc" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.
The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction
We visualize the outer boundary curve chain and background grid with the following
plotProject!(sandbox_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains three curve segments "Line1", "Arc", and "Line2" labeled in the figure by O.1, O.2, and O.3, respectively.
Suppose that the domain boundary requires a curved segment instead of the straight line "Line2". We will replace this line segment in the outer boundary chain with a cubic spline.
First, we remove the "Line2" curve from the "Outer" chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
The plot automatically updates and we see that the outer boundary is open and contains two segments: "Line1" and "Arc".
Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve "Arc" and end at the first point of the curve "Line1". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. The spline curve constructor newSplineCurve also takes the number of points as an input argument.
We create a pill shaped inner boundary curve chain composed of four pieces
Straight line segment from $(1, 5)$ to $(1, 3)$.
Half-circle arc of radius $r=1$ centered at $(0, 3)$.
Straight line segment from $(-1, 3)$ to $(-1, 5)$.
Half-circle arc of radius $r=1$ centered at $(0, 5)$.
Similar to the construction of the "Outer" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
inner_line1 = newEndPointsLineCurve("Line1", # curve name
+ [1.0, 5.0, 0.0], # start point
+ [1.0, 3.0, 0.0]) # end point
+
+inner_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-1.0, 3.0, 0.0], # start point
+ [-1.0, 5.0, 0.0]) # end point
To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at $(0, 3)$ varies from $0$ to $-180$ degrees. The top half-circle arc centered at $(0, 5)$ has an angle that varies from $180$ to $0$ degrees. The construction of the two circle arcs are
inner_bottom_arc = newCircularArcCurve("BottomArc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 1.0, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+
+inner_top_arc = newCircularArcCurve("TopArc", # curve name
+ [0.0, 5.0, 0.0], # center
+ 1.0, # radius
+ 180.0, # start angle
+ 0.0, # end angle
+ "degrees") # units for angle
Note, we use "radians" to set the angle bounds for inner_bottom_arc and "degrees" for the angle bounds of inner_top_arc.
The curve names "Line1", "Line2", "BottomArc", and "TopArc" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.
The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.
This inner boundary chain name "inner" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments "Line1", "BottomArc", "Line2", and "TopArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:
sandbox.control: A HOHQMesh control file for the current project.
sandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
sandbox.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 7.5414000000000009E-002
+ Number of nodes = 511
+ Number of Edges = 933
+ Number of Elements = 422
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00002932 1.17335568 0.18813138 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00953438 2.30790024 1.31439620 1.00000000 999.99900000 1.00000000
+ Condition 1.00041663 2.41773865 1.21024584 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.01673809 3.68828437 1.59413340 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001750 1.13820387 0.14143901 0.00000000 999.99900000 1.00000000
+ Minimum Angle 32.22733574 89.35690571 68.75321248 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.61089476 152.37947944 113.36221513 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.
Additionally, the remove_mesh! command deletes the mesh information from the sandbox_project and sandbox.mesh from the out folder. However, the sandbox.control and sandbox.tec files are still present in out directory.
Suppose that the inner boundary actually requires a curved segment instead of the straight line "Line1". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.
We remove the "Line1" curve from the inner chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: "BottomArc", "Line2", and "TopArc". Note that the index of the remaining curves has changed as shown below.
Brief note about undo / redo
The interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.
undoActionName()
+"Remove Inner Boundary Curve"
We can undo the removal of the "Line1" curve with undo
undo()
+"Undo Remove Inner Boundary Curve"
In addition to reinstating "Line1" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.
Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.
The new inner curve segment will be an oscillating line given by the parametric equations
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above
We see from the figure that this parametric equation curve starts at the point $(1,5)$ and, therefore, matches the end point of the existing curve "TopArc" present in the "inner" chain. However, the parametric equation curve ends at the point $(2,3)$ which does not match the "BottomArc" curve. So, the inner boundary chain remains open.
Attempt to generate a mesh with an open curve chain
An open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.
To create a closed boundary curve we must remove the "BottomArc" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point $(2, 3)$ and end at the point $(-1, 3)$ to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the "BottomArc" from the "inner" chain.
The figure updates to display the "inner" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.
A half-circle arc that joins the points $(2, 3)$ and $(-1, 3)$ has a radius $r=1.5$, is centered at $(0.5, 3)$ and has an angle that vaires from $0$ to $-180$. We construct this circle arc and directly add it to the sandbox_project.
new_bottom_arc = newCircularArcCurve("wideBottomArc", # curve name
+ [0.5, 3.0, 0.0], # center
+ 1.5, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
The updated plot now gives the modified, closed inner curve chain that now contains four curve segments "Line2", "TopArc", "wiggleLine", and "wideBottomArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.11353599999999998
+ Number of nodes = 712
+ Number of Edges = 1308
+ Number of Elements = 596
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00002932 1.15661960 0.12823902 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.01050856 3.14732001 1.34260027 1.00000000 999.99900000 1.00000000
+ Condition 1.00037771 2.59434067 1.22850175 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.02744717 3.68828437 1.64751502 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001750 1.13149451 0.09443920 0.00000000 999.99900000 1.00000000
+ Minimum Angle 31.87236189 89.33988565 67.86178629 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.44177106 157.27121105 114.35699650 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The visualization updates automatically and the background grid is removed after when the mesh is generated.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.
Add the background grid when an outer boundary curve is present.
Visualize an interactive mesh project.
Discuss undo / redo capabilities.
Construct and add parametric spline curves.
Construct and add a curve from parametric equations.
Construct and add straight line segments.
Construct and add circular arc segments.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with modified outer and inner curve chains
+#
+# Create inner / outer boundary chains composed of the four
+# available HOHQMesh curve types.
+#
+# Keywords: outer boundary, inner boundary, parametric equations,
+# circle arcs, cubic spline, curve removal
+using HOHQMesh
+
+# Instantiate the project
+sandbox_project = newProject("sandbox", "out")
+
+# Add the background grid
+addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])
+
+# Create and add the original outer boundary curves
+outer_line1 = newEndPointsLineCurve("Line1", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])
+outer_line2 = newEndPointsLineCurve("Line2", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])
+outer_arc = newCircularArcCurve("Arc", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, "degrees")
+
+addCurveToOuterBoundary!(sandbox_project, outer_line1)
+addCurveToOuterBoundary!(sandbox_project, outer_arc)
+addCurveToOuterBoundary!(sandbox_project, outer_line2)
+
+# Modify the outer boundary to have a spline instead of a straight line
+removeOuterBoundaryCurveWithName!(sandbox_project, "Line2")
+
+spline_data = [ [0.0 -5.0 3.0 0.0]
+ [0.25 -2.0 1.0 0.0]
+ [0.5 -4.0 0.5 0.0]
+ [0.75 -2.0 -3.0 0.0]
+ [1.0 0.0 -7.0 0.0] ]
+outer_spline = newSplineCurve("Spline", 5, spline_data)
+addCurveToOuterBoundary!(sandbox_project, outer_spline)
+
+# Create and add the inner boundary curves
+inner_line1 = newEndPointsLineCurve("Line1", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])
+inner_line2 = newEndPointsLineCurve("Line2", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])
+inner_bottom_arc = newCircularArcCurve("BottomArc", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, "radians")
+inner_top_arc = newCircularArcCurve("TopArc", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, "degrees")
+
+addCurveToInnerBoundary!(sandbox_project, inner_line1, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_line2, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_top_arc, "inner")
+
+# Generate a mesh
+generate_mesh(sandbox_project)
+
+# Delete the existing mesh before modifying the inner boundary curve chain
+remove_mesh!(sandbox_project)
+
+# Modify the inner boundary curve with an oscillatory line and a new circle arc
+removeInnerBoundaryCurve!(sandbox_project, "Line1", "inner")
+removeInnerBoundaryCurve!(sandbox_project, "BottomArc", "inner")
+
+xEqn = "x(t) = t + 1"
+yEqn = "y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)"
+zEqn = "z(t) = 0.0"
+inner_eqn = newParametricEquationCurve("wiggleLine", xEqn, yEqn, zEqn)
+
+new_bottom_arc = newCircularArcCurve("wideBottomArc", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, "radians")
+
+addCurveToInnerBoundary!(sandbox_project, inner_eqn, "inner")
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
+
+# Regenerate the final mesh
+generate_mesh(sandbox_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Monday 8 January 2024. Using Julia version 1.6.7.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.
The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "TheBlob" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
The following commands create a new curve for the parametric equations above
The name of this curve is assigned to be "Blob". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for blob_project to have elements with side length two in each direction
addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])
We next visualize the outer boundary curve and background grid with the following
plotProject!(blob_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "Blob" labeled in the figure by O.1.
From the visualization we see that the background grid is likely too coarse to produce a "good" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction
setBackgroundGridSize!(blob_project, 0.5, 0.5)
Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.
The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.
We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:
TheBlob.control: A HOHQMesh control file for the current project.
TheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
TheBlob.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 8.4328000000000000E-002
+ Number of nodes = 479
+ Number of Edges = 895
+ Number of Elements = 417
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025286 0.36208840 0.11936333 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002882 2.58443761 1.26335838 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.12867591 1.18585825 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006176 4.77438730 1.51314025 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011275 0.28170345 0.10292806 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.38249259 89.99827733 73.08294187 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132795 156.98701187 109.36585212 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point $(-4, 0)$ is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with
Above we create a circular refinement region centered at the point $(-4, -0.5)$ with a desired resolution size $0.4$ and a radius of $1.0$. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.
With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 9.2778999999999986E-002
+ Number of nodes = 503
+ Number of Edges = 940
+ Number of Elements = 438
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025286 0.36208840 0.11412688 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002883 2.47056840 1.26416662 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.12867592 1.18429212 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006176 4.77438730 1.51407242 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011275 0.28170345 0.09814903 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.38249259 89.99827897 72.80049710 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132784 156.98701188 109.63478104 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.
Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.
Define a curved outer boundary using parametric equations.
Add and adjust the background grid.
Visualize an interactive mesh project.
Add manual refinement to a local region of the domain.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with a curved outer boundary
+#
+# Create an outer boundary from a set of parametric equations.
+# Add manual refinement in a small region around the point (-4, -0.5).
+#
+# Keywords: outer boundary, parametric equations, refinement center
+using HOHQMesh
+
+# Instantiate the project
+blob_project = newProject("TheBlob", "out")
+
+# Create and add the outer boundary curve
+xEqn = "x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3"
+yEqn = "y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2"
+zEqn = "z(t) = 0.0"
+blob = newParametricEquationCurve("Blob", xEqn, yEqn, zEqn)
+addCurveToOuterBoundary!(blob_project, blob)
+
+# Add the background grid
+addBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])
+
+# Create and add the refinement region
+center = newRefinementCenter("region", "smooth", [-4.0, -0.5, 0.0], 0.4, 1.0)
+addRefinementRegion!(blob_project, center)
+
+# Generate the mesh
+generate_mesh(blob_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Monday 8 January 2024. Using Julia version 1.6.7.
For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.
For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.
This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.
This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.
This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line "curves".
This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve "chain" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line "curves". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "spline_curves" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.
The outer boundary curve for this tutorial is a circle of radius $r=4$ centered at the point $(0, -1)$. We define this circular curve with the function newCircularArcCurve as follows
circ = newCircularArcCurve("outerCircle", # curve name
+ [0.0, -1.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circ is assigned to be "outerCircle". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circ curve is then added to the spline_project as an outer boundary curve with
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for spline_project to have elements with side length $0.6$ in each direction
We next visualize the outer boundary curve and background grid with the following
plotProject!(spline_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "outerCircle" labeled in the figure by O.1.
A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots $t_j$, $x_j$, $y_j$, $z_j$ where $j$ indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder
We create a parametric spline curve from a file with
The name of the curve stored in the dictionary spline1 is assigned to be "big_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline1 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve "big_spline" labeled in the figure by 1.1.
Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.
Below, we construct another parametric spline using this strategy that consists of five data points
The name of the curve stored in the dictionary spline2 is assigned to be "small_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline2 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner2" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve "small_spline" labeled in the figure by 2.1.
Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with
edge1 = newEndPointsLineCurve("triangle", # curve name
+ [-2.3, -1.0, 0.0], # start point
+ [-1.7, -1.0, 0.0]) # end point
+
+edge2 = newEndPointsLineCurve("triangle", # curve name
+ [-1.7, -1.0, 0.0], # start point
+ [-2.0, -0.4, 0.0]) # end point
+
+edge3 = newEndPointsLineCurve("triangle", # curve name
+ [-2.0, -0.4, 0.0], # start point
+ [-2.3, -1.0, 0.0]) # end point
Here, each edge of the curve is given the same name "triangle" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.
The inner boundary chain name "inner3" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called "triangle" labeled in the figure by 3.1, 3.2, and 3.3.
With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:
spline_curves.control: A HOHQMesh control file for the current project.
spline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
spline_curves.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(spline_project)
+ 1 chevron elements removed from mesh.
+ 1 chevron elements removed from mesh.
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.25359100000000001
+ Number of nodes = 1176
+ Number of Edges = 2225
+ Number of Elements = 1047
+ Number of Subdivisions = 4
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00006209 0.15607019 0.04505180 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00008965 2.78091496 1.23178864 1.00000000 999.99900000 1.00000000
+ Condition 1.00000055 3.82171291 1.15535543 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00014261 6.78201663 1.46249737 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001491 0.10424647 0.03955817 0.00000000 999.99900000 1.00000000
+ Minimum Angle 37.24189766 89.96174556 74.42003031 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.03128071 157.35065162 107.91806148 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of "bad" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the "big_spline" curve. We decide that we are satisfied with the overall mesh quality.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples/ folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "box_two_circles" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.
When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.
For the box_project we first query the current values for the polynomial order and the mesh output format
We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be $4$ and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.
The domain for this tutorial is a rectangular box with the bounds $[0,30]\times[0,15]$. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:
Set the lower left corner point of the domain $(x_0, y_0)$, define the element size in each spatial direction $\Delta x$ and $\Delta y$, and the number of steps taken in each direction $N_x, N_y$. The resulting background grid will have the extent $[x_0, x_0 + N_x \Delta x]$ by $[y_0, y_0 + N_y \Delta y]$. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands
Set the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box $[0,30]\times[0,15]$ we use
Next, we add the two circular inner boundary curves with different radii.
The first circle will have radius $r=2$ and be centered at the point $(4, 4)$. We define this circular curve with the function newCircularArcCurve as follows
circle1 = newCircularArcCurve("circle1", # curve name
+ [4.0, 4.0, 0.0], # circle center
+ 2.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be "circle1". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circle1 curve is then added to the box_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called "inner1" and it contains a single curve "circle1" labeled in the figure by 1.1.
With analogous steps we create another circular curve with radius $r=4$, centered at $(20, 9)$ and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.
circle2 = newCircularArcCurve("circle2", # curve name
+ [20.0, 9.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 2.0 * pi, # end angle
+ "radians") # angle units
+addCurveToInnerBoundary!(box_project, circle2, "inner2")
Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called "inner2" and it contains a single curve "circle2" labeled in the figure by 2.1.
With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:
box_two_circles.control: A HOHQMesh control file for the current project.
box_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
box_two_circles.inp: A mesh file with format ABAQUS that was set above.
To do this we execute the command
generate_mesh(box_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 2.9116999999999997E-002
+ Number of nodes = 498
+ Number of Edges = 921
+ Number of Elements = 422
+ Number of Subdivisions = 0
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.34513977 1.15385313 0.91833886 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00000004 1.71084672 1.08736698 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 1.46547984 1.04928616 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00000006 2.43578615 1.16710823 1.00000000 4.00000000 1.00000000
+ Jacobian 0.17854786 1.07210200 0.86801191 0.00000000 999.99900000 1.00000000
+ Minimum Angle 50.57680338 89.99999787 83.84338772 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00000259 136.97085026 96.70176380 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.
From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.
This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples/ folder constructs an identical example mesh as shown in the Guided tour using generic function calls.
A thorough description of the functions can be found in the API section.
The general workflow of the interactive mesh functionality within a REPL session is
c = new(name, startLocation [x,y,z], endLocation [x,y,z]) *Straight Line*
+ c = new(name, center [x,y,z], radius, startAngle, endAngle) *Circular Arc*
+ c = new(name, xEqn, yEqn, zEqn) *Parametric equation*
+ c = new(name, dataFile) *Spline with data from a file*
+ c = new(name, nKnots, knotsMatrix) *Spline with given knot values*
Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.
All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.
HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).
HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.
Developer Certificate of Origin
+Version 1.1
+
+Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+1 Letterman Drive
+Suite D4700
+San Francisco, CA, 94129
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+
+Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+(a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+(b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+(c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+(d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
Settings
This document was generated with Documenter.jl version 0.27.25 on Thursday 4 April 2024. Using Julia version 1.10.2.
When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:
Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.
If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.
Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like VS Code with the Julia extension). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.
Set the new version number in Project.toml according to the Julian version of semver. Commit and push.
Comment @JuliaRegistrator register on the commit setting the version number.
JuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.
Increment the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.
You can build the documentation of HOHQMesh.jl locally by running
julia --project=docs -e 'using Pkg; Pkg.instantiate(); include("docs/make.jl")'
from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).
Settings
This document was generated with Documenter.jl version 0.27.25 on Thursday 4 April 2024. Using Julia version 1.10.2.
In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.
All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).
If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.
git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git
+# get latest main from the main repo
+git checkout main
+git pull
+# create a new branch for a cool new feature, bug fix, ...
+git checkout -b YOUR_BRANCH_NAME
+# do some work and push it to your fork
+git push -u myfork
+# go to https://github.com/trixi-framework/HOHQMesh.jl/pull
+# and create a PR from your new branch
Why using pull requests?
Immediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.
With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.
Avoid committing unwanted files
When you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.
For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:
Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.
Execute git fetch to get the latest changes from the repository.
Make sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.
Merge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.
In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.
If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should
merge the current main to your branch
run tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs
properly comment your code
delete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)
remove debug statements
add a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)
After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.
Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.
Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.
Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).
Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:
Update your clone by running git fetch.
Check out main using git checkout main.
Delete merged branch locally with git branch -d yourbranch.
Remove local references to deleted remote branch by executing git remote prune origin.
You can now proceed with your next changes by starting again at the top.
Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):
If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running
git reset HEAD~
This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.
If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.
Large files
You should never try to fix this yourself, as it potentially disrupts/destroys the work of others!
Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):
Tell everyone to commit and push their changes to the repository.
Fix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.
Perform the following steps to clean up the Git repository:
cd /tmp
+
+# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/
+
+# Get fresh clone of repo (so you can throw it away in case there is a problem)
+git clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git
+
+# Clean up repo of all files larger than 10M
+java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git
+
+# Enter repo
+cd HOHQMesh.jl.git
+
+# Clean up reflog and force aggressive garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
+
+# Push changes
+git push
+
+# Delete clone
+rm -rf HOHQMesh.jl.git
Tell everyone to clean up their local working copies by performing the following steps (also do this yourself):
# Enter repo
+cd HOHQMesh.jl
+
+# Get current changes
+git fetch
+
+# Check out the fixed branch
+git checkout branchname
+
+# IMPORTANT: Do a rebase instead of a pull!
+git rebase
+
+# Clean reflog and force garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
IMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.
Settings
This document was generated with Documenter.jl version 0.27.25 on Thursday 4 April 2024. Using Julia version 1.10.2.
diff --git a/v0.2.3/guided-tour/index.html b/v0.2.3/guided-tour/index.html
new file mode 100644
index 00000000..7d95ec2b
--- /dev/null
+++ b/v0.2.3/guided-tour/index.html
@@ -0,0 +1,62 @@
+
+Guided tour · HOHQMesh.jl
In this brief overview, we highlight two scripts from the examples/ folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.
A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute
A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute
For completeness, we provide the example script and walk-through each step in the construction of the Project below.
using HOHQMesh
+
+# Create a new project with the name "IceCreamCone", which will also be the
+# name of the mesh, plot and stats files, written to output folder `out`.
+
+p = newProject("IceCreamCone", "out")
+
+# Outer boundary for this example mesh is a complete circle. Add it into the project.
+
+circ = newCircularArcCurve("outerCircle", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, "degrees")
+addCurveToOuterBoundary!(p, circ)
+
+# Inner boundary is three curves. Two straight lines and a circular arc.
+# Note the three curve are connected to ensure a counter-clockwise orientation
+# as required by HOHQMesh
+
+# Create the three interior curves. The individual names of each curve in the inner
+# chain are used internally by HOHQMesh and are output as the given boundary names in
+# the mesh file.
+
+cone1 = newEndPointsLineCurve("cone1", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])
+iceCream = newCircularArcCurve("iceCream", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, "degrees")
+cone2 = newEndPointsLineCurve("cone2", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])
+
+# Assemble the three curve in a closed chain oriented counter-clockwise. The chain
+# name `IceCreamCone` is only used internally by HOHQMesh.
+
+addCurveToInnerBoundary!(p, cone1, "IceCreamCone")
+addCurveToInnerBoundary!(p, iceCream, "IceCreamCone")
+addCurveToInnerBoundary!(p, cone2, "IceCreamCone")
+
+# Adjust some `RunParameters` and overwrite the defaults values. In this case, we
+# set a new value for the boundary order polynomial representation and adjust the
+# output mesh file format to be `sem`
+
+setPolynomialOrder!(p, 4)
+setPlotFileFormat!(p, "sem")
+
+# A background grid is required for the mesh generation. In this example we lay a
+# background grid of Cartesian boxes with size 0.5.
+
+addBackgroundGrid!(p, [0.5, 0.5, 0.0])
+
+# Plot the project model curves and background grid
+
+if isdefined(Main, :Makie)
+ plotProject!(p, MODEL+GRID)
+ @info "Press enter to generate the mesh and update the plot."
+ readline()
+ else # Throw an informational message about plotting to the user
+ @info "To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again."
+ end
+
+# Generate the mesh. This produces the mesh and TecPlot files `IceCreamCone.mesh` and `IceCreamCone.tec`
+# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is
+# updated with the mesh that was generated.
+
+generate_mesh(p)
+
+# After the mesh successfully generates mesh statistics, such as the number of corner nodes,
+# the number of elements etc., are printed to the REPL
The first line creates a new project, where the mesh and plot file names will be derived from the project name, "IceCreamCone" written to the specified folder.
To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:
Parametric equations
Cubic Splines
Lines defined by their end points
Circular arcs
In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.
Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, "IceCreamCone" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.
For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script resets the polynomial order (default = 5) and the plot file format (default = "skeleton").
One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, only the mesh size needs to be specified using
The example sets the background mesh size to be 0.5 in the x and y directions. The z component is ignored.
The script finishes by generating the quad mesh and plotting the results, as shown below
Finally, the script returns the project so that it can be edited further, if desired.
To save a control file for HOHQMesh, simply invoke
saveProject(proj::Project)
where the name of the control file (traditionally with a .control extension) matches the name of the project proj. saveProject is automatically called when a mesh is generated.
Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.
Settings
This document was generated with Documenter.jl version 0.27.25 on Thursday 4 April 2024. Using Julia version 1.10.2.
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.
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.
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
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.,
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.
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.
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.
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.
Settings
This document was generated with Documenter.jl version 0.27.25 on Thursday 4 April 2024. Using Julia version 1.10.2.
The supplied name will be the default name of the control, mesh, and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.
The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.
If the model is modified and you want to re-plot with the new values, invoke
updatePlot!(proj::Project, options)
but generally the plot will be updated automatically as you build the model.
HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.
The available mesh file formats are "ISM", "ISM-V2", or "ABAQUS". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.
The plot file (which can be viewed with something like VisIt or ParaView) format is either "skeleton" or "sem". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.
By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with
A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available in the documentation.
To change the defaults, the smoother parameters can be set/enquired with the functions
There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must be specified after a new project has been created.
Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.
Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).
where name labels the refinement region, the type is either "smooth" or "sharp", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.
The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a "chain" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.
The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.
The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.
See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.
Returns a new set of parametric equation. Equations must be of the form
<function name>(<argument>) = ...
The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
A cubic spline is defined by an array of knots, $t_j$, $x_j$, $y_j$, $z_j$. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the $t$, $x$, $y$, $z$ values, e.g.
The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either "degrees" or "radians". That argument is optional, and defaults to "degrees".
Using the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using
The syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.
The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.
Several scripts are available in the examples/ folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.
Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.
The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.
To generate a mesh interactively you
Create a project with a user given projectName and folder where any generated files are to be saved
p = newProject(<projectName>, <folder>)
Both of these input arguments are strings.
Create inner and outer boundary curves from the available types
c = newEndPointsLineCurve(<name>, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*
+c = newCircularArcCurve(<name>, center [x, y, z], radius, startAngle, endAngle, units = "degrees" or "radians") *Circular Arc*
+c = newParametricEquationCurve(<name>, xEqn, yEqn, zEqn) *Parametric equation*
+c = newSplineCurve(<name>, dataFile) *Spline with data from a file*
+c = newSpline(<name>, nKnots, knotsMatrix) *Spline with given knot values*
See Defining curves for further details on the different curve type currently supported by HOHQMesh.
The generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.
Add curves to build the model to see what you have added,
addOuterBoundaryCurve!(p, <curveName>) *Add outer boundary curve*
+addInnerBoundaryCurve!(p, <curveName>, <InnerBoundaryName>) *Add curve to an inner boundary*
For a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.
Curves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.
Visualize the project's model, if desired
plotProject!(p, MODEL)
Plots are updated in response to user interactions. However, to update the plot at any time, use
updatePlot!(p, options)
Options are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.
Visualization requirement
The interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.
Set the background grid
When no outer boundary curve is present, the background grid can be set with
addBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])
Or
addBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])
The first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.
When an outer boundary is present the background grid can be set as
addBackgroundGrid!(p, [dx, dy, dz])
where the spacing controls the number of elements in each direction.
Background grid
A background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.
Adjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by
setPolynomialOrder!(p, order)
The background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately
The mesh file will be saved in <folder> with the name <projectName>.mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name <projectName>.control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.
All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.
Settings
This document was generated with Documenter.jl version 0.27.25 on Thursday 4 April 2024. Using Julia version 1.10.2.
Copyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-Lakemper
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Settings
This document was generated with Documenter.jl version 0.27.25 on Thursday 4 April 2024. Using Julia version 1.10.2.
Add the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version
Add the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.
Add an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.
Return a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.
Generate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.
You can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.
You can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
Generate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.
This function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
getCurveType(crv::Dic{String,Any})
+
+Get the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,
+`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.
Get the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.
Set the file format for the plot file. Acceptable choices are "sem", which includes interior nodes and boundary nodes and "skeleton", which includes only the corner nodes.
This document was generated with Documenter.jl version 0.27.25 on Thursday 4 April 2024. Using Julia version 1.10.2.
diff --git a/v0.2.3/search_index.js b/v0.2.3/search_index.js
new file mode 100644
index 00000000..99088851
--- /dev/null
+++ b/v0.2.3/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"contributing/#Contributing","page":"Contributing","title":"Contributing","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.","category":"page"},{"location":"contributing/#Developer-Certificate-of-Origin-(Version-1.1)","page":"Contributing","title":"Developer Certificate of Origin (Version 1.1)","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"The following text was taken from https://developercertificate.org:","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"Developer Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n1 Letterman Drive\nSuite D4700\nSan Francisco, CA, 94129\n\nEveryone is permitted to copy and distribute verbatim copies of this\nlicense document, but changing it is not allowed.\n\n\nDeveloper's Certificate of Origin 1.1\n\nBy making a contribution to this project, I certify that:\n\n(a) The contribution was created in whole or in part by me and I\n have the right to submit it under the open source license\n indicated in the file; or\n\n(b) The contribution is based upon previous work that, to the best\n of my knowledge, is covered under an appropriate open source\n license and I have the right under that license to submit that\n work with modifications, whether created in whole or in part\n by me, under the same open source license (unless I am\n permitted to submit under a different license), as indicated\n in the file; or\n\n(c) The contribution was provided directly to me by some other\n person who certified (a), (b) or (c) and I have not modified\n it.\n\n(d) I understand and agree that this project and the contribution\n are public and that a record of the contribution (including all\n personal information I submit with it, including my sign-off) is\n maintained indefinitely and may be redistributed consistent with\n this project or the open source license(s) involved.","category":"page"},{"location":"development/#Development","page":"Development","title":"Development","text":"","category":"section"},{"location":"development/#Text-editors","page":"Development","title":"Text editors","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:","category":"page"},{"location":"development/#VS-Code","page":"Development","title":"VS Code","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.","category":"page"},{"location":"development/#Juno","page":"Development","title":"Juno","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.","category":"page"},{"location":"development/#Vim-or-Emacs","page":"Development","title":"Vim or Emacs","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like VS Code with the Julia extension). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.","category":"page"},{"location":"development/#Releasing-a-new-version-of-HOHQMesh","page":"Development","title":"Releasing a new version of HOHQMesh","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Check whether everything is okay, tests pass etc.\nSet the new version number in Project.toml according to the Julian version of semver. Commit and push.\nComment @JuliaRegistrator register on the commit setting the version number.\nJuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.\nIncrement the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.","category":"page"},{"location":"development/#Preview-the-documentation","page":"Development","title":"Preview the documentation","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"You can build the documentation of HOHQMesh.jl locally by running","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"julia --project=docs -e 'using Pkg; Pkg.instantiate(); include(\"docs/make.jl\")'","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).","category":"page"},{"location":"tutorials/straight_outer_boundary/#Straight-sided-outer-boundary","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples/ folder.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Synopsis","page":"Straight-sided outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Initialization","page":"Straight-sided outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We create a new project with the name \"box_two_circles\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_project = newProject(\"box_two_circles\", \"out\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Adjusting-project-parameters","page":"Straight-sided outer boundary","title":"Adjusting project parameters","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"For the box_project we first query the current values for the polynomial order and the mesh output format","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> getPolynomialOrder(box_project)\n5\n\njulia> getMeshFileFormat(box_project)\n\"ISM-V2\"","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be 4 and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"setPolynomialOrder!(box_project, 4)\nsetMeshFileFormat!(box_project, \"ABAQUS\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-background-grid","page":"Straight-sided outer boundary","title":"Add the background grid","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The domain for this tutorial is a rectangular box with the bounds 030times015. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Set the lower left corner point of the domain (x_0 y_0), define the element size in each spatial direction Delta x and Delta y, and the number of steps taken in each direction N_x N_y. The resulting background grid will have the extent x_0 x_0 + N_x Delta x by y_0 y_0 + N_y Delta y. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands\nlower_left = [0.0, 0.0, 0.0]\nspacing = [1.0, 1.0, 0.0]\nnum_intervals = [30, 15, 0]\naddBackgroundGrid!(box_project, lower_left, spacing, num_intervals)\nSet the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box 030times015 we use\nbounds = [15.0, 0.0, 0.0, 30.0]\nN = [30, 15, 0]\naddBackgroundGrid!(box_project, bounds, N)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we visualize the box_project to ensure that the background grid has been added correctly.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"plotProject!(box_project, GRID)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use the keyword and GRID to indicate that we want the background grid to be included in the visualization.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: background)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-inner-boundaries","page":"Straight-sided outer boundary","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we add the two circular inner boundary curves with different radii.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The first circle will have radius r=2 and be centered at the point (4 4). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle1 = newCircularArcCurve(\"circle1\", # curve name\n [4.0, 4.0, 0.0], # circle center\n 2.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be \"circle1\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The new circle1 curve is then added to the box_project as an inner boundary curve with","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"addCurveToInnerBoundary!(box_project, circle1, \"inner1\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called \"inner1\" and it contains a single curve \"circle1\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: first_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With analogous steps we create another circular curve with radius r=4, centered at (20 9) and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle2 = newCircularArcCurve(\"circle2\", # curve name\n [20.0, 9.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 2.0 * pi, # end angle\n \"radians\") # angle units\naddCurveToInnerBoundary!(box_project, circle2, \"inner2\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called \"inner2\" and it contains a single curve \"circle2\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: second_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Generate-the-mesh","page":"Straight-sided outer boundary","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_two_circles.control: A HOHQMesh control file for the current project.\nbox_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nbox_two_circles.inp: A mesh file with format ABAQUS that was set above.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"generate_mesh(box_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 2.9116999999999997E-002\n Number of nodes = 498\n Number of Edges = 921\n Number of Elements = 422\n Number of Subdivisions = 0\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.34513977 1.15385313 0.91833886 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00000004 1.71084672 1.08736698 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 1.46547984 1.04928616 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00000006 2.43578615 1.16710823 1.00000000 4.00000000 1.00000000\n Jacobian 0.17854786 1.07210200 0.86801191 0.00000000 999.99900000 1.00000000\n Minimum Angle 50.57680338 89.99999787 83.84338772 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00000259 136.97085026 96.70176380 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: final_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Summary","page":"Straight-sided outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"github-git/#GitHub-and-Git","page":"GitHub & Git","title":"GitHub & Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This page contains information on how to use GitHub and Git when developing HOHQMesh.","category":"page"},{"location":"github-git/#Development-workflow","page":"GitHub & Git","title":"Development workflow","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For adding modifications to HOHQMesh, we generally follow these steps:","category":"page"},{"location":"github-git/#Create-an-issue-(optional)","page":"GitHub & Git","title":"Create an issue (optional)","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.","category":"page"},{"location":"github-git/#Create-a-branch-and-*immediately*-create-a-pull-request","page":"GitHub & Git","title":"Create a branch and immediately create a pull request","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git\n# get latest main from the main repo\ngit checkout main\ngit pull\n# create a new branch for a cool new feature, bug fix, ...\ngit checkout -b YOUR_BRANCH_NAME\n# do some work and push it to your fork\ngit push -u myfork\n# go to https://github.com/trixi-framework/HOHQMesh.jl/pull\n# and create a PR from your new branch","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"info: Why using pull requests?\nImmediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.","category":"page"},{"location":"github-git/#Make-changes","page":"GitHub & Git","title":"Make changes","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"warning: Avoid committing unwanted files\nWhen you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.","category":"page"},{"location":"github-git/#Keep-your-branch-in-sync-with-main","page":"GitHub & Git","title":"Keep your branch in sync with main","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.\nExecute git fetch to get the latest changes from the repository.\nMake sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.\nMerge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.","category":"page"},{"location":"github-git/#Prepare-for-review","page":"GitHub & Git","title":"Prepare for review","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"merge the current main to your branch\nrun tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs\nproperly comment your code\ndelete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)\nremove debug statements\nadd a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.","category":"page"},{"location":"github-git/#Get-reviewed","page":"GitHub & Git","title":"Get reviewed","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.","category":"page"},{"location":"github-git/#Merge-branch","page":"GitHub & Git","title":"Merge branch","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).","category":"page"},{"location":"github-git/#Update-your-working-copy","page":"GitHub & Git","title":"Update your working copy","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Update your clone by running git fetch.\nCheck out main using git checkout main.\nDelete merged branch locally with git branch -d yourbranch.\nRemove local references to deleted remote branch by executing git remote prune origin.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"You can now proceed with your next changes by starting again at the top.","category":"page"},{"location":"github-git/#Using-Git","page":"GitHub & Git","title":"Using Git","text":"","category":"section"},{"location":"github-git/#Resources-for-learning-Git","page":"GitHub & Git","title":"Resources for learning Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Git Handbook by GitHub\nLearn Git Branching","category":"page"},{"location":"github-git/#Tips-and-tricks","page":"GitHub & Git","title":"Tips and tricks","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This is an unordered collection of different tips and tricks that can be helpful while working with Git. As usual, your mileage might vary.","category":"page"},{"location":"github-git/#Undo-last-commit","page":"GitHub & Git","title":"Undo last commit","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git reset HEAD~","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.","category":"page"},{"location":"github-git/#Remove-large-file-from-repository","page":"GitHub & Git","title":"Remove large file from repository","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"danger: Large files\nYou should never try to fix this yourself, as it potentially disrupts/destroys the work of others!","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Tell everyone to commit and push their changes to the repository.\nFix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.\nPerform the following steps to clean up the Git repository:\ncd /tmp\n\n# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/\n\n# Get fresh clone of repo (so you can throw it away in case there is a problem)\ngit clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git\n\n# Clean up repo of all files larger than 10M\njava -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git\n\n# Enter repo\ncd HOHQMesh.jl.git\n\n# Clean up reflog and force aggressive garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\n\n# Push changes\ngit push\n\n# Delete clone\nrm -rf HOHQMesh.jl.git\nTell everyone to clean up their local working copies by performing the following steps (also do this yourself):\n# Enter repo\ncd HOHQMesh.jl\n\n# Get current changes\ngit fetch\n\n# Check out the fixed branch\ngit checkout branchname\n\n# IMPORTANT: Do a rebase instead of a pull!\ngit rebase\n\n# Clean reflog and force garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\nIMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.","category":"page"},{"location":"interactive-api/#API","page":"API","title":"API","text":"","category":"section"},{"location":"interactive-api/#Project-creation-and-saving","page":"API","title":"Project creation and saving","text":"","category":"section"},{"location":"interactive-api/#New-Project","page":"API","title":"New Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = newProject(name::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied name will be the default name of the control, mesh, and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.","category":"page"},{"location":"interactive-api/#Opening-an-existing-project-file","page":"API","title":"Opening an existing project file","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A project can be created from an existing HOHQMesh control file with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = openProject(fileName::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied fileName will be the name of the project and the generated mesh and plot files will be placed in the supplied folder.","category":"page"},{"location":"interactive-api/#Saving-a-Project","page":"API","title":"Saving a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" saveProject(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"writes a control file to the folder designated when creating the new project. It can be read in again with openProject.","category":"page"},{"location":"interactive-api/#Plotting-a-Project","page":"API","title":"Plotting a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" plotProject!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the model is modified and you want to re-plot with the new values, invoke","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" updatePlot!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"but generally the plot will be updated automatically as you build the model.","category":"page"},{"location":"interactive-api/#Modifying/editing-a-Project","page":"API","title":"Modifying/editing a Project","text":"","category":"section"},{"location":"interactive-api/#Setting-the-name-of-a-Project","page":"API","title":"Setting the name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name is the name under which the mesh, plot, statistics and control files will be written. It can be changed at any time with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setName!(proj::Project,name::String)","category":"page"},{"location":"interactive-api/#Getting-the-current-name-of-a-Project","page":"API","title":"Getting the current name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name can be fetched and printed to the screen with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getName(proj::Project)","category":"page"},{"location":"interactive-api/#Controlling-the-mesh-generation","page":"API","title":"Controlling the mesh generation","text":"","category":"section"},{"location":"interactive-api/#Editing-the-RunParameters","page":"API","title":"Editing the RunParameters","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The run parameters can be enquired and set with these getter/setter pairs:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setPolynomialOrder!(proj::Project, p::Int)\n [Return:Int] getPolynomialOrder(proj::Project)\n [Return:nothing] setMeshFileFormat!(proj::Project, meshFileFormat::String)\n [Return:String] getMeshFileFormat(proj::Project)\n [Return:nothing] setPlotFileFormat!(proj::Project, plotFileFormat::String)\n [Return:String] getPlotFileFormat(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The available mesh file formats are \"ISM\", \"ISM-V2\", or \"ABAQUS\". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot file (which can be viewed with something like VisIt or ParaView) format is either \"skeleton\" or \"sem\". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.","category":"page"},{"location":"interactive-api/#Changing-the-output-file-names","page":"API","title":"Changing the output file names","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setName!(proj::Project,name::String)\n [Return:String] getName(proj::Project)\n [Return:nothing] setFolder!(proj::Project,folder::String)\n [Return:String] getFolder(proj::Project)","category":"page"},{"location":"interactive-api/#Smoothing-operations","page":"API","title":"Smoothing operations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available in the documentation.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To change the defaults, the smoother parameters can be set/enquired with the functions","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setSmoothingStatus!(proj::Project, status::String)\n [Return:String] getSmoothingStatus(proj::Project)\n [Return:nothing] setSmoothingType!(proj::Project, type::String)\n [Return:String] getSmoothingType(proj::Project)\n [Return:nothing] setSmoothingIterations!(proj::Project, iterations::Int)\n [Return:Int] getSmoothingIterations(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The smooth status is either \"ON\" or \"OFF\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To remove the smoother altogether, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] removeSpringSmoother!(proj::Project)","category":"page"},{"location":"interactive-api/#Adding-the-background-grid","page":"API","title":"Adding the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must be specified after a new project has been created.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addBackgroundGrid!(proj::Project,\n x0::Array{Float64},\n dx::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n box::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n bgSize::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.","category":"page"},{"location":"interactive-api/#Changing-the-background-grid","page":"API","title":"Changing the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The size of an existing background grid in a Project can be adjusted with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setBackgroundGridSize!(proj::Project,\n dx::Float64,\n dy::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If a plot is present it will be updated automatically.","category":"page"},{"location":"interactive-api/#Manual-refinement-regions","page":"API","title":"Manual refinement regions","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To create a RefinementCenter,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementCenter(name::String,\n type::String,\n x0::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where name labels the refinement region, the type is either \"smooth\" or \"sharp\", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Similarly, one can create a RefinementLine,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementLine(name::String,\n type::String,\n x0::Array{Float64}, x1::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where x0 is the start position and x1 is the end of the line. The name, type, h, and w parameters are the same as for a RefinementCenter.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To add a refinement region to the project,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addRefinementRegion!(proj::Project, r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To get a reference to a refinement region with a given name, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] getRefinementRegion(proj::Project, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to get a list of all the refinement regions,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Array{Dict{String,Any}}] array = allRefinementRegions(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"A refinement region can be edited by using the following:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementType!(r::Dict{String,Any}, type::String)\n [Return:String] getRefinementType(r::Dict{String,Any})\n [Return:nothing] setRefinementLocation!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementLocation(r::Dict{String,Any})\n [Return:nothing] setRefinementGridSize!(r::Dict{String,Any}, h::Float64)\n [Return:Float64] getRefinementGridSize(r::Dict{String,Any})\n [Return:nothing] setRefinementWidth!(r::Dict{String,Any}, w::Float64)\n [Return:Float64] getRefinementWidth(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where r is a dictionary returned by newRefinementCenter!, newRefinementLine!, or getRefinementRegion.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To further edit a RefinementLine, use the methods","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementStart!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementStart(r::Dict{String,Any})\n [Return:nothing] setRefinementEnd!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementEnd(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Boundary-curves","page":"API","title":"Boundary curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a \"chain\" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.","category":"page"},{"location":"interactive-api/#Defining-curves","page":"API","title":"Defining curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Four curve types can be added to the outer and inner boundary curve chains. They are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"interactive-api/#Parametric-equations","page":"API","title":"Parametric equations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Creating a new curve equation","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\")","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Returns a new set of parametric equation. Equations must be of the form","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" () = ...","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" xEqn = \"x(t) = 4*cos(2*pi*t) - 0.6*cos(8*pi*t)^3\"\n yEqn = \"y(t) = 4*sin(2*pi*t) - 0.5*sin(11*pi*t)^2\"\n zEqn = \"z(t) = 0.0\"\n blob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The z-Equation is optional, but for now must define zero for z by default.","category":"page"},{"location":"interactive-api/#Cubic-spline-curve","page":"API","title":"Cubic spline curve","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A cubic spline is defined by an array of knots, t_j, x_j, y_j, z_j. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the t, x, y, z values, e.g.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" 9\n 0.000000000000000 -3.50000000000000 3.50000000000000 0.0\n 3.846153846153846E-002 -3.20000000000000 5.00000000000 0.0\n 7.692307692307693E-002 -2.00000000000000 6.00000000000 0.0\n 0.769230769230769 0.000000000000000 -1.00000000000000 0.0\n 0.807692307692308 -1.00000000000000 -1.00000000000000 0.0\n 0.846153846153846 -2.00000000000000 -0.800000000000000 0.0\n 0.884615384615385 -2.50000000000000 0.000000000000000 0.0\n 0.923076923076923 -3.00000000000000 1.00000000000000 0.0\n 1.00000000000000 -3.50000000000000 3.50000000000000 0.0","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"or by constructing the required nKnots x 4 array and supplying it to the new procedure. The respective constructors for a spline curve are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newSplineCurve(name::String,\n dataFile::String)\n [Return:Dict{String,Any}] newSplineCurve(name::String,\n nKnots::Int,\n data::Matrix{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the spline curve is to be closed. The last data point must be the same as the first.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n ex_spline = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"interactive-api/#Line-defined-by-end-points","page":"API","title":"Line defined by end points","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A straight line is constructed with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newEndPointsLineCurve(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The xStart and xEnd are arrays of the form [x, y, z]. The z component should be zero and for now is ignored.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" line1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])","category":"page"},{"location":"interactive-api/#Circular-arc","page":"API","title":"Circular arc","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newCircularArcCurve(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either \"degrees\" or \"radians\". That argument is optional, and defaults to \"degrees\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" halfCircle = newCircularArcCurve(\"Dome\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")","category":"page"},{"location":"interactive-api/#Adding-and-removing-outer-and-inner-boundaries","page":"API","title":"Adding and removing outer and inner boundaries","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Adding an outer boundary curve\nUsing the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using\n[Return:nothing] addCurveToOuterBoundary!(proj::Project,\n crv::Dict{String,Any})\ncrv is the dictionary that represents the curve.\nExample:\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\nAdding an inner boundary curve\nThe syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.\n[Return:nothing] addCurveToInnerBoundary!(proj::Project,\n crv::Dict{String,Any},\n chainName::String)\nExample:\nline1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\naddCurveToInnerBoundary!(p, line1, \"interior_curve\")\nTo edit curves they can be accessed by the name:\n[Return:Dict{String,Any}] getInnerBoundaryCurve(proj::Project,\n curveName::String,\n chainName::String)\n[Return:Dict{String,Any}] getOuterBoundaryCurveWithName(proj::Project,\n name::String)\nDeleting boundary curves\nThe entire outer boundary or an entire inner boundary can be removed from the project.\n[Return:nothing] removeOuterBoundary!(proj::Project)\n[Return:nothing] removeInnerBoundary!(proj::Project, chainName::String)\nAlternatively, individual pieces of the boundary curve chains can be removed.\n[Return:nothing] removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n[Return:nothing] removeInnerBoundaryCurve!(proj::Project,\n name::String,\n chainName::String)\nAs in HOHQMesh the project can have only one outer boundary chain, so the removal does not require a specific chainName.","category":"page"},{"location":"interactive-api/#Editing-curves","page":"API","title":"Editing curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"You can determine the type of a curve by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getCurveType(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"For any of the curves, their name can be changed by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setCurveName!(crv::Dict{String,Any}, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"and checked by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" getCurveName(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Otherwise there are special functions to change the parameters of curves","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setXEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setYEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setZEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcUnits!(arc::Dict{String,Any}, units::String)\n [Return:nothing] setArcCenter!(arc::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n [Return:String] getXEqn(crv::Dict{String,Any})\n [Return:String] getYEqn(crv::Dict{String,Any})\n [Return:String] getZEqn(crv::Dict{String,Any})\n [Return:Array{Float64}] getStartPoint(crv::Dict{String,Any})\n [Return:Array{Float64}] getEndPoint(crv::Dict{String,Any})\n [Return:String] getArcUnits(arc::Dict{String,Any})\n [Return:Array{Float64}] getArcCenter(arc::Dict{String,Any})\n [Return:Float64] getArcStartAngle(arc::Dict{String,Any})\n [Return:Float64] getArcEndAngle(arc::Dict{String,Any})\n [Return:Float64] getArcRadius(arc::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Undo/redo","page":"API","title":"Undo/redo","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The interactive mesh functionality has unlimited undo/redo for most actions.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"In interactive mode, actions can be undone by the commands","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undo()\n [Return:String] redo()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where the return string contains the name of the action performed.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To find out what the next actions are, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undoActionName()\n [Return:String] redoActionName()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to clear the undo stack, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] clearUndoRedo()","category":"page"},{"location":"tutorials/curved_outer_boundary/#Curved-outer-boundary","page":"Curved outer boundary","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Synopsis","page":"Curved outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initialization","page":"Curved outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We create a new project with the name \"TheBlob\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"blob_project = newProject(\"TheBlob\", \"out\")","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-the-outer-boundary","page":"Curved outer boundary","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary curve for the domain of interest in this tutorial is given by the parametric equations","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":" beginaligned\n x(t) = 4cos(2 pi t) - frac35cos^3(8 pi t)02cm\n y(t) = 4sin(2 pi t) - frac12sin^2(11 pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"xEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The name of this curve is assigned to be \"Blob\". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addCurveToOuterBoundary!(blob_project, blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-a-background-grid","page":"Curved outer boundary","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for blob_project to have elements with side length two in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"plotProject!(blob_project, MODEL+GRID)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"Blob\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: coarse_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From the visualization we see that the background grid is likely too coarse to produce a \"good\" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"setBackgroundGridSize!(blob_project, 0.5, 0.5)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: fine_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initial-mesh-and-user-adjustments","page":"Curved outer boundary","title":"Initial mesh and user adjustments","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"TheBlob.control: A HOHQMesh control file for the current project.\nTheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nTheBlob.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 8.4328000000000000E-002\n Number of nodes = 479\n Number of Edges = 895\n Number of Elements = 417\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025286 0.36208840 0.11936333 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002882 2.58443761 1.26335838 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.12867591 1.18585825 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006176 4.77438730 1.51314025 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011275 0.28170345 0.10292806 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.38249259 89.99827733 73.08294187 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132795 156.98701187 109.36585212 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: initial_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point (-4 0) is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"center = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Above we create a circular refinement region centered at the point (-4 -05) with a desired resolution size 04 and a radius of 10. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: refinement_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Final-mesh","page":"Curved outer boundary","title":"Final mesh","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 9.2778999999999986E-002\n Number of nodes = 503\n Number of Edges = 940\n Number of Elements = 438\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025286 0.36208840 0.11412688 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002883 2.47056840 1.26416662 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.12867592 1.18429212 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006176 4.77438730 1.51407242 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011275 0.28170345 0.09814903 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.38249259 89.99827897 72.80049710 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132784 156.98701188 109.63478104 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: final_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Summary","page":"Curved outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"# Interactive mesh with a curved outer boundary\n#\n# Create an outer boundary from a set of parametric equations.\n# Add manual refinement in a small region around the point (-4, -0.5).\n#\n# Keywords: outer boundary, parametric equations, refinement center\nusing HOHQMesh\n\n# Instantiate the project\nblob_project = newProject(\"TheBlob\", \"out\")\n\n# Create and add the outer boundary curve\nxEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)\naddCurveToOuterBoundary!(blob_project, blob)\n\n# Add the background grid\naddBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])\n\n# Create and add the refinement region\ncenter = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)\n\n# Generate the mesh\ngenerate_mesh(blob_project)","category":"page"},{"location":"tutorials/create_edit_curves/#Creating-and-editing-curves","page":"Creating and editing curves","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a \"chain\" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/create_edit_curves/#Synopsis","page":"Creating and editing curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/#Initialization","page":"Creating and editing curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a new project with the name \"sandbox\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox_project = newProject(\"sandbox\", \"out\")","category":"page"},{"location":"tutorials/create_edit_curves/#Add-the-outer-boundary-chain","page":"Creating and editing curves","title":"Add the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We first create the outer boundary curve chain that is composed of three pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (0 -7) to (5 3).\nHalf-circle arc of radius r=5 centered at (0 3).\nStraight line segment from (-5 3) to (0 -7).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [0.0, -7.0, 0.0], # start point\n [5.0, 3.0, 0.0]) # end point\n\nouter_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-5.0, 3.0, 0.0], # start point\n [0.0, -7.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from 0 to 180 degrees.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_arc = newCircularArcCurve(\"Arc\", # curve name\n [0.0, 3.0, 0.0], # center\n 5.0, # radius\n 0.0, # start angle\n 180.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", and \"Arc\" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-a-background-grid","page":"Creating and editing curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We visualize the outer boundary curve chain and background grid with the following","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"plotProject!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains three curve segments \"Line1\", \"Arc\", and \"Line2\" labeled in the figure by O.1, O.2, and O.3, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-the-outer-boundary-chain","page":"Creating and editing curves","title":"Edit the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the domain boundary requires a curved segment instead of the straight line \"Line2\". We will replace this line segment in the outer boundary chain with a cubic spline.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"First, we remove the \"Line2\" curve from the \"Outer\" chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Outer curve removal\nAlternatively, we can remove the curve \"Line2\" using its index in the \"Outer\" boundary chain.removeOuterBoundaryCurveAtIndex!(sandbox_project, 3)This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The plot automatically updates and we see that the outer boundary is open and contains two segments: \"Line1\" and \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve \"Arc\" and end at the first point of the curve \"Line1\". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. The spline curve constructor newSplineCurve also takes the number of points as an input argument.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"spline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we add the spline curve outer_spline into the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates automatically to display the \"Outer\" boundary chain with the new \"Spline\" curve labeled O.3.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-an-inner-boundary-chain","page":"Creating and editing curves","title":"Add an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a pill shaped inner boundary curve chain composed of four pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (1 5) to (1 3).\nHalf-circle arc of radius r=1 centered at (0 3).\nStraight line segment from (-1 3) to (-1 5).\nHalf-circle arc of radius r=1 centered at (0 5).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Similar to the construction of the \"Outer\" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [1.0, 5.0, 0.0], # start point\n [1.0, 3.0, 0.0]) # end point\n\ninner_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-1.0, 3.0, 0.0], # start point\n [-1.0, 5.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at (0 3) varies from 0 to -180 degrees. The top half-circle arc centered at (0 5) has an angle that varies from 180 to 0 degrees. The construction of the two circle arcs are","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_bottom_arc = newCircularArcCurve(\"BottomArc\", # curve name\n [0.0, 3.0, 0.0], # center\n 1.0, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\n\ninner_top_arc = newCircularArcCurve(\"TopArc\", # curve name\n [0.0, 5.0, 0.0], # center\n 1.0, # radius\n 180.0, # start angle\n 0.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Note, we use \"radians\" to set the angle bounds for inner_bottom_arc and \"degrees\" for the angle bounds of inner_top_arc.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", \"BottomArc\", and \"TopArc\" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This inner boundary chain name \"inner\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments \"Line1\", \"BottomArc\", \"Line2\", and \"TopArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_pill)","category":"page"},{"location":"tutorials/create_edit_curves/#Generate-the-mesh","page":"Creating and editing curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox.control: A HOHQMesh control file for the current project.\nsandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nsandbox.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 7.5414000000000009E-002\n Number of nodes = 511\n Number of Edges = 933\n Number of Elements = 422\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00002932 1.17335568 0.18813138 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00953438 2.30790024 1.31439620 1.00000000 999.99900000 1.00000000\n Condition 1.00041663 2.41773865 1.21024584 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.01673809 3.68828437 1.59413340 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001750 1.13820387 0.14143901 0.00000000 999.99900000 1.00000000\n Minimum Angle 32.22733574 89.35690571 68.75321248 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.61089476 152.37947944 113.36221513 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: initial_mesh)","category":"page"},{"location":"tutorials/create_edit_curves/#Delete-the-existing-mesh","page":"Creating and editing curves","title":"Delete the existing mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"remove_mesh!(sandbox_project)\nupdatePlot!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Additionally, the remove_mesh! command deletes the mesh information from the sandbox_project and sandbox.mesh from the out folder. However, the sandbox.control and sandbox.tec files are still present in out directory.","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-an-inner-boundary-chain","page":"Creating and editing curves","title":"Edit an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the inner boundary actually requires a curved segment instead of the straight line \"Line1\". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We remove the \"Line1\" curve from the inner chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Inner curve removal\nAlternatively, we can remove the curve \"Line1\" using its index in the inner boundary chain.removeInnerBoundaryCurveAtIndex!(sandbox_project, 1, \"inner\")This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: \"BottomArc\", \"Line2\", and \"TopArc\". Note that the index of the remaining curves has changed as shown below.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Brief note about undo / redo\nThe interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.undoActionName()\n\"Remove Inner Boundary Curve\"We can undo the removal of the \"Line1\" curve with undoundo()\n\"Undo Remove Inner Boundary Curve\"In addition to reinstating \"Line1\" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The new inner curve segment will be an oscillating line given by the parametric equations","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":" beginaligned\n x(t) = t + 102cm\n y(t) = -2t + 5 - frac32 cos(pi t) sin(pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"xEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The name of this new curve is assigned to be \"wiggleLine\". We add this new curve to the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The automatically updated figure now shows:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_open_chain)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We see from the figure that this parametric equation curve starts at the point (15) and, therefore, matches the end point of the existing curve \"TopArc\" present in the \"inner\" chain. However, the parametric equation curve ends at the point (23) which does not match the \"BottomArc\" curve. So, the inner boundary chain remains open.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"warning: Attempt to generate a mesh with an open curve chain\nAn open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create a closed boundary curve we must remove the \"BottomArc\" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point (2 3) and end at the point (-1 3) to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the \"BottomArc\" from the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates to display the \"inner\" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_remove_arc)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"A half-circle arc that joins the points (2 3) and (-1 3) has a radius r=15, is centered at (05 3) and has an angle that vaires from 0 to -180. We construct this circle arc and directly add it to the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"new_bottom_arc = newCircularArcCurve(\"wideBottomArc\", # curve name\n [0.5, 3.0, 0.0], # center\n 1.5, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The updated plot now gives the modified, closed inner curve chain that now contains four curve segments \"Line2\", \"TopArc\", \"wiggleLine\", and \"wideBottomArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/#Regenerate-the-mesh","page":"Creating and editing curves","title":"Regenerate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.11353599999999998\n Number of nodes = 712\n Number of Edges = 1308\n Number of Elements = 596\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00002932 1.15661960 0.12823902 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.01050856 3.14732001 1.34260027 1.00000000 999.99900000 1.00000000\n Condition 1.00037771 2.59434067 1.22850175 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.02744717 3.68828437 1.64751502 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001750 1.13149451 0.09443920 0.00000000 999.99900000 1.00000000\n Minimum Angle 31.87236189 89.33988565 67.86178629 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.44177106 157.27121105 114.35699650 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: zoom_corner)","category":"page"},{"location":"tutorials/create_edit_curves/#Summary","page":"Creating and editing curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"# Interactive mesh with modified outer and inner curve chains\n#\n# Create inner / outer boundary chains composed of the four\n# available HOHQMesh curve types.\n#\n# Keywords: outer boundary, inner boundary, parametric equations,\n# circle arcs, cubic spline, curve removal\nusing HOHQMesh\n\n# Instantiate the project\nsandbox_project = newProject(\"sandbox\", \"out\")\n\n# Add the background grid\naddBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])\n\n# Create and add the original outer boundary curves\nouter_line1 = newEndPointsLineCurve(\"Line1\", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])\nouter_line2 = newEndPointsLineCurve(\"Line2\", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])\nouter_arc = newCircularArcCurve(\"Arc\", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, \"degrees\")\n\naddCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)\n\n# Modify the outer boundary to have a spline instead of a straight line\nremoveOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")\n\nspline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)\naddCurveToOuterBoundary!(sandbox_project, outer_spline)\n\n# Create and add the inner boundary curves\ninner_line1 = newEndPointsLineCurve(\"Line1\", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])\ninner_line2 = newEndPointsLineCurve(\"Line2\", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])\ninner_bottom_arc = newCircularArcCurve(\"BottomArc\", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, \"radians\")\ninner_top_arc = newCircularArcCurve(\"TopArc\", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, \"degrees\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")\n\n# Generate a mesh\ngenerate_mesh(sandbox_project)\n\n# Delete the existing mesh before modifying the inner boundary curve chain\nremove_mesh!(sandbox_project)\n\n# Modify the inner boundary curve with an oscillatory line and a new circle arc\nremoveInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")\nremoveInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")\n\nxEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)\n\nnew_bottom_arc = newCircularArcCurve(\"wideBottomArc\", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, \"radians\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")\n\n# Regenerate the final mesh\ngenerate_mesh(sandbox_project)","category":"page"},{"location":"interactive_overview/#InteractiveTool","page":"Overview","title":"Overview","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Several scripts are available in the examples/ folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.","category":"page"},{"location":"interactive_overview/#Workflow-and-basic-moves","page":"Overview","title":"Workflow and basic moves","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"To generate a mesh interactively you","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Create a project with a user given projectName and folder where any generated files are to be saved\np = newProject(, )\nBoth of these input arguments are strings.\nCreate inner and outer boundary curves from the available types\nc = newEndPointsLineCurve(, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*\nc = newCircularArcCurve(, center [x, y, z], radius, startAngle, endAngle, units = \"degrees\" or \"radians\") *Circular Arc*\nc = newParametricEquationCurve(, xEqn, yEqn, zEqn) *Parametric equation*\nc = newSplineCurve(, dataFile) *Spline with data from a file*\nc = newSpline(, nKnots, knotsMatrix) *Spline with given knot values*\nSee Defining curves for further details on the different curve type currently supported by HOHQMesh.\nThe generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.\nAdd curves to build the model to see what you have added,\naddOuterBoundaryCurve!(p, ) *Add outer boundary curve*\naddInnerBoundaryCurve!(p, , ) *Add curve to an inner boundary*\nFor a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.\nCurves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.\nVisualize the project's model, if desired\nplotProject!(p, MODEL)\nPlots are updated in response to user interactions. However, to update the plot at any time, use\nupdatePlot!(p, options)\nOptions are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.\nnote: Visualization requirement\nThe interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.\nSet the background grid\nWhen no outer boundary curve is present, the background grid can be set with\naddBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])\nOr\naddBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])\nThe first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.\nWhen an outer boundary is present the background grid can be set as\naddBackgroundGrid!(p, [dx, dy, dz])\nwhere the spacing controls the number of elements in each direction.\nnote: Background grid\nA background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.\nAdjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by\nsetPolynomialOrder!(p, order)\nThe background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately\nsetBackgroundGridSize!(p, 0.5, 0.25)\nSee Controlling the mesh generation for details on adjusting parameters already present in the Project.\nGenerate the mesh\ngenerate_mesh(p)\nThe mesh file will be saved in with the name .mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name .control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.","category":"page"},{"location":"interactive_overview/#Advanced","page":"Overview","title":"Advanced","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.","category":"page"},{"location":"testing/#Testing","page":"Testing","title":"Testing","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In HOHQMesh and its related repositories, tests are triggered by","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"each git push to main and\neach git push to any pull request.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test and coverage requirements\nBefore merging a pull request (PR) to main, we require thatthe code passes all functional tests\ncode coverage does not decrease.","category":"page"},{"location":"testing/#Testing-setup","page":"Testing","title":"Testing setup","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> using Pkg; Pkg.test(\"HOHQMesh\")","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> # Run all test for the interactive Curve API\n include(joinpath(\"test\", \"test_curve.jl\"))","category":"page"},{"location":"testing/#Adding-new-tests","page":"Testing","title":"Adding new tests","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test duration\nAs a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).","category":"page"},{"location":"testing/#Test-coverage","page":"Testing","title":"Test coverage","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered \"covered\" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The \"Details\" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Coverage requirements\nIn general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.","category":"page"},{"location":"authors/#Authors","page":"Authors","title":"Authors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.","category":"page"},{"location":"authors/#Principal-Developers","page":"Authors","title":"Principal Developers","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"David A. Kopriva, Florida State University, USA\nAndrew Winters, Linköping University, Sweden","category":"page"},{"location":"authors/#Contributors","page":"Authors","title":"Contributors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"The following people contributed major additions or modifications to HOHQMesh and are listed in alphabetical order:","category":"page"},{"location":"authors/","page":"Authors","title":"Authors","text":"David Kopriva\nHendrik Ranocha\nMichael Schlottke-Lakemper\nAndrew Winters","category":"page"},{"location":"reference/#HOHQMesh.jl-API","page":"Reference","title":"HOHQMesh.jl API","text":"","category":"section"},{"location":"reference/","page":"Reference","title":"Reference","text":"CurrentModule = HOHQMesh","category":"page"},{"location":"reference/","page":"Reference","title":"Reference","text":"Modules = [HOHQMesh]","category":"page"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary named boundaryName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, obj::Dict{String,Any})\n\nAdd a curve to the outer boundary or a refinement reion to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}, Array{Float64}, Array{Int64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})\n\nAdd the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version\n\naddBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nis a lot easier to use.\n\nTODO: Change HOHQMesh and delete this way to specify the domain and use the bounding box one instead.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}, Array{Int64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nAdd the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid(proj::Project, bgSize::Array{Float64})\n\nAdd the background grid block with the grid size to be a 3-vector. Use this when there is an outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, dict::Dict{String,Any})\n\nUsed only for undo/redo.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToInnerBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.addCurveToInnerBoundary!","text":"addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary with name boundaryName. If an inner boundary of that name does not exist, one is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addCurveToOuterBoundary!","text":"addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})\n\nAdd a curve to the outer boundary. The curves must be added in order counter-clockwise\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addInnerBoundaryWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.addInnerBoundaryWithName!","text":"addInnerBoundaryWithName!(proj::Project,name::String)\n\nCreate a new empty inner boundary with the given name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addObserver-Tuple{Any, String, Any}","page":"Reference","title":"HOHQMesh.addObserver","text":"addObserver(observer::Any, note::String, f::Any)\n\nf is the function to be executed (called) when a notification of name note is given.\n\nThe function called upon notification must have the signature f(observer, sender, args...)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addOuterBoundary!","text":"addOuterBoundary!(proj::Project, outerBoundary::Dict{String,Any})\n\nAdd an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegion!","text":"addRefinementRegion!(proj::Project,r::Dict{String,Any})\n\nAdd the refinement region to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegionPoints!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegionPoints!","text":"addRefinementRegionPoints!(proj::Project, r::Dict{String,Any})\n\nCompute and add to the project the plotting points for the refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRunParameters!","page":"Reference","title":"HOHQMesh.addRunParameters!","text":"addRunParameters!(proj::Project,\n plotFormat::String = \"skeleton\",\n meshFileFormat::String = \"ISM-V2\",\n polynomialOrder::Int = 5)\n\nAdd a RUN_PARAMETERS block and set all the parameters in one call.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.addSpringSmoother!","page":"Reference","title":"HOHQMesh.addSpringSmoother!","text":"addSpringSmoother!(status::String, type::String, nIterations::Int)\n\nStatus is either ON or OFF Type is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.bboxUnion-Tuple{Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.bboxUnion","text":"bboxUnion(box1::Array{Float64}, box2::Array{Float64})\n\nReturns the union of two bounding boxes\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.curveBounds-Tuple{Matrix{Float64}}","page":"Reference","title":"HOHQMesh.curveBounds","text":"curveBounds(crvPoints::Array{Float64,2})\n\nFind the bounds of a single curve, discretized as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.emptyBounds-Tuple{}","page":"Reference","title":"HOHQMesh.emptyBounds","text":"emptyBounds()\n\nReturns an array that will always be ignored when unioned with another bounding box.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.examples_dir-Tuple{}","page":"Reference","title":"HOHQMesh.examples_dir","text":"examples_dir()\n\nReturn the path to the directory with some example mesh setups.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.extract_mesh_file_format-Tuple{Any}","page":"Reference","title":"HOHQMesh.extract_mesh_file_format","text":"extract_mesh_file_format(control_file)\n\nReturn a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{Any}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(control_file;\n output_directory=\"out\",\n mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing,\n verbose=false)\n\nGenerate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.\n\nYou can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.\n\nYou can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(proj::Project)\n\nGenerate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.\n\nThis function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getAllRefinementRegions-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getAllRefinementRegions","text":"getAllRefinementRegions(proj::Project)\n\nGet the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcCenter","text":"getArcCenter(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the center of a circular arc as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcEndAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcEndAngle","text":"getArcEndAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcRadius-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcRadius","text":"getArcRadius(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcStartAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcStartAngle","text":"getArcStartAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcUnits-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcUnits","text":"getArcUnits(crv::Dict{String,Any}, units::String)\n\nGet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridLowerLeft-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridLowerLeft","text":"getBackgroundGridLowerLeft(proj::Project)\n\nReturns the [x,y] of the lower left point of the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSize-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSize","text":"getBackgroundGridSize(proj::Project)\n\nReturns the background grid size array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSteps-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSteps","text":"getBackgroundGridSteps(proj::Project)\n\nReturns the [Nx,Ny,Nz] for the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String, boundaryName::String)\n\nGet the curve named curveName from the inner boundary named boundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String)\n\nGet the curve with name curveName from the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveName","text":"getCurveName(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveType","text":"getCurveType(crv::Dic{String,Any})\n\nGet the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,\n`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getEndPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getEndPoint","text":"getEndPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the end point for a line curve as an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundary-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundary","text":"getInnerBoundary(proj::Project, name::String)\n\nGet the chain of curves from the inner boundary with name name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryChainWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryChainWithName","text":"getInnerBoundaryWithName(proj::Project, name::String)\n\nGet the inner boundary CHAIN with the given name. If one does not exist, it is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryCurve","text":"\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getMeshFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getMeshFileFormat","text":"getMeshFileFormat(proj::Project)\n\nReturns the format in which the mesh will be written.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getName-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getName","text":"getName(proj::Project)\n\nReturns the filename to be used by the mesh, plot, control, and stats files.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryChainList-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getOuterBoundaryChainList","text":"getOuterBoundaryChainList(proj::Project)\n\nGet the array of outer boundary curves.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryCurveWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getOuterBoundaryCurveWithName","text":"getOuterBoundaryCurveWithName(proj::Project, name::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPlotFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPlotFileFormat","text":"getPlotFileFormat(proj::Project)\n\nReturns the plot file format.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPolynomialOrder-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPolynomialOrder","text":"getPolynomialOrder(proj::Project)\n\nReturns the polynomial order for boundary curves in the mesh file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementEnd-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementEnd","text":"getRefinementEnd(r::Dict{String,Any})\n\nReturn Array{Float64} of the end location of the refinement line\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementGridSize-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementGridSize","text":"getRefinementGridSize(r::Dict{String,Any})\n\nReturns the grid size,h, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementLocation-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementLocation","text":"getRefinementLocation(r::Dict{String,Any})\n\nReturn Array{Float64} of the location of the refinement center.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementName","text":"getRefinementName(r::Dict{String,Any})\n\nReturn name of the refinement. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"getRefinementRegion(proj::Project, indx)\n\nGet the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"(i,r) = getRefinementRegion(project, name)\n\nGet the refinement region with the given name and its location in the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegionCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementRegionCenter","text":"getRefinementRegionCenter(r::Dict{String,Any})\n\nGet, or compute, the center of the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementStart-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementStart","text":"getRefinementStart (r::Dict{String,Any})\n\nReturn Array{Float64} of the start location of the refinement line. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementType","text":"getRefinementType(r::Dict{String,Any})\n\nReturn the type of refinement, either \"smooth\" or \"sharp\". r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementWidth-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementWidth","text":"getRefinementWidth(r::Dict{String,Any})\n\nReturns the region width,w, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingIterations-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingIterations","text":"getSmoothingIterations(proj::Project)\n\nGet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingStatus-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingStatus","text":"smoothingStatus(proj::Project)\n\nReturns whether the smoother will be \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingType-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingType","text":"getSmoothingType(proj::Project)\n\nReturns either \"LinearSpring\" or \"LinearAndCrossbarSpring\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplineNKnots-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplineNKnots","text":"getSplineNKnots(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplinePoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplinePoints","text":"getSplinePoints(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getStartPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getStartPoint","text":"getStartPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the start point for a line curve as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getXEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getXEqn","text":"getXEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getYEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getYEqn","text":"getYEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getZEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getZEqn","text":"getZEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.hasBackgroundGrid-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.hasBackgroundGrid","text":"hasBackgroundGrid(proj::Project)\n\nTests to see if the project has a backgroundGrid dictionary defined.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.innerBoundaryIndices-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.innerBoundaryIndices","text":"innerBoundaryIndices(proj::Project, curveName::String)\n\nReturns (curveIndex,chainIndex) for the location of the curve named curveName in it's inner boundary chain.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryAtIndex!-Tuple{HOHQMesh.Project, String, Int64, Dict{String, Any}, Vector{Any}, Vector{String}}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryAtIndex!","text":"insertInnerBoundaryAtIndex!(proj::Project, chainName::String, indx::Int, chain::??)\n\nInsert an entire inner boundary. Primarily meant for undo operation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64, String}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryCurveAtIndex!","text":"insertInnerBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any},\n indx::Int, boundaryName::String)\n\nInsert a curve crv into an inner boundary chain boundaryName at the specified index indx.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertOuterBoundaryCurveAtIndex!","text":"insertOuterBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any}, indx::Int)\n\nInsert a curve into the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertRefinementRegion!","text":"insertRefinementRegion!(proj::Project, r::Dict{String,Any}, indx::Int)\n\nUsed by undo()\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelChainIsOK-Tuple{Vector{Dict{String, Any}}, String}","page":"Reference","title":"HOHQMesh.modelChainIsOK","text":"modelChainIsOK(chain::Vector{Dict{String, Any}}, chainName::String)\n\nReturns true if the chain of curves is contiguous and closed; false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelCurvesAreOK-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.modelCurvesAreOK","text":"modelCurvesAreOK(proj::Project)\n\nGo through all curves in the model and make sure they are connected and closed. Also, remove any empty outer / inner boundary chains.\n\nReturns true if all curves are connected and closed, false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreate a new parametric equation curve.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-2","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)\n\nCreate a new circular arc.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-Tuple{String, Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})\n\nCreate a new line defined by its end points.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, nKnots::Int, data::Matrix{Float64})\n\nCreate a spline curve from an array of knots\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, String}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, dataFile::String)\n\nCreate a spline curve from the contents of a data file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newCircularArcCurve","page":"Reference","title":"HOHQMesh.newCircularArcCurve","text":"newCircularArcCurve(name::String, center::Array{Float64},\n startAngle::Float64, endAngle::Float64,\n units::String)\n\nCreates and returns a new circular arc curve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newEndPointsLineCurve-Tuple{String, Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.newEndPointsLineCurve","text":"newEndPointsLineCurve(name::String, xStart::Array{Float64},xEnd::Array[Float64])\n\nCreates and returns a new curve defined by its end points in the form of a Dictionary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newParametricEquationCurve","page":"Reference","title":"HOHQMesh.newParametricEquationCurve","text":"newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreates and returns a new parametricEquationCurve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newProject","text":"newProject(name::String, folder::String)\n\nCreate a new project with the given name. That name will be used for the mesh and plot files in the specified folder.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementCenter-Tuple{String, String, Array{Float64}, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementCenter","text":"newRefinementCenter(name, type,\n center, meshSize,\n width)\n\nCreate refinement center of type \"smooth\" or \"sharp\" centered at center = [x,y,z] with a mesh size meshSize spread over a radius width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementLine-Tuple{String, String, Array{Float64}, Array{Float64}, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementLine","text":"newRefinementLine(name, type,\n start, end,\n meshSize,\n width)\n\nCreate refinement line of type \"smooth\" or \"sharp\" between start = [x,y,z] and end = [x,y,z] with a mesh size meshSize spread over a width width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, nKnots::Int, data::Array{Float64,4})\n\nReturns a spline curve given the number of knots and the array of knots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, dataFile::String)\n\nReturns a spline curve given a data file that contains the number of knots on the first line, and the spline data following that.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.openProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.openProject","text":"openProject(fileName::String, folder::String)\n\nOpen existing project described in the control File.\n\nfolder = folder the control file is in\nfileName = the name of the file\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.postNotificationWithName-Tuple{Any, String, Tuple}","page":"Reference","title":"HOHQMesh.postNotificationWithName","text":"postNotificationWithName(sender::Any, name::String, userInfo::Tuple)\n\nExecutes the function associated with the observer for the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.refinementRegionPoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.refinementRegionPoints","text":"refinementRegionPoints(r::Dict{String,Any})\n\nReturns Array{Float64,2} being the plotting points of a refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String, innerBoundaryName::String)\n\nDelete the curve named curveName from the inner boundary named innerBoundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String)\n\nDelete the curve named curveName from the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeBackgroundGrid!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeBackgroundGrid!","text":"removeBackgroundGrid!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundary!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundary!","text":"removeInnerBoundary!(proj::Project, chainName::String)\n\nRemove an entire inner boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurve!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurve!","text":"removeInnerBoundaryCurve!(proj::Project, name::String, chainName::String)\n\nRemove the curve with name from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurveAtIndex!","text":"removeInnerBoundaryCurveAtIndex!(proj::Project, indx::Int, chainName::String)\n\nRemove the curve at index indx from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundary!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeOuterBoundary!","text":"removeOuterBoundary!(proj::Project)\n\nRemove the outer boundary curve if it exists.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveAtIndex!","text":"removeOuterBoundaryCurveAtIndex!(proj::Project, indx::Int)\n\nRemove a curve from the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveWithName!","text":"removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n\nRemove the named curve in the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRefinementRegion!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeRefinementRegion!","text":"removeRefinementRegion!(proj::Project, name::String)\n\nDelete the named refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRunParameters!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeRunParameters!","text":"removeRunParameters!(proj::Project)\n\nRemove the run parameters block from the project. This is not undo-able.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeSpringSmoother!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeSpringSmoother!","text":"removeSpringSmoother!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove_mesh!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.remove_mesh!","text":"remove_mesh!(proj::Project)\n\nRemove the mesh file from proj.projectDirectory and delete the mesh from the plot\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.saveProject-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.saveProject","text":"saveProject(proj::Project)\n\nproj = Project to be saved\n\nSave a project dictionary to the file path specified when the project was created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcCenter!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setArcCenter!","text":"setArcCenter!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the center of a circular arc.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcEndAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcEndAngle!","text":"setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcRadius!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcRadius!","text":"setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcStartAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcStartAngle!","text":"setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcUnits!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setArcUnits!","text":"setArcUnits(crv::Dict{String,Any}, units::String)\n\nSet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridLowerLeft!-Tuple{HOHQMesh.Project, Array{Float64}}","page":"Reference","title":"HOHQMesh.setBackgroundGridLowerLeft!","text":"setBackgroundGridLowerLeft!(proj::Project, x0::Array{Float64})\n\nSet the lower left location of the background grid for problems that have no outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSpacing!(proj::Project, dx::Float64, dy::Float64, dz::Float64 = 0.0)\n\nUser facing function\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Array{Float64}, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Array{Float64}, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, dx is passed an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Float64, Float64, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Float64, dy::Float64, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, the new grid size in either direction is passed individually with dxand dy.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSteps!-Tuple{HOHQMesh.Project, Array{Int64}}","page":"Reference","title":"HOHQMesh.setBackgroundGridSteps!","text":"setBackgroundGridSteps!(proj::Project, N::Array{Int})\n\nSet how many steps of size setBackgroundGridSpacing in each direction the background grid extends from the lower left.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setCurveName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setCurveName!","text":"setCurveName!(curveDict, name)\n\nSet the name of the curve represented by curveDict.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setEndPoint!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setEndPoint!","text":"setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the end point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setMeshFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setMeshFileFormat!","text":"setMeshFileFormat(proj::Project, meshFileFormat::String)\n\nSet the file format for the mesh file. Acceptable choices are \"ISM\", \"ISM-V2\", or \"ABAQUS\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setName!","text":"setName(proj::Project,name::String)\n\nThe name of the project is the filename to be used by the mesh, plot, and stats files. It is also the name of the control file the tool will produce.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPlotFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setPlotFileFormat!","text":"setPlotFileFormat(proj::Project, plotFileFormat::String)\n\nSet the file format for the plot file. Acceptable choices are \"sem\", which includes interior nodes and boundary nodes and \"skeleton\", which includes only the corner nodes.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPolynomialOrder!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setPolynomialOrder!","text":"setPolynomialOrder(proj::Project, p::Int)\n\nSet the polynomial order for boundary curves in the mesh file to p.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementEnd!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementEnd!","text":"setRefinementEnd!(refinementRegion, location)\n\nSet the end point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementGridSize!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementGridSize!","text":"setRefinementGridSize!(r::Dict{String,Any}, h)\n\nSet the grid size, h for the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementLocation!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementLocation!","text":"setRefinementLocation!(refinementCenter, location)\n\nSet the location of a refinement center to location = [x,y,z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementName!","text":"setRefinementName!(r::Dict{String,Any}, type)\n\nSet a name for the refinement region.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementStart!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementStart!","text":"setRefinementStart!(refinementRegion, location)\n\nSet the start point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementType!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementType!","text":"setRefinementType!(refinementRegion, type)\n\nSet the type, either \"smooth\" or \"sharp\" for the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementWidth!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementWidth!","text":"setRefinementWidth!(r::Dict{String,Any}, width)\n\nSet the width of the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingIterations!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setSmoothingIterations!","text":"setSmoothingIterations!(proj::Project, iterations::Int)\n\nSet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingStatus!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingStatus!","text":"setSmoothingStatus(proj:Project, status::String)\n\nStatus is either \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingType!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingType!","text":"setSmoothingType!(proj:Project, status::String)\n\nType is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplineNKnots!-Tuple{Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.setSplineNKnots!","text":"setSplineNKnots!(spline::Dict{String,Any}, nKnots::Int)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplinePoints!-Tuple{Dict{String, Any}, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.setSplinePoints!","text":"setSplinePoints!(spline::Dict{String,Any},points::Array{Float64,4})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setStartPoint!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setStartPoint!","text":"setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the start point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setXEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setXEqn!","text":"setXEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the x-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setYEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setYEqn!","text":"setYEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the y-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setZEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setZEqn!","text":"setZEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the zEqn-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.unRegisterForNotification-Tuple{Any, String}","page":"Reference","title":"HOHQMesh.unRegisterForNotification","text":"unRegisterForNotification(observer::Any, note::String)\n\nRemove the observer from being notified by the notification note\n\n\n\n\n\n","category":"method"},{"location":"tutorials/spline_curves/#Spline-curves","page":"Spline curves","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line \"curves\". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.","category":"page"},{"location":"tutorials/spline_curves/#Synopsis","page":"Spline curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/spline_curves/#Initialization","page":"Spline curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a new project with the name \"spline_curves\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_project = newProject(\"spline_curves\", \"out\")","category":"page"},{"location":"tutorials/spline_curves/#Add-the-outer-boundary","page":"Spline curves","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The outer boundary curve for this tutorial is a circle of radius r=4 centered at the point (0 -1). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"circ = newCircularArcCurve(\"outerCircle\", # curve name\n [0.0, -1.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circ is assigned to be \"outerCircle\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new circ curve is then added to the spline_project as an outer boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToOuterBoundary!(spline_project, circ)","category":"page"},{"location":"tutorials/spline_curves/#Add-a-background-grid","page":"Spline curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for spline_project to have elements with side length 06 in each direction","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addBackgroundGrid!(spline_project, [0.6, 0.6, 0.0])","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"plotProject!(spline_project, MODEL+GRID)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"outerCircle\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/spline_curves/#Add-the-inner-boundaries","page":"Spline curves","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The domain of this tutorial will contain three inner boundary curves:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Cubic spline curve created from data points read in from a file.\nCubic spline curve created from points directly given in the code.\nTriangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-with-data-from-a-file","page":"Spline curves","title":"Cubic spline with data from a file","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots t_j, x_j, y_j, z_j where j indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a parametric spline curve from a file with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline1 = newSplineCurve(\"big_spline\", joinpath(@__DIR__, \"examples\", \"test_spline_curve_data.txt\"))","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline1 is assigned to be \"big_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline1 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline1, \"inner1\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve \"big_spline\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: one_curve)","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-from-data-in-Julia","page":"Spline curves","title":"Cubic spline from data in Julia","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Below, we construct another parametric spline using this strategy that consists of five data points","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n\nspline2 = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline2 is assigned to be \"small_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline2 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline2, \"inner2\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner2\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve \"small_spline\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: two_curves)","category":"page"},{"location":"tutorials/spline_curves/#Triangular-shape","page":"Spline curves","title":"Triangular shape","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"edge1 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.3, -1.0, 0.0], # start point\n [-1.7, -1.0, 0.0]) # end point\n\nedge2 = newEndPointsLineCurve(\"triangle\", # curve name\n [-1.7, -1.0, 0.0], # start point\n [-2.0, -0.4, 0.0]) # end point\n\nedge3 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.0, -0.4, 0.0], # start point\n [-2.3, -1.0, 0.0]) # end point","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, each edge of the curve is given the same name \"triangle\" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, edge1, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge2, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge3, \"inner3\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The inner boundary chain name \"inner3\" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called \"triangle\" labeled in the figure by 3.1, 3.2, and 3.3.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: three_curves)","category":"page"},{"location":"tutorials/spline_curves/#Generate-the-mesh","page":"Spline curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_curves.control: A HOHQMesh control file for the current project.\nspline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nspline_curves.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"generate_mesh(spline_project)\n 1 chevron elements removed from mesh.\n 1 chevron elements removed from mesh.\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.25359100000000001\n Number of nodes = 1176\n Number of Edges = 2225\n Number of Elements = 1047\n Number of Subdivisions = 4\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00006209 0.15607019 0.04505180 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00008965 2.78091496 1.23178864 1.00000000 999.99900000 1.00000000\n Condition 1.00000055 3.82171291 1.15535543 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00014261 6.78201663 1.46249737 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001491 0.10424647 0.03955817 0.00000000 999.99900000 1.00000000\n Minimum Angle 37.24189766 89.96174556 74.42003031 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.03128071 157.35065162 107.91806148 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of \"bad\" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: final_spline)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the \"big_spline\" curve. We decide that we are satisfied with the overall mesh quality.","category":"page"},{"location":"tutorials/spline_curves/#Summary","page":"Spline curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#Tutorials","page":"Overview","title":"Tutorials for HOHQMesh.jl","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"The tutorial section for HOHQMesh.jl provides step-by-step commands and accompanying explanations for the major features of the interactive mesh generation tools.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.","category":"page"},{"location":"tutorials/introduction/#[Straight-sided-outer-boundary](@ref)","page":"Overview","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.","category":"page"},{"location":"tutorials/introduction/#Synopsis","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/introduction/#[Curved-outer-boundary](@ref)","page":"Overview","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.","category":"page"},{"location":"tutorials/introduction/#Synopsis-2","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/introduction/#[Spline-curves](@ref)","page":"Overview","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/introduction/#Synopsis-3","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#[Creating-and-editing-curves](@ref)","page":"Overview","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve \"chain\" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.","category":"page"},{"location":"tutorials/introduction/#Synopsis-4","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"guided-tour/#Guided-tour","page":"Guided tour","title":"Guided tour","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In this brief overview, we highlight two scripts from the examples/ folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"See the HOHQMesh documentation for more details about its terminology and capabilities.","category":"page"},{"location":"guided-tour/#Mesh-from-a-control-file","page":"Guided tour","title":"Mesh from a control file","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_from_control_file.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"This command will create mesh and plot files in the out directory.","category":"page"},{"location":"guided-tour/#Build-a-mesh-from-scratch","page":"Guided tour","title":"Build a mesh from scratch","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_boundary.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For completeness, we provide the example script and walk-through each step in the construction of the Project below.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"using HOHQMesh\n\n# Create a new project with the name \"IceCreamCone\", which will also be the\n# name of the mesh, plot and stats files, written to output folder `out`.\n\np = newProject(\"IceCreamCone\", \"out\")\n\n# Outer boundary for this example mesh is a complete circle. Add it into the project.\n\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\n\n# Inner boundary is three curves. Two straight lines and a circular arc.\n# Note the three curve are connected to ensure a counter-clockwise orientation\n# as required by HOHQMesh\n\n# Create the three interior curves. The individual names of each curve in the inner\n# chain are used internally by HOHQMesh and are output as the given boundary names in\n# the mesh file.\n\ncone1 = newEndPointsLineCurve(\"cone1\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\niceCream = newCircularArcCurve(\"iceCream\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")\ncone2 = newEndPointsLineCurve(\"cone2\", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])\n\n# Assemble the three curve in a closed chain oriented counter-clockwise. The chain\n# name `IceCreamCone` is only used internally by HOHQMesh.\n\naddCurveToInnerBoundary!(p, cone1, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, iceCream, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, cone2, \"IceCreamCone\")\n\n# Adjust some `RunParameters` and overwrite the defaults values. In this case, we\n# set a new value for the boundary order polynomial representation and adjust the\n# output mesh file format to be `sem`\n\nsetPolynomialOrder!(p, 4)\nsetPlotFileFormat!(p, \"sem\")\n\n# A background grid is required for the mesh generation. In this example we lay a\n# background grid of Cartesian boxes with size 0.5.\n\naddBackgroundGrid!(p, [0.5, 0.5, 0.0])\n\n# Plot the project model curves and background grid\n\nif isdefined(Main, :Makie)\n plotProject!(p, MODEL+GRID)\n @info \"Press enter to generate the mesh and update the plot.\"\n readline()\n else # Throw an informational message about plotting to the user\n @info \"To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again.\"\n end\n\n# Generate the mesh. This produces the mesh and TecPlot files `IceCreamCone.mesh` and `IceCreamCone.tec`\n# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is\n# updated with the mesh that was generated.\n\ngenerate_mesh(p)\n\n# After the mesh successfully generates mesh statistics, such as the number of corner nodes,\n# the number of elements etc., are printed to the REPL","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The first line creates a new project, where the mesh and plot file names will be derived from the project name, \"IceCreamCone\" written to the specified folder.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, \"IceCreamCone\" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script resets the polynomial order (default = 5) and the plot file format (default = \"skeleton\").","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, only the mesh size needs to be specified using","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"addBackgroundGrid!(proj::Project, bgSize::Array{Float64})","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The example sets the background mesh size to be 0.5 in the x and y directions. The z component is ignored.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The script finishes by generating the quad mesh and plotting the results, as shown below","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"(Image: iceCreamCone)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Finally, the script returns the project so that it can be edited further, if desired.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To save a control file for HOHQMesh, simply invoke","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"saveProject(proj::Project)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"where the name of the control file (traditionally with a .control extension) matches the name of the project proj. saveProject is automatically called when a mesh is generated.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.","category":"page"},{"location":"license/#License","page":"License","title":"License","text":"","category":"section"},{"location":"license/","page":"License","title":"License","text":"MIT LicenseCopyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-LakemperPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"CheatSheet/#Commands-Cheat-Sheet","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples/ folder constructs an identical example mesh as shown in the Guided tour using generic function calls.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"A thorough description of the functions can be found in the API section.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The general workflow of the interactive mesh functionality within a REPL session is","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Create a project\nAdd boundary curves\nAdd a background grid\nAdd manual refinement (if desired)\nGenerate mesh","category":"page"},{"location":"CheatSheet/#Project","page":"Commands Cheat Sheet","title":"Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" p = newProject(, )","category":"page"},{"location":"CheatSheet/#cs-plotting","page":"Commands Cheat Sheet","title":"Plotting","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" plotProject!(p, options)\n updatePlot!(p, options)","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The options are any sum of MODEL, GRID, REFINEMENTS, and MESH.","category":"page"},{"location":"CheatSheet/#Curves","page":"Commands Cheat Sheet","title":"Curves","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" c = new(name, startLocation [x,y,z], endLocation [x,y,z]) *Straight Line*\n c = new(name, center [x,y,z], radius, startAngle, endAngle) *Circular Arc*\n c = new(name, xEqn, yEqn, zEqn) *Parametric equation*\n c = new(name, dataFile) *Spline with data from a file*\n c = new(name, nKnots, knotsMatrix) *Spline with given knot values*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#cs-manual-refinement","page":"Commands Cheat Sheet","title":"Manual Refinement","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" r = newRefinementCenter(name, type, center, gridSize, radius)\n r = newRefinementLine(name, type, startPoint, endPoint, gridSize, width)","category":"page"},{"location":"CheatSheet/#Adding-to-a-Project","page":"Commands Cheat Sheet","title":"Adding to a Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" add!(p, c) *Add outer boundary curve*\n add!(p, c, ) *Add curve to an inner boundary*\n add!(p, r) *Add refinement region*\n\n addBackgroundGrid!(p, [top, left, bottom, right], [nX, nY, nZ]) *No outer boundary*\n addBackgroundGrid!(p, [dx, dy, dz]) *If an outer boundary is present*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function add!, which is a shortcut to the full functions, e.g. addOuterBoundaryCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#Accessing-items","page":"Commands Cheat Sheet","title":"Accessing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" crv = getCurve(p, curveName) *Get a curve in the outer boundary*\n crv = getCurve(p, curveName, boundaryName) *Get a curve in an inner boundary*\n indx, chain = getChain(p, boundaryName) *Get a complete inner boundary curve*\n r = getRefinementRegion(p, name)","category":"page"},{"location":"CheatSheet/#Removing-from-Project","page":"Commands Cheat Sheet","title":"Removing from Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" removeOuterBoundary!(p) *Entire outer boundary curve*\n removeInnerBoundary!(p, innerBoundaryName) *Entire inner boundary curve*\n remove!(p, name) *Curve in outer boundary*\n remove!(p, name, innerBoundaryName) *Curve in inner boundary*\n removeRefinementRegion!(p, name)","category":"page"},{"location":"CheatSheet/#Editing-items","page":"Commands Cheat Sheet","title":"Editing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.","category":"page"},{"location":"CheatSheet/#Meshing","page":"Commands Cheat Sheet","title":"Meshing","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" generate_mesh(p)\n remove_mesh!(p)","category":"page"},{"location":"#HOHQMesh.jl","page":"Home","title":"HOHQMesh.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6 and above.","category":"page"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> import Pkg; Pkg.add(\"HOHQMesh\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the Julia REPL, you can load HOHQMesh with","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using HOHQMesh","category":"page"},{"location":"","page":"Home","title":"Home","text":"and then happily generate away!","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> control_file = joinpath(HOHQMesh.examples_dir(), \"GingerbreadMan.control\")\n\njulia> output = generate_mesh(control_file)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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,","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: gingerbreadman_with_edges_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"while the 3D file Snake.control produces this mesh:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: snake_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.,","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_box_two_circles.jl\"))","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using Pkg; Pkg.add(\"GLMakie\")\njulia> using GLMakie","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: box_two_circles)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Further explanation of the interactive functionality can be found here. Additional examples are available in the Tutorials.","category":"page"},{"location":"#authors-index-md","page":"Home","title":"Authors","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#License-and-contributing","page":"Home","title":"License and contributing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Acknowledgements","page":"Home","title":"Acknowledgements","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"}]
+}
diff --git a/v0.2.3/siteinfo.js b/v0.2.3/siteinfo.js
new file mode 100644
index 00000000..488dce70
--- /dev/null
+++ b/v0.2.3/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.2.3";
diff --git a/v0.2.3/testing/index.html b/v0.2.3/testing/index.html
new file mode 100644
index 00000000..0dd2dd30
--- /dev/null
+++ b/v0.2.3/testing/index.html
@@ -0,0 +1,3 @@
+
+Testing · HOHQMesh.jl
During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In HOHQMesh and its related repositories, tests are triggered by
each git push to main and
each git push to any pull request.
Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.
Test and coverage requirements
Before merging a pull request (PR) to main, we require that
The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing
julia> using Pkg; Pkg.test("HOHQMesh")
in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,
julia> # Run all test for the interactive Curve API
+ include(joinpath("test", "test_curve.jl"))
We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.
Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.
When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).
Test duration
As a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).
In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered "covered" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The "Details" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.
Coverage requirements
In general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.
Settings
This document was generated with Documenter.jl version 0.27.25 on Thursday 4 April 2024. Using Julia version 1.10.2.
diff --git a/v0.2.3/tutorials/create_edit_curves/index.html b/v0.2.3/tutorials/create_edit_curves/index.html
new file mode 100644
index 00000000..00fbaf6b
--- /dev/null
+++ b/v0.2.3/tutorials/create_edit_curves/index.html
@@ -0,0 +1,166 @@
+
+Creating and editing curves · HOHQMesh.jl
The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a "chain" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "sandbox" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.
We first create the outer boundary curve chain that is composed of three pieces
Straight line segment from $(0, -7)$ to $(5, 3)$.
Half-circle arc of radius $r=5$ centered at $(0, 3)$.
Straight line segment from $(-5, 3)$ to $(0, -7)$.
Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
outer_line1 = newEndPointsLineCurve("Line1", # curve name
+ [0.0, -7.0, 0.0], # start point
+ [5.0, 3.0, 0.0]) # end point
+
+outer_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-5.0, 3.0, 0.0], # start point
+ [0.0, -7.0, 0.0]) # end point
To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from $0$ to $180$ degrees.
outer_arc = newCircularArcCurve("Arc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 5.0, # radius
+ 0.0, # start angle
+ 180.0, # end angle
+ "degrees") # units for angle
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be "Arc".
The curve names "Line1", "Line2", and "Arc" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.
The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction
We visualize the outer boundary curve chain and background grid with the following
plotProject!(sandbox_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains three curve segments "Line1", "Arc", and "Line2" labeled in the figure by O.1, O.2, and O.3, respectively.
Suppose that the domain boundary requires a curved segment instead of the straight line "Line2". We will replace this line segment in the outer boundary chain with a cubic spline.
First, we remove the "Line2" curve from the "Outer" chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
The plot automatically updates and we see that the outer boundary is open and contains two segments: "Line1" and "Arc".
Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve "Arc" and end at the first point of the curve "Line1". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. The spline curve constructor newSplineCurve also takes the number of points as an input argument.
We create a pill shaped inner boundary curve chain composed of four pieces
Straight line segment from $(1, 5)$ to $(1, 3)$.
Half-circle arc of radius $r=1$ centered at $(0, 3)$.
Straight line segment from $(-1, 3)$ to $(-1, 5)$.
Half-circle arc of radius $r=1$ centered at $(0, 5)$.
Similar to the construction of the "Outer" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
inner_line1 = newEndPointsLineCurve("Line1", # curve name
+ [1.0, 5.0, 0.0], # start point
+ [1.0, 3.0, 0.0]) # end point
+
+inner_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-1.0, 3.0, 0.0], # start point
+ [-1.0, 5.0, 0.0]) # end point
To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at $(0, 3)$ varies from $0$ to $-180$ degrees. The top half-circle arc centered at $(0, 5)$ has an angle that varies from $180$ to $0$ degrees. The construction of the two circle arcs are
inner_bottom_arc = newCircularArcCurve("BottomArc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 1.0, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+
+inner_top_arc = newCircularArcCurve("TopArc", # curve name
+ [0.0, 5.0, 0.0], # center
+ 1.0, # radius
+ 180.0, # start angle
+ 0.0, # end angle
+ "degrees") # units for angle
Note, we use "radians" to set the angle bounds for inner_bottom_arc and "degrees" for the angle bounds of inner_top_arc.
The curve names "Line1", "Line2", "BottomArc", and "TopArc" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.
The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.
This inner boundary chain name "inner" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments "Line1", "BottomArc", "Line2", and "TopArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:
sandbox.control: A HOHQMesh control file for the current project.
sandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
sandbox.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 7.5414000000000009E-002
+ Number of nodes = 511
+ Number of Edges = 933
+ Number of Elements = 422
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00002932 1.17335568 0.18813138 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00953438 2.30790024 1.31439620 1.00000000 999.99900000 1.00000000
+ Condition 1.00041663 2.41773865 1.21024584 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.01673809 3.68828437 1.59413340 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001750 1.13820387 0.14143901 0.00000000 999.99900000 1.00000000
+ Minimum Angle 32.22733574 89.35690571 68.75321248 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.61089476 152.37947944 113.36221513 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.
Additionally, the remove_mesh! command deletes the mesh information from the sandbox_project and sandbox.mesh from the out folder. However, the sandbox.control and sandbox.tec files are still present in out directory.
Suppose that the inner boundary actually requires a curved segment instead of the straight line "Line1". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.
We remove the "Line1" curve from the inner chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: "BottomArc", "Line2", and "TopArc". Note that the index of the remaining curves has changed as shown below.
Brief note about undo / redo
The interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.
undoActionName()
+"Remove Inner Boundary Curve"
We can undo the removal of the "Line1" curve with undo
undo()
+"Undo Remove Inner Boundary Curve"
In addition to reinstating "Line1" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.
Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.
The new inner curve segment will be an oscillating line given by the parametric equations
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above
We see from the figure that this parametric equation curve starts at the point $(1,5)$ and, therefore, matches the end point of the existing curve "TopArc" present in the "inner" chain. However, the parametric equation curve ends at the point $(2,3)$ which does not match the "BottomArc" curve. So, the inner boundary chain remains open.
Attempt to generate a mesh with an open curve chain
An open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.
To create a closed boundary curve we must remove the "BottomArc" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point $(2, 3)$ and end at the point $(-1, 3)$ to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the "BottomArc" from the "inner" chain.
The figure updates to display the "inner" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.
A half-circle arc that joins the points $(2, 3)$ and $(-1, 3)$ has a radius $r=1.5$, is centered at $(0.5, 3)$ and has an angle that vaires from $0$ to $-180$. We construct this circle arc and directly add it to the sandbox_project.
new_bottom_arc = newCircularArcCurve("wideBottomArc", # curve name
+ [0.5, 3.0, 0.0], # center
+ 1.5, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
The updated plot now gives the modified, closed inner curve chain that now contains four curve segments "Line2", "TopArc", "wiggleLine", and "wideBottomArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.11353599999999998
+ Number of nodes = 712
+ Number of Edges = 1308
+ Number of Elements = 596
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00002932 1.15661960 0.12823902 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.01050856 3.14732001 1.34260027 1.00000000 999.99900000 1.00000000
+ Condition 1.00037771 2.59434067 1.22850175 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.02744717 3.68828437 1.64751502 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001750 1.13149451 0.09443920 0.00000000 999.99900000 1.00000000
+ Minimum Angle 31.87236189 89.33988565 67.86178629 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.44177106 157.27121105 114.35699650 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The visualization updates automatically and the background grid is removed after when the mesh is generated.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.
Add the background grid when an outer boundary curve is present.
Visualize an interactive mesh project.
Discuss undo / redo capabilities.
Construct and add parametric spline curves.
Construct and add a curve from parametric equations.
Construct and add straight line segments.
Construct and add circular arc segments.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with modified outer and inner curve chains
+#
+# Create inner / outer boundary chains composed of the four
+# available HOHQMesh curve types.
+#
+# Keywords: outer boundary, inner boundary, parametric equations,
+# circle arcs, cubic spline, curve removal
+using HOHQMesh
+
+# Instantiate the project
+sandbox_project = newProject("sandbox", "out")
+
+# Add the background grid
+addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])
+
+# Create and add the original outer boundary curves
+outer_line1 = newEndPointsLineCurve("Line1", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])
+outer_line2 = newEndPointsLineCurve("Line2", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])
+outer_arc = newCircularArcCurve("Arc", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, "degrees")
+
+addCurveToOuterBoundary!(sandbox_project, outer_line1)
+addCurveToOuterBoundary!(sandbox_project, outer_arc)
+addCurveToOuterBoundary!(sandbox_project, outer_line2)
+
+# Modify the outer boundary to have a spline instead of a straight line
+removeOuterBoundaryCurveWithName!(sandbox_project, "Line2")
+
+spline_data = [ [0.0 -5.0 3.0 0.0]
+ [0.25 -2.0 1.0 0.0]
+ [0.5 -4.0 0.5 0.0]
+ [0.75 -2.0 -3.0 0.0]
+ [1.0 0.0 -7.0 0.0] ]
+outer_spline = newSplineCurve("Spline", 5, spline_data)
+addCurveToOuterBoundary!(sandbox_project, outer_spline)
+
+# Create and add the inner boundary curves
+inner_line1 = newEndPointsLineCurve("Line1", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])
+inner_line2 = newEndPointsLineCurve("Line2", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])
+inner_bottom_arc = newCircularArcCurve("BottomArc", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, "radians")
+inner_top_arc = newCircularArcCurve("TopArc", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, "degrees")
+
+addCurveToInnerBoundary!(sandbox_project, inner_line1, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_line2, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_top_arc, "inner")
+
+# Generate a mesh
+generate_mesh(sandbox_project)
+
+# Delete the existing mesh before modifying the inner boundary curve chain
+remove_mesh!(sandbox_project)
+
+# Modify the inner boundary curve with an oscillatory line and a new circle arc
+removeInnerBoundaryCurve!(sandbox_project, "Line1", "inner")
+removeInnerBoundaryCurve!(sandbox_project, "BottomArc", "inner")
+
+xEqn = "x(t) = t + 1"
+yEqn = "y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)"
+zEqn = "z(t) = 0.0"
+inner_eqn = newParametricEquationCurve("wiggleLine", xEqn, yEqn, zEqn)
+
+new_bottom_arc = newCircularArcCurve("wideBottomArc", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, "radians")
+
+addCurveToInnerBoundary!(sandbox_project, inner_eqn, "inner")
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
+
+# Regenerate the final mesh
+generate_mesh(sandbox_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Thursday 4 April 2024. Using Julia version 1.10.2.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.
The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "TheBlob" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
The following commands create a new curve for the parametric equations above
The name of this curve is assigned to be "Blob". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for blob_project to have elements with side length two in each direction
addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])
We next visualize the outer boundary curve and background grid with the following
plotProject!(blob_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "Blob" labeled in the figure by O.1.
From the visualization we see that the background grid is likely too coarse to produce a "good" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction
setBackgroundGridSize!(blob_project, 0.5, 0.5)
Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.
The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.
We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:
TheBlob.control: A HOHQMesh control file for the current project.
TheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
TheBlob.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 8.4328000000000000E-002
+ Number of nodes = 479
+ Number of Edges = 895
+ Number of Elements = 417
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025286 0.36208840 0.11936333 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002882 2.58443761 1.26335838 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.12867591 1.18585825 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006176 4.77438730 1.51314025 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011275 0.28170345 0.10292806 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.38249259 89.99827733 73.08294187 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132795 156.98701187 109.36585212 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point $(-4, 0)$ is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with
Above we create a circular refinement region centered at the point $(-4, -0.5)$ with a desired resolution size $0.4$ and a radius of $1.0$. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.
With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 9.2778999999999986E-002
+ Number of nodes = 503
+ Number of Edges = 940
+ Number of Elements = 438
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025286 0.36208840 0.11412688 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002883 2.47056840 1.26416662 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.12867592 1.18429212 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006176 4.77438730 1.51407242 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011275 0.28170345 0.09814903 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.38249259 89.99827897 72.80049710 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132784 156.98701188 109.63478104 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.
Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.
Define a curved outer boundary using parametric equations.
Add and adjust the background grid.
Visualize an interactive mesh project.
Add manual refinement to a local region of the domain.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with a curved outer boundary
+#
+# Create an outer boundary from a set of parametric equations.
+# Add manual refinement in a small region around the point (-4, -0.5).
+#
+# Keywords: outer boundary, parametric equations, refinement center
+using HOHQMesh
+
+# Instantiate the project
+blob_project = newProject("TheBlob", "out")
+
+# Create and add the outer boundary curve
+xEqn = "x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3"
+yEqn = "y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2"
+zEqn = "z(t) = 0.0"
+blob = newParametricEquationCurve("Blob", xEqn, yEqn, zEqn)
+addCurveToOuterBoundary!(blob_project, blob)
+
+# Add the background grid
+addBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])
+
+# Create and add the refinement region
+center = newRefinementCenter("region", "smooth", [-4.0, -0.5, 0.0], 0.4, 1.0)
+addRefinementRegion!(blob_project, center)
+
+# Generate the mesh
+generate_mesh(blob_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Thursday 4 April 2024. Using Julia version 1.10.2.
For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.
For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.
This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.
This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.
This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line "curves".
This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve "chain" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line "curves". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "spline_curves" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.
The outer boundary curve for this tutorial is a circle of radius $r=4$ centered at the point $(0, -1)$. We define this circular curve with the function newCircularArcCurve as follows
circ = newCircularArcCurve("outerCircle", # curve name
+ [0.0, -1.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circ is assigned to be "outerCircle". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circ curve is then added to the spline_project as an outer boundary curve with
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for spline_project to have elements with side length $0.6$ in each direction
We next visualize the outer boundary curve and background grid with the following
plotProject!(spline_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "outerCircle" labeled in the figure by O.1.
A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots $t_j$, $x_j$, $y_j$, $z_j$ where $j$ indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder
We create a parametric spline curve from a file with
The name of the curve stored in the dictionary spline1 is assigned to be "big_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline1 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve "big_spline" labeled in the figure by 1.1.
Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.
Below, we construct another parametric spline using this strategy that consists of five data points
The name of the curve stored in the dictionary spline2 is assigned to be "small_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline2 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner2" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve "small_spline" labeled in the figure by 2.1.
Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with
edge1 = newEndPointsLineCurve("triangle", # curve name
+ [-2.3, -1.0, 0.0], # start point
+ [-1.7, -1.0, 0.0]) # end point
+
+edge2 = newEndPointsLineCurve("triangle", # curve name
+ [-1.7, -1.0, 0.0], # start point
+ [-2.0, -0.4, 0.0]) # end point
+
+edge3 = newEndPointsLineCurve("triangle", # curve name
+ [-2.0, -0.4, 0.0], # start point
+ [-2.3, -1.0, 0.0]) # end point
Here, each edge of the curve is given the same name "triangle" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.
The inner boundary chain name "inner3" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called "triangle" labeled in the figure by 3.1, 3.2, and 3.3.
With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:
spline_curves.control: A HOHQMesh control file for the current project.
spline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
spline_curves.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(spline_project)
+ 1 chevron elements removed from mesh.
+ 1 chevron elements removed from mesh.
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.25359100000000001
+ Number of nodes = 1176
+ Number of Edges = 2225
+ Number of Elements = 1047
+ Number of Subdivisions = 4
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00006209 0.15607019 0.04505180 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00008965 2.78091496 1.23178864 1.00000000 999.99900000 1.00000000
+ Condition 1.00000055 3.82171291 1.15535543 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00014261 6.78201663 1.46249737 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001491 0.10424647 0.03955817 0.00000000 999.99900000 1.00000000
+ Minimum Angle 37.24189766 89.96174556 74.42003031 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.03128071 157.35065162 107.91806148 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of "bad" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the "big_spline" curve. We decide that we are satisfied with the overall mesh quality.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples/ folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "box_two_circles" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.
When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.
For the box_project we first query the current values for the polynomial order and the mesh output format
We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be $4$ and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.
The domain for this tutorial is a rectangular box with the bounds $[0,30]\times[0,15]$. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:
Set the lower left corner point of the domain $(x_0, y_0)$, define the element size in each spatial direction $\Delta x$ and $\Delta y$, and the number of steps taken in each direction $N_x, N_y$. The resulting background grid will have the extent $[x_0, x_0 + N_x \Delta x]$ by $[y_0, y_0 + N_y \Delta y]$. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands
Set the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box $[0,30]\times[0,15]$ we use
Next, we add the two circular inner boundary curves with different radii.
The first circle will have radius $r=2$ and be centered at the point $(4, 4)$. We define this circular curve with the function newCircularArcCurve as follows
circle1 = newCircularArcCurve("circle1", # curve name
+ [4.0, 4.0, 0.0], # circle center
+ 2.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be "circle1". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circle1 curve is then added to the box_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called "inner1" and it contains a single curve "circle1" labeled in the figure by 1.1.
With analogous steps we create another circular curve with radius $r=4$, centered at $(20, 9)$ and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.
circle2 = newCircularArcCurve("circle2", # curve name
+ [20.0, 9.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 2.0 * pi, # end angle
+ "radians") # angle units
+addCurveToInnerBoundary!(box_project, circle2, "inner2")
Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called "inner2" and it contains a single curve "circle2" labeled in the figure by 2.1.
With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:
box_two_circles.control: A HOHQMesh control file for the current project.
box_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
box_two_circles.inp: A mesh file with format ABAQUS that was set above.
To do this we execute the command
generate_mesh(box_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 2.9116999999999997E-002
+ Number of nodes = 498
+ Number of Edges = 921
+ Number of Elements = 422
+ Number of Subdivisions = 0
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.34513977 1.15385313 0.91833886 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00000004 1.71084672 1.08736698 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 1.46547984 1.04928616 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00000006 2.43578615 1.16710823 1.00000000 4.00000000 1.00000000
+ Jacobian 0.17854786 1.07210200 0.86801191 0.00000000 999.99900000 1.00000000
+ Minimum Angle 50.57680338 89.99999787 83.84338772 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00000259 136.97085026 96.70176380 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.
From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.
This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples/ folder constructs an identical example mesh as shown in the Guided tour using generic function calls.
A thorough description of the functions can be found in the API section.
The general workflow of the interactive mesh functionality within a REPL session is
c = new(name, startLocation [x,y,z], endLocation [x,y,z]) *Straight Line*
+ c = new(name, center [x,y,z], radius, startAngle, endAngle) *Circular Arc*
+ c = new(name, xEqn, yEqn, zEqn) *Parametric equation*
+ c = new(name, dataFile) *Spline with data from a file*
+ c = new(name, nKnots, knotsMatrix) *Spline with given knot values*
Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.
All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.
HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).
HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.
Developer Certificate of Origin
+Version 1.1
+
+Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+1 Letterman Drive
+Suite D4700
+San Francisco, CA, 94129
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+
+Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+(a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+(b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+(c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+(d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
Settings
This document was generated with Documenter.jl version 0.27.25 on Wednesday 10 April 2024. Using Julia version 1.10.2.
When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:
Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.
If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.
Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like VS Code with the Julia extension). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.
Set the new version number in Project.toml according to the Julian version of semver. Commit and push.
Comment @JuliaRegistrator register on the commit setting the version number.
JuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.
Increment the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.
You can build the documentation of HOHQMesh.jl locally by running
julia --project=docs -e 'using Pkg; Pkg.instantiate(); include("docs/make.jl")'
from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).
Settings
This document was generated with Documenter.jl version 0.27.25 on Wednesday 10 April 2024. Using Julia version 1.10.2.
In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.
All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).
If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.
git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git
+# get latest main from the main repo
+git checkout main
+git pull
+# create a new branch for a cool new feature, bug fix, ...
+git checkout -b YOUR_BRANCH_NAME
+# do some work and push it to your fork
+git push -u myfork
+# go to https://github.com/trixi-framework/HOHQMesh.jl/pull
+# and create a PR from your new branch
Why using pull requests?
Immediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.
With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.
Avoid committing unwanted files
When you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.
For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:
Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.
Execute git fetch to get the latest changes from the repository.
Make sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.
Merge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.
In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.
If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should
merge the current main to your branch
run tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs
properly comment your code
delete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)
remove debug statements
add a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)
After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.
Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.
Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.
Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).
Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:
Update your clone by running git fetch.
Check out main using git checkout main.
Delete merged branch locally with git branch -d yourbranch.
Remove local references to deleted remote branch by executing git remote prune origin.
You can now proceed with your next changes by starting again at the top.
Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):
If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running
git reset HEAD~
This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.
If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.
Large files
You should never try to fix this yourself, as it potentially disrupts/destroys the work of others!
Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):
Tell everyone to commit and push their changes to the repository.
Fix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.
Perform the following steps to clean up the Git repository:
cd /tmp
+
+# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/
+
+# Get fresh clone of repo (so you can throw it away in case there is a problem)
+git clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git
+
+# Clean up repo of all files larger than 10M
+java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git
+
+# Enter repo
+cd HOHQMesh.jl.git
+
+# Clean up reflog and force aggressive garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
+
+# Push changes
+git push
+
+# Delete clone
+rm -rf HOHQMesh.jl.git
Tell everyone to clean up their local working copies by performing the following steps (also do this yourself):
# Enter repo
+cd HOHQMesh.jl
+
+# Get current changes
+git fetch
+
+# Check out the fixed branch
+git checkout branchname
+
+# IMPORTANT: Do a rebase instead of a pull!
+git rebase
+
+# Clean reflog and force garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
IMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.
Settings
This document was generated with Documenter.jl version 0.27.25 on Wednesday 10 April 2024. Using Julia version 1.10.2.
diff --git a/v0.2.4/guided-tour/index.html b/v0.2.4/guided-tour/index.html
new file mode 100644
index 00000000..4de97af9
--- /dev/null
+++ b/v0.2.4/guided-tour/index.html
@@ -0,0 +1,62 @@
+
+Guided tour · HOHQMesh.jl
In this brief overview, we highlight two scripts from the examples/ folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.
A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute
A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute
For completeness, we provide the example script and walk-through each step in the construction of the Project below.
using HOHQMesh
+
+# Create a new project with the name "IceCreamCone", which will also be the
+# name of the mesh, plot and stats files, written to output folder `out`.
+
+p = newProject("IceCreamCone", "out")
+
+# Outer boundary for this example mesh is a complete circle. Add it into the project.
+
+circ = newCircularArcCurve("outerCircle", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, "degrees")
+addCurveToOuterBoundary!(p, circ)
+
+# Inner boundary is three curves. Two straight lines and a circular arc.
+# Note the three curve are connected to ensure a counter-clockwise orientation
+# as required by HOHQMesh
+
+# Create the three interior curves. The individual names of each curve in the inner
+# chain are used internally by HOHQMesh and are output as the given boundary names in
+# the mesh file.
+
+cone1 = newEndPointsLineCurve("cone1", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])
+iceCream = newCircularArcCurve("iceCream", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, "degrees")
+cone2 = newEndPointsLineCurve("cone2", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])
+
+# Assemble the three curve in a closed chain oriented counter-clockwise. The chain
+# name `IceCreamCone` is only used internally by HOHQMesh.
+
+addCurveToInnerBoundary!(p, cone1, "IceCreamCone")
+addCurveToInnerBoundary!(p, iceCream, "IceCreamCone")
+addCurveToInnerBoundary!(p, cone2, "IceCreamCone")
+
+# Adjust some `RunParameters` and overwrite the defaults values. In this case, we
+# set a new value for the boundary order polynomial representation and adjust the
+# output mesh file format to be `sem`
+
+setPolynomialOrder!(p, 4)
+setPlotFileFormat!(p, "sem")
+
+# A background grid is required for the mesh generation. In this example we lay a
+# background grid of Cartesian boxes with size 0.5.
+
+addBackgroundGrid!(p, [0.5, 0.5, 0.0])
+
+# Plot the project model curves and background grid
+
+if isdefined(Main, :Makie)
+ plotProject!(p, MODEL+GRID)
+ @info "Press enter to generate the mesh and update the plot."
+ readline()
+ else # Throw an informational message about plotting to the user
+ @info "To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again."
+ end
+
+# Generate the mesh. This produces the mesh and TecPlot files `IceCreamCone.mesh` and `IceCreamCone.tec`
+# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is
+# updated with the mesh that was generated.
+
+generate_mesh(p)
+
+# After the mesh successfully generates mesh statistics, such as the number of corner nodes,
+# the number of elements etc., are printed to the REPL
The first line creates a new project, where the mesh and plot file names will be derived from the project name, "IceCreamCone" written to the specified folder.
To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:
Parametric equations
Cubic Splines
Lines defined by their end points
Circular arcs
In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.
Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, "IceCreamCone" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.
For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script resets the polynomial order (default = 5) and the plot file format (default = "skeleton").
One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, only the mesh size needs to be specified using
The example sets the background mesh size to be 0.5 in the x and y directions. The z component is ignored.
The script finishes by generating the quad mesh and plotting the results, as shown below
Finally, the script returns the project so that it can be edited further, if desired.
To save a control file for HOHQMesh, simply invoke
saveProject(proj::Project)
where the name of the control file (traditionally with a .control extension) matches the name of the project proj. saveProject is automatically called when a mesh is generated.
Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.
Settings
This document was generated with Documenter.jl version 0.27.25 on Wednesday 10 April 2024. Using Julia version 1.10.2.
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.
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.
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
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.,
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.
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.
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.
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.
Settings
This document was generated with Documenter.jl version 0.27.25 on Wednesday 10 April 2024. Using Julia version 1.10.2.
The supplied name will be the default name of the control, mesh, and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.
The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.
If the model is modified and you want to re-plot with the new values, invoke
updatePlot!(proj::Project, options)
but generally the plot will be updated automatically as you build the model.
HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.
The available mesh file formats are "ISM", "ISM-V2", or "ABAQUS". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.
The plot file (which can be viewed with something like VisIt or ParaView) format is either "skeleton" or "sem". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.
By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with
A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available in the documentation.
To change the defaults, the smoother parameters can be set/enquired with the functions
There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must be specified after a new project has been created.
Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.
Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).
where name labels the refinement region, the type is either "smooth" or "sharp", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.
The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a "chain" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.
The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.
The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.
See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.
Returns a new set of parametric equation. Equations must be of the form
<function name>(<argument>) = ...
The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
A cubic spline is defined by an array of knots, $t_j$, $x_j$, $y_j$, $z_j$. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the $t$, $x$, $y$, $z$ values, e.g.
The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either "degrees" or "radians". That argument is optional, and defaults to "degrees".
Using the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using
The syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.
The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.
Several scripts are available in the examples/ folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.
Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.
The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.
To generate a mesh interactively you
Create a project with a user given projectName and folder where any generated files are to be saved
p = newProject(<projectName>, <folder>)
Both of these input arguments are strings.
Create inner and outer boundary curves from the available types
c = newEndPointsLineCurve(<name>, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*
+c = newCircularArcCurve(<name>, center [x, y, z], radius, startAngle, endAngle, units = "degrees" or "radians") *Circular Arc*
+c = newParametricEquationCurve(<name>, xEqn, yEqn, zEqn) *Parametric equation*
+c = newSplineCurve(<name>, dataFile) *Spline with data from a file*
+c = newSpline(<name>, nKnots, knotsMatrix) *Spline with given knot values*
See Defining curves for further details on the different curve type currently supported by HOHQMesh.
The generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.
Add curves to build the model to see what you have added,
addOuterBoundaryCurve!(p, <curveName>) *Add outer boundary curve*
+addInnerBoundaryCurve!(p, <curveName>, <InnerBoundaryName>) *Add curve to an inner boundary*
For a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.
Curves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.
Visualize the project's model, if desired
plotProject!(p, MODEL)
Plots are updated in response to user interactions. However, to update the plot at any time, use
updatePlot!(p, options)
Options are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.
Visualization requirement
The interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.
Set the background grid
When no outer boundary curve is present, the background grid can be set with
addBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])
Or
addBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])
The first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.
When an outer boundary is present the background grid can be set as
addBackgroundGrid!(p, [dx, dy, dz])
where the spacing controls the number of elements in each direction.
Background grid
A background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.
Adjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by
setPolynomialOrder!(p, order)
The background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately
The mesh file will be saved in <folder> with the name <projectName>.mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name <projectName>.control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.
All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.
Settings
This document was generated with Documenter.jl version 0.27.25 on Wednesday 10 April 2024. Using Julia version 1.10.2.
Copyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-Lakemper
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Settings
This document was generated with Documenter.jl version 0.27.25 on Wednesday 10 April 2024. Using Julia version 1.10.2.
Add the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version
Add the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.
Add an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.
Return a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.
Generate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.
You can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.
You can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
Generate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.
This function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
getCurveType(crv::Dic{String,Any})
+
+Get the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,
+`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.
Get the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.
Plot objects specified by the plotOptions. Construct the plotOptions by the sum of what is to be drawn from the choices MODEL, GRID, MESH, REFINEMENTS.
Example: To plot the model and the grid, plotOptions = MODEL + GRID. To plot just the mesh, plotOptions = MESH.
To plot everything, plotOptions = MODEL + GRID + MESH + REFINEMENTS
Contents are overlaid in the order: GRID, MESH, MODEL, REFINEMENTS
Requires Makie.jl
Please note that for this function to work, you need to load Makie.jl in your REPL (e.g., by calling using GLMakie).
Set the file format for the plot file. Acceptable choices are "sem", which includes interior nodes and boundary nodes and "skeleton", which includes only the corner nodes.
This document was generated with Documenter.jl version 0.27.25 on Wednesday 10 April 2024. Using Julia version 1.10.2.
diff --git a/v0.2.4/search_index.js b/v0.2.4/search_index.js
new file mode 100644
index 00000000..862173e5
--- /dev/null
+++ b/v0.2.4/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"contributing/#Contributing","page":"Contributing","title":"Contributing","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.","category":"page"},{"location":"contributing/#Developer-Certificate-of-Origin-(Version-1.1)","page":"Contributing","title":"Developer Certificate of Origin (Version 1.1)","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"The following text was taken from https://developercertificate.org:","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"Developer Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n1 Letterman Drive\nSuite D4700\nSan Francisco, CA, 94129\n\nEveryone is permitted to copy and distribute verbatim copies of this\nlicense document, but changing it is not allowed.\n\n\nDeveloper's Certificate of Origin 1.1\n\nBy making a contribution to this project, I certify that:\n\n(a) The contribution was created in whole or in part by me and I\n have the right to submit it under the open source license\n indicated in the file; or\n\n(b) The contribution is based upon previous work that, to the best\n of my knowledge, is covered under an appropriate open source\n license and I have the right under that license to submit that\n work with modifications, whether created in whole or in part\n by me, under the same open source license (unless I am\n permitted to submit under a different license), as indicated\n in the file; or\n\n(c) The contribution was provided directly to me by some other\n person who certified (a), (b) or (c) and I have not modified\n it.\n\n(d) I understand and agree that this project and the contribution\n are public and that a record of the contribution (including all\n personal information I submit with it, including my sign-off) is\n maintained indefinitely and may be redistributed consistent with\n this project or the open source license(s) involved.","category":"page"},{"location":"development/#Development","page":"Development","title":"Development","text":"","category":"section"},{"location":"development/#Text-editors","page":"Development","title":"Text editors","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:","category":"page"},{"location":"development/#VS-Code","page":"Development","title":"VS Code","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.","category":"page"},{"location":"development/#Juno","page":"Development","title":"Juno","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.","category":"page"},{"location":"development/#Vim-or-Emacs","page":"Development","title":"Vim or Emacs","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like VS Code with the Julia extension). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.","category":"page"},{"location":"development/#Releasing-a-new-version-of-HOHQMesh","page":"Development","title":"Releasing a new version of HOHQMesh","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Check whether everything is okay, tests pass etc.\nSet the new version number in Project.toml according to the Julian version of semver. Commit and push.\nComment @JuliaRegistrator register on the commit setting the version number.\nJuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.\nIncrement the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.","category":"page"},{"location":"development/#Preview-the-documentation","page":"Development","title":"Preview the documentation","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"You can build the documentation of HOHQMesh.jl locally by running","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"julia --project=docs -e 'using Pkg; Pkg.instantiate(); include(\"docs/make.jl\")'","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).","category":"page"},{"location":"tutorials/straight_outer_boundary/#Straight-sided-outer-boundary","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples/ folder.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Synopsis","page":"Straight-sided outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Initialization","page":"Straight-sided outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We create a new project with the name \"box_two_circles\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_project = newProject(\"box_two_circles\", \"out\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Adjusting-project-parameters","page":"Straight-sided outer boundary","title":"Adjusting project parameters","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"For the box_project we first query the current values for the polynomial order and the mesh output format","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> getPolynomialOrder(box_project)\n5\n\njulia> getMeshFileFormat(box_project)\n\"ISM-V2\"","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be 4 and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"setPolynomialOrder!(box_project, 4)\nsetMeshFileFormat!(box_project, \"ABAQUS\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-background-grid","page":"Straight-sided outer boundary","title":"Add the background grid","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The domain for this tutorial is a rectangular box with the bounds 030times015. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Set the lower left corner point of the domain (x_0 y_0), define the element size in each spatial direction Delta x and Delta y, and the number of steps taken in each direction N_x N_y. The resulting background grid will have the extent x_0 x_0 + N_x Delta x by y_0 y_0 + N_y Delta y. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands\nlower_left = [0.0, 0.0, 0.0]\nspacing = [1.0, 1.0, 0.0]\nnum_intervals = [30, 15, 0]\naddBackgroundGrid!(box_project, lower_left, spacing, num_intervals)\nSet the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box 030times015 we use\nbounds = [15.0, 0.0, 0.0, 30.0]\nN = [30, 15, 0]\naddBackgroundGrid!(box_project, bounds, N)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we visualize the box_project to ensure that the background grid has been added correctly.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"plotProject!(box_project, GRID)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use the keyword and GRID to indicate that we want the background grid to be included in the visualization.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: background)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-inner-boundaries","page":"Straight-sided outer boundary","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we add the two circular inner boundary curves with different radii.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The first circle will have radius r=2 and be centered at the point (4 4). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle1 = newCircularArcCurve(\"circle1\", # curve name\n [4.0, 4.0, 0.0], # circle center\n 2.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be \"circle1\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The new circle1 curve is then added to the box_project as an inner boundary curve with","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"addCurveToInnerBoundary!(box_project, circle1, \"inner1\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called \"inner1\" and it contains a single curve \"circle1\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: first_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With analogous steps we create another circular curve with radius r=4, centered at (20 9) and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle2 = newCircularArcCurve(\"circle2\", # curve name\n [20.0, 9.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 2.0 * pi, # end angle\n \"radians\") # angle units\naddCurveToInnerBoundary!(box_project, circle2, \"inner2\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called \"inner2\" and it contains a single curve \"circle2\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: second_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Generate-the-mesh","page":"Straight-sided outer boundary","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_two_circles.control: A HOHQMesh control file for the current project.\nbox_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nbox_two_circles.inp: A mesh file with format ABAQUS that was set above.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"generate_mesh(box_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 2.9116999999999997E-002\n Number of nodes = 498\n Number of Edges = 921\n Number of Elements = 422\n Number of Subdivisions = 0\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.34513977 1.15385313 0.91833886 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00000004 1.71084672 1.08736698 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 1.46547984 1.04928616 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00000006 2.43578615 1.16710823 1.00000000 4.00000000 1.00000000\n Jacobian 0.17854786 1.07210200 0.86801191 0.00000000 999.99900000 1.00000000\n Minimum Angle 50.57680338 89.99999787 83.84338772 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00000259 136.97085026 96.70176380 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: final_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Summary","page":"Straight-sided outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"github-git/#GitHub-and-Git","page":"GitHub & Git","title":"GitHub & Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This page contains information on how to use GitHub and Git when developing HOHQMesh.","category":"page"},{"location":"github-git/#Development-workflow","page":"GitHub & Git","title":"Development workflow","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For adding modifications to HOHQMesh, we generally follow these steps:","category":"page"},{"location":"github-git/#Create-an-issue-(optional)","page":"GitHub & Git","title":"Create an issue (optional)","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.","category":"page"},{"location":"github-git/#Create-a-branch-and-*immediately*-create-a-pull-request","page":"GitHub & Git","title":"Create a branch and immediately create a pull request","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git\n# get latest main from the main repo\ngit checkout main\ngit pull\n# create a new branch for a cool new feature, bug fix, ...\ngit checkout -b YOUR_BRANCH_NAME\n# do some work and push it to your fork\ngit push -u myfork\n# go to https://github.com/trixi-framework/HOHQMesh.jl/pull\n# and create a PR from your new branch","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"info: Why using pull requests?\nImmediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.","category":"page"},{"location":"github-git/#Make-changes","page":"GitHub & Git","title":"Make changes","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"warning: Avoid committing unwanted files\nWhen you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.","category":"page"},{"location":"github-git/#Keep-your-branch-in-sync-with-main","page":"GitHub & Git","title":"Keep your branch in sync with main","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.\nExecute git fetch to get the latest changes from the repository.\nMake sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.\nMerge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.","category":"page"},{"location":"github-git/#Prepare-for-review","page":"GitHub & Git","title":"Prepare for review","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"merge the current main to your branch\nrun tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs\nproperly comment your code\ndelete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)\nremove debug statements\nadd a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.","category":"page"},{"location":"github-git/#Get-reviewed","page":"GitHub & Git","title":"Get reviewed","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.","category":"page"},{"location":"github-git/#Merge-branch","page":"GitHub & Git","title":"Merge branch","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).","category":"page"},{"location":"github-git/#Update-your-working-copy","page":"GitHub & Git","title":"Update your working copy","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Update your clone by running git fetch.\nCheck out main using git checkout main.\nDelete merged branch locally with git branch -d yourbranch.\nRemove local references to deleted remote branch by executing git remote prune origin.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"You can now proceed with your next changes by starting again at the top.","category":"page"},{"location":"github-git/#Using-Git","page":"GitHub & Git","title":"Using Git","text":"","category":"section"},{"location":"github-git/#Resources-for-learning-Git","page":"GitHub & Git","title":"Resources for learning Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Git Handbook by GitHub\nLearn Git Branching","category":"page"},{"location":"github-git/#Tips-and-tricks","page":"GitHub & Git","title":"Tips and tricks","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This is an unordered collection of different tips and tricks that can be helpful while working with Git. As usual, your mileage might vary.","category":"page"},{"location":"github-git/#Undo-last-commit","page":"GitHub & Git","title":"Undo last commit","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git reset HEAD~","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.","category":"page"},{"location":"github-git/#Remove-large-file-from-repository","page":"GitHub & Git","title":"Remove large file from repository","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"danger: Large files\nYou should never try to fix this yourself, as it potentially disrupts/destroys the work of others!","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Tell everyone to commit and push their changes to the repository.\nFix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.\nPerform the following steps to clean up the Git repository:\ncd /tmp\n\n# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/\n\n# Get fresh clone of repo (so you can throw it away in case there is a problem)\ngit clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git\n\n# Clean up repo of all files larger than 10M\njava -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git\n\n# Enter repo\ncd HOHQMesh.jl.git\n\n# Clean up reflog and force aggressive garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\n\n# Push changes\ngit push\n\n# Delete clone\nrm -rf HOHQMesh.jl.git\nTell everyone to clean up their local working copies by performing the following steps (also do this yourself):\n# Enter repo\ncd HOHQMesh.jl\n\n# Get current changes\ngit fetch\n\n# Check out the fixed branch\ngit checkout branchname\n\n# IMPORTANT: Do a rebase instead of a pull!\ngit rebase\n\n# Clean reflog and force garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\nIMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.","category":"page"},{"location":"interactive-api/#API","page":"API","title":"API","text":"","category":"section"},{"location":"interactive-api/#Project-creation-and-saving","page":"API","title":"Project creation and saving","text":"","category":"section"},{"location":"interactive-api/#New-Project","page":"API","title":"New Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = newProject(name::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied name will be the default name of the control, mesh, and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.","category":"page"},{"location":"interactive-api/#Opening-an-existing-project-file","page":"API","title":"Opening an existing project file","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A project can be created from an existing HOHQMesh control file with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = openProject(fileName::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied fileName will be the name of the project and the generated mesh and plot files will be placed in the supplied folder.","category":"page"},{"location":"interactive-api/#Saving-a-Project","page":"API","title":"Saving a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" saveProject(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"writes a control file to the folder designated when creating the new project. It can be read in again with openProject.","category":"page"},{"location":"interactive-api/#Plotting-a-Project","page":"API","title":"Plotting a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" plotProject!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the model is modified and you want to re-plot with the new values, invoke","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" updatePlot!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"but generally the plot will be updated automatically as you build the model.","category":"page"},{"location":"interactive-api/#Modifying/editing-a-Project","page":"API","title":"Modifying/editing a Project","text":"","category":"section"},{"location":"interactive-api/#Setting-the-name-of-a-Project","page":"API","title":"Setting the name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name is the name under which the mesh, plot, statistics and control files will be written. It can be changed at any time with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setName!(proj::Project,name::String)","category":"page"},{"location":"interactive-api/#Getting-the-current-name-of-a-Project","page":"API","title":"Getting the current name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name can be fetched and printed to the screen with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getName(proj::Project)","category":"page"},{"location":"interactive-api/#Controlling-the-mesh-generation","page":"API","title":"Controlling the mesh generation","text":"","category":"section"},{"location":"interactive-api/#Editing-the-RunParameters","page":"API","title":"Editing the RunParameters","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The run parameters can be enquired and set with these getter/setter pairs:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setPolynomialOrder!(proj::Project, p::Int)\n [Return:Int] getPolynomialOrder(proj::Project)\n [Return:nothing] setMeshFileFormat!(proj::Project, meshFileFormat::String)\n [Return:String] getMeshFileFormat(proj::Project)\n [Return:nothing] setPlotFileFormat!(proj::Project, plotFileFormat::String)\n [Return:String] getPlotFileFormat(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The available mesh file formats are \"ISM\", \"ISM-V2\", or \"ABAQUS\". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot file (which can be viewed with something like VisIt or ParaView) format is either \"skeleton\" or \"sem\". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.","category":"page"},{"location":"interactive-api/#Changing-the-output-file-names","page":"API","title":"Changing the output file names","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setName!(proj::Project,name::String)\n [Return:String] getName(proj::Project)\n [Return:nothing] setFolder!(proj::Project,folder::String)\n [Return:String] getFolder(proj::Project)","category":"page"},{"location":"interactive-api/#Smoothing-operations","page":"API","title":"Smoothing operations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available in the documentation.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To change the defaults, the smoother parameters can be set/enquired with the functions","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setSmoothingStatus!(proj::Project, status::String)\n [Return:String] getSmoothingStatus(proj::Project)\n [Return:nothing] setSmoothingType!(proj::Project, type::String)\n [Return:String] getSmoothingType(proj::Project)\n [Return:nothing] setSmoothingIterations!(proj::Project, iterations::Int)\n [Return:Int] getSmoothingIterations(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The smooth status is either \"ON\" or \"OFF\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To remove the smoother altogether, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] removeSpringSmoother!(proj::Project)","category":"page"},{"location":"interactive-api/#Adding-the-background-grid","page":"API","title":"Adding the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must be specified after a new project has been created.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addBackgroundGrid!(proj::Project,\n x0::Array{Float64},\n dx::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n box::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n bgSize::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.","category":"page"},{"location":"interactive-api/#Changing-the-background-grid","page":"API","title":"Changing the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The size of an existing background grid in a Project can be adjusted with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setBackgroundGridSize!(proj::Project,\n dx::Float64,\n dy::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If a plot is present it will be updated automatically.","category":"page"},{"location":"interactive-api/#Manual-refinement-regions","page":"API","title":"Manual refinement regions","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To create a RefinementCenter,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementCenter(name::String,\n type::String,\n x0::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where name labels the refinement region, the type is either \"smooth\" or \"sharp\", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Similarly, one can create a RefinementLine,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementLine(name::String,\n type::String,\n x0::Array{Float64}, x1::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where x0 is the start position and x1 is the end of the line. The name, type, h, and w parameters are the same as for a RefinementCenter.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To add a refinement region to the project,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addRefinementRegion!(proj::Project, r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To get a reference to a refinement region with a given name, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] getRefinementRegion(proj::Project, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to get a list of all the refinement regions,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Array{Dict{String,Any}}] array = allRefinementRegions(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"A refinement region can be edited by using the following:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementType!(r::Dict{String,Any}, type::String)\n [Return:String] getRefinementType(r::Dict{String,Any})\n [Return:nothing] setRefinementLocation!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementLocation(r::Dict{String,Any})\n [Return:nothing] setRefinementGridSize!(r::Dict{String,Any}, h::Float64)\n [Return:Float64] getRefinementGridSize(r::Dict{String,Any})\n [Return:nothing] setRefinementWidth!(r::Dict{String,Any}, w::Float64)\n [Return:Float64] getRefinementWidth(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where r is a dictionary returned by newRefinementCenter!, newRefinementLine!, or getRefinementRegion.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To further edit a RefinementLine, use the methods","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementStart!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementStart(r::Dict{String,Any})\n [Return:nothing] setRefinementEnd!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementEnd(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Boundary-curves","page":"API","title":"Boundary curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a \"chain\" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.","category":"page"},{"location":"interactive-api/#Defining-curves","page":"API","title":"Defining curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Four curve types can be added to the outer and inner boundary curve chains. They are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"interactive-api/#Parametric-equations","page":"API","title":"Parametric equations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Creating a new curve equation","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\")","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Returns a new set of parametric equation. Equations must be of the form","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" () = ...","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" xEqn = \"x(t) = 4*cos(2*pi*t) - 0.6*cos(8*pi*t)^3\"\n yEqn = \"y(t) = 4*sin(2*pi*t) - 0.5*sin(11*pi*t)^2\"\n zEqn = \"z(t) = 0.0\"\n blob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The z-Equation is optional, but for now must define zero for z by default.","category":"page"},{"location":"interactive-api/#Cubic-spline-curve","page":"API","title":"Cubic spline curve","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A cubic spline is defined by an array of knots, t_j, x_j, y_j, z_j. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the t, x, y, z values, e.g.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" 9\n 0.000000000000000 -3.50000000000000 3.50000000000000 0.0\n 3.846153846153846E-002 -3.20000000000000 5.00000000000 0.0\n 7.692307692307693E-002 -2.00000000000000 6.00000000000 0.0\n 0.769230769230769 0.000000000000000 -1.00000000000000 0.0\n 0.807692307692308 -1.00000000000000 -1.00000000000000 0.0\n 0.846153846153846 -2.00000000000000 -0.800000000000000 0.0\n 0.884615384615385 -2.50000000000000 0.000000000000000 0.0\n 0.923076923076923 -3.00000000000000 1.00000000000000 0.0\n 1.00000000000000 -3.50000000000000 3.50000000000000 0.0","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"or by constructing the required nKnots x 4 array and supplying it to the new procedure. The respective constructors for a spline curve are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newSplineCurve(name::String,\n dataFile::String)\n [Return:Dict{String,Any}] newSplineCurve(name::String,\n nKnots::Int,\n data::Matrix{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the spline curve is to be closed. The last data point must be the same as the first.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n ex_spline = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"interactive-api/#Line-defined-by-end-points","page":"API","title":"Line defined by end points","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A straight line is constructed with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newEndPointsLineCurve(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The xStart and xEnd are arrays of the form [x, y, z]. The z component should be zero and for now is ignored.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" line1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])","category":"page"},{"location":"interactive-api/#Circular-arc","page":"API","title":"Circular arc","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newCircularArcCurve(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either \"degrees\" or \"radians\". That argument is optional, and defaults to \"degrees\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" halfCircle = newCircularArcCurve(\"Dome\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")","category":"page"},{"location":"interactive-api/#Adding-and-removing-outer-and-inner-boundaries","page":"API","title":"Adding and removing outer and inner boundaries","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Adding an outer boundary curve\nUsing the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using\n[Return:nothing] addCurveToOuterBoundary!(proj::Project,\n crv::Dict{String,Any})\ncrv is the dictionary that represents the curve.\nExample:\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\nAdding an inner boundary curve\nThe syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.\n[Return:nothing] addCurveToInnerBoundary!(proj::Project,\n crv::Dict{String,Any},\n chainName::String)\nExample:\nline1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\naddCurveToInnerBoundary!(p, line1, \"interior_curve\")\nTo edit curves they can be accessed by the name:\n[Return:Dict{String,Any}] getInnerBoundaryCurve(proj::Project,\n curveName::String,\n chainName::String)\n[Return:Dict{String,Any}] getOuterBoundaryCurveWithName(proj::Project,\n name::String)\nDeleting boundary curves\nThe entire outer boundary or an entire inner boundary can be removed from the project.\n[Return:nothing] removeOuterBoundary!(proj::Project)\n[Return:nothing] removeInnerBoundary!(proj::Project, chainName::String)\nAlternatively, individual pieces of the boundary curve chains can be removed.\n[Return:nothing] removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n[Return:nothing] removeInnerBoundaryCurve!(proj::Project,\n name::String,\n chainName::String)\nAs in HOHQMesh the project can have only one outer boundary chain, so the removal does not require a specific chainName.","category":"page"},{"location":"interactive-api/#Editing-curves","page":"API","title":"Editing curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"You can determine the type of a curve by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getCurveType(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"For any of the curves, their name can be changed by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setCurveName!(crv::Dict{String,Any}, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"and checked by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" getCurveName(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Otherwise there are special functions to change the parameters of curves","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setXEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setYEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setZEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcUnits!(arc::Dict{String,Any}, units::String)\n [Return:nothing] setArcCenter!(arc::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n [Return:String] getXEqn(crv::Dict{String,Any})\n [Return:String] getYEqn(crv::Dict{String,Any})\n [Return:String] getZEqn(crv::Dict{String,Any})\n [Return:Array{Float64}] getStartPoint(crv::Dict{String,Any})\n [Return:Array{Float64}] getEndPoint(crv::Dict{String,Any})\n [Return:String] getArcUnits(arc::Dict{String,Any})\n [Return:Array{Float64}] getArcCenter(arc::Dict{String,Any})\n [Return:Float64] getArcStartAngle(arc::Dict{String,Any})\n [Return:Float64] getArcEndAngle(arc::Dict{String,Any})\n [Return:Float64] getArcRadius(arc::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Undo/redo","page":"API","title":"Undo/redo","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The interactive mesh functionality has unlimited undo/redo for most actions.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"In interactive mode, actions can be undone by the commands","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undo()\n [Return:String] redo()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where the return string contains the name of the action performed.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To find out what the next actions are, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undoActionName()\n [Return:String] redoActionName()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to clear the undo stack, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] clearUndoRedo()","category":"page"},{"location":"tutorials/curved_outer_boundary/#Curved-outer-boundary","page":"Curved outer boundary","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Synopsis","page":"Curved outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initialization","page":"Curved outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We create a new project with the name \"TheBlob\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"blob_project = newProject(\"TheBlob\", \"out\")","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-the-outer-boundary","page":"Curved outer boundary","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary curve for the domain of interest in this tutorial is given by the parametric equations","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":" beginaligned\n x(t) = 4cos(2 pi t) - frac35cos^3(8 pi t)02cm\n y(t) = 4sin(2 pi t) - frac12sin^2(11 pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"xEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The name of this curve is assigned to be \"Blob\". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addCurveToOuterBoundary!(blob_project, blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-a-background-grid","page":"Curved outer boundary","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for blob_project to have elements with side length two in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"plotProject!(blob_project, MODEL+GRID)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"Blob\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: coarse_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From the visualization we see that the background grid is likely too coarse to produce a \"good\" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"setBackgroundGridSize!(blob_project, 0.5, 0.5)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: fine_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initial-mesh-and-user-adjustments","page":"Curved outer boundary","title":"Initial mesh and user adjustments","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"TheBlob.control: A HOHQMesh control file for the current project.\nTheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nTheBlob.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 8.4328000000000000E-002\n Number of nodes = 479\n Number of Edges = 895\n Number of Elements = 417\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025286 0.36208840 0.11936333 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002882 2.58443761 1.26335838 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.12867591 1.18585825 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006176 4.77438730 1.51314025 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011275 0.28170345 0.10292806 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.38249259 89.99827733 73.08294187 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132795 156.98701187 109.36585212 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: initial_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point (-4 0) is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"center = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Above we create a circular refinement region centered at the point (-4 -05) with a desired resolution size 04 and a radius of 10. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: refinement_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Final-mesh","page":"Curved outer boundary","title":"Final mesh","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 9.2778999999999986E-002\n Number of nodes = 503\n Number of Edges = 940\n Number of Elements = 438\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025286 0.36208840 0.11412688 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002883 2.47056840 1.26416662 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.12867592 1.18429212 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006176 4.77438730 1.51407242 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011275 0.28170345 0.09814903 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.38249259 89.99827897 72.80049710 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132784 156.98701188 109.63478104 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: final_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Summary","page":"Curved outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"# Interactive mesh with a curved outer boundary\n#\n# Create an outer boundary from a set of parametric equations.\n# Add manual refinement in a small region around the point (-4, -0.5).\n#\n# Keywords: outer boundary, parametric equations, refinement center\nusing HOHQMesh\n\n# Instantiate the project\nblob_project = newProject(\"TheBlob\", \"out\")\n\n# Create and add the outer boundary curve\nxEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)\naddCurveToOuterBoundary!(blob_project, blob)\n\n# Add the background grid\naddBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])\n\n# Create and add the refinement region\ncenter = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)\n\n# Generate the mesh\ngenerate_mesh(blob_project)","category":"page"},{"location":"tutorials/create_edit_curves/#Creating-and-editing-curves","page":"Creating and editing curves","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a \"chain\" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/create_edit_curves/#Synopsis","page":"Creating and editing curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/#Initialization","page":"Creating and editing curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a new project with the name \"sandbox\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox_project = newProject(\"sandbox\", \"out\")","category":"page"},{"location":"tutorials/create_edit_curves/#Add-the-outer-boundary-chain","page":"Creating and editing curves","title":"Add the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We first create the outer boundary curve chain that is composed of three pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (0 -7) to (5 3).\nHalf-circle arc of radius r=5 centered at (0 3).\nStraight line segment from (-5 3) to (0 -7).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [0.0, -7.0, 0.0], # start point\n [5.0, 3.0, 0.0]) # end point\n\nouter_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-5.0, 3.0, 0.0], # start point\n [0.0, -7.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from 0 to 180 degrees.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_arc = newCircularArcCurve(\"Arc\", # curve name\n [0.0, 3.0, 0.0], # center\n 5.0, # radius\n 0.0, # start angle\n 180.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", and \"Arc\" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-a-background-grid","page":"Creating and editing curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We visualize the outer boundary curve chain and background grid with the following","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"plotProject!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains three curve segments \"Line1\", \"Arc\", and \"Line2\" labeled in the figure by O.1, O.2, and O.3, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-the-outer-boundary-chain","page":"Creating and editing curves","title":"Edit the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the domain boundary requires a curved segment instead of the straight line \"Line2\". We will replace this line segment in the outer boundary chain with a cubic spline.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"First, we remove the \"Line2\" curve from the \"Outer\" chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Outer curve removal\nAlternatively, we can remove the curve \"Line2\" using its index in the \"Outer\" boundary chain.removeOuterBoundaryCurveAtIndex!(sandbox_project, 3)This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The plot automatically updates and we see that the outer boundary is open and contains two segments: \"Line1\" and \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve \"Arc\" and end at the first point of the curve \"Line1\". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. The spline curve constructor newSplineCurve also takes the number of points as an input argument.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"spline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we add the spline curve outer_spline into the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates automatically to display the \"Outer\" boundary chain with the new \"Spline\" curve labeled O.3.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-an-inner-boundary-chain","page":"Creating and editing curves","title":"Add an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a pill shaped inner boundary curve chain composed of four pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (1 5) to (1 3).\nHalf-circle arc of radius r=1 centered at (0 3).\nStraight line segment from (-1 3) to (-1 5).\nHalf-circle arc of radius r=1 centered at (0 5).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Similar to the construction of the \"Outer\" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [1.0, 5.0, 0.0], # start point\n [1.0, 3.0, 0.0]) # end point\n\ninner_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-1.0, 3.0, 0.0], # start point\n [-1.0, 5.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at (0 3) varies from 0 to -180 degrees. The top half-circle arc centered at (0 5) has an angle that varies from 180 to 0 degrees. The construction of the two circle arcs are","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_bottom_arc = newCircularArcCurve(\"BottomArc\", # curve name\n [0.0, 3.0, 0.0], # center\n 1.0, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\n\ninner_top_arc = newCircularArcCurve(\"TopArc\", # curve name\n [0.0, 5.0, 0.0], # center\n 1.0, # radius\n 180.0, # start angle\n 0.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Note, we use \"radians\" to set the angle bounds for inner_bottom_arc and \"degrees\" for the angle bounds of inner_top_arc.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", \"BottomArc\", and \"TopArc\" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This inner boundary chain name \"inner\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments \"Line1\", \"BottomArc\", \"Line2\", and \"TopArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_pill)","category":"page"},{"location":"tutorials/create_edit_curves/#Generate-the-mesh","page":"Creating and editing curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox.control: A HOHQMesh control file for the current project.\nsandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nsandbox.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 7.5414000000000009E-002\n Number of nodes = 511\n Number of Edges = 933\n Number of Elements = 422\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00002932 1.17335568 0.18813138 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00953438 2.30790024 1.31439620 1.00000000 999.99900000 1.00000000\n Condition 1.00041663 2.41773865 1.21024584 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.01673809 3.68828437 1.59413340 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001750 1.13820387 0.14143901 0.00000000 999.99900000 1.00000000\n Minimum Angle 32.22733574 89.35690571 68.75321248 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.61089476 152.37947944 113.36221513 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: initial_mesh)","category":"page"},{"location":"tutorials/create_edit_curves/#Delete-the-existing-mesh","page":"Creating and editing curves","title":"Delete the existing mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"remove_mesh!(sandbox_project)\nupdatePlot!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Additionally, the remove_mesh! command deletes the mesh information from the sandbox_project and sandbox.mesh from the out folder. However, the sandbox.control and sandbox.tec files are still present in out directory.","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-an-inner-boundary-chain","page":"Creating and editing curves","title":"Edit an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the inner boundary actually requires a curved segment instead of the straight line \"Line1\". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We remove the \"Line1\" curve from the inner chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Inner curve removal\nAlternatively, we can remove the curve \"Line1\" using its index in the inner boundary chain.removeInnerBoundaryCurveAtIndex!(sandbox_project, 1, \"inner\")This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: \"BottomArc\", \"Line2\", and \"TopArc\". Note that the index of the remaining curves has changed as shown below.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Brief note about undo / redo\nThe interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.undoActionName()\n\"Remove Inner Boundary Curve\"We can undo the removal of the \"Line1\" curve with undoundo()\n\"Undo Remove Inner Boundary Curve\"In addition to reinstating \"Line1\" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The new inner curve segment will be an oscillating line given by the parametric equations","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":" beginaligned\n x(t) = t + 102cm\n y(t) = -2t + 5 - frac32 cos(pi t) sin(pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"xEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The name of this new curve is assigned to be \"wiggleLine\". We add this new curve to the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The automatically updated figure now shows:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_open_chain)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We see from the figure that this parametric equation curve starts at the point (15) and, therefore, matches the end point of the existing curve \"TopArc\" present in the \"inner\" chain. However, the parametric equation curve ends at the point (23) which does not match the \"BottomArc\" curve. So, the inner boundary chain remains open.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"warning: Attempt to generate a mesh with an open curve chain\nAn open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create a closed boundary curve we must remove the \"BottomArc\" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point (2 3) and end at the point (-1 3) to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the \"BottomArc\" from the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates to display the \"inner\" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_remove_arc)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"A half-circle arc that joins the points (2 3) and (-1 3) has a radius r=15, is centered at (05 3) and has an angle that vaires from 0 to -180. We construct this circle arc and directly add it to the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"new_bottom_arc = newCircularArcCurve(\"wideBottomArc\", # curve name\n [0.5, 3.0, 0.0], # center\n 1.5, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The updated plot now gives the modified, closed inner curve chain that now contains four curve segments \"Line2\", \"TopArc\", \"wiggleLine\", and \"wideBottomArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/#Regenerate-the-mesh","page":"Creating and editing curves","title":"Regenerate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.11353599999999998\n Number of nodes = 712\n Number of Edges = 1308\n Number of Elements = 596\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00002932 1.15661960 0.12823902 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.01050856 3.14732001 1.34260027 1.00000000 999.99900000 1.00000000\n Condition 1.00037771 2.59434067 1.22850175 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.02744717 3.68828437 1.64751502 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001750 1.13149451 0.09443920 0.00000000 999.99900000 1.00000000\n Minimum Angle 31.87236189 89.33988565 67.86178629 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.44177106 157.27121105 114.35699650 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: zoom_corner)","category":"page"},{"location":"tutorials/create_edit_curves/#Summary","page":"Creating and editing curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"# Interactive mesh with modified outer and inner curve chains\n#\n# Create inner / outer boundary chains composed of the four\n# available HOHQMesh curve types.\n#\n# Keywords: outer boundary, inner boundary, parametric equations,\n# circle arcs, cubic spline, curve removal\nusing HOHQMesh\n\n# Instantiate the project\nsandbox_project = newProject(\"sandbox\", \"out\")\n\n# Add the background grid\naddBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])\n\n# Create and add the original outer boundary curves\nouter_line1 = newEndPointsLineCurve(\"Line1\", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])\nouter_line2 = newEndPointsLineCurve(\"Line2\", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])\nouter_arc = newCircularArcCurve(\"Arc\", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, \"degrees\")\n\naddCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)\n\n# Modify the outer boundary to have a spline instead of a straight line\nremoveOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")\n\nspline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)\naddCurveToOuterBoundary!(sandbox_project, outer_spline)\n\n# Create and add the inner boundary curves\ninner_line1 = newEndPointsLineCurve(\"Line1\", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])\ninner_line2 = newEndPointsLineCurve(\"Line2\", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])\ninner_bottom_arc = newCircularArcCurve(\"BottomArc\", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, \"radians\")\ninner_top_arc = newCircularArcCurve(\"TopArc\", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, \"degrees\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")\n\n# Generate a mesh\ngenerate_mesh(sandbox_project)\n\n# Delete the existing mesh before modifying the inner boundary curve chain\nremove_mesh!(sandbox_project)\n\n# Modify the inner boundary curve with an oscillatory line and a new circle arc\nremoveInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")\nremoveInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")\n\nxEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)\n\nnew_bottom_arc = newCircularArcCurve(\"wideBottomArc\", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, \"radians\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")\n\n# Regenerate the final mesh\ngenerate_mesh(sandbox_project)","category":"page"},{"location":"interactive_overview/#InteractiveTool","page":"Overview","title":"Overview","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Several scripts are available in the examples/ folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.","category":"page"},{"location":"interactive_overview/#Workflow-and-basic-moves","page":"Overview","title":"Workflow and basic moves","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"To generate a mesh interactively you","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Create a project with a user given projectName and folder where any generated files are to be saved\np = newProject(, )\nBoth of these input arguments are strings.\nCreate inner and outer boundary curves from the available types\nc = newEndPointsLineCurve(, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*\nc = newCircularArcCurve(, center [x, y, z], radius, startAngle, endAngle, units = \"degrees\" or \"radians\") *Circular Arc*\nc = newParametricEquationCurve(, xEqn, yEqn, zEqn) *Parametric equation*\nc = newSplineCurve(, dataFile) *Spline with data from a file*\nc = newSpline(, nKnots, knotsMatrix) *Spline with given knot values*\nSee Defining curves for further details on the different curve type currently supported by HOHQMesh.\nThe generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.\nAdd curves to build the model to see what you have added,\naddOuterBoundaryCurve!(p, ) *Add outer boundary curve*\naddInnerBoundaryCurve!(p, , ) *Add curve to an inner boundary*\nFor a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.\nCurves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.\nVisualize the project's model, if desired\nplotProject!(p, MODEL)\nPlots are updated in response to user interactions. However, to update the plot at any time, use\nupdatePlot!(p, options)\nOptions are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.\nnote: Visualization requirement\nThe interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.\nSet the background grid\nWhen no outer boundary curve is present, the background grid can be set with\naddBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])\nOr\naddBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])\nThe first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.\nWhen an outer boundary is present the background grid can be set as\naddBackgroundGrid!(p, [dx, dy, dz])\nwhere the spacing controls the number of elements in each direction.\nnote: Background grid\nA background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.\nAdjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by\nsetPolynomialOrder!(p, order)\nThe background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately\nsetBackgroundGridSize!(p, 0.5, 0.25)\nSee Controlling the mesh generation for details on adjusting parameters already present in the Project.\nGenerate the mesh\ngenerate_mesh(p)\nThe mesh file will be saved in with the name .mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name .control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.","category":"page"},{"location":"interactive_overview/#Advanced","page":"Overview","title":"Advanced","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.","category":"page"},{"location":"testing/#Testing","page":"Testing","title":"Testing","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In HOHQMesh and its related repositories, tests are triggered by","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"each git push to main and\neach git push to any pull request.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test and coverage requirements\nBefore merging a pull request (PR) to main, we require thatthe code passes all functional tests\ncode coverage does not decrease.","category":"page"},{"location":"testing/#Testing-setup","page":"Testing","title":"Testing setup","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> using Pkg; Pkg.test(\"HOHQMesh\")","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> # Run all test for the interactive Curve API\n include(joinpath(\"test\", \"test_curve.jl\"))","category":"page"},{"location":"testing/#Adding-new-tests","page":"Testing","title":"Adding new tests","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test duration\nAs a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).","category":"page"},{"location":"testing/#Test-coverage","page":"Testing","title":"Test coverage","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered \"covered\" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The \"Details\" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Coverage requirements\nIn general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.","category":"page"},{"location":"authors/#Authors","page":"Authors","title":"Authors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.","category":"page"},{"location":"authors/#Principal-Developers","page":"Authors","title":"Principal Developers","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"David A. Kopriva, Florida State University, USA\nAndrew Winters, Linköping University, Sweden","category":"page"},{"location":"authors/#Contributors","page":"Authors","title":"Contributors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"The following people contributed major additions or modifications to HOHQMesh and are listed in alphabetical order:","category":"page"},{"location":"authors/","page":"Authors","title":"Authors","text":"David Kopriva\nHendrik Ranocha\nMichael Schlottke-Lakemper\nAndrew Winters","category":"page"},{"location":"reference/#HOHQMesh.jl-API","page":"Reference","title":"HOHQMesh.jl API","text":"","category":"section"},{"location":"reference/","page":"Reference","title":"Reference","text":"CurrentModule = HOHQMesh","category":"page"},{"location":"reference/","page":"Reference","title":"Reference","text":"Modules = [HOHQMesh]","category":"page"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary named boundaryName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, obj::Dict{String,Any})\n\nAdd a curve to the outer boundary or a refinement reion to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}, Array{Float64}, Array{Int64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})\n\nAdd the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version\n\naddBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nis a lot easier to use.\n\nTODO: Change HOHQMesh and delete this way to specify the domain and use the bounding box one instead.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}, Array{Int64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nAdd the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid(proj::Project, bgSize::Array{Float64})\n\nAdd the background grid block with the grid size to be a 3-vector. Use this when there is an outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, dict::Dict{String,Any})\n\nUsed only for undo/redo.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToInnerBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.addCurveToInnerBoundary!","text":"addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary with name boundaryName. If an inner boundary of that name does not exist, one is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addCurveToOuterBoundary!","text":"addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})\n\nAdd a curve to the outer boundary. The curves must be added in order counter-clockwise\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addInnerBoundaryWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.addInnerBoundaryWithName!","text":"addInnerBoundaryWithName!(proj::Project,name::String)\n\nCreate a new empty inner boundary with the given name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addObserver-Tuple{Any, String, Any}","page":"Reference","title":"HOHQMesh.addObserver","text":"addObserver(observer::Any, note::String, f::Any)\n\nf is the function to be executed (called) when a notification of name note is given.\n\nThe function called upon notification must have the signature f(observer, sender, args...)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addOuterBoundary!","text":"addOuterBoundary!(proj::Project, outerBoundary::Dict{String,Any})\n\nAdd an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegion!","text":"addRefinementRegion!(proj::Project,r::Dict{String,Any})\n\nAdd the refinement region to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegionPoints!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegionPoints!","text":"addRefinementRegionPoints!(proj::Project, r::Dict{String,Any})\n\nCompute and add to the project the plotting points for the refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRunParameters!","page":"Reference","title":"HOHQMesh.addRunParameters!","text":"addRunParameters!(proj::Project,\n plotFormat::String = \"skeleton\",\n meshFileFormat::String = \"ISM-V2\",\n polynomialOrder::Int = 5)\n\nAdd a RUN_PARAMETERS block and set all the parameters in one call.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.addSpringSmoother!","page":"Reference","title":"HOHQMesh.addSpringSmoother!","text":"addSpringSmoother!(status::String, type::String, nIterations::Int)\n\nStatus is either ON or OFF Type is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.bboxUnion-Tuple{Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.bboxUnion","text":"bboxUnion(box1::Array{Float64}, box2::Array{Float64})\n\nReturns the union of two bounding boxes\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.curveBounds-Tuple{Matrix{Float64}}","page":"Reference","title":"HOHQMesh.curveBounds","text":"curveBounds(crvPoints::Array{Float64,2})\n\nFind the bounds of a single curve, discretized as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.emptyBounds-Tuple{}","page":"Reference","title":"HOHQMesh.emptyBounds","text":"emptyBounds()\n\nReturns an array that will always be ignored when unioned with another bounding box.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.examples_dir-Tuple{}","page":"Reference","title":"HOHQMesh.examples_dir","text":"examples_dir()\n\nReturn the path to the directory with some example mesh setups.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.extract_mesh_file_format-Tuple{Any}","page":"Reference","title":"HOHQMesh.extract_mesh_file_format","text":"extract_mesh_file_format(control_file)\n\nReturn a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{Any}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(control_file;\n output_directory=\"out\",\n mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing,\n verbose=false)\n\nGenerate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.\n\nYou can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.\n\nYou can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(proj::Project)\n\nGenerate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.\n\nThis function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getAllRefinementRegions-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getAllRefinementRegions","text":"getAllRefinementRegions(proj::Project)\n\nGet the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcCenter","text":"getArcCenter(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the center of a circular arc as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcEndAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcEndAngle","text":"getArcEndAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcRadius-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcRadius","text":"getArcRadius(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcStartAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcStartAngle","text":"getArcStartAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcUnits-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcUnits","text":"getArcUnits(crv::Dict{String,Any}, units::String)\n\nGet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridLowerLeft-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridLowerLeft","text":"getBackgroundGridLowerLeft(proj::Project)\n\nReturns the [x,y] of the lower left point of the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSize-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSize","text":"getBackgroundGridSize(proj::Project)\n\nReturns the background grid size array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSteps-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSteps","text":"getBackgroundGridSteps(proj::Project)\n\nReturns the [Nx,Ny,Nz] for the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String, boundaryName::String)\n\nGet the curve named curveName from the inner boundary named boundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String)\n\nGet the curve with name curveName from the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveName","text":"getCurveName(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveType","text":"getCurveType(crv::Dic{String,Any})\n\nGet the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,\n`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getEndPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getEndPoint","text":"getEndPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the end point for a line curve as an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundary-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundary","text":"getInnerBoundary(proj::Project, name::String)\n\nGet the chain of curves from the inner boundary with name name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryChainWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryChainWithName","text":"getInnerBoundaryWithName(proj::Project, name::String)\n\nGet the inner boundary CHAIN with the given name. If one does not exist, it is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryCurve","text":"\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getMeshFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getMeshFileFormat","text":"getMeshFileFormat(proj::Project)\n\nReturns the format in which the mesh will be written.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getName-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getName","text":"getName(proj::Project)\n\nReturns the filename to be used by the mesh, plot, control, and stats files.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryChainList-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getOuterBoundaryChainList","text":"getOuterBoundaryChainList(proj::Project)\n\nGet the array of outer boundary curves.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryCurveWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getOuterBoundaryCurveWithName","text":"getOuterBoundaryCurveWithName(proj::Project, name::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPlotFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPlotFileFormat","text":"getPlotFileFormat(proj::Project)\n\nReturns the plot file format.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPolynomialOrder-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPolynomialOrder","text":"getPolynomialOrder(proj::Project)\n\nReturns the polynomial order for boundary curves in the mesh file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementEnd-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementEnd","text":"getRefinementEnd(r::Dict{String,Any})\n\nReturn Array{Float64} of the end location of the refinement line\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementGridSize-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementGridSize","text":"getRefinementGridSize(r::Dict{String,Any})\n\nReturns the grid size,h, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementLocation-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementLocation","text":"getRefinementLocation(r::Dict{String,Any})\n\nReturn Array{Float64} of the location of the refinement center.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementName","text":"getRefinementName(r::Dict{String,Any})\n\nReturn name of the refinement. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"getRefinementRegion(proj::Project, indx)\n\nGet the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"(i,r) = getRefinementRegion(project, name)\n\nGet the refinement region with the given name and its location in the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegionCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementRegionCenter","text":"getRefinementRegionCenter(r::Dict{String,Any})\n\nGet, or compute, the center of the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementStart-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementStart","text":"getRefinementStart (r::Dict{String,Any})\n\nReturn Array{Float64} of the start location of the refinement line. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementType","text":"getRefinementType(r::Dict{String,Any})\n\nReturn the type of refinement, either \"smooth\" or \"sharp\". r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementWidth-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementWidth","text":"getRefinementWidth(r::Dict{String,Any})\n\nReturns the region width,w, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingIterations-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingIterations","text":"getSmoothingIterations(proj::Project)\n\nGet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingStatus-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingStatus","text":"smoothingStatus(proj::Project)\n\nReturns whether the smoother will be \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingType-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingType","text":"getSmoothingType(proj::Project)\n\nReturns either \"LinearSpring\" or \"LinearAndCrossbarSpring\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplineNKnots-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplineNKnots","text":"getSplineNKnots(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplinePoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplinePoints","text":"getSplinePoints(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getStartPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getStartPoint","text":"getStartPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the start point for a line curve as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getXEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getXEqn","text":"getXEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getYEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getYEqn","text":"getYEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getZEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getZEqn","text":"getZEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.hasBackgroundGrid-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.hasBackgroundGrid","text":"hasBackgroundGrid(proj::Project)\n\nTests to see if the project has a backgroundGrid dictionary defined.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.innerBoundaryIndices-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.innerBoundaryIndices","text":"innerBoundaryIndices(proj::Project, curveName::String)\n\nReturns (curveIndex,chainIndex) for the location of the curve named curveName in it's inner boundary chain.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryAtIndex!-Tuple{HOHQMesh.Project, String, Int64, Dict{String, Any}, Vector{Any}, Vector{String}}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryAtIndex!","text":"insertInnerBoundaryAtIndex!(proj::Project, chainName::String, indx::Int, chain::??)\n\nInsert an entire inner boundary. Primarily meant for undo operation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64, String}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryCurveAtIndex!","text":"insertInnerBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any},\n indx::Int, boundaryName::String)\n\nInsert a curve crv into an inner boundary chain boundaryName at the specified index indx.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertOuterBoundaryCurveAtIndex!","text":"insertOuterBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any}, indx::Int)\n\nInsert a curve into the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertRefinementRegion!","text":"insertRefinementRegion!(proj::Project, r::Dict{String,Any}, indx::Int)\n\nUsed by undo()\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelChainIsOK-Tuple{Vector{Dict{String, Any}}, String}","page":"Reference","title":"HOHQMesh.modelChainIsOK","text":"modelChainIsOK(chain::Vector{Dict{String, Any}}, chainName::String)\n\nReturns true if the chain of curves is contiguous and closed; false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelCurvesAreOK-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.modelCurvesAreOK","text":"modelCurvesAreOK(proj::Project)\n\nGo through all curves in the model and make sure they are connected and closed. Also, remove any empty outer / inner boundary chains.\n\nReturns true if all curves are connected and closed, false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreate a new parametric equation curve.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-2","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)\n\nCreate a new circular arc.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-Tuple{String, Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})\n\nCreate a new line defined by its end points.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, nKnots::Int, data::Matrix{Float64})\n\nCreate a spline curve from an array of knots\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, String}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, dataFile::String)\n\nCreate a spline curve from the contents of a data file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newCircularArcCurve","page":"Reference","title":"HOHQMesh.newCircularArcCurve","text":"newCircularArcCurve(name::String, center::Array{Float64},\n startAngle::Float64, endAngle::Float64,\n units::String)\n\nCreates and returns a new circular arc curve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newEndPointsLineCurve-Tuple{String, Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.newEndPointsLineCurve","text":"newEndPointsLineCurve(name::String, xStart::Array{Float64},xEnd::Array[Float64])\n\nCreates and returns a new curve defined by its end points in the form of a Dictionary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newParametricEquationCurve","page":"Reference","title":"HOHQMesh.newParametricEquationCurve","text":"newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreates and returns a new parametricEquationCurve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newProject","text":"newProject(name::String, folder::String)\n\nCreate a new project with the given name. That name will be used for the mesh and plot files in the specified folder.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementCenter-Tuple{String, String, Array{Float64}, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementCenter","text":"newRefinementCenter(name, type,\n center, meshSize,\n width)\n\nCreate refinement center of type \"smooth\" or \"sharp\" centered at center = [x,y,z] with a mesh size meshSize spread over a radius width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementLine-Tuple{String, String, Array{Float64}, Array{Float64}, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementLine","text":"newRefinementLine(name, type,\n start, end,\n meshSize,\n width)\n\nCreate refinement line of type \"smooth\" or \"sharp\" between start = [x,y,z] and end = [x,y,z] with a mesh size meshSize spread over a width width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, nKnots::Int, data::Array{Float64,4})\n\nReturns a spline curve given the number of knots and the array of knots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, dataFile::String)\n\nReturns a spline curve given a data file that contains the number of knots on the first line, and the spline data following that.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.openProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.openProject","text":"openProject(fileName::String, folder::String)\n\nOpen existing project described in the control File.\n\nfolder = folder the control file is in\nfileName = the name of the file\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.plotProject!","page":"Reference","title":"HOHQMesh.plotProject!","text":"plotProject!(proj::Project, plotOptions::Int = 0)\n\nPlot objects specified by the plotOptions. Construct the plotOptions by the sum of what is to be drawn from the choices MODEL, GRID, MESH, REFINEMENTS.\n\nExample: To plot the model and the grid, plotOptions = MODEL + GRID. To plot just the mesh, plotOptions = MESH.\n\nTo plot everything, plotOptions = MODEL + GRID + MESH + REFINEMENTS\n\nContents are overlaid in the order: GRID, MESH, MODEL, REFINEMENTS\n\nnote: Requires Makie.jl\nPlease note that for this function to work, you need to load Makie.jl in your REPL (e.g., by calling using GLMakie).\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.postNotificationWithName-Tuple{Any, String, Tuple}","page":"Reference","title":"HOHQMesh.postNotificationWithName","text":"postNotificationWithName(sender::Any, name::String, userInfo::Tuple)\n\nExecutes the function associated with the observer for the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.refinementRegionPoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.refinementRegionPoints","text":"refinementRegionPoints(r::Dict{String,Any})\n\nReturns Array{Float64,2} being the plotting points of a refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String, innerBoundaryName::String)\n\nDelete the curve named curveName from the inner boundary named innerBoundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String)\n\nDelete the curve named curveName from the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeBackgroundGrid!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeBackgroundGrid!","text":"removeBackgroundGrid!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundary!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundary!","text":"removeInnerBoundary!(proj::Project, chainName::String)\n\nRemove an entire inner boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurve!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurve!","text":"removeInnerBoundaryCurve!(proj::Project, name::String, chainName::String)\n\nRemove the curve with name from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurveAtIndex!","text":"removeInnerBoundaryCurveAtIndex!(proj::Project, indx::Int, chainName::String)\n\nRemove the curve at index indx from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundary!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeOuterBoundary!","text":"removeOuterBoundary!(proj::Project)\n\nRemove the outer boundary curve if it exists.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveAtIndex!","text":"removeOuterBoundaryCurveAtIndex!(proj::Project, indx::Int)\n\nRemove a curve from the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveWithName!","text":"removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n\nRemove the named curve in the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRefinementRegion!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeRefinementRegion!","text":"removeRefinementRegion!(proj::Project, name::String)\n\nDelete the named refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRunParameters!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeRunParameters!","text":"removeRunParameters!(proj::Project)\n\nRemove the run parameters block from the project. This is not undo-able.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeSpringSmoother!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeSpringSmoother!","text":"removeSpringSmoother!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove_mesh!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.remove_mesh!","text":"remove_mesh!(proj::Project)\n\nRemove the mesh file from proj.projectDirectory and delete the mesh from the plot\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.saveProject-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.saveProject","text":"saveProject(proj::Project)\n\nproj = Project to be saved\n\nSave a project dictionary to the file path specified when the project was created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcCenter!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setArcCenter!","text":"setArcCenter!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the center of a circular arc.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcEndAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcEndAngle!","text":"setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcRadius!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcRadius!","text":"setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcStartAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcStartAngle!","text":"setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcUnits!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setArcUnits!","text":"setArcUnits(crv::Dict{String,Any}, units::String)\n\nSet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridLowerLeft!-Tuple{HOHQMesh.Project, Array{Float64}}","page":"Reference","title":"HOHQMesh.setBackgroundGridLowerLeft!","text":"setBackgroundGridLowerLeft!(proj::Project, x0::Array{Float64})\n\nSet the lower left location of the background grid for problems that have no outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSpacing!(proj::Project, dx::Float64, dy::Float64, dz::Float64 = 0.0)\n\nUser facing function\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Array{Float64}, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Array{Float64}, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, dx is passed an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Float64, Float64, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Float64, dy::Float64, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, the new grid size in either direction is passed individually with dxand dy.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSteps!-Tuple{HOHQMesh.Project, Array{Int64}}","page":"Reference","title":"HOHQMesh.setBackgroundGridSteps!","text":"setBackgroundGridSteps!(proj::Project, N::Array{Int})\n\nSet how many steps of size setBackgroundGridSpacing in each direction the background grid extends from the lower left.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setCurveName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setCurveName!","text":"setCurveName!(curveDict, name)\n\nSet the name of the curve represented by curveDict.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setEndPoint!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setEndPoint!","text":"setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the end point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setMeshFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setMeshFileFormat!","text":"setMeshFileFormat(proj::Project, meshFileFormat::String)\n\nSet the file format for the mesh file. Acceptable choices are \"ISM\", \"ISM-V2\", or \"ABAQUS\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setName!","text":"setName(proj::Project,name::String)\n\nThe name of the project is the filename to be used by the mesh, plot, and stats files. It is also the name of the control file the tool will produce.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPlotFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setPlotFileFormat!","text":"setPlotFileFormat(proj::Project, plotFileFormat::String)\n\nSet the file format for the plot file. Acceptable choices are \"sem\", which includes interior nodes and boundary nodes and \"skeleton\", which includes only the corner nodes.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPolynomialOrder!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setPolynomialOrder!","text":"setPolynomialOrder(proj::Project, p::Int)\n\nSet the polynomial order for boundary curves in the mesh file to p.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementEnd!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementEnd!","text":"setRefinementEnd!(refinementRegion, location)\n\nSet the end point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementGridSize!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementGridSize!","text":"setRefinementGridSize!(r::Dict{String,Any}, h)\n\nSet the grid size, h for the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementLocation!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementLocation!","text":"setRefinementLocation!(refinementCenter, location)\n\nSet the location of a refinement center to location = [x,y,z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementName!","text":"setRefinementName!(r::Dict{String,Any}, type)\n\nSet a name for the refinement region.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementStart!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementStart!","text":"setRefinementStart!(refinementRegion, location)\n\nSet the start point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementType!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementType!","text":"setRefinementType!(refinementRegion, type)\n\nSet the type, either \"smooth\" or \"sharp\" for the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementWidth!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementWidth!","text":"setRefinementWidth!(r::Dict{String,Any}, width)\n\nSet the width of the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingIterations!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setSmoothingIterations!","text":"setSmoothingIterations!(proj::Project, iterations::Int)\n\nSet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingStatus!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingStatus!","text":"setSmoothingStatus(proj:Project, status::String)\n\nStatus is either \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingType!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingType!","text":"setSmoothingType!(proj:Project, status::String)\n\nType is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplineNKnots!-Tuple{Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.setSplineNKnots!","text":"setSplineNKnots!(spline::Dict{String,Any}, nKnots::Int)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplinePoints!-Tuple{Dict{String, Any}, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.setSplinePoints!","text":"setSplinePoints!(spline::Dict{String,Any},points::Array{Float64,4})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setStartPoint!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setStartPoint!","text":"setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the start point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setXEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setXEqn!","text":"setXEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the x-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setYEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setYEqn!","text":"setYEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the y-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setZEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setZEqn!","text":"setZEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the zEqn-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.unRegisterForNotification-Tuple{Any, String}","page":"Reference","title":"HOHQMesh.unRegisterForNotification","text":"unRegisterForNotification(observer::Any, note::String)\n\nRemove the observer from being notified by the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.updatePlot!","page":"Reference","title":"HOHQMesh.updatePlot!","text":"updatePlot!(proj::Project, plotOptions::Int)\n\nReplot with the new plotOptions = combinations (sums) of\n\nGRID, MESH, MODEL, REFINEMENTS\n\nExample: updatePlot!(p, MESH + MODEL)\n\nnote: Requires Makie.jl\nPlease note that for this function to work, you need to load Makie.jl in your REPL (e.g., by calling using GLMakie).\n\n\n\n\n\n","category":"function"},{"location":"tutorials/spline_curves/#Spline-curves","page":"Spline curves","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line \"curves\". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.","category":"page"},{"location":"tutorials/spline_curves/#Synopsis","page":"Spline curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/spline_curves/#Initialization","page":"Spline curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a new project with the name \"spline_curves\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_project = newProject(\"spline_curves\", \"out\")","category":"page"},{"location":"tutorials/spline_curves/#Add-the-outer-boundary","page":"Spline curves","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The outer boundary curve for this tutorial is a circle of radius r=4 centered at the point (0 -1). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"circ = newCircularArcCurve(\"outerCircle\", # curve name\n [0.0, -1.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circ is assigned to be \"outerCircle\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new circ curve is then added to the spline_project as an outer boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToOuterBoundary!(spline_project, circ)","category":"page"},{"location":"tutorials/spline_curves/#Add-a-background-grid","page":"Spline curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for spline_project to have elements with side length 06 in each direction","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addBackgroundGrid!(spline_project, [0.6, 0.6, 0.0])","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"plotProject!(spline_project, MODEL+GRID)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"outerCircle\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/spline_curves/#Add-the-inner-boundaries","page":"Spline curves","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The domain of this tutorial will contain three inner boundary curves:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Cubic spline curve created from data points read in from a file.\nCubic spline curve created from points directly given in the code.\nTriangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-with-data-from-a-file","page":"Spline curves","title":"Cubic spline with data from a file","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots t_j, x_j, y_j, z_j where j indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a parametric spline curve from a file with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline1 = newSplineCurve(\"big_spline\", joinpath(@__DIR__, \"examples\", \"test_spline_curve_data.txt\"))","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline1 is assigned to be \"big_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline1 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline1, \"inner1\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve \"big_spline\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: one_curve)","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-from-data-in-Julia","page":"Spline curves","title":"Cubic spline from data in Julia","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Below, we construct another parametric spline using this strategy that consists of five data points","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n\nspline2 = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline2 is assigned to be \"small_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline2 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline2, \"inner2\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner2\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve \"small_spline\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: two_curves)","category":"page"},{"location":"tutorials/spline_curves/#Triangular-shape","page":"Spline curves","title":"Triangular shape","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"edge1 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.3, -1.0, 0.0], # start point\n [-1.7, -1.0, 0.0]) # end point\n\nedge2 = newEndPointsLineCurve(\"triangle\", # curve name\n [-1.7, -1.0, 0.0], # start point\n [-2.0, -0.4, 0.0]) # end point\n\nedge3 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.0, -0.4, 0.0], # start point\n [-2.3, -1.0, 0.0]) # end point","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, each edge of the curve is given the same name \"triangle\" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, edge1, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge2, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge3, \"inner3\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The inner boundary chain name \"inner3\" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called \"triangle\" labeled in the figure by 3.1, 3.2, and 3.3.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: three_curves)","category":"page"},{"location":"tutorials/spline_curves/#Generate-the-mesh","page":"Spline curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_curves.control: A HOHQMesh control file for the current project.\nspline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nspline_curves.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"generate_mesh(spline_project)\n 1 chevron elements removed from mesh.\n 1 chevron elements removed from mesh.\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.25359100000000001\n Number of nodes = 1176\n Number of Edges = 2225\n Number of Elements = 1047\n Number of Subdivisions = 4\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00006209 0.15607019 0.04505180 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00008965 2.78091496 1.23178864 1.00000000 999.99900000 1.00000000\n Condition 1.00000055 3.82171291 1.15535543 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00014261 6.78201663 1.46249737 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001491 0.10424647 0.03955817 0.00000000 999.99900000 1.00000000\n Minimum Angle 37.24189766 89.96174556 74.42003031 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.03128071 157.35065162 107.91806148 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of \"bad\" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: final_spline)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the \"big_spline\" curve. We decide that we are satisfied with the overall mesh quality.","category":"page"},{"location":"tutorials/spline_curves/#Summary","page":"Spline curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#Tutorials","page":"Overview","title":"Tutorials for HOHQMesh.jl","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"The tutorial section for HOHQMesh.jl provides step-by-step commands and accompanying explanations for the major features of the interactive mesh generation tools.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.","category":"page"},{"location":"tutorials/introduction/#[Straight-sided-outer-boundary](@ref)","page":"Overview","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.","category":"page"},{"location":"tutorials/introduction/#Synopsis","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/introduction/#[Curved-outer-boundary](@ref)","page":"Overview","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.","category":"page"},{"location":"tutorials/introduction/#Synopsis-2","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/introduction/#[Spline-curves](@ref)","page":"Overview","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/introduction/#Synopsis-3","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#[Creating-and-editing-curves](@ref)","page":"Overview","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve \"chain\" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.","category":"page"},{"location":"tutorials/introduction/#Synopsis-4","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"guided-tour/#Guided-tour","page":"Guided tour","title":"Guided tour","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In this brief overview, we highlight two scripts from the examples/ folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"See the HOHQMesh documentation for more details about its terminology and capabilities.","category":"page"},{"location":"guided-tour/#Mesh-from-a-control-file","page":"Guided tour","title":"Mesh from a control file","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_from_control_file.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"This command will create mesh and plot files in the out directory.","category":"page"},{"location":"guided-tour/#Build-a-mesh-from-scratch","page":"Guided tour","title":"Build a mesh from scratch","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_boundary.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For completeness, we provide the example script and walk-through each step in the construction of the Project below.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"using HOHQMesh\n\n# Create a new project with the name \"IceCreamCone\", which will also be the\n# name of the mesh, plot and stats files, written to output folder `out`.\n\np = newProject(\"IceCreamCone\", \"out\")\n\n# Outer boundary for this example mesh is a complete circle. Add it into the project.\n\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\n\n# Inner boundary is three curves. Two straight lines and a circular arc.\n# Note the three curve are connected to ensure a counter-clockwise orientation\n# as required by HOHQMesh\n\n# Create the three interior curves. The individual names of each curve in the inner\n# chain are used internally by HOHQMesh and are output as the given boundary names in\n# the mesh file.\n\ncone1 = newEndPointsLineCurve(\"cone1\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\niceCream = newCircularArcCurve(\"iceCream\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")\ncone2 = newEndPointsLineCurve(\"cone2\", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])\n\n# Assemble the three curve in a closed chain oriented counter-clockwise. The chain\n# name `IceCreamCone` is only used internally by HOHQMesh.\n\naddCurveToInnerBoundary!(p, cone1, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, iceCream, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, cone2, \"IceCreamCone\")\n\n# Adjust some `RunParameters` and overwrite the defaults values. In this case, we\n# set a new value for the boundary order polynomial representation and adjust the\n# output mesh file format to be `sem`\n\nsetPolynomialOrder!(p, 4)\nsetPlotFileFormat!(p, \"sem\")\n\n# A background grid is required for the mesh generation. In this example we lay a\n# background grid of Cartesian boxes with size 0.5.\n\naddBackgroundGrid!(p, [0.5, 0.5, 0.0])\n\n# Plot the project model curves and background grid\n\nif isdefined(Main, :Makie)\n plotProject!(p, MODEL+GRID)\n @info \"Press enter to generate the mesh and update the plot.\"\n readline()\n else # Throw an informational message about plotting to the user\n @info \"To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again.\"\n end\n\n# Generate the mesh. This produces the mesh and TecPlot files `IceCreamCone.mesh` and `IceCreamCone.tec`\n# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is\n# updated with the mesh that was generated.\n\ngenerate_mesh(p)\n\n# After the mesh successfully generates mesh statistics, such as the number of corner nodes,\n# the number of elements etc., are printed to the REPL","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The first line creates a new project, where the mesh and plot file names will be derived from the project name, \"IceCreamCone\" written to the specified folder.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, \"IceCreamCone\" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script resets the polynomial order (default = 5) and the plot file format (default = \"skeleton\").","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, only the mesh size needs to be specified using","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"addBackgroundGrid!(proj::Project, bgSize::Array{Float64})","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The example sets the background mesh size to be 0.5 in the x and y directions. The z component is ignored.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The script finishes by generating the quad mesh and plotting the results, as shown below","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"(Image: iceCreamCone)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Finally, the script returns the project so that it can be edited further, if desired.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To save a control file for HOHQMesh, simply invoke","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"saveProject(proj::Project)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"where the name of the control file (traditionally with a .control extension) matches the name of the project proj. saveProject is automatically called when a mesh is generated.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.","category":"page"},{"location":"license/#License","page":"License","title":"License","text":"","category":"section"},{"location":"license/","page":"License","title":"License","text":"MIT LicenseCopyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-LakemperPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"CheatSheet/#Commands-Cheat-Sheet","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples/ folder constructs an identical example mesh as shown in the Guided tour using generic function calls.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"A thorough description of the functions can be found in the API section.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The general workflow of the interactive mesh functionality within a REPL session is","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Create a project\nAdd boundary curves\nAdd a background grid\nAdd manual refinement (if desired)\nGenerate mesh","category":"page"},{"location":"CheatSheet/#Project","page":"Commands Cheat Sheet","title":"Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" p = newProject(, )","category":"page"},{"location":"CheatSheet/#cs-plotting","page":"Commands Cheat Sheet","title":"Plotting","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" plotProject!(p, options)\n updatePlot!(p, options)","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The options are any sum of MODEL, GRID, REFINEMENTS, and MESH.","category":"page"},{"location":"CheatSheet/#Curves","page":"Commands Cheat Sheet","title":"Curves","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" c = new(name, startLocation [x,y,z], endLocation [x,y,z]) *Straight Line*\n c = new(name, center [x,y,z], radius, startAngle, endAngle) *Circular Arc*\n c = new(name, xEqn, yEqn, zEqn) *Parametric equation*\n c = new(name, dataFile) *Spline with data from a file*\n c = new(name, nKnots, knotsMatrix) *Spline with given knot values*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#cs-manual-refinement","page":"Commands Cheat Sheet","title":"Manual Refinement","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" r = newRefinementCenter(name, type, center, gridSize, radius)\n r = newRefinementLine(name, type, startPoint, endPoint, gridSize, width)","category":"page"},{"location":"CheatSheet/#Adding-to-a-Project","page":"Commands Cheat Sheet","title":"Adding to a Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" add!(p, c) *Add outer boundary curve*\n add!(p, c, ) *Add curve to an inner boundary*\n add!(p, r) *Add refinement region*\n\n addBackgroundGrid!(p, [top, left, bottom, right], [nX, nY, nZ]) *No outer boundary*\n addBackgroundGrid!(p, [dx, dy, dz]) *If an outer boundary is present*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function add!, which is a shortcut to the full functions, e.g. addOuterBoundaryCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#Accessing-items","page":"Commands Cheat Sheet","title":"Accessing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" crv = getCurve(p, curveName) *Get a curve in the outer boundary*\n crv = getCurve(p, curveName, boundaryName) *Get a curve in an inner boundary*\n indx, chain = getChain(p, boundaryName) *Get a complete inner boundary curve*\n r = getRefinementRegion(p, name)","category":"page"},{"location":"CheatSheet/#Removing-from-Project","page":"Commands Cheat Sheet","title":"Removing from Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" removeOuterBoundary!(p) *Entire outer boundary curve*\n removeInnerBoundary!(p, innerBoundaryName) *Entire inner boundary curve*\n remove!(p, name) *Curve in outer boundary*\n remove!(p, name, innerBoundaryName) *Curve in inner boundary*\n removeRefinementRegion!(p, name)","category":"page"},{"location":"CheatSheet/#Editing-items","page":"Commands Cheat Sheet","title":"Editing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.","category":"page"},{"location":"CheatSheet/#Meshing","page":"Commands Cheat Sheet","title":"Meshing","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" generate_mesh(p)\n remove_mesh!(p)","category":"page"},{"location":"#HOHQMesh.jl","page":"Home","title":"HOHQMesh.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6 and above.","category":"page"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> import Pkg; Pkg.add(\"HOHQMesh\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the Julia REPL, you can load HOHQMesh with","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using HOHQMesh","category":"page"},{"location":"","page":"Home","title":"Home","text":"and then happily generate away!","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> control_file = joinpath(HOHQMesh.examples_dir(), \"GingerbreadMan.control\")\n\njulia> output = generate_mesh(control_file)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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,","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: gingerbreadman_with_edges_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"while the 3D file Snake.control produces this mesh:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: snake_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.,","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_box_two_circles.jl\"))","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using Pkg; Pkg.add(\"GLMakie\")\njulia> using GLMakie","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: box_two_circles)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Further explanation of the interactive functionality can be found here. Additional examples are available in the Tutorials.","category":"page"},{"location":"#authors-index-md","page":"Home","title":"Authors","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#License-and-contributing","page":"Home","title":"License and contributing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Acknowledgements","page":"Home","title":"Acknowledgements","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"}]
+}
diff --git a/v0.2.4/siteinfo.js b/v0.2.4/siteinfo.js
new file mode 100644
index 00000000..65d676e5
--- /dev/null
+++ b/v0.2.4/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.2.4";
diff --git a/v0.2.4/testing/index.html b/v0.2.4/testing/index.html
new file mode 100644
index 00000000..a12dbc5b
--- /dev/null
+++ b/v0.2.4/testing/index.html
@@ -0,0 +1,3 @@
+
+Testing · HOHQMesh.jl
During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In HOHQMesh and its related repositories, tests are triggered by
each git push to main and
each git push to any pull request.
Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.
Test and coverage requirements
Before merging a pull request (PR) to main, we require that
The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing
julia> using Pkg; Pkg.test("HOHQMesh")
in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,
julia> # Run all test for the interactive Curve API
+ include(joinpath("test", "test_curve.jl"))
We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.
Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.
When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).
Test duration
As a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).
In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered "covered" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The "Details" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.
Coverage requirements
In general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.
Settings
This document was generated with Documenter.jl version 0.27.25 on Wednesday 10 April 2024. Using Julia version 1.10.2.
diff --git a/v0.2.4/tutorials/create_edit_curves/index.html b/v0.2.4/tutorials/create_edit_curves/index.html
new file mode 100644
index 00000000..510c8516
--- /dev/null
+++ b/v0.2.4/tutorials/create_edit_curves/index.html
@@ -0,0 +1,166 @@
+
+Creating and editing curves · HOHQMesh.jl
The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a "chain" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "sandbox" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.
We first create the outer boundary curve chain that is composed of three pieces
Straight line segment from $(0, -7)$ to $(5, 3)$.
Half-circle arc of radius $r=5$ centered at $(0, 3)$.
Straight line segment from $(-5, 3)$ to $(0, -7)$.
Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
outer_line1 = newEndPointsLineCurve("Line1", # curve name
+ [0.0, -7.0, 0.0], # start point
+ [5.0, 3.0, 0.0]) # end point
+
+outer_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-5.0, 3.0, 0.0], # start point
+ [0.0, -7.0, 0.0]) # end point
To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from $0$ to $180$ degrees.
outer_arc = newCircularArcCurve("Arc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 5.0, # radius
+ 0.0, # start angle
+ 180.0, # end angle
+ "degrees") # units for angle
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be "Arc".
The curve names "Line1", "Line2", and "Arc" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.
The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction
We visualize the outer boundary curve chain and background grid with the following
plotProject!(sandbox_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains three curve segments "Line1", "Arc", and "Line2" labeled in the figure by O.1, O.2, and O.3, respectively.
Suppose that the domain boundary requires a curved segment instead of the straight line "Line2". We will replace this line segment in the outer boundary chain with a cubic spline.
First, we remove the "Line2" curve from the "Outer" chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
The plot automatically updates and we see that the outer boundary is open and contains two segments: "Line1" and "Arc".
Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve "Arc" and end at the first point of the curve "Line1". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. The spline curve constructor newSplineCurve also takes the number of points as an input argument.
We create a pill shaped inner boundary curve chain composed of four pieces
Straight line segment from $(1, 5)$ to $(1, 3)$.
Half-circle arc of radius $r=1$ centered at $(0, 3)$.
Straight line segment from $(-1, 3)$ to $(-1, 5)$.
Half-circle arc of radius $r=1$ centered at $(0, 5)$.
Similar to the construction of the "Outer" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
inner_line1 = newEndPointsLineCurve("Line1", # curve name
+ [1.0, 5.0, 0.0], # start point
+ [1.0, 3.0, 0.0]) # end point
+
+inner_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-1.0, 3.0, 0.0], # start point
+ [-1.0, 5.0, 0.0]) # end point
To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at $(0, 3)$ varies from $0$ to $-180$ degrees. The top half-circle arc centered at $(0, 5)$ has an angle that varies from $180$ to $0$ degrees. The construction of the two circle arcs are
inner_bottom_arc = newCircularArcCurve("BottomArc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 1.0, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+
+inner_top_arc = newCircularArcCurve("TopArc", # curve name
+ [0.0, 5.0, 0.0], # center
+ 1.0, # radius
+ 180.0, # start angle
+ 0.0, # end angle
+ "degrees") # units for angle
Note, we use "radians" to set the angle bounds for inner_bottom_arc and "degrees" for the angle bounds of inner_top_arc.
The curve names "Line1", "Line2", "BottomArc", and "TopArc" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.
The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.
This inner boundary chain name "inner" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments "Line1", "BottomArc", "Line2", and "TopArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:
sandbox.control: A HOHQMesh control file for the current project.
sandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
sandbox.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 7.5414000000000009E-002
+ Number of nodes = 511
+ Number of Edges = 933
+ Number of Elements = 422
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00002932 1.17335568 0.18813138 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00953438 2.30790024 1.31439620 1.00000000 999.99900000 1.00000000
+ Condition 1.00041663 2.41773865 1.21024584 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.01673809 3.68828437 1.59413340 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001750 1.13820387 0.14143901 0.00000000 999.99900000 1.00000000
+ Minimum Angle 32.22733574 89.35690571 68.75321248 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.61089476 152.37947944 113.36221513 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.
Additionally, the remove_mesh! command deletes the mesh information from the sandbox_project and sandbox.mesh from the out folder. However, the sandbox.control and sandbox.tec files are still present in out directory.
Suppose that the inner boundary actually requires a curved segment instead of the straight line "Line1". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.
We remove the "Line1" curve from the inner chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: "BottomArc", "Line2", and "TopArc". Note that the index of the remaining curves has changed as shown below.
Brief note about undo / redo
The interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.
undoActionName()
+"Remove Inner Boundary Curve"
We can undo the removal of the "Line1" curve with undo
undo()
+"Undo Remove Inner Boundary Curve"
In addition to reinstating "Line1" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.
Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.
The new inner curve segment will be an oscillating line given by the parametric equations
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above
We see from the figure that this parametric equation curve starts at the point $(1,5)$ and, therefore, matches the end point of the existing curve "TopArc" present in the "inner" chain. However, the parametric equation curve ends at the point $(2,3)$ which does not match the "BottomArc" curve. So, the inner boundary chain remains open.
Attempt to generate a mesh with an open curve chain
An open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.
To create a closed boundary curve we must remove the "BottomArc" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point $(2, 3)$ and end at the point $(-1, 3)$ to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the "BottomArc" from the "inner" chain.
The figure updates to display the "inner" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.
A half-circle arc that joins the points $(2, 3)$ and $(-1, 3)$ has a radius $r=1.5$, is centered at $(0.5, 3)$ and has an angle that vaires from $0$ to $-180$. We construct this circle arc and directly add it to the sandbox_project.
new_bottom_arc = newCircularArcCurve("wideBottomArc", # curve name
+ [0.5, 3.0, 0.0], # center
+ 1.5, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
The updated plot now gives the modified, closed inner curve chain that now contains four curve segments "Line2", "TopArc", "wiggleLine", and "wideBottomArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.11353599999999998
+ Number of nodes = 712
+ Number of Edges = 1308
+ Number of Elements = 596
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00002932 1.15661960 0.12823902 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.01050856 3.14732001 1.34260027 1.00000000 999.99900000 1.00000000
+ Condition 1.00037771 2.59434067 1.22850175 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.02744717 3.68828437 1.64751502 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001750 1.13149451 0.09443920 0.00000000 999.99900000 1.00000000
+ Minimum Angle 31.87236189 89.33988565 67.86178629 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.44177106 157.27121105 114.35699650 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The visualization updates automatically and the background grid is removed after when the mesh is generated.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.
Add the background grid when an outer boundary curve is present.
Visualize an interactive mesh project.
Discuss undo / redo capabilities.
Construct and add parametric spline curves.
Construct and add a curve from parametric equations.
Construct and add straight line segments.
Construct and add circular arc segments.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with modified outer and inner curve chains
+#
+# Create inner / outer boundary chains composed of the four
+# available HOHQMesh curve types.
+#
+# Keywords: outer boundary, inner boundary, parametric equations,
+# circle arcs, cubic spline, curve removal
+using HOHQMesh
+
+# Instantiate the project
+sandbox_project = newProject("sandbox", "out")
+
+# Add the background grid
+addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])
+
+# Create and add the original outer boundary curves
+outer_line1 = newEndPointsLineCurve("Line1", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])
+outer_line2 = newEndPointsLineCurve("Line2", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])
+outer_arc = newCircularArcCurve("Arc", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, "degrees")
+
+addCurveToOuterBoundary!(sandbox_project, outer_line1)
+addCurveToOuterBoundary!(sandbox_project, outer_arc)
+addCurveToOuterBoundary!(sandbox_project, outer_line2)
+
+# Modify the outer boundary to have a spline instead of a straight line
+removeOuterBoundaryCurveWithName!(sandbox_project, "Line2")
+
+spline_data = [ [0.0 -5.0 3.0 0.0]
+ [0.25 -2.0 1.0 0.0]
+ [0.5 -4.0 0.5 0.0]
+ [0.75 -2.0 -3.0 0.0]
+ [1.0 0.0 -7.0 0.0] ]
+outer_spline = newSplineCurve("Spline", 5, spline_data)
+addCurveToOuterBoundary!(sandbox_project, outer_spline)
+
+# Create and add the inner boundary curves
+inner_line1 = newEndPointsLineCurve("Line1", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])
+inner_line2 = newEndPointsLineCurve("Line2", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])
+inner_bottom_arc = newCircularArcCurve("BottomArc", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, "radians")
+inner_top_arc = newCircularArcCurve("TopArc", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, "degrees")
+
+addCurveToInnerBoundary!(sandbox_project, inner_line1, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_line2, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_top_arc, "inner")
+
+# Generate a mesh
+generate_mesh(sandbox_project)
+
+# Delete the existing mesh before modifying the inner boundary curve chain
+remove_mesh!(sandbox_project)
+
+# Modify the inner boundary curve with an oscillatory line and a new circle arc
+removeInnerBoundaryCurve!(sandbox_project, "Line1", "inner")
+removeInnerBoundaryCurve!(sandbox_project, "BottomArc", "inner")
+
+xEqn = "x(t) = t + 1"
+yEqn = "y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)"
+zEqn = "z(t) = 0.0"
+inner_eqn = newParametricEquationCurve("wiggleLine", xEqn, yEqn, zEqn)
+
+new_bottom_arc = newCircularArcCurve("wideBottomArc", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, "radians")
+
+addCurveToInnerBoundary!(sandbox_project, inner_eqn, "inner")
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
+
+# Regenerate the final mesh
+generate_mesh(sandbox_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Wednesday 10 April 2024. Using Julia version 1.10.2.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.
The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "TheBlob" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
The following commands create a new curve for the parametric equations above
The name of this curve is assigned to be "Blob". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for blob_project to have elements with side length two in each direction
addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])
We next visualize the outer boundary curve and background grid with the following
plotProject!(blob_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "Blob" labeled in the figure by O.1.
From the visualization we see that the background grid is likely too coarse to produce a "good" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction
setBackgroundGridSize!(blob_project, 0.5, 0.5)
Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.
The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.
We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:
TheBlob.control: A HOHQMesh control file for the current project.
TheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
TheBlob.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 8.4328000000000000E-002
+ Number of nodes = 479
+ Number of Edges = 895
+ Number of Elements = 417
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025286 0.36208840 0.11936333 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002882 2.58443761 1.26335838 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.12867591 1.18585825 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006176 4.77438730 1.51314025 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011275 0.28170345 0.10292806 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.38249259 89.99827733 73.08294187 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132795 156.98701187 109.36585212 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point $(-4, 0)$ is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with
Above we create a circular refinement region centered at the point $(-4, -0.5)$ with a desired resolution size $0.4$ and a radius of $1.0$. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.
With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 9.2778999999999986E-002
+ Number of nodes = 503
+ Number of Edges = 940
+ Number of Elements = 438
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025286 0.36208840 0.11412688 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002883 2.47056840 1.26416662 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.12867592 1.18429212 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006176 4.77438730 1.51407242 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011275 0.28170345 0.09814903 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.38249259 89.99827897 72.80049710 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132784 156.98701188 109.63478104 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.
Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.
Define a curved outer boundary using parametric equations.
Add and adjust the background grid.
Visualize an interactive mesh project.
Add manual refinement to a local region of the domain.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with a curved outer boundary
+#
+# Create an outer boundary from a set of parametric equations.
+# Add manual refinement in a small region around the point (-4, -0.5).
+#
+# Keywords: outer boundary, parametric equations, refinement center
+using HOHQMesh
+
+# Instantiate the project
+blob_project = newProject("TheBlob", "out")
+
+# Create and add the outer boundary curve
+xEqn = "x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3"
+yEqn = "y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2"
+zEqn = "z(t) = 0.0"
+blob = newParametricEquationCurve("Blob", xEqn, yEqn, zEqn)
+addCurveToOuterBoundary!(blob_project, blob)
+
+# Add the background grid
+addBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])
+
+# Create and add the refinement region
+center = newRefinementCenter("region", "smooth", [-4.0, -0.5, 0.0], 0.4, 1.0)
+addRefinementRegion!(blob_project, center)
+
+# Generate the mesh
+generate_mesh(blob_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Wednesday 10 April 2024. Using Julia version 1.10.2.
For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.
For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.
This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.
This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.
This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line "curves".
This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve "chain" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line "curves". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "spline_curves" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.
The outer boundary curve for this tutorial is a circle of radius $r=4$ centered at the point $(0, -1)$. We define this circular curve with the function newCircularArcCurve as follows
circ = newCircularArcCurve("outerCircle", # curve name
+ [0.0, -1.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circ is assigned to be "outerCircle". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circ curve is then added to the spline_project as an outer boundary curve with
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for spline_project to have elements with side length $0.6$ in each direction
We next visualize the outer boundary curve and background grid with the following
plotProject!(spline_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "outerCircle" labeled in the figure by O.1.
A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots $t_j$, $x_j$, $y_j$, $z_j$ where $j$ indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder
We create a parametric spline curve from a file with
The name of the curve stored in the dictionary spline1 is assigned to be "big_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline1 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve "big_spline" labeled in the figure by 1.1.
Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.
Below, we construct another parametric spline using this strategy that consists of five data points
The name of the curve stored in the dictionary spline2 is assigned to be "small_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline2 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner2" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve "small_spline" labeled in the figure by 2.1.
Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with
edge1 = newEndPointsLineCurve("triangle", # curve name
+ [-2.3, -1.0, 0.0], # start point
+ [-1.7, -1.0, 0.0]) # end point
+
+edge2 = newEndPointsLineCurve("triangle", # curve name
+ [-1.7, -1.0, 0.0], # start point
+ [-2.0, -0.4, 0.0]) # end point
+
+edge3 = newEndPointsLineCurve("triangle", # curve name
+ [-2.0, -0.4, 0.0], # start point
+ [-2.3, -1.0, 0.0]) # end point
Here, each edge of the curve is given the same name "triangle" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.
The inner boundary chain name "inner3" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called "triangle" labeled in the figure by 3.1, 3.2, and 3.3.
With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:
spline_curves.control: A HOHQMesh control file for the current project.
spline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
spline_curves.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(spline_project)
+ 1 chevron elements removed from mesh.
+ 1 chevron elements removed from mesh.
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.25359100000000001
+ Number of nodes = 1176
+ Number of Edges = 2225
+ Number of Elements = 1047
+ Number of Subdivisions = 4
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00006209 0.15607019 0.04505180 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00008965 2.78091496 1.23178864 1.00000000 999.99900000 1.00000000
+ Condition 1.00000055 3.82171291 1.15535543 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00014261 6.78201663 1.46249737 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001491 0.10424647 0.03955817 0.00000000 999.99900000 1.00000000
+ Minimum Angle 37.24189766 89.96174556 74.42003031 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.03128071 157.35065162 107.91806148 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of "bad" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the "big_spline" curve. We decide that we are satisfied with the overall mesh quality.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples/ folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "box_two_circles" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.
When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.
For the box_project we first query the current values for the polynomial order and the mesh output format
We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be $4$ and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.
The domain for this tutorial is a rectangular box with the bounds $[0,30]\times[0,15]$. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:
Set the lower left corner point of the domain $(x_0, y_0)$, define the element size in each spatial direction $\Delta x$ and $\Delta y$, and the number of steps taken in each direction $N_x, N_y$. The resulting background grid will have the extent $[x_0, x_0 + N_x \Delta x]$ by $[y_0, y_0 + N_y \Delta y]$. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands
Set the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box $[0,30]\times[0,15]$ we use
Next, we add the two circular inner boundary curves with different radii.
The first circle will have radius $r=2$ and be centered at the point $(4, 4)$. We define this circular curve with the function newCircularArcCurve as follows
circle1 = newCircularArcCurve("circle1", # curve name
+ [4.0, 4.0, 0.0], # circle center
+ 2.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be "circle1". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circle1 curve is then added to the box_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called "inner1" and it contains a single curve "circle1" labeled in the figure by 1.1.
With analogous steps we create another circular curve with radius $r=4$, centered at $(20, 9)$ and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.
circle2 = newCircularArcCurve("circle2", # curve name
+ [20.0, 9.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 2.0 * pi, # end angle
+ "radians") # angle units
+addCurveToInnerBoundary!(box_project, circle2, "inner2")
Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called "inner2" and it contains a single curve "circle2" labeled in the figure by 2.1.
With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:
box_two_circles.control: A HOHQMesh control file for the current project.
box_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
box_two_circles.inp: A mesh file with format ABAQUS that was set above.
To do this we execute the command
generate_mesh(box_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 2.9116999999999997E-002
+ Number of nodes = 498
+ Number of Edges = 921
+ Number of Elements = 422
+ Number of Subdivisions = 0
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.34513977 1.15385313 0.91833886 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00000004 1.71084672 1.08736698 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 1.46547984 1.04928616 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00000006 2.43578615 1.16710823 1.00000000 4.00000000 1.00000000
+ Jacobian 0.17854786 1.07210200 0.86801191 0.00000000 999.99900000 1.00000000
+ Minimum Angle 50.57680338 89.99999787 83.84338772 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00000259 136.97085026 96.70176380 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.
From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.
This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples/ folder constructs an identical example mesh as shown in the Guided tour using generic function calls.
A thorough description of the functions can be found in the API section.
The general workflow of the interactive mesh functionality within a REPL session is
c = new(name, startLocation [x,y,z], endLocation [x,y,z]) *Straight Line*
+ c = new(name, center [x,y,z], radius, startAngle, endAngle) *Circular Arc*
+ c = new(name, xEqn, yEqn, zEqn) *Parametric equation*
+ c = new(name, dataFile) *Spline with data from a file*
+ c = new(name, nKnots, knotsMatrix) *Spline with given knot values*
Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.
All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.
HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).
HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.
Developer Certificate of Origin
+Version 1.1
+
+Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+1 Letterman Drive
+Suite D4700
+San Francisco, CA, 94129
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+
+Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+(a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+(b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+(c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+(d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 30 April 2024. Using Julia version 1.10.2.
When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:
Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.
If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.
Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like VS Code with the Julia extension). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.
Set the new version number in Project.toml according to the Julian version of semver. Commit and push.
Comment @JuliaRegistrator register on the commit setting the version number.
JuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.
Increment the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.
You can build the documentation of HOHQMesh.jl locally by running
julia --project=docs -e 'using Pkg; Pkg.instantiate(); include("docs/make.jl")'
from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 30 April 2024. Using Julia version 1.10.2.
In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.
All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).
If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.
git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git
+# get latest main from the main repo
+git checkout main
+git pull
+# create a new branch for a cool new feature, bug fix, ...
+git checkout -b YOUR_BRANCH_NAME
+# do some work and push it to your fork
+git push -u myfork
+# go to https://github.com/trixi-framework/HOHQMesh.jl/pull
+# and create a PR from your new branch
Why using pull requests?
Immediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.
With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.
Avoid committing unwanted files
When you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.
For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:
Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.
Execute git fetch to get the latest changes from the repository.
Make sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.
Merge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.
In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.
If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should
merge the current main to your branch
run tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs
properly comment your code
delete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)
remove debug statements
add a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)
After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.
Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.
Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.
Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).
Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:
Update your clone by running git fetch.
Check out main using git checkout main.
Delete merged branch locally with git branch -d yourbranch.
Remove local references to deleted remote branch by executing git remote prune origin.
You can now proceed with your next changes by starting again at the top.
Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):
If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running
git reset HEAD~
This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.
If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.
Large files
You should never try to fix this yourself, as it potentially disrupts/destroys the work of others!
Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):
Tell everyone to commit and push their changes to the repository.
Fix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.
Perform the following steps to clean up the Git repository:
cd /tmp
+
+# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/
+
+# Get fresh clone of repo (so you can throw it away in case there is a problem)
+git clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git
+
+# Clean up repo of all files larger than 10M
+java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git
+
+# Enter repo
+cd HOHQMesh.jl.git
+
+# Clean up reflog and force aggressive garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
+
+# Push changes
+git push
+
+# Delete clone
+rm -rf HOHQMesh.jl.git
Tell everyone to clean up their local working copies by performing the following steps (also do this yourself):
# Enter repo
+cd HOHQMesh.jl
+
+# Get current changes
+git fetch
+
+# Check out the fixed branch
+git checkout branchname
+
+# IMPORTANT: Do a rebase instead of a pull!
+git rebase
+
+# Clean reflog and force garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
IMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 30 April 2024. Using Julia version 1.10.2.
diff --git a/v0.2.5/guided-tour/index.html b/v0.2.5/guided-tour/index.html
new file mode 100644
index 00000000..104d6cbd
--- /dev/null
+++ b/v0.2.5/guided-tour/index.html
@@ -0,0 +1,62 @@
+
+Guided tour · HOHQMesh.jl
In this brief overview, we highlight two scripts from the examples/ folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.
A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute
A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute
For completeness, we provide the example script and walk-through each step in the construction of the Project below.
using HOHQMesh
+
+# Create a new project with the name "IceCreamCone", which will also be the
+# name of the mesh, plot and stats files, written to output folder `out`.
+
+p = newProject("IceCreamCone", "out")
+
+# Outer boundary for this example mesh is a complete circle. Add it into the project.
+
+circ = newCircularArcCurve("outerCircle", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, "degrees")
+addCurveToOuterBoundary!(p, circ)
+
+# Inner boundary is three curves. Two straight lines and a circular arc.
+# Note the three curve are connected to ensure a counter-clockwise orientation
+# as required by HOHQMesh
+
+# Create the three interior curves. The individual names of each curve in the inner
+# chain are used internally by HOHQMesh and are output as the given boundary names in
+# the mesh file.
+
+cone1 = newEndPointsLineCurve("cone1", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])
+iceCream = newCircularArcCurve("iceCream", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, "degrees")
+cone2 = newEndPointsLineCurve("cone2", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])
+
+# Assemble the three curve in a closed chain oriented counter-clockwise. The chain
+# name `IceCreamCone` is only used internally by HOHQMesh.
+
+addCurveToInnerBoundary!(p, cone1, "IceCreamCone")
+addCurveToInnerBoundary!(p, iceCream, "IceCreamCone")
+addCurveToInnerBoundary!(p, cone2, "IceCreamCone")
+
+# Adjust some `RunParameters` and overwrite the defaults values. In this case, we
+# set a new value for the boundary order polynomial representation and adjust the
+# output mesh file format to be `sem`
+
+setPolynomialOrder!(p, 4)
+setPlotFileFormat!(p, "sem")
+
+# A background grid is required for the mesh generation. In this example we lay a
+# background grid of Cartesian boxes with size 0.5.
+
+addBackgroundGrid!(p, [0.5, 0.5, 0.0])
+
+# Plot the project model curves and background grid
+
+if isdefined(Main, :Makie)
+ plotProject!(p, MODEL+GRID)
+ @info "Press enter to generate the mesh and update the plot."
+ readline()
+ else # Throw an informational message about plotting to the user
+ @info "To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again."
+ end
+
+# Generate the mesh. This produces the mesh and TecPlot files `IceCreamCone.mesh` and `IceCreamCone.tec`
+# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is
+# updated with the mesh that was generated.
+
+generate_mesh(p)
+
+# After the mesh successfully generates mesh statistics, such as the number of corner nodes,
+# the number of elements etc., are printed to the REPL
The first line creates a new project, where the mesh and plot file names will be derived from the project name, "IceCreamCone" written to the specified folder.
To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:
Parametric equations
Cubic Splines
Lines defined by their end points
Circular arcs
In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.
Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, "IceCreamCone" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.
For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script resets the polynomial order (default = 5) and the plot file format (default = "skeleton").
One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, only the mesh size needs to be specified using
The example sets the background mesh size to be 0.5 in the x and y directions. The z component is ignored.
The script finishes by generating the quad mesh and plotting the results, as shown below
Finally, the script returns the project so that it can be edited further, if desired.
To save a control file for HOHQMesh, simply invoke
saveProject(proj::Project)
where the name of the control file (traditionally with a .control extension) matches the name of the project proj. saveProject is automatically called when a mesh is generated.
Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 30 April 2024. Using Julia version 1.10.2.
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.
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.
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
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.,
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.
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.
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.
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.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 30 April 2024. Using Julia version 1.10.2.
The supplied name will be the default name of the control, mesh, and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.
The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.
If the model is modified and you want to re-plot with the new values, invoke
updatePlot!(proj::Project, options)
but generally the plot will be updated automatically as you build the model.
HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.
The available mesh file formats are "ISM", "ISM-V2", or "ABAQUS". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.
The plot file (which can be viewed with something like VisIt or ParaView) format is either "skeleton" or "sem". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.
By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with
A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available in the documentation.
To change the defaults, the smoother parameters can be set/enquired with the functions
There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must be specified after a new project has been created.
Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.
Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).
where name labels the refinement region, the type is either "smooth" or "sharp", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.
The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a "chain" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.
The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.
The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.
See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.
Returns a new set of parametric equation. Equations must be of the form
<function name>(<argument>) = ...
The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
A cubic spline is defined by an array of knots, $t_j$, $x_j$, $y_j$, $z_j$. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the $t$, $x$, $y$, $z$ values, e.g.
The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either "degrees" or "radians". That argument is optional, and defaults to "degrees".
Using the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using
The syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.
The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.
Several scripts are available in the examples/ folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.
Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.
The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.
To generate a mesh interactively you
Create a project with a user given projectName and folder where any generated files are to be saved
p = newProject(<projectName>, <folder>)
Both of these input arguments are strings.
Create inner and outer boundary curves from the available types
c = newEndPointsLineCurve(<name>, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*
+c = newCircularArcCurve(<name>, center [x, y, z], radius, startAngle, endAngle, units = "degrees" or "radians") *Circular Arc*
+c = newParametricEquationCurve(<name>, xEqn, yEqn, zEqn) *Parametric equation*
+c = newSplineCurve(<name>, dataFile) *Spline with data from a file*
+c = newSpline(<name>, nKnots, knotsMatrix) *Spline with given knot values*
See Defining curves for further details on the different curve type currently supported by HOHQMesh.
The generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.
Add curves to build the model to see what you have added,
addOuterBoundaryCurve!(p, <curveName>) *Add outer boundary curve*
+addInnerBoundaryCurve!(p, <curveName>, <InnerBoundaryName>) *Add curve to an inner boundary*
For a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.
Curves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.
Visualize the project's model, if desired
plotProject!(p, MODEL)
Plots are updated in response to user interactions. However, to update the plot at any time, use
updatePlot!(p, options)
Options are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.
Visualization requirement
The interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.
Set the background grid
When no outer boundary curve is present, the background grid can be set with
addBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])
Or
addBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])
The first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.
When an outer boundary is present the background grid can be set as
addBackgroundGrid!(p, [dx, dy, dz])
where the spacing controls the number of elements in each direction.
Background grid
A background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.
Adjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by
setPolynomialOrder!(p, order)
The background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately
The mesh file will be saved in <folder> with the name <projectName>.mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name <projectName>.control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.
The generate_mesh function has two optional arguments. The first is the Boolean verbose argument. One can pass verbose=true to output additional messages and information during the meshing process. The second is the integer subdivision_maximum argument. The default value is subdivision_maximum=8, meaning that elements can be up to a factor of 2^8 smaller than the existing background grid. Note, think before adjusting the subdivision_maximum level! It is often the case that adjusting the boundary curves, background grid size, adding local refinement regions, or some combination of these adjustments removes the need to adjust the subdivision depth.
All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 30 April 2024. Using Julia version 1.10.2.
Copyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-Lakemper
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 30 April 2024. Using Julia version 1.10.2.
Add the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version
Add the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.
Add an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.
Return a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.
Generate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.
You can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.
You can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.
To override the maximum number of allowable subdivisions in the quad tree during meshing adjust the value of subdivision_maximum. The default value of subdivision_maximum is 8, meaning that elements can be up to a factor of 2^8 smaller than the background grid. Note, think before doing this! It could be adjusting the boundary curves, background grid size, adding local refinement regions, or some combination may remove the need to adjust the subdivision depth.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
Generate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.
This function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.
With the optional argument verbose one can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information.
To override the maximum number of allowable subdivisions in the quad tree during meshing adjust the value of subdivision_maximum. The default value of subdivision_maximum is 8, meaning that elements can be up to a factor of 2^8 smaller than the background grid. Note, think before doing this! It could be adjusting the boundary curves, background grid size, adding local refinement regions, or some combination may remove the need to adjust the subdivision depth.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
getCurveType(crv::Dic{String,Any})
+
+Get the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,
+`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.
Get the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.
Plot objects specified by the plotOptions. Construct the plotOptions by the sum of what is to be drawn from the choices MODEL, GRID, MESH, REFINEMENTS.
Example: To plot the model and the grid, plotOptions = MODEL + GRID. To plot just the mesh, plotOptions = MESH.
To plot everything, plotOptions = MODEL + GRID + MESH + REFINEMENTS
Contents are overlaid in the order: GRID, MESH, MODEL, REFINEMENTS
Requires Makie.jl
Please note that for this function to work, you need to load Makie.jl in your REPL (e.g., by calling using GLMakie).
Set the file format for the plot file. Acceptable choices are "sem", which includes interior nodes and boundary nodes and "skeleton", which includes only the corner nodes.
This document was generated with Documenter.jl version 0.27.25 on Tuesday 30 April 2024. Using Julia version 1.10.2.
diff --git a/v0.2.5/search_index.js b/v0.2.5/search_index.js
new file mode 100644
index 00000000..12f6a72a
--- /dev/null
+++ b/v0.2.5/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"contributing/#Contributing","page":"Contributing","title":"Contributing","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.","category":"page"},{"location":"contributing/#Developer-Certificate-of-Origin-(Version-1.1)","page":"Contributing","title":"Developer Certificate of Origin (Version 1.1)","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"The following text was taken from https://developercertificate.org:","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"Developer Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n1 Letterman Drive\nSuite D4700\nSan Francisco, CA, 94129\n\nEveryone is permitted to copy and distribute verbatim copies of this\nlicense document, but changing it is not allowed.\n\n\nDeveloper's Certificate of Origin 1.1\n\nBy making a contribution to this project, I certify that:\n\n(a) The contribution was created in whole or in part by me and I\n have the right to submit it under the open source license\n indicated in the file; or\n\n(b) The contribution is based upon previous work that, to the best\n of my knowledge, is covered under an appropriate open source\n license and I have the right under that license to submit that\n work with modifications, whether created in whole or in part\n by me, under the same open source license (unless I am\n permitted to submit under a different license), as indicated\n in the file; or\n\n(c) The contribution was provided directly to me by some other\n person who certified (a), (b) or (c) and I have not modified\n it.\n\n(d) I understand and agree that this project and the contribution\n are public and that a record of the contribution (including all\n personal information I submit with it, including my sign-off) is\n maintained indefinitely and may be redistributed consistent with\n this project or the open source license(s) involved.","category":"page"},{"location":"development/#Development","page":"Development","title":"Development","text":"","category":"section"},{"location":"development/#Text-editors","page":"Development","title":"Text editors","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:","category":"page"},{"location":"development/#VS-Code","page":"Development","title":"VS Code","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.","category":"page"},{"location":"development/#Juno","page":"Development","title":"Juno","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.","category":"page"},{"location":"development/#Vim-or-Emacs","page":"Development","title":"Vim or Emacs","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like VS Code with the Julia extension). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.","category":"page"},{"location":"development/#Releasing-a-new-version-of-HOHQMesh","page":"Development","title":"Releasing a new version of HOHQMesh","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Check whether everything is okay, tests pass etc.\nSet the new version number in Project.toml according to the Julian version of semver. Commit and push.\nComment @JuliaRegistrator register on the commit setting the version number.\nJuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.\nIncrement the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.","category":"page"},{"location":"development/#Preview-the-documentation","page":"Development","title":"Preview the documentation","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"You can build the documentation of HOHQMesh.jl locally by running","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"julia --project=docs -e 'using Pkg; Pkg.instantiate(); include(\"docs/make.jl\")'","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).","category":"page"},{"location":"tutorials/straight_outer_boundary/#Straight-sided-outer-boundary","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples/ folder.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Synopsis","page":"Straight-sided outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Initialization","page":"Straight-sided outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We create a new project with the name \"box_two_circles\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_project = newProject(\"box_two_circles\", \"out\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Adjusting-project-parameters","page":"Straight-sided outer boundary","title":"Adjusting project parameters","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"For the box_project we first query the current values for the polynomial order and the mesh output format","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> getPolynomialOrder(box_project)\n5\n\njulia> getMeshFileFormat(box_project)\n\"ISM-V2\"","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be 4 and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"setPolynomialOrder!(box_project, 4)\nsetMeshFileFormat!(box_project, \"ABAQUS\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-background-grid","page":"Straight-sided outer boundary","title":"Add the background grid","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The domain for this tutorial is a rectangular box with the bounds 030times015. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Set the lower left corner point of the domain (x_0 y_0), define the element size in each spatial direction Delta x and Delta y, and the number of steps taken in each direction N_x N_y. The resulting background grid will have the extent x_0 x_0 + N_x Delta x by y_0 y_0 + N_y Delta y. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands\nlower_left = [0.0, 0.0, 0.0]\nspacing = [1.0, 1.0, 0.0]\nnum_intervals = [30, 15, 0]\naddBackgroundGrid!(box_project, lower_left, spacing, num_intervals)\nSet the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box 030times015 we use\nbounds = [15.0, 0.0, 0.0, 30.0]\nN = [30, 15, 0]\naddBackgroundGrid!(box_project, bounds, N)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we visualize the box_project to ensure that the background grid has been added correctly.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"plotProject!(box_project, GRID)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use the keyword and GRID to indicate that we want the background grid to be included in the visualization.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: background)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-inner-boundaries","page":"Straight-sided outer boundary","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we add the two circular inner boundary curves with different radii.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The first circle will have radius r=2 and be centered at the point (4 4). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle1 = newCircularArcCurve(\"circle1\", # curve name\n [4.0, 4.0, 0.0], # circle center\n 2.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be \"circle1\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The new circle1 curve is then added to the box_project as an inner boundary curve with","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"addCurveToInnerBoundary!(box_project, circle1, \"inner1\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called \"inner1\" and it contains a single curve \"circle1\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: first_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With analogous steps we create another circular curve with radius r=4, centered at (20 9) and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle2 = newCircularArcCurve(\"circle2\", # curve name\n [20.0, 9.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 2.0 * pi, # end angle\n \"radians\") # angle units\naddCurveToInnerBoundary!(box_project, circle2, \"inner2\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called \"inner2\" and it contains a single curve \"circle2\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: second_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Generate-the-mesh","page":"Straight-sided outer boundary","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_two_circles.control: A HOHQMesh control file for the current project.\nbox_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nbox_two_circles.inp: A mesh file with format ABAQUS that was set above.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"generate_mesh(box_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 2.9116999999999997E-002\n Number of nodes = 498\n Number of Edges = 921\n Number of Elements = 422\n Number of Subdivisions = 0\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.34513977 1.15385313 0.91833886 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00000004 1.71084672 1.08736698 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 1.46547984 1.04928616 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00000006 2.43578615 1.16710823 1.00000000 4.00000000 1.00000000\n Jacobian 0.17854786 1.07210200 0.86801191 0.00000000 999.99900000 1.00000000\n Minimum Angle 50.57680338 89.99999787 83.84338772 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00000259 136.97085026 96.70176380 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: final_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Summary","page":"Straight-sided outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"github-git/#GitHub-and-Git","page":"GitHub & Git","title":"GitHub & Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This page contains information on how to use GitHub and Git when developing HOHQMesh.","category":"page"},{"location":"github-git/#Development-workflow","page":"GitHub & Git","title":"Development workflow","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For adding modifications to HOHQMesh, we generally follow these steps:","category":"page"},{"location":"github-git/#Create-an-issue-(optional)","page":"GitHub & Git","title":"Create an issue (optional)","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.","category":"page"},{"location":"github-git/#Create-a-branch-and-*immediately*-create-a-pull-request","page":"GitHub & Git","title":"Create a branch and immediately create a pull request","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git\n# get latest main from the main repo\ngit checkout main\ngit pull\n# create a new branch for a cool new feature, bug fix, ...\ngit checkout -b YOUR_BRANCH_NAME\n# do some work and push it to your fork\ngit push -u myfork\n# go to https://github.com/trixi-framework/HOHQMesh.jl/pull\n# and create a PR from your new branch","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"info: Why using pull requests?\nImmediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.","category":"page"},{"location":"github-git/#Make-changes","page":"GitHub & Git","title":"Make changes","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"warning: Avoid committing unwanted files\nWhen you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.","category":"page"},{"location":"github-git/#Keep-your-branch-in-sync-with-main","page":"GitHub & Git","title":"Keep your branch in sync with main","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.\nExecute git fetch to get the latest changes from the repository.\nMake sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.\nMerge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.","category":"page"},{"location":"github-git/#Prepare-for-review","page":"GitHub & Git","title":"Prepare for review","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"merge the current main to your branch\nrun tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs\nproperly comment your code\ndelete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)\nremove debug statements\nadd a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.","category":"page"},{"location":"github-git/#Get-reviewed","page":"GitHub & Git","title":"Get reviewed","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.","category":"page"},{"location":"github-git/#Merge-branch","page":"GitHub & Git","title":"Merge branch","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).","category":"page"},{"location":"github-git/#Update-your-working-copy","page":"GitHub & Git","title":"Update your working copy","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Update your clone by running git fetch.\nCheck out main using git checkout main.\nDelete merged branch locally with git branch -d yourbranch.\nRemove local references to deleted remote branch by executing git remote prune origin.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"You can now proceed with your next changes by starting again at the top.","category":"page"},{"location":"github-git/#Using-Git","page":"GitHub & Git","title":"Using Git","text":"","category":"section"},{"location":"github-git/#Resources-for-learning-Git","page":"GitHub & Git","title":"Resources for learning Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Git Handbook by GitHub\nLearn Git Branching","category":"page"},{"location":"github-git/#Tips-and-tricks","page":"GitHub & Git","title":"Tips and tricks","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This is an unordered collection of different tips and tricks that can be helpful while working with Git. As usual, your mileage might vary.","category":"page"},{"location":"github-git/#Undo-last-commit","page":"GitHub & Git","title":"Undo last commit","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git reset HEAD~","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.","category":"page"},{"location":"github-git/#Remove-large-file-from-repository","page":"GitHub & Git","title":"Remove large file from repository","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"danger: Large files\nYou should never try to fix this yourself, as it potentially disrupts/destroys the work of others!","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Tell everyone to commit and push their changes to the repository.\nFix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.\nPerform the following steps to clean up the Git repository:\ncd /tmp\n\n# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/\n\n# Get fresh clone of repo (so you can throw it away in case there is a problem)\ngit clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git\n\n# Clean up repo of all files larger than 10M\njava -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git\n\n# Enter repo\ncd HOHQMesh.jl.git\n\n# Clean up reflog and force aggressive garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\n\n# Push changes\ngit push\n\n# Delete clone\nrm -rf HOHQMesh.jl.git\nTell everyone to clean up their local working copies by performing the following steps (also do this yourself):\n# Enter repo\ncd HOHQMesh.jl\n\n# Get current changes\ngit fetch\n\n# Check out the fixed branch\ngit checkout branchname\n\n# IMPORTANT: Do a rebase instead of a pull!\ngit rebase\n\n# Clean reflog and force garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\nIMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.","category":"page"},{"location":"interactive-api/#API","page":"API","title":"API","text":"","category":"section"},{"location":"interactive-api/#Project-creation-and-saving","page":"API","title":"Project creation and saving","text":"","category":"section"},{"location":"interactive-api/#New-Project","page":"API","title":"New Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = newProject(name::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied name will be the default name of the control, mesh, and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.","category":"page"},{"location":"interactive-api/#Opening-an-existing-project-file","page":"API","title":"Opening an existing project file","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A project can be created from an existing HOHQMesh control file with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = openProject(fileName::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied fileName will be the name of the project and the generated mesh and plot files will be placed in the supplied folder.","category":"page"},{"location":"interactive-api/#Saving-a-Project","page":"API","title":"Saving a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" saveProject(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"writes a control file to the folder designated when creating the new project. It can be read in again with openProject.","category":"page"},{"location":"interactive-api/#Plotting-a-Project","page":"API","title":"Plotting a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" plotProject!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the model is modified and you want to re-plot with the new values, invoke","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" updatePlot!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"but generally the plot will be updated automatically as you build the model.","category":"page"},{"location":"interactive-api/#Modifying/editing-a-Project","page":"API","title":"Modifying/editing a Project","text":"","category":"section"},{"location":"interactive-api/#Setting-the-name-of-a-Project","page":"API","title":"Setting the name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name is the name under which the mesh, plot, statistics and control files will be written. It can be changed at any time with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setName!(proj::Project,name::String)","category":"page"},{"location":"interactive-api/#Getting-the-current-name-of-a-Project","page":"API","title":"Getting the current name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name can be fetched and printed to the screen with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getName(proj::Project)","category":"page"},{"location":"interactive-api/#Controlling-the-mesh-generation","page":"API","title":"Controlling the mesh generation","text":"","category":"section"},{"location":"interactive-api/#Editing-the-RunParameters","page":"API","title":"Editing the RunParameters","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The run parameters can be enquired and set with these getter/setter pairs:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setPolynomialOrder!(proj::Project, p::Int)\n [Return:Int] getPolynomialOrder(proj::Project)\n [Return:nothing] setMeshFileFormat!(proj::Project, meshFileFormat::String)\n [Return:String] getMeshFileFormat(proj::Project)\n [Return:nothing] setPlotFileFormat!(proj::Project, plotFileFormat::String)\n [Return:String] getPlotFileFormat(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The available mesh file formats are \"ISM\", \"ISM-V2\", or \"ABAQUS\". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot file (which can be viewed with something like VisIt or ParaView) format is either \"skeleton\" or \"sem\". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.","category":"page"},{"location":"interactive-api/#Changing-the-output-file-names","page":"API","title":"Changing the output file names","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setName!(proj::Project,name::String)\n [Return:String] getName(proj::Project)\n [Return:nothing] setFolder!(proj::Project,folder::String)\n [Return:String] getFolder(proj::Project)","category":"page"},{"location":"interactive-api/#Smoothing-operations","page":"API","title":"Smoothing operations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available in the documentation.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To change the defaults, the smoother parameters can be set/enquired with the functions","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setSmoothingStatus!(proj::Project, status::String)\n [Return:String] getSmoothingStatus(proj::Project)\n [Return:nothing] setSmoothingType!(proj::Project, type::String)\n [Return:String] getSmoothingType(proj::Project)\n [Return:nothing] setSmoothingIterations!(proj::Project, iterations::Int)\n [Return:Int] getSmoothingIterations(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The smooth status is either \"ON\" or \"OFF\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To remove the smoother altogether, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] removeSpringSmoother!(proj::Project)","category":"page"},{"location":"interactive-api/#Adding-the-background-grid","page":"API","title":"Adding the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must be specified after a new project has been created.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addBackgroundGrid!(proj::Project,\n x0::Array{Float64},\n dx::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n box::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n bgSize::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.","category":"page"},{"location":"interactive-api/#Changing-the-background-grid","page":"API","title":"Changing the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The size of an existing background grid in a Project can be adjusted with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setBackgroundGridSize!(proj::Project,\n dx::Float64,\n dy::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If a plot is present it will be updated automatically.","category":"page"},{"location":"interactive-api/#Manual-refinement-regions","page":"API","title":"Manual refinement regions","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To create a RefinementCenter,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementCenter(name::String,\n type::String,\n x0::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where name labels the refinement region, the type is either \"smooth\" or \"sharp\", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Similarly, one can create a RefinementLine,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementLine(name::String,\n type::String,\n x0::Array{Float64}, x1::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where x0 is the start position and x1 is the end of the line. The name, type, h, and w parameters are the same as for a RefinementCenter.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To add a refinement region to the project,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addRefinementRegion!(proj::Project, r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To get a reference to a refinement region with a given name, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] getRefinementRegion(proj::Project, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to get a list of all the refinement regions,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Array{Dict{String,Any}}] array = allRefinementRegions(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"A refinement region can be edited by using the following:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementType!(r::Dict{String,Any}, type::String)\n [Return:String] getRefinementType(r::Dict{String,Any})\n [Return:nothing] setRefinementLocation!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementLocation(r::Dict{String,Any})\n [Return:nothing] setRefinementGridSize!(r::Dict{String,Any}, h::Float64)\n [Return:Float64] getRefinementGridSize(r::Dict{String,Any})\n [Return:nothing] setRefinementWidth!(r::Dict{String,Any}, w::Float64)\n [Return:Float64] getRefinementWidth(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where r is a dictionary returned by newRefinementCenter!, newRefinementLine!, or getRefinementRegion.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To further edit a RefinementLine, use the methods","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementStart!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementStart(r::Dict{String,Any})\n [Return:nothing] setRefinementEnd!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementEnd(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Boundary-curves","page":"API","title":"Boundary curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a \"chain\" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.","category":"page"},{"location":"interactive-api/#Defining-curves","page":"API","title":"Defining curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Four curve types can be added to the outer and inner boundary curve chains. They are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"interactive-api/#Parametric-equations","page":"API","title":"Parametric equations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Creating a new curve equation","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\")","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Returns a new set of parametric equation. Equations must be of the form","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" () = ...","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" xEqn = \"x(t) = 4*cos(2*pi*t) - 0.6*cos(8*pi*t)^3\"\n yEqn = \"y(t) = 4*sin(2*pi*t) - 0.5*sin(11*pi*t)^2\"\n zEqn = \"z(t) = 0.0\"\n blob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The z-Equation is optional, but for now must define zero for z by default.","category":"page"},{"location":"interactive-api/#Cubic-spline-curve","page":"API","title":"Cubic spline curve","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A cubic spline is defined by an array of knots, t_j, x_j, y_j, z_j. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the t, x, y, z values, e.g.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" 9\n 0.000000000000000 -3.50000000000000 3.50000000000000 0.0\n 3.846153846153846E-002 -3.20000000000000 5.00000000000 0.0\n 7.692307692307693E-002 -2.00000000000000 6.00000000000 0.0\n 0.769230769230769 0.000000000000000 -1.00000000000000 0.0\n 0.807692307692308 -1.00000000000000 -1.00000000000000 0.0\n 0.846153846153846 -2.00000000000000 -0.800000000000000 0.0\n 0.884615384615385 -2.50000000000000 0.000000000000000 0.0\n 0.923076923076923 -3.00000000000000 1.00000000000000 0.0\n 1.00000000000000 -3.50000000000000 3.50000000000000 0.0","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"or by constructing the required nKnots x 4 array and supplying it to the new procedure. The respective constructors for a spline curve are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newSplineCurve(name::String,\n dataFile::String)\n [Return:Dict{String,Any}] newSplineCurve(name::String,\n nKnots::Int,\n data::Matrix{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the spline curve is to be closed. The last data point must be the same as the first.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n ex_spline = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"interactive-api/#Line-defined-by-end-points","page":"API","title":"Line defined by end points","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A straight line is constructed with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newEndPointsLineCurve(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The xStart and xEnd are arrays of the form [x, y, z]. The z component should be zero and for now is ignored.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" line1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])","category":"page"},{"location":"interactive-api/#Circular-arc","page":"API","title":"Circular arc","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newCircularArcCurve(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either \"degrees\" or \"radians\". That argument is optional, and defaults to \"degrees\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" halfCircle = newCircularArcCurve(\"Dome\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")","category":"page"},{"location":"interactive-api/#Adding-and-removing-outer-and-inner-boundaries","page":"API","title":"Adding and removing outer and inner boundaries","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Adding an outer boundary curve\nUsing the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using\n[Return:nothing] addCurveToOuterBoundary!(proj::Project,\n crv::Dict{String,Any})\ncrv is the dictionary that represents the curve.\nExample:\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\nAdding an inner boundary curve\nThe syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.\n[Return:nothing] addCurveToInnerBoundary!(proj::Project,\n crv::Dict{String,Any},\n chainName::String)\nExample:\nline1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\naddCurveToInnerBoundary!(p, line1, \"interior_curve\")\nTo edit curves they can be accessed by the name:\n[Return:Dict{String,Any}] getInnerBoundaryCurve(proj::Project,\n curveName::String,\n chainName::String)\n[Return:Dict{String,Any}] getOuterBoundaryCurveWithName(proj::Project,\n name::String)\nDeleting boundary curves\nThe entire outer boundary or an entire inner boundary can be removed from the project.\n[Return:nothing] removeOuterBoundary!(proj::Project)\n[Return:nothing] removeInnerBoundary!(proj::Project, chainName::String)\nAlternatively, individual pieces of the boundary curve chains can be removed.\n[Return:nothing] removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n[Return:nothing] removeInnerBoundaryCurve!(proj::Project,\n name::String,\n chainName::String)\nAs in HOHQMesh the project can have only one outer boundary chain, so the removal does not require a specific chainName.","category":"page"},{"location":"interactive-api/#Editing-curves","page":"API","title":"Editing curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"You can determine the type of a curve by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getCurveType(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"For any of the curves, their name can be changed by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setCurveName!(crv::Dict{String,Any}, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"and checked by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" getCurveName(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Otherwise there are special functions to change the parameters of curves","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setXEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setYEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setZEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcUnits!(arc::Dict{String,Any}, units::String)\n [Return:nothing] setArcCenter!(arc::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n [Return:String] getXEqn(crv::Dict{String,Any})\n [Return:String] getYEqn(crv::Dict{String,Any})\n [Return:String] getZEqn(crv::Dict{String,Any})\n [Return:Array{Float64}] getStartPoint(crv::Dict{String,Any})\n [Return:Array{Float64}] getEndPoint(crv::Dict{String,Any})\n [Return:String] getArcUnits(arc::Dict{String,Any})\n [Return:Array{Float64}] getArcCenter(arc::Dict{String,Any})\n [Return:Float64] getArcStartAngle(arc::Dict{String,Any})\n [Return:Float64] getArcEndAngle(arc::Dict{String,Any})\n [Return:Float64] getArcRadius(arc::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Undo/redo","page":"API","title":"Undo/redo","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The interactive mesh functionality has unlimited undo/redo for most actions.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"In interactive mode, actions can be undone by the commands","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undo()\n [Return:String] redo()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where the return string contains the name of the action performed.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To find out what the next actions are, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undoActionName()\n [Return:String] redoActionName()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to clear the undo stack, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] clearUndoRedo()","category":"page"},{"location":"tutorials/curved_outer_boundary/#Curved-outer-boundary","page":"Curved outer boundary","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Synopsis","page":"Curved outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initialization","page":"Curved outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We create a new project with the name \"TheBlob\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"blob_project = newProject(\"TheBlob\", \"out\")","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-the-outer-boundary","page":"Curved outer boundary","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary curve for the domain of interest in this tutorial is given by the parametric equations","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":" beginaligned\n x(t) = 4cos(2 pi t) - frac35cos^3(8 pi t)02cm\n y(t) = 4sin(2 pi t) - frac12sin^2(11 pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"xEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The name of this curve is assigned to be \"Blob\". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addCurveToOuterBoundary!(blob_project, blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-a-background-grid","page":"Curved outer boundary","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for blob_project to have elements with side length two in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"plotProject!(blob_project, MODEL+GRID)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"Blob\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: coarse_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From the visualization we see that the background grid is likely too coarse to produce a \"good\" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"setBackgroundGridSize!(blob_project, 0.5, 0.5)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: fine_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initial-mesh-and-user-adjustments","page":"Curved outer boundary","title":"Initial mesh and user adjustments","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"TheBlob.control: A HOHQMesh control file for the current project.\nTheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nTheBlob.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 8.4328000000000000E-002\n Number of nodes = 479\n Number of Edges = 895\n Number of Elements = 417\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025286 0.36208840 0.11936333 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002882 2.58443761 1.26335838 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.12867591 1.18585825 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006176 4.77438730 1.51314025 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011275 0.28170345 0.10292806 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.38249259 89.99827733 73.08294187 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132795 156.98701187 109.36585212 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: initial_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point (-4 0) is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"center = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Above we create a circular refinement region centered at the point (-4 -05) with a desired resolution size 04 and a radius of 10. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: refinement_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Final-mesh","page":"Curved outer boundary","title":"Final mesh","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 9.2778999999999986E-002\n Number of nodes = 503\n Number of Edges = 940\n Number of Elements = 438\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025286 0.36208840 0.11412688 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002883 2.47056840 1.26416662 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.12867592 1.18429212 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006176 4.77438730 1.51407242 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011275 0.28170345 0.09814903 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.38249259 89.99827897 72.80049710 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132784 156.98701188 109.63478104 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: final_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Summary","page":"Curved outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"# Interactive mesh with a curved outer boundary\n#\n# Create an outer boundary from a set of parametric equations.\n# Add manual refinement in a small region around the point (-4, -0.5).\n#\n# Keywords: outer boundary, parametric equations, refinement center\nusing HOHQMesh\n\n# Instantiate the project\nblob_project = newProject(\"TheBlob\", \"out\")\n\n# Create and add the outer boundary curve\nxEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)\naddCurveToOuterBoundary!(blob_project, blob)\n\n# Add the background grid\naddBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])\n\n# Create and add the refinement region\ncenter = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)\n\n# Generate the mesh\ngenerate_mesh(blob_project)","category":"page"},{"location":"tutorials/create_edit_curves/#Creating-and-editing-curves","page":"Creating and editing curves","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a \"chain\" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/create_edit_curves/#Synopsis","page":"Creating and editing curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/#Initialization","page":"Creating and editing curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a new project with the name \"sandbox\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox_project = newProject(\"sandbox\", \"out\")","category":"page"},{"location":"tutorials/create_edit_curves/#Add-the-outer-boundary-chain","page":"Creating and editing curves","title":"Add the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We first create the outer boundary curve chain that is composed of three pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (0 -7) to (5 3).\nHalf-circle arc of radius r=5 centered at (0 3).\nStraight line segment from (-5 3) to (0 -7).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [0.0, -7.0, 0.0], # start point\n [5.0, 3.0, 0.0]) # end point\n\nouter_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-5.0, 3.0, 0.0], # start point\n [0.0, -7.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from 0 to 180 degrees.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_arc = newCircularArcCurve(\"Arc\", # curve name\n [0.0, 3.0, 0.0], # center\n 5.0, # radius\n 0.0, # start angle\n 180.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", and \"Arc\" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-a-background-grid","page":"Creating and editing curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We visualize the outer boundary curve chain and background grid with the following","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"plotProject!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains three curve segments \"Line1\", \"Arc\", and \"Line2\" labeled in the figure by O.1, O.2, and O.3, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-the-outer-boundary-chain","page":"Creating and editing curves","title":"Edit the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the domain boundary requires a curved segment instead of the straight line \"Line2\". We will replace this line segment in the outer boundary chain with a cubic spline.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"First, we remove the \"Line2\" curve from the \"Outer\" chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Outer curve removal\nAlternatively, we can remove the curve \"Line2\" using its index in the \"Outer\" boundary chain.removeOuterBoundaryCurveAtIndex!(sandbox_project, 3)This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The plot automatically updates and we see that the outer boundary is open and contains two segments: \"Line1\" and \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve \"Arc\" and end at the first point of the curve \"Line1\". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. The spline curve constructor newSplineCurve also takes the number of points as an input argument.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"spline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we add the spline curve outer_spline into the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates automatically to display the \"Outer\" boundary chain with the new \"Spline\" curve labeled O.3.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-an-inner-boundary-chain","page":"Creating and editing curves","title":"Add an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a pill shaped inner boundary curve chain composed of four pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (1 5) to (1 3).\nHalf-circle arc of radius r=1 centered at (0 3).\nStraight line segment from (-1 3) to (-1 5).\nHalf-circle arc of radius r=1 centered at (0 5).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Similar to the construction of the \"Outer\" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [1.0, 5.0, 0.0], # start point\n [1.0, 3.0, 0.0]) # end point\n\ninner_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-1.0, 3.0, 0.0], # start point\n [-1.0, 5.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at (0 3) varies from 0 to -180 degrees. The top half-circle arc centered at (0 5) has an angle that varies from 180 to 0 degrees. The construction of the two circle arcs are","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_bottom_arc = newCircularArcCurve(\"BottomArc\", # curve name\n [0.0, 3.0, 0.0], # center\n 1.0, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\n\ninner_top_arc = newCircularArcCurve(\"TopArc\", # curve name\n [0.0, 5.0, 0.0], # center\n 1.0, # radius\n 180.0, # start angle\n 0.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Note, we use \"radians\" to set the angle bounds for inner_bottom_arc and \"degrees\" for the angle bounds of inner_top_arc.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", \"BottomArc\", and \"TopArc\" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This inner boundary chain name \"inner\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments \"Line1\", \"BottomArc\", \"Line2\", and \"TopArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_pill)","category":"page"},{"location":"tutorials/create_edit_curves/#Generate-the-mesh","page":"Creating and editing curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox.control: A HOHQMesh control file for the current project.\nsandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nsandbox.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 7.5414000000000009E-002\n Number of nodes = 511\n Number of Edges = 933\n Number of Elements = 422\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00002932 1.17335568 0.18813138 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00953438 2.30790024 1.31439620 1.00000000 999.99900000 1.00000000\n Condition 1.00041663 2.41773865 1.21024584 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.01673809 3.68828437 1.59413340 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001750 1.13820387 0.14143901 0.00000000 999.99900000 1.00000000\n Minimum Angle 32.22733574 89.35690571 68.75321248 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.61089476 152.37947944 113.36221513 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: initial_mesh)","category":"page"},{"location":"tutorials/create_edit_curves/#Delete-the-existing-mesh","page":"Creating and editing curves","title":"Delete the existing mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"remove_mesh!(sandbox_project)\nupdatePlot!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Additionally, the remove_mesh! command deletes the mesh information from the sandbox_project and sandbox.mesh from the out folder. However, the sandbox.control and sandbox.tec files are still present in out directory.","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-an-inner-boundary-chain","page":"Creating and editing curves","title":"Edit an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the inner boundary actually requires a curved segment instead of the straight line \"Line1\". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We remove the \"Line1\" curve from the inner chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Inner curve removal\nAlternatively, we can remove the curve \"Line1\" using its index in the inner boundary chain.removeInnerBoundaryCurveAtIndex!(sandbox_project, 1, \"inner\")This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: \"BottomArc\", \"Line2\", and \"TopArc\". Note that the index of the remaining curves has changed as shown below.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Brief note about undo / redo\nThe interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.undoActionName()\n\"Remove Inner Boundary Curve\"We can undo the removal of the \"Line1\" curve with undoundo()\n\"Undo Remove Inner Boundary Curve\"In addition to reinstating \"Line1\" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The new inner curve segment will be an oscillating line given by the parametric equations","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":" beginaligned\n x(t) = t + 102cm\n y(t) = -2t + 5 - frac32 cos(pi t) sin(pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"xEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The name of this new curve is assigned to be \"wiggleLine\". We add this new curve to the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The automatically updated figure now shows:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_open_chain)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We see from the figure that this parametric equation curve starts at the point (15) and, therefore, matches the end point of the existing curve \"TopArc\" present in the \"inner\" chain. However, the parametric equation curve ends at the point (23) which does not match the \"BottomArc\" curve. So, the inner boundary chain remains open.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"warning: Attempt to generate a mesh with an open curve chain\nAn open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create a closed boundary curve we must remove the \"BottomArc\" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point (2 3) and end at the point (-1 3) to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the \"BottomArc\" from the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates to display the \"inner\" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_remove_arc)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"A half-circle arc that joins the points (2 3) and (-1 3) has a radius r=15, is centered at (05 3) and has an angle that vaires from 0 to -180. We construct this circle arc and directly add it to the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"new_bottom_arc = newCircularArcCurve(\"wideBottomArc\", # curve name\n [0.5, 3.0, 0.0], # center\n 1.5, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The updated plot now gives the modified, closed inner curve chain that now contains four curve segments \"Line2\", \"TopArc\", \"wiggleLine\", and \"wideBottomArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/#Regenerate-the-mesh","page":"Creating and editing curves","title":"Regenerate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.11353599999999998\n Number of nodes = 712\n Number of Edges = 1308\n Number of Elements = 596\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00002932 1.15661960 0.12823902 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.01050856 3.14732001 1.34260027 1.00000000 999.99900000 1.00000000\n Condition 1.00037771 2.59434067 1.22850175 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.02744717 3.68828437 1.64751502 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001750 1.13149451 0.09443920 0.00000000 999.99900000 1.00000000\n Minimum Angle 31.87236189 89.33988565 67.86178629 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.44177106 157.27121105 114.35699650 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: zoom_corner)","category":"page"},{"location":"tutorials/create_edit_curves/#Summary","page":"Creating and editing curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"# Interactive mesh with modified outer and inner curve chains\n#\n# Create inner / outer boundary chains composed of the four\n# available HOHQMesh curve types.\n#\n# Keywords: outer boundary, inner boundary, parametric equations,\n# circle arcs, cubic spline, curve removal\nusing HOHQMesh\n\n# Instantiate the project\nsandbox_project = newProject(\"sandbox\", \"out\")\n\n# Add the background grid\naddBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])\n\n# Create and add the original outer boundary curves\nouter_line1 = newEndPointsLineCurve(\"Line1\", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])\nouter_line2 = newEndPointsLineCurve(\"Line2\", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])\nouter_arc = newCircularArcCurve(\"Arc\", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, \"degrees\")\n\naddCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)\n\n# Modify the outer boundary to have a spline instead of a straight line\nremoveOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")\n\nspline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)\naddCurveToOuterBoundary!(sandbox_project, outer_spline)\n\n# Create and add the inner boundary curves\ninner_line1 = newEndPointsLineCurve(\"Line1\", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])\ninner_line2 = newEndPointsLineCurve(\"Line2\", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])\ninner_bottom_arc = newCircularArcCurve(\"BottomArc\", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, \"radians\")\ninner_top_arc = newCircularArcCurve(\"TopArc\", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, \"degrees\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")\n\n# Generate a mesh\ngenerate_mesh(sandbox_project)\n\n# Delete the existing mesh before modifying the inner boundary curve chain\nremove_mesh!(sandbox_project)\n\n# Modify the inner boundary curve with an oscillatory line and a new circle arc\nremoveInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")\nremoveInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")\n\nxEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)\n\nnew_bottom_arc = newCircularArcCurve(\"wideBottomArc\", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, \"radians\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")\n\n# Regenerate the final mesh\ngenerate_mesh(sandbox_project)","category":"page"},{"location":"interactive_overview/#InteractiveTool","page":"Overview","title":"Overview","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Several scripts are available in the examples/ folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.","category":"page"},{"location":"interactive_overview/#Workflow-and-basic-moves","page":"Overview","title":"Workflow and basic moves","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"To generate a mesh interactively you","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Create a project with a user given projectName and folder where any generated files are to be saved\np = newProject(, )\nBoth of these input arguments are strings.\nCreate inner and outer boundary curves from the available types\nc = newEndPointsLineCurve(, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*\nc = newCircularArcCurve(, center [x, y, z], radius, startAngle, endAngle, units = \"degrees\" or \"radians\") *Circular Arc*\nc = newParametricEquationCurve(, xEqn, yEqn, zEqn) *Parametric equation*\nc = newSplineCurve(, dataFile) *Spline with data from a file*\nc = newSpline(, nKnots, knotsMatrix) *Spline with given knot values*\nSee Defining curves for further details on the different curve type currently supported by HOHQMesh.\nThe generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.\nAdd curves to build the model to see what you have added,\naddOuterBoundaryCurve!(p, ) *Add outer boundary curve*\naddInnerBoundaryCurve!(p, , ) *Add curve to an inner boundary*\nFor a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.\nCurves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.\nVisualize the project's model, if desired\nplotProject!(p, MODEL)\nPlots are updated in response to user interactions. However, to update the plot at any time, use\nupdatePlot!(p, options)\nOptions are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.\nnote: Visualization requirement\nThe interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.\nSet the background grid\nWhen no outer boundary curve is present, the background grid can be set with\naddBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])\nOr\naddBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])\nThe first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.\nWhen an outer boundary is present the background grid can be set as\naddBackgroundGrid!(p, [dx, dy, dz])\nwhere the spacing controls the number of elements in each direction.\nnote: Background grid\nA background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.\nAdjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by\nsetPolynomialOrder!(p, order)\nThe background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately\nsetBackgroundGridSize!(p, 0.5, 0.25)\nSee Controlling the mesh generation for details on adjusting parameters already present in the Project.\nGenerate the mesh\ngenerate_mesh(p)\nThe mesh file will be saved in with the name .mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name .control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.","category":"page"},{"location":"interactive_overview/#Advanced","page":"Overview","title":"Advanced","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The generate_mesh function has two optional arguments. The first is the Boolean verbose argument. One can pass verbose=true to output additional messages and information during the meshing process. The second is the integer subdivision_maximum argument. The default value is subdivision_maximum=8, meaning that elements can be up to a factor of 2^8 smaller than the existing background grid. Note, think before adjusting the subdivision_maximum level! It is often the case that adjusting the boundary curves, background grid size, adding local refinement regions, or some combination of these adjustments removes the need to adjust the subdivision depth.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.","category":"page"},{"location":"testing/#Testing","page":"Testing","title":"Testing","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In HOHQMesh and its related repositories, tests are triggered by","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"each git push to main and\neach git push to any pull request.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test and coverage requirements\nBefore merging a pull request (PR) to main, we require thatthe code passes all functional tests\ncode coverage does not decrease.","category":"page"},{"location":"testing/#Testing-setup","page":"Testing","title":"Testing setup","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> using Pkg; Pkg.test(\"HOHQMesh\")","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> # Run all test for the interactive Curve API\n include(joinpath(\"test\", \"test_curve.jl\"))","category":"page"},{"location":"testing/#Adding-new-tests","page":"Testing","title":"Adding new tests","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test duration\nAs a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).","category":"page"},{"location":"testing/#Test-coverage","page":"Testing","title":"Test coverage","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered \"covered\" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The \"Details\" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Coverage requirements\nIn general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.","category":"page"},{"location":"authors/#Authors","page":"Authors","title":"Authors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.","category":"page"},{"location":"authors/#Principal-Developers","page":"Authors","title":"Principal Developers","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"David A. Kopriva, Florida State University, USA\nAndrew Winters, Linköping University, Sweden","category":"page"},{"location":"authors/#Contributors","page":"Authors","title":"Contributors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"The following people contributed major additions or modifications to HOHQMesh and are listed in alphabetical order:","category":"page"},{"location":"authors/","page":"Authors","title":"Authors","text":"David Kopriva\nHendrik Ranocha\nMichael Schlottke-Lakemper\nAndrew Winters","category":"page"},{"location":"reference/#HOHQMesh.jl-API","page":"Reference","title":"HOHQMesh.jl API","text":"","category":"section"},{"location":"reference/","page":"Reference","title":"Reference","text":"CurrentModule = HOHQMesh","category":"page"},{"location":"reference/","page":"Reference","title":"Reference","text":"Modules = [HOHQMesh]","category":"page"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary named boundaryName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, obj::Dict{String,Any})\n\nAdd a curve to the outer boundary or a refinement reion to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}, Array{Float64}, Array{Int64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})\n\nAdd the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version\n\naddBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nis a lot easier to use.\n\nTODO: Change HOHQMesh and delete this way to specify the domain and use the bounding box one instead.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}, Array{Int64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nAdd the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid(proj::Project, bgSize::Array{Float64})\n\nAdd the background grid block with the grid size to be a 3-vector. Use this when there is an outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, dict::Dict{String,Any})\n\nUsed only for undo/redo.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToInnerBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.addCurveToInnerBoundary!","text":"addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary with name boundaryName. If an inner boundary of that name does not exist, one is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addCurveToOuterBoundary!","text":"addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})\n\nAdd a curve to the outer boundary. The curves must be added in order counter-clockwise\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addInnerBoundaryWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.addInnerBoundaryWithName!","text":"addInnerBoundaryWithName!(proj::Project,name::String)\n\nCreate a new empty inner boundary with the given name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addObserver-Tuple{Any, String, Any}","page":"Reference","title":"HOHQMesh.addObserver","text":"addObserver(observer::Any, note::String, f::Any)\n\nf is the function to be executed (called) when a notification of name note is given.\n\nThe function called upon notification must have the signature f(observer, sender, args...)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addOuterBoundary!","text":"addOuterBoundary!(proj::Project, outerBoundary::Dict{String,Any})\n\nAdd an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegion!","text":"addRefinementRegion!(proj::Project,r::Dict{String,Any})\n\nAdd the refinement region to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegionPoints!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegionPoints!","text":"addRefinementRegionPoints!(proj::Project, r::Dict{String,Any})\n\nCompute and add to the project the plotting points for the refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRunParameters!","page":"Reference","title":"HOHQMesh.addRunParameters!","text":"addRunParameters!(proj::Project,\n plotFormat::String = \"skeleton\",\n meshFileFormat::String = \"ISM-V2\",\n polynomialOrder::Int = 5)\n\nAdd a RUN_PARAMETERS block and set all the parameters in one call.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.addSpringSmoother!","page":"Reference","title":"HOHQMesh.addSpringSmoother!","text":"addSpringSmoother!(status::String, type::String, nIterations::Int)\n\nStatus is either ON or OFF Type is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.bboxUnion-Tuple{Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.bboxUnion","text":"bboxUnion(box1::Array{Float64}, box2::Array{Float64})\n\nReturns the union of two bounding boxes\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.curveBounds-Tuple{Matrix{Float64}}","page":"Reference","title":"HOHQMesh.curveBounds","text":"curveBounds(crvPoints::Array{Float64,2})\n\nFind the bounds of a single curve, discretized as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.emptyBounds-Tuple{}","page":"Reference","title":"HOHQMesh.emptyBounds","text":"emptyBounds()\n\nReturns an array that will always be ignored when unioned with another bounding box.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.examples_dir-Tuple{}","page":"Reference","title":"HOHQMesh.examples_dir","text":"examples_dir()\n\nReturn the path to the directory with some example mesh setups.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.extract_mesh_file_format-Tuple{Any}","page":"Reference","title":"HOHQMesh.extract_mesh_file_format","text":"extract_mesh_file_format(control_file)\n\nReturn a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{Any}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(control_file;\n output_directory=\"out\",\n mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing,\n verbose=false)\n\nGenerate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.\n\nYou can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.\n\nYou can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.\n\nTo override the maximum number of allowable subdivisions in the quad tree during meshing adjust the value of subdivision_maximum. The default value of subdivision_maximum is 8, meaning that elements can be up to a factor of 2^8 smaller than the background grid. Note, think before doing this! It could be adjusting the boundary curves, background grid size, adding local refinement regions, or some combination may remove the need to adjust the subdivision depth.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(proj::Project; verbose=false, subdivision_maximum=8)\n\nGenerate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.\n\nThis function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.\n\nWith the optional argument verbose one can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information.\n\nTo override the maximum number of allowable subdivisions in the quad tree during meshing adjust the value of subdivision_maximum. The default value of subdivision_maximum is 8, meaning that elements can be up to a factor of 2^8 smaller than the background grid. Note, think before doing this! It could be adjusting the boundary curves, background grid size, adding local refinement regions, or some combination may remove the need to adjust the subdivision depth.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getAllRefinementRegions-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getAllRefinementRegions","text":"getAllRefinementRegions(proj::Project)\n\nGet the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcCenter","text":"getArcCenter(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the center of a circular arc as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcEndAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcEndAngle","text":"getArcEndAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcRadius-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcRadius","text":"getArcRadius(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcStartAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcStartAngle","text":"getArcStartAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcUnits-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcUnits","text":"getArcUnits(crv::Dict{String,Any}, units::String)\n\nGet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridLowerLeft-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridLowerLeft","text":"getBackgroundGridLowerLeft(proj::Project)\n\nReturns the [x,y] of the lower left point of the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSize-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSize","text":"getBackgroundGridSize(proj::Project)\n\nReturns the background grid size array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSteps-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSteps","text":"getBackgroundGridSteps(proj::Project)\n\nReturns the [Nx,Ny,Nz] for the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String, boundaryName::String)\n\nGet the curve named curveName from the inner boundary named boundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String)\n\nGet the curve with name curveName from the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveName","text":"getCurveName(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveType","text":"getCurveType(crv::Dic{String,Any})\n\nGet the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,\n`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getEndPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getEndPoint","text":"getEndPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the end point for a line curve as an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundary-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundary","text":"getInnerBoundary(proj::Project, name::String)\n\nGet the chain of curves from the inner boundary with name name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryChainWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryChainWithName","text":"getInnerBoundaryWithName(proj::Project, name::String)\n\nGet the inner boundary CHAIN with the given name. If one does not exist, it is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryCurve","text":"\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getMeshFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getMeshFileFormat","text":"getMeshFileFormat(proj::Project)\n\nReturns the format in which the mesh will be written.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getName-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getName","text":"getName(proj::Project)\n\nReturns the filename to be used by the mesh, plot, control, and stats files.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryChainList-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getOuterBoundaryChainList","text":"getOuterBoundaryChainList(proj::Project)\n\nGet the array of outer boundary curves.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryCurveWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getOuterBoundaryCurveWithName","text":"getOuterBoundaryCurveWithName(proj::Project, name::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPlotFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPlotFileFormat","text":"getPlotFileFormat(proj::Project)\n\nReturns the plot file format.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPolynomialOrder-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPolynomialOrder","text":"getPolynomialOrder(proj::Project)\n\nReturns the polynomial order for boundary curves in the mesh file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementEnd-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementEnd","text":"getRefinementEnd(r::Dict{String,Any})\n\nReturn Array{Float64} of the end location of the refinement line\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementGridSize-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementGridSize","text":"getRefinementGridSize(r::Dict{String,Any})\n\nReturns the grid size,h, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementLocation-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementLocation","text":"getRefinementLocation(r::Dict{String,Any})\n\nReturn Array{Float64} of the location of the refinement center.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementName","text":"getRefinementName(r::Dict{String,Any})\n\nReturn name of the refinement. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"getRefinementRegion(proj::Project, indx)\n\nGet the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"(i,r) = getRefinementRegion(project, name)\n\nGet the refinement region with the given name and its location in the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegionCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementRegionCenter","text":"getRefinementRegionCenter(r::Dict{String,Any})\n\nGet, or compute, the center of the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementStart-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementStart","text":"getRefinementStart (r::Dict{String,Any})\n\nReturn Array{Float64} of the start location of the refinement line. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementType","text":"getRefinementType(r::Dict{String,Any})\n\nReturn the type of refinement, either \"smooth\" or \"sharp\". r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementWidth-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementWidth","text":"getRefinementWidth(r::Dict{String,Any})\n\nReturns the region width,w, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingIterations-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingIterations","text":"getSmoothingIterations(proj::Project)\n\nGet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingStatus-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingStatus","text":"smoothingStatus(proj::Project)\n\nReturns whether the smoother will be \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingType-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingType","text":"getSmoothingType(proj::Project)\n\nReturns either \"LinearSpring\" or \"LinearAndCrossbarSpring\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplineNKnots-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplineNKnots","text":"getSplineNKnots(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplinePoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplinePoints","text":"getSplinePoints(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getStartPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getStartPoint","text":"getStartPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the start point for a line curve as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getXEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getXEqn","text":"getXEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getYEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getYEqn","text":"getYEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getZEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getZEqn","text":"getZEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.hasBackgroundGrid-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.hasBackgroundGrid","text":"hasBackgroundGrid(proj::Project)\n\nTests to see if the project has a backgroundGrid dictionary defined.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.innerBoundaryIndices-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.innerBoundaryIndices","text":"innerBoundaryIndices(proj::Project, curveName::String)\n\nReturns (curveIndex,chainIndex) for the location of the curve named curveName in it's inner boundary chain.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryAtIndex!-Tuple{HOHQMesh.Project, String, Int64, Dict{String, Any}, Vector{Any}, Vector{String}}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryAtIndex!","text":"insertInnerBoundaryAtIndex!(proj::Project, chainName::String, indx::Int, chain::??)\n\nInsert an entire inner boundary. Primarily meant for undo operation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64, String}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryCurveAtIndex!","text":"insertInnerBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any},\n indx::Int, boundaryName::String)\n\nInsert a curve crv into an inner boundary chain boundaryName at the specified index indx.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertOuterBoundaryCurveAtIndex!","text":"insertOuterBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any}, indx::Int)\n\nInsert a curve into the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertRefinementRegion!","text":"insertRefinementRegion!(proj::Project, r::Dict{String,Any}, indx::Int)\n\nUsed by undo()\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelChainIsOK-Tuple{Vector{Dict{String, Any}}, String}","page":"Reference","title":"HOHQMesh.modelChainIsOK","text":"modelChainIsOK(chain::Vector{Dict{String, Any}}, chainName::String)\n\nReturns true if the chain of curves is contiguous and closed; false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelCurvesAreOK-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.modelCurvesAreOK","text":"modelCurvesAreOK(proj::Project)\n\nGo through all curves in the model and make sure they are connected and closed. Also, remove any empty outer / inner boundary chains.\n\nReturns true if all curves are connected and closed, false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreate a new parametric equation curve.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-2","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)\n\nCreate a new circular arc.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-Tuple{String, Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})\n\nCreate a new line defined by its end points.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, nKnots::Int, data::Matrix{Float64})\n\nCreate a spline curve from an array of knots\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, String}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, dataFile::String)\n\nCreate a spline curve from the contents of a data file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newCircularArcCurve","page":"Reference","title":"HOHQMesh.newCircularArcCurve","text":"newCircularArcCurve(name::String, center::Array{Float64},\n startAngle::Float64, endAngle::Float64,\n units::String)\n\nCreates and returns a new circular arc curve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newEndPointsLineCurve-Tuple{String, Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.newEndPointsLineCurve","text":"newEndPointsLineCurve(name::String, xStart::Array{Float64},xEnd::Array[Float64])\n\nCreates and returns a new curve defined by its end points in the form of a Dictionary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newParametricEquationCurve","page":"Reference","title":"HOHQMesh.newParametricEquationCurve","text":"newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreates and returns a new parametricEquationCurve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newProject","text":"newProject(name::String, folder::String)\n\nCreate a new project with the given name. That name will be used for the mesh and plot files in the specified folder.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementCenter-Tuple{String, String, Array{Float64}, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementCenter","text":"newRefinementCenter(name, type,\n center, meshSize,\n width)\n\nCreate refinement center of type \"smooth\" or \"sharp\" centered at center = [x,y,z] with a mesh size meshSize spread over a radius width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementLine-Tuple{String, String, Array{Float64}, Array{Float64}, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementLine","text":"newRefinementLine(name, type,\n start, end,\n meshSize,\n width)\n\nCreate refinement line of type \"smooth\" or \"sharp\" between start = [x,y,z] and end = [x,y,z] with a mesh size meshSize spread over a width width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, nKnots::Int, data::Array{Float64,4})\n\nReturns a spline curve given the number of knots and the array of knots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, dataFile::String)\n\nReturns a spline curve given a data file that contains the number of knots on the first line, and the spline data following that.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.openProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.openProject","text":"openProject(fileName::String, folder::String)\n\nOpen existing project described in the control File.\n\nfolder = folder the control file is in\nfileName = the name of the file\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.plotProject!","page":"Reference","title":"HOHQMesh.plotProject!","text":"plotProject!(proj::Project, plotOptions::Int = 0)\n\nPlot objects specified by the plotOptions. Construct the plotOptions by the sum of what is to be drawn from the choices MODEL, GRID, MESH, REFINEMENTS.\n\nExample: To plot the model and the grid, plotOptions = MODEL + GRID. To plot just the mesh, plotOptions = MESH.\n\nTo plot everything, plotOptions = MODEL + GRID + MESH + REFINEMENTS\n\nContents are overlaid in the order: GRID, MESH, MODEL, REFINEMENTS\n\nnote: Requires Makie.jl\nPlease note that for this function to work, you need to load Makie.jl in your REPL (e.g., by calling using GLMakie).\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.postNotificationWithName-Tuple{Any, String, Tuple}","page":"Reference","title":"HOHQMesh.postNotificationWithName","text":"postNotificationWithName(sender::Any, name::String, userInfo::Tuple)\n\nExecutes the function associated with the observer for the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.refinementRegionPoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.refinementRegionPoints","text":"refinementRegionPoints(r::Dict{String,Any})\n\nReturns Array{Float64,2} being the plotting points of a refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String, innerBoundaryName::String)\n\nDelete the curve named curveName from the inner boundary named innerBoundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String)\n\nDelete the curve named curveName from the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeBackgroundGrid!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeBackgroundGrid!","text":"removeBackgroundGrid!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundary!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundary!","text":"removeInnerBoundary!(proj::Project, chainName::String)\n\nRemove an entire inner boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurve!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurve!","text":"removeInnerBoundaryCurve!(proj::Project, name::String, chainName::String)\n\nRemove the curve with name from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurveAtIndex!","text":"removeInnerBoundaryCurveAtIndex!(proj::Project, indx::Int, chainName::String)\n\nRemove the curve at index indx from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundary!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeOuterBoundary!","text":"removeOuterBoundary!(proj::Project)\n\nRemove the outer boundary curve if it exists.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveAtIndex!","text":"removeOuterBoundaryCurveAtIndex!(proj::Project, indx::Int)\n\nRemove a curve from the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveWithName!","text":"removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n\nRemove the named curve in the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRefinementRegion!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeRefinementRegion!","text":"removeRefinementRegion!(proj::Project, name::String)\n\nDelete the named refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRunParameters!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeRunParameters!","text":"removeRunParameters!(proj::Project)\n\nRemove the run parameters block from the project. This is not undo-able.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeSpringSmoother!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeSpringSmoother!","text":"removeSpringSmoother!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove_mesh!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.remove_mesh!","text":"remove_mesh!(proj::Project)\n\nRemove the mesh file from proj.projectDirectory and delete the mesh from the plot\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.saveProject-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.saveProject","text":"saveProject(proj::Project)\n\nproj = Project to be saved\n\nSave a project dictionary to the file path specified when the project was created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcCenter!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setArcCenter!","text":"setArcCenter!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the center of a circular arc.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcEndAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcEndAngle!","text":"setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcRadius!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcRadius!","text":"setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcStartAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcStartAngle!","text":"setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcUnits!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setArcUnits!","text":"setArcUnits(crv::Dict{String,Any}, units::String)\n\nSet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridLowerLeft!-Tuple{HOHQMesh.Project, Array{Float64}}","page":"Reference","title":"HOHQMesh.setBackgroundGridLowerLeft!","text":"setBackgroundGridLowerLeft!(proj::Project, x0::Array{Float64})\n\nSet the lower left location of the background grid for problems that have no outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSpacing!(proj::Project, dx::Float64, dy::Float64, dz::Float64 = 0.0)\n\nUser facing function\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Array{Float64}, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Array{Float64}, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, dx is passed an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Float64, Float64, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Float64, dy::Float64, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, the new grid size in either direction is passed individually with dxand dy.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSteps!-Tuple{HOHQMesh.Project, Array{Int64}}","page":"Reference","title":"HOHQMesh.setBackgroundGridSteps!","text":"setBackgroundGridSteps!(proj::Project, N::Array{Int})\n\nSet how many steps of size setBackgroundGridSpacing in each direction the background grid extends from the lower left.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setCurveName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setCurveName!","text":"setCurveName!(curveDict, name)\n\nSet the name of the curve represented by curveDict.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setEndPoint!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setEndPoint!","text":"setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the end point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setMeshFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setMeshFileFormat!","text":"setMeshFileFormat(proj::Project, meshFileFormat::String)\n\nSet the file format for the mesh file. Acceptable choices are \"ISM\", \"ISM-V2\", or \"ABAQUS\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setName!","text":"setName(proj::Project,name::String)\n\nThe name of the project is the filename to be used by the mesh, plot, and stats files. It is also the name of the control file the tool will produce.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPlotFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setPlotFileFormat!","text":"setPlotFileFormat(proj::Project, plotFileFormat::String)\n\nSet the file format for the plot file. Acceptable choices are \"sem\", which includes interior nodes and boundary nodes and \"skeleton\", which includes only the corner nodes.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPolynomialOrder!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setPolynomialOrder!","text":"setPolynomialOrder(proj::Project, p::Int)\n\nSet the polynomial order for boundary curves in the mesh file to p.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementEnd!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementEnd!","text":"setRefinementEnd!(refinementRegion, location)\n\nSet the end point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementGridSize!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementGridSize!","text":"setRefinementGridSize!(r::Dict{String,Any}, h)\n\nSet the grid size, h for the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementLocation!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementLocation!","text":"setRefinementLocation!(refinementCenter, location)\n\nSet the location of a refinement center to location = [x,y,z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementName!","text":"setRefinementName!(r::Dict{String,Any}, type)\n\nSet a name for the refinement region.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementStart!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementStart!","text":"setRefinementStart!(refinementRegion, location)\n\nSet the start point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementType!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementType!","text":"setRefinementType!(refinementRegion, type)\n\nSet the type, either \"smooth\" or \"sharp\" for the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementWidth!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementWidth!","text":"setRefinementWidth!(r::Dict{String,Any}, width)\n\nSet the width of the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingIterations!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setSmoothingIterations!","text":"setSmoothingIterations!(proj::Project, iterations::Int)\n\nSet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingStatus!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingStatus!","text":"setSmoothingStatus(proj:Project, status::String)\n\nStatus is either \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingType!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingType!","text":"setSmoothingType!(proj:Project, status::String)\n\nType is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplineNKnots!-Tuple{Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.setSplineNKnots!","text":"setSplineNKnots!(spline::Dict{String,Any}, nKnots::Int)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplinePoints!-Tuple{Dict{String, Any}, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.setSplinePoints!","text":"setSplinePoints!(spline::Dict{String,Any},points::Array{Float64,4})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setStartPoint!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setStartPoint!","text":"setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the start point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setXEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setXEqn!","text":"setXEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the x-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setYEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setYEqn!","text":"setYEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the y-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setZEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setZEqn!","text":"setZEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the zEqn-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.unRegisterForNotification-Tuple{Any, String}","page":"Reference","title":"HOHQMesh.unRegisterForNotification","text":"unRegisterForNotification(observer::Any, note::String)\n\nRemove the observer from being notified by the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.updatePlot!","page":"Reference","title":"HOHQMesh.updatePlot!","text":"updatePlot!(proj::Project, plotOptions::Int)\n\nReplot with the new plotOptions = combinations (sums) of\n\nGRID, MESH, MODEL, REFINEMENTS\n\nExample: updatePlot!(p, MESH + MODEL)\n\nnote: Requires Makie.jl\nPlease note that for this function to work, you need to load Makie.jl in your REPL (e.g., by calling using GLMakie).\n\n\n\n\n\n","category":"function"},{"location":"tutorials/spline_curves/#Spline-curves","page":"Spline curves","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line \"curves\". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.","category":"page"},{"location":"tutorials/spline_curves/#Synopsis","page":"Spline curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/spline_curves/#Initialization","page":"Spline curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a new project with the name \"spline_curves\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_project = newProject(\"spline_curves\", \"out\")","category":"page"},{"location":"tutorials/spline_curves/#Add-the-outer-boundary","page":"Spline curves","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The outer boundary curve for this tutorial is a circle of radius r=4 centered at the point (0 -1). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"circ = newCircularArcCurve(\"outerCircle\", # curve name\n [0.0, -1.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circ is assigned to be \"outerCircle\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new circ curve is then added to the spline_project as an outer boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToOuterBoundary!(spline_project, circ)","category":"page"},{"location":"tutorials/spline_curves/#Add-a-background-grid","page":"Spline curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for spline_project to have elements with side length 06 in each direction","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addBackgroundGrid!(spline_project, [0.6, 0.6, 0.0])","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"plotProject!(spline_project, MODEL+GRID)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"outerCircle\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/spline_curves/#Add-the-inner-boundaries","page":"Spline curves","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The domain of this tutorial will contain three inner boundary curves:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Cubic spline curve created from data points read in from a file.\nCubic spline curve created from points directly given in the code.\nTriangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-with-data-from-a-file","page":"Spline curves","title":"Cubic spline with data from a file","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots t_j, x_j, y_j, z_j where j indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a parametric spline curve from a file with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline1 = newSplineCurve(\"big_spline\", joinpath(@__DIR__, \"examples\", \"test_spline_curve_data.txt\"))","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline1 is assigned to be \"big_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline1 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline1, \"inner1\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve \"big_spline\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: one_curve)","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-from-data-in-Julia","page":"Spline curves","title":"Cubic spline from data in Julia","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Below, we construct another parametric spline using this strategy that consists of five data points","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n\nspline2 = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline2 is assigned to be \"small_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline2 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline2, \"inner2\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner2\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve \"small_spline\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: two_curves)","category":"page"},{"location":"tutorials/spline_curves/#Triangular-shape","page":"Spline curves","title":"Triangular shape","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"edge1 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.3, -1.0, 0.0], # start point\n [-1.7, -1.0, 0.0]) # end point\n\nedge2 = newEndPointsLineCurve(\"triangle\", # curve name\n [-1.7, -1.0, 0.0], # start point\n [-2.0, -0.4, 0.0]) # end point\n\nedge3 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.0, -0.4, 0.0], # start point\n [-2.3, -1.0, 0.0]) # end point","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, each edge of the curve is given the same name \"triangle\" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, edge1, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge2, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge3, \"inner3\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The inner boundary chain name \"inner3\" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called \"triangle\" labeled in the figure by 3.1, 3.2, and 3.3.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: three_curves)","category":"page"},{"location":"tutorials/spline_curves/#Generate-the-mesh","page":"Spline curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_curves.control: A HOHQMesh control file for the current project.\nspline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nspline_curves.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"generate_mesh(spline_project)\n 1 chevron elements removed from mesh.\n 1 chevron elements removed from mesh.\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.25359100000000001\n Number of nodes = 1176\n Number of Edges = 2225\n Number of Elements = 1047\n Number of Subdivisions = 4\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00006209 0.15607019 0.04505180 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00008965 2.78091496 1.23178864 1.00000000 999.99900000 1.00000000\n Condition 1.00000055 3.82171291 1.15535543 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00014261 6.78201663 1.46249737 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001491 0.10424647 0.03955817 0.00000000 999.99900000 1.00000000\n Minimum Angle 37.24189766 89.96174556 74.42003031 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.03128071 157.35065162 107.91806148 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of \"bad\" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: final_spline)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the \"big_spline\" curve. We decide that we are satisfied with the overall mesh quality.","category":"page"},{"location":"tutorials/spline_curves/#Summary","page":"Spline curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#Tutorials","page":"Overview","title":"Tutorials for HOHQMesh.jl","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"The tutorial section for HOHQMesh.jl provides step-by-step commands and accompanying explanations for the major features of the interactive mesh generation tools.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.","category":"page"},{"location":"tutorials/introduction/#[Straight-sided-outer-boundary](@ref)","page":"Overview","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.","category":"page"},{"location":"tutorials/introduction/#Synopsis","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/introduction/#[Curved-outer-boundary](@ref)","page":"Overview","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.","category":"page"},{"location":"tutorials/introduction/#Synopsis-2","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/introduction/#[Spline-curves](@ref)","page":"Overview","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/introduction/#Synopsis-3","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#[Creating-and-editing-curves](@ref)","page":"Overview","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve \"chain\" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.","category":"page"},{"location":"tutorials/introduction/#Synopsis-4","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"guided-tour/#Guided-tour","page":"Guided tour","title":"Guided tour","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In this brief overview, we highlight two scripts from the examples/ folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"See the HOHQMesh documentation for more details about its terminology and capabilities.","category":"page"},{"location":"guided-tour/#Mesh-from-a-control-file","page":"Guided tour","title":"Mesh from a control file","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_from_control_file.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"This command will create mesh and plot files in the out directory.","category":"page"},{"location":"guided-tour/#Build-a-mesh-from-scratch","page":"Guided tour","title":"Build a mesh from scratch","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_boundary.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For completeness, we provide the example script and walk-through each step in the construction of the Project below.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"using HOHQMesh\n\n# Create a new project with the name \"IceCreamCone\", which will also be the\n# name of the mesh, plot and stats files, written to output folder `out`.\n\np = newProject(\"IceCreamCone\", \"out\")\n\n# Outer boundary for this example mesh is a complete circle. Add it into the project.\n\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\n\n# Inner boundary is three curves. Two straight lines and a circular arc.\n# Note the three curve are connected to ensure a counter-clockwise orientation\n# as required by HOHQMesh\n\n# Create the three interior curves. The individual names of each curve in the inner\n# chain are used internally by HOHQMesh and are output as the given boundary names in\n# the mesh file.\n\ncone1 = newEndPointsLineCurve(\"cone1\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\niceCream = newCircularArcCurve(\"iceCream\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")\ncone2 = newEndPointsLineCurve(\"cone2\", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])\n\n# Assemble the three curve in a closed chain oriented counter-clockwise. The chain\n# name `IceCreamCone` is only used internally by HOHQMesh.\n\naddCurveToInnerBoundary!(p, cone1, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, iceCream, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, cone2, \"IceCreamCone\")\n\n# Adjust some `RunParameters` and overwrite the defaults values. In this case, we\n# set a new value for the boundary order polynomial representation and adjust the\n# output mesh file format to be `sem`\n\nsetPolynomialOrder!(p, 4)\nsetPlotFileFormat!(p, \"sem\")\n\n# A background grid is required for the mesh generation. In this example we lay a\n# background grid of Cartesian boxes with size 0.5.\n\naddBackgroundGrid!(p, [0.5, 0.5, 0.0])\n\n# Plot the project model curves and background grid\n\nif isdefined(Main, :Makie)\n plotProject!(p, MODEL+GRID)\n @info \"Press enter to generate the mesh and update the plot.\"\n readline()\n else # Throw an informational message about plotting to the user\n @info \"To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again.\"\n end\n\n# Generate the mesh. This produces the mesh and TecPlot files `IceCreamCone.mesh` and `IceCreamCone.tec`\n# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is\n# updated with the mesh that was generated.\n\ngenerate_mesh(p)\n\n# After the mesh successfully generates mesh statistics, such as the number of corner nodes,\n# the number of elements etc., are printed to the REPL","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The first line creates a new project, where the mesh and plot file names will be derived from the project name, \"IceCreamCone\" written to the specified folder.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, \"IceCreamCone\" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script resets the polynomial order (default = 5) and the plot file format (default = \"skeleton\").","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, only the mesh size needs to be specified using","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"addBackgroundGrid!(proj::Project, bgSize::Array{Float64})","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The example sets the background mesh size to be 0.5 in the x and y directions. The z component is ignored.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The script finishes by generating the quad mesh and plotting the results, as shown below","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"(Image: iceCreamCone)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Finally, the script returns the project so that it can be edited further, if desired.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To save a control file for HOHQMesh, simply invoke","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"saveProject(proj::Project)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"where the name of the control file (traditionally with a .control extension) matches the name of the project proj. saveProject is automatically called when a mesh is generated.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.","category":"page"},{"location":"license/#License","page":"License","title":"License","text":"","category":"section"},{"location":"license/","page":"License","title":"License","text":"MIT LicenseCopyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-LakemperPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"CheatSheet/#Commands-Cheat-Sheet","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples/ folder constructs an identical example mesh as shown in the Guided tour using generic function calls.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"A thorough description of the functions can be found in the API section.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The general workflow of the interactive mesh functionality within a REPL session is","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Create a project\nAdd boundary curves\nAdd a background grid\nAdd manual refinement (if desired)\nGenerate mesh","category":"page"},{"location":"CheatSheet/#Project","page":"Commands Cheat Sheet","title":"Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" p = newProject(, )","category":"page"},{"location":"CheatSheet/#cs-plotting","page":"Commands Cheat Sheet","title":"Plotting","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" plotProject!(p, options)\n updatePlot!(p, options)","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The options are any sum of MODEL, GRID, REFINEMENTS, and MESH.","category":"page"},{"location":"CheatSheet/#Curves","page":"Commands Cheat Sheet","title":"Curves","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" c = new(name, startLocation [x,y,z], endLocation [x,y,z]) *Straight Line*\n c = new(name, center [x,y,z], radius, startAngle, endAngle) *Circular Arc*\n c = new(name, xEqn, yEqn, zEqn) *Parametric equation*\n c = new(name, dataFile) *Spline with data from a file*\n c = new(name, nKnots, knotsMatrix) *Spline with given knot values*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#cs-manual-refinement","page":"Commands Cheat Sheet","title":"Manual Refinement","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" r = newRefinementCenter(name, type, center, gridSize, radius)\n r = newRefinementLine(name, type, startPoint, endPoint, gridSize, width)","category":"page"},{"location":"CheatSheet/#Adding-to-a-Project","page":"Commands Cheat Sheet","title":"Adding to a Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" add!(p, c) *Add outer boundary curve*\n add!(p, c, ) *Add curve to an inner boundary*\n add!(p, r) *Add refinement region*\n\n addBackgroundGrid!(p, [top, left, bottom, right], [nX, nY, nZ]) *No outer boundary*\n addBackgroundGrid!(p, [dx, dy, dz]) *If an outer boundary is present*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function add!, which is a shortcut to the full functions, e.g. addOuterBoundaryCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#Accessing-items","page":"Commands Cheat Sheet","title":"Accessing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" crv = getCurve(p, curveName) *Get a curve in the outer boundary*\n crv = getCurve(p, curveName, boundaryName) *Get a curve in an inner boundary*\n indx, chain = getChain(p, boundaryName) *Get a complete inner boundary curve*\n r = getRefinementRegion(p, name)","category":"page"},{"location":"CheatSheet/#Removing-from-Project","page":"Commands Cheat Sheet","title":"Removing from Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" removeOuterBoundary!(p) *Entire outer boundary curve*\n removeInnerBoundary!(p, innerBoundaryName) *Entire inner boundary curve*\n remove!(p, name) *Curve in outer boundary*\n remove!(p, name, innerBoundaryName) *Curve in inner boundary*\n removeRefinementRegion!(p, name)","category":"page"},{"location":"CheatSheet/#Editing-items","page":"Commands Cheat Sheet","title":"Editing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.","category":"page"},{"location":"CheatSheet/#Meshing","page":"Commands Cheat Sheet","title":"Meshing","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" generate_mesh(p)\n remove_mesh!(p)","category":"page"},{"location":"#HOHQMesh.jl","page":"Home","title":"HOHQMesh.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6 and above.","category":"page"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> import Pkg; Pkg.add(\"HOHQMesh\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the Julia REPL, you can load HOHQMesh with","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using HOHQMesh","category":"page"},{"location":"","page":"Home","title":"Home","text":"and then happily generate away!","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> control_file = joinpath(HOHQMesh.examples_dir(), \"GingerbreadMan.control\")\n\njulia> output = generate_mesh(control_file)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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,","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: gingerbreadman_with_edges_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"while the 3D file Snake.control produces this mesh:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: snake_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.,","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_box_two_circles.jl\"))","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using Pkg; Pkg.add(\"GLMakie\")\njulia> using GLMakie","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: box_two_circles)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Further explanation of the interactive functionality can be found here. Additional examples are available in the Tutorials.","category":"page"},{"location":"#authors-index-md","page":"Home","title":"Authors","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#License-and-contributing","page":"Home","title":"License and contributing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Acknowledgements","page":"Home","title":"Acknowledgements","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"}]
+}
diff --git a/v0.2.5/siteinfo.js b/v0.2.5/siteinfo.js
new file mode 100644
index 00000000..bfcb0ea4
--- /dev/null
+++ b/v0.2.5/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.2.5";
diff --git a/v0.2.5/testing/index.html b/v0.2.5/testing/index.html
new file mode 100644
index 00000000..155115d1
--- /dev/null
+++ b/v0.2.5/testing/index.html
@@ -0,0 +1,3 @@
+
+Testing · HOHQMesh.jl
During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In HOHQMesh and its related repositories, tests are triggered by
each git push to main and
each git push to any pull request.
Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.
Test and coverage requirements
Before merging a pull request (PR) to main, we require that
The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing
julia> using Pkg; Pkg.test("HOHQMesh")
in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,
julia> # Run all test for the interactive Curve API
+ include(joinpath("test", "test_curve.jl"))
We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.
Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.
When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).
Test duration
As a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).
In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered "covered" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The "Details" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.
Coverage requirements
In general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 30 April 2024. Using Julia version 1.10.2.
diff --git a/v0.2.5/tutorials/create_edit_curves/index.html b/v0.2.5/tutorials/create_edit_curves/index.html
new file mode 100644
index 00000000..532cff9c
--- /dev/null
+++ b/v0.2.5/tutorials/create_edit_curves/index.html
@@ -0,0 +1,166 @@
+
+Creating and editing curves · HOHQMesh.jl
The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a "chain" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "sandbox" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.
We first create the outer boundary curve chain that is composed of three pieces
Straight line segment from $(0, -7)$ to $(5, 3)$.
Half-circle arc of radius $r=5$ centered at $(0, 3)$.
Straight line segment from $(-5, 3)$ to $(0, -7)$.
Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
outer_line1 = newEndPointsLineCurve("Line1", # curve name
+ [0.0, -7.0, 0.0], # start point
+ [5.0, 3.0, 0.0]) # end point
+
+outer_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-5.0, 3.0, 0.0], # start point
+ [0.0, -7.0, 0.0]) # end point
To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from $0$ to $180$ degrees.
outer_arc = newCircularArcCurve("Arc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 5.0, # radius
+ 0.0, # start angle
+ 180.0, # end angle
+ "degrees") # units for angle
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be "Arc".
The curve names "Line1", "Line2", and "Arc" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.
The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction
We visualize the outer boundary curve chain and background grid with the following
plotProject!(sandbox_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains three curve segments "Line1", "Arc", and "Line2" labeled in the figure by O.1, O.2, and O.3, respectively.
Suppose that the domain boundary requires a curved segment instead of the straight line "Line2". We will replace this line segment in the outer boundary chain with a cubic spline.
First, we remove the "Line2" curve from the "Outer" chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
The plot automatically updates and we see that the outer boundary is open and contains two segments: "Line1" and "Arc".
Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve "Arc" and end at the first point of the curve "Line1". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. The spline curve constructor newSplineCurve also takes the number of points as an input argument.
We create a pill shaped inner boundary curve chain composed of four pieces
Straight line segment from $(1, 5)$ to $(1, 3)$.
Half-circle arc of radius $r=1$ centered at $(0, 3)$.
Straight line segment from $(-1, 3)$ to $(-1, 5)$.
Half-circle arc of radius $r=1$ centered at $(0, 5)$.
Similar to the construction of the "Outer" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
inner_line1 = newEndPointsLineCurve("Line1", # curve name
+ [1.0, 5.0, 0.0], # start point
+ [1.0, 3.0, 0.0]) # end point
+
+inner_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-1.0, 3.0, 0.0], # start point
+ [-1.0, 5.0, 0.0]) # end point
To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at $(0, 3)$ varies from $0$ to $-180$ degrees. The top half-circle arc centered at $(0, 5)$ has an angle that varies from $180$ to $0$ degrees. The construction of the two circle arcs are
inner_bottom_arc = newCircularArcCurve("BottomArc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 1.0, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+
+inner_top_arc = newCircularArcCurve("TopArc", # curve name
+ [0.0, 5.0, 0.0], # center
+ 1.0, # radius
+ 180.0, # start angle
+ 0.0, # end angle
+ "degrees") # units for angle
Note, we use "radians" to set the angle bounds for inner_bottom_arc and "degrees" for the angle bounds of inner_top_arc.
The curve names "Line1", "Line2", "BottomArc", and "TopArc" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.
The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.
This inner boundary chain name "inner" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments "Line1", "BottomArc", "Line2", and "TopArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:
sandbox.control: A HOHQMesh control file for the current project.
sandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
sandbox.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 7.5414000000000009E-002
+ Number of nodes = 511
+ Number of Edges = 933
+ Number of Elements = 422
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00002932 1.17335568 0.18813138 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00953438 2.30790024 1.31439620 1.00000000 999.99900000 1.00000000
+ Condition 1.00041663 2.41773865 1.21024584 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.01673809 3.68828437 1.59413340 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001750 1.13820387 0.14143901 0.00000000 999.99900000 1.00000000
+ Minimum Angle 32.22733574 89.35690571 68.75321248 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.61089476 152.37947944 113.36221513 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.
Additionally, the remove_mesh! command deletes the mesh information from the sandbox_project and sandbox.mesh from the out folder. However, the sandbox.control and sandbox.tec files are still present in out directory.
Suppose that the inner boundary actually requires a curved segment instead of the straight line "Line1". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.
We remove the "Line1" curve from the inner chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: "BottomArc", "Line2", and "TopArc". Note that the index of the remaining curves has changed as shown below.
Brief note about undo / redo
The interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.
undoActionName()
+"Remove Inner Boundary Curve"
We can undo the removal of the "Line1" curve with undo
undo()
+"Undo Remove Inner Boundary Curve"
In addition to reinstating "Line1" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.
Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.
The new inner curve segment will be an oscillating line given by the parametric equations
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above
We see from the figure that this parametric equation curve starts at the point $(1,5)$ and, therefore, matches the end point of the existing curve "TopArc" present in the "inner" chain. However, the parametric equation curve ends at the point $(2,3)$ which does not match the "BottomArc" curve. So, the inner boundary chain remains open.
Attempt to generate a mesh with an open curve chain
An open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.
To create a closed boundary curve we must remove the "BottomArc" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point $(2, 3)$ and end at the point $(-1, 3)$ to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the "BottomArc" from the "inner" chain.
The figure updates to display the "inner" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.
A half-circle arc that joins the points $(2, 3)$ and $(-1, 3)$ has a radius $r=1.5$, is centered at $(0.5, 3)$ and has an angle that vaires from $0$ to $-180$. We construct this circle arc and directly add it to the sandbox_project.
new_bottom_arc = newCircularArcCurve("wideBottomArc", # curve name
+ [0.5, 3.0, 0.0], # center
+ 1.5, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
The updated plot now gives the modified, closed inner curve chain that now contains four curve segments "Line2", "TopArc", "wiggleLine", and "wideBottomArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.11353599999999998
+ Number of nodes = 712
+ Number of Edges = 1308
+ Number of Elements = 596
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00002932 1.15661960 0.12823902 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.01050856 3.14732001 1.34260027 1.00000000 999.99900000 1.00000000
+ Condition 1.00037771 2.59434067 1.22850175 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.02744717 3.68828437 1.64751502 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001750 1.13149451 0.09443920 0.00000000 999.99900000 1.00000000
+ Minimum Angle 31.87236189 89.33988565 67.86178629 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.44177106 157.27121105 114.35699650 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The visualization updates automatically and the background grid is removed after when the mesh is generated.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.
Add the background grid when an outer boundary curve is present.
Visualize an interactive mesh project.
Discuss undo / redo capabilities.
Construct and add parametric spline curves.
Construct and add a curve from parametric equations.
Construct and add straight line segments.
Construct and add circular arc segments.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with modified outer and inner curve chains
+#
+# Create inner / outer boundary chains composed of the four
+# available HOHQMesh curve types.
+#
+# Keywords: outer boundary, inner boundary, parametric equations,
+# circle arcs, cubic spline, curve removal
+using HOHQMesh
+
+# Instantiate the project
+sandbox_project = newProject("sandbox", "out")
+
+# Add the background grid
+addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])
+
+# Create and add the original outer boundary curves
+outer_line1 = newEndPointsLineCurve("Line1", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])
+outer_line2 = newEndPointsLineCurve("Line2", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])
+outer_arc = newCircularArcCurve("Arc", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, "degrees")
+
+addCurveToOuterBoundary!(sandbox_project, outer_line1)
+addCurveToOuterBoundary!(sandbox_project, outer_arc)
+addCurveToOuterBoundary!(sandbox_project, outer_line2)
+
+# Modify the outer boundary to have a spline instead of a straight line
+removeOuterBoundaryCurveWithName!(sandbox_project, "Line2")
+
+spline_data = [ [0.0 -5.0 3.0 0.0]
+ [0.25 -2.0 1.0 0.0]
+ [0.5 -4.0 0.5 0.0]
+ [0.75 -2.0 -3.0 0.0]
+ [1.0 0.0 -7.0 0.0] ]
+outer_spline = newSplineCurve("Spline", 5, spline_data)
+addCurveToOuterBoundary!(sandbox_project, outer_spline)
+
+# Create and add the inner boundary curves
+inner_line1 = newEndPointsLineCurve("Line1", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])
+inner_line2 = newEndPointsLineCurve("Line2", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])
+inner_bottom_arc = newCircularArcCurve("BottomArc", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, "radians")
+inner_top_arc = newCircularArcCurve("TopArc", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, "degrees")
+
+addCurveToInnerBoundary!(sandbox_project, inner_line1, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_line2, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_top_arc, "inner")
+
+# Generate a mesh
+generate_mesh(sandbox_project)
+
+# Delete the existing mesh before modifying the inner boundary curve chain
+remove_mesh!(sandbox_project)
+
+# Modify the inner boundary curve with an oscillatory line and a new circle arc
+removeInnerBoundaryCurve!(sandbox_project, "Line1", "inner")
+removeInnerBoundaryCurve!(sandbox_project, "BottomArc", "inner")
+
+xEqn = "x(t) = t + 1"
+yEqn = "y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)"
+zEqn = "z(t) = 0.0"
+inner_eqn = newParametricEquationCurve("wiggleLine", xEqn, yEqn, zEqn)
+
+new_bottom_arc = newCircularArcCurve("wideBottomArc", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, "radians")
+
+addCurveToInnerBoundary!(sandbox_project, inner_eqn, "inner")
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
+
+# Regenerate the final mesh
+generate_mesh(sandbox_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 30 April 2024. Using Julia version 1.10.2.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.
The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "TheBlob" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
The following commands create a new curve for the parametric equations above
The name of this curve is assigned to be "Blob". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for blob_project to have elements with side length two in each direction
addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])
We next visualize the outer boundary curve and background grid with the following
plotProject!(blob_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "Blob" labeled in the figure by O.1.
From the visualization we see that the background grid is likely too coarse to produce a "good" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction
setBackgroundGridSize!(blob_project, 0.5, 0.5)
Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.
The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.
We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:
TheBlob.control: A HOHQMesh control file for the current project.
TheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
TheBlob.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 8.4328000000000000E-002
+ Number of nodes = 479
+ Number of Edges = 895
+ Number of Elements = 417
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025286 0.36208840 0.11936333 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002882 2.58443761 1.26335838 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.12867591 1.18585825 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006176 4.77438730 1.51314025 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011275 0.28170345 0.10292806 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.38249259 89.99827733 73.08294187 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132795 156.98701187 109.36585212 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point $(-4, 0)$ is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with
Above we create a circular refinement region centered at the point $(-4, -0.5)$ with a desired resolution size $0.4$ and a radius of $1.0$. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.
With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 9.2778999999999986E-002
+ Number of nodes = 503
+ Number of Edges = 940
+ Number of Elements = 438
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025286 0.36208840 0.11412688 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002883 2.47056840 1.26416662 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.12867592 1.18429212 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006176 4.77438730 1.51407242 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011275 0.28170345 0.09814903 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.38249259 89.99827897 72.80049710 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132784 156.98701188 109.63478104 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.
Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.
Define a curved outer boundary using parametric equations.
Add and adjust the background grid.
Visualize an interactive mesh project.
Add manual refinement to a local region of the domain.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with a curved outer boundary
+#
+# Create an outer boundary from a set of parametric equations.
+# Add manual refinement in a small region around the point (-4, -0.5).
+#
+# Keywords: outer boundary, parametric equations, refinement center
+using HOHQMesh
+
+# Instantiate the project
+blob_project = newProject("TheBlob", "out")
+
+# Create and add the outer boundary curve
+xEqn = "x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3"
+yEqn = "y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2"
+zEqn = "z(t) = 0.0"
+blob = newParametricEquationCurve("Blob", xEqn, yEqn, zEqn)
+addCurveToOuterBoundary!(blob_project, blob)
+
+# Add the background grid
+addBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])
+
+# Create and add the refinement region
+center = newRefinementCenter("region", "smooth", [-4.0, -0.5, 0.0], 0.4, 1.0)
+addRefinementRegion!(blob_project, center)
+
+# Generate the mesh
+generate_mesh(blob_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 30 April 2024. Using Julia version 1.10.2.
For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.
For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.
This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.
This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.
This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line "curves".
This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve "chain" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line "curves". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "spline_curves" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.
The outer boundary curve for this tutorial is a circle of radius $r=4$ centered at the point $(0, -1)$. We define this circular curve with the function newCircularArcCurve as follows
circ = newCircularArcCurve("outerCircle", # curve name
+ [0.0, -1.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circ is assigned to be "outerCircle". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circ curve is then added to the spline_project as an outer boundary curve with
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for spline_project to have elements with side length $0.6$ in each direction
We next visualize the outer boundary curve and background grid with the following
plotProject!(spline_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "outerCircle" labeled in the figure by O.1.
A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots $t_j$, $x_j$, $y_j$, $z_j$ where $j$ indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder
We create a parametric spline curve from a file with
The name of the curve stored in the dictionary spline1 is assigned to be "big_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline1 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve "big_spline" labeled in the figure by 1.1.
Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.
Below, we construct another parametric spline using this strategy that consists of five data points
The name of the curve stored in the dictionary spline2 is assigned to be "small_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline2 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner2" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve "small_spline" labeled in the figure by 2.1.
Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with
edge1 = newEndPointsLineCurve("triangle", # curve name
+ [-2.3, -1.0, 0.0], # start point
+ [-1.7, -1.0, 0.0]) # end point
+
+edge2 = newEndPointsLineCurve("triangle", # curve name
+ [-1.7, -1.0, 0.0], # start point
+ [-2.0, -0.4, 0.0]) # end point
+
+edge3 = newEndPointsLineCurve("triangle", # curve name
+ [-2.0, -0.4, 0.0], # start point
+ [-2.3, -1.0, 0.0]) # end point
Here, each edge of the curve is given the same name "triangle" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.
The inner boundary chain name "inner3" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called "triangle" labeled in the figure by 3.1, 3.2, and 3.3.
With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:
spline_curves.control: A HOHQMesh control file for the current project.
spline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
spline_curves.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(spline_project)
+ 1 chevron elements removed from mesh.
+ 1 chevron elements removed from mesh.
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.25359100000000001
+ Number of nodes = 1176
+ Number of Edges = 2225
+ Number of Elements = 1047
+ Number of Subdivisions = 4
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00006209 0.15607019 0.04505180 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00008965 2.78091496 1.23178864 1.00000000 999.99900000 1.00000000
+ Condition 1.00000055 3.82171291 1.15535543 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00014261 6.78201663 1.46249737 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001491 0.10424647 0.03955817 0.00000000 999.99900000 1.00000000
+ Minimum Angle 37.24189766 89.96174556 74.42003031 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.03128071 157.35065162 107.91806148 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of "bad" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the "big_spline" curve. We decide that we are satisfied with the overall mesh quality.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples/ folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "box_two_circles" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.
When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.
For the box_project we first query the current values for the polynomial order and the mesh output format
We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be $4$ and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.
The domain for this tutorial is a rectangular box with the bounds $[0,30]\times[0,15]$. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:
Set the lower left corner point of the domain $(x_0, y_0)$, define the element size in each spatial direction $\Delta x$ and $\Delta y$, and the number of steps taken in each direction $N_x, N_y$. The resulting background grid will have the extent $[x_0, x_0 + N_x \Delta x]$ by $[y_0, y_0 + N_y \Delta y]$. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands
Set the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box $[0,30]\times[0,15]$ we use
Next, we add the two circular inner boundary curves with different radii.
The first circle will have radius $r=2$ and be centered at the point $(4, 4)$. We define this circular curve with the function newCircularArcCurve as follows
circle1 = newCircularArcCurve("circle1", # curve name
+ [4.0, 4.0, 0.0], # circle center
+ 2.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be "circle1". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circle1 curve is then added to the box_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called "inner1" and it contains a single curve "circle1" labeled in the figure by 1.1.
With analogous steps we create another circular curve with radius $r=4$, centered at $(20, 9)$ and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.
circle2 = newCircularArcCurve("circle2", # curve name
+ [20.0, 9.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 2.0 * pi, # end angle
+ "radians") # angle units
+addCurveToInnerBoundary!(box_project, circle2, "inner2")
Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called "inner2" and it contains a single curve "circle2" labeled in the figure by 2.1.
With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:
box_two_circles.control: A HOHQMesh control file for the current project.
box_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
box_two_circles.inp: A mesh file with format ABAQUS that was set above.
To do this we execute the command
generate_mesh(box_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 2.9116999999999997E-002
+ Number of nodes = 498
+ Number of Edges = 921
+ Number of Elements = 422
+ Number of Subdivisions = 0
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.34513977 1.15385313 0.91833886 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00000004 1.71084672 1.08736698 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 1.46547984 1.04928616 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00000006 2.43578615 1.16710823 1.00000000 4.00000000 1.00000000
+ Jacobian 0.17854786 1.07210200 0.86801191 0.00000000 999.99900000 1.00000000
+ Minimum Angle 50.57680338 89.99999787 83.84338772 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00000259 136.97085026 96.70176380 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.
From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.
This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples/ folder constructs an identical example mesh as shown in the Guided tour using generic function calls.
A thorough description of the functions can be found in the API section.
The general workflow of the interactive mesh functionality within a REPL session is
c = new(name, startLocation [x,y,z], endLocation [x,y,z]) *Straight Line*
+ c = new(name, center [x,y,z], radius, startAngle, endAngle) *Circular Arc*
+ c = new(name, xEqn, yEqn, zEqn) *Parametric equation*
+ c = new(name, dataFile) *Spline with data from a file*
+ c = new(name, nKnots, knotsMatrix) *Spline with given knot values*
Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.
All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.
HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.
HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).
HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.
Developer Certificate of Origin
+Version 1.1
+
+Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+1 Letterman Drive
+Suite D4700
+San Francisco, CA, 94129
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+
+Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+(a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+(b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+(c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+(d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 25 June 2024. Using Julia version 1.10.4.
When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:
Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.
If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.
Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like VS Code with the Julia extension). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.
Set the new version number in Project.toml according to the Julian version of semver. Commit and push.
Comment @JuliaRegistrator register on the commit setting the version number.
JuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.
Increment the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.
You can build the documentation of HOHQMesh.jl locally by running
julia --project=docs -e 'using Pkg; Pkg.instantiate(); include("docs/make.jl")'
from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 25 June 2024. Using Julia version 1.10.4.
In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.
All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).
If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.
git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git
+# get latest main from the main repo
+git checkout main
+git pull
+# create a new branch for a cool new feature, bug fix, ...
+git checkout -b YOUR_BRANCH_NAME
+# do some work and push it to your fork
+git push -u myfork
+# go to https://github.com/trixi-framework/HOHQMesh.jl/pull
+# and create a PR from your new branch
Why using pull requests?
Immediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.
With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.
Avoid committing unwanted files
When you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.
For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:
Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.
Execute git fetch to get the latest changes from the repository.
Make sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.
Merge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.
In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.
If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should
merge the current main to your branch
run tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs
properly comment your code
delete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)
remove debug statements
add a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)
After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.
Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.
Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.
Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).
Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:
Update your clone by running git fetch.
Check out main using git checkout main.
Delete merged branch locally with git branch -d yourbranch.
Remove local references to deleted remote branch by executing git remote prune origin.
You can now proceed with your next changes by starting again at the top.
Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):
If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running
git reset HEAD~
This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.
If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.
Large files
You should never try to fix this yourself, as it potentially disrupts/destroys the work of others!
Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):
Tell everyone to commit and push their changes to the repository.
Fix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.
Perform the following steps to clean up the Git repository:
cd /tmp
+
+# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/
+
+# Get fresh clone of repo (so you can throw it away in case there is a problem)
+git clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git
+
+# Clean up repo of all files larger than 10M
+java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git
+
+# Enter repo
+cd HOHQMesh.jl.git
+
+# Clean up reflog and force aggressive garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
+
+# Push changes
+git push
+
+# Delete clone
+rm -rf HOHQMesh.jl.git
Tell everyone to clean up their local working copies by performing the following steps (also do this yourself):
# Enter repo
+cd HOHQMesh.jl
+
+# Get current changes
+git fetch
+
+# Check out the fixed branch
+git checkout branchname
+
+# IMPORTANT: Do a rebase instead of a pull!
+git rebase
+
+# Clean reflog and force garbage collection
+git reflog expire --expire=now --all && git gc --prune=now --aggressive
IMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 25 June 2024. Using Julia version 1.10.4.
diff --git a/v0.2.6/guided-tour/index.html b/v0.2.6/guided-tour/index.html
new file mode 100644
index 00000000..7b4d153c
--- /dev/null
+++ b/v0.2.6/guided-tour/index.html
@@ -0,0 +1,62 @@
+
+Guided tour · HOHQMesh.jl
In this brief overview, we highlight two scripts from the examples/ folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.
A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute
A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute
For completeness, we provide the example script and walk-through each step in the construction of the Project below.
using HOHQMesh
+
+# Create a new project with the name "IceCreamCone", which will also be the
+# name of the mesh, plot and stats files, written to output folder `out`.
+
+p = newProject("IceCreamCone", "out")
+
+# Outer boundary for this example mesh is a complete circle. Add it into the project.
+
+circ = newCircularArcCurve("outerCircle", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, "degrees")
+addCurveToOuterBoundary!(p, circ)
+
+# Inner boundary is three curves. Two straight lines and a circular arc.
+# Note the three curve are connected to ensure a counter-clockwise orientation
+# as required by HOHQMesh
+
+# Create the three interior curves. The individual names of each curve in the inner
+# chain are used internally by HOHQMesh and are output as the given boundary names in
+# the mesh file.
+
+cone1 = newEndPointsLineCurve("cone1", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])
+iceCream = newCircularArcCurve("iceCream", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, "degrees")
+cone2 = newEndPointsLineCurve("cone2", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])
+
+# Assemble the three curve in a closed chain oriented counter-clockwise. The chain
+# name `IceCreamCone` is only used internally by HOHQMesh.
+
+addCurveToInnerBoundary!(p, cone1, "IceCreamCone")
+addCurveToInnerBoundary!(p, iceCream, "IceCreamCone")
+addCurveToInnerBoundary!(p, cone2, "IceCreamCone")
+
+# Adjust some `RunParameters` and overwrite the defaults values. In this case, we
+# set a new value for the boundary order polynomial representation and adjust the
+# output mesh file format to be `sem`
+
+setPolynomialOrder!(p, 4)
+setPlotFileFormat!(p, "sem")
+
+# A background grid is required for the mesh generation. In this example we lay a
+# background grid of Cartesian boxes with size 0.5.
+
+addBackgroundGrid!(p, [0.5, 0.5, 0.0])
+
+# Plot the project model curves and background grid
+
+if isdefined(Main, :Makie)
+ plotProject!(p, MODEL+GRID)
+ @info "Press enter to generate the mesh and update the plot."
+ readline()
+ else # Throw an informational message about plotting to the user
+ @info "To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again."
+ end
+
+# Generate the mesh. This produces the mesh and TecPlot files `IceCreamCone.mesh` and `IceCreamCone.tec`
+# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is
+# updated with the mesh that was generated.
+
+generate_mesh(p)
+
+# After the mesh successfully generates mesh statistics, such as the number of corner nodes,
+# the number of elements etc., are printed to the REPL
The first line creates a new project, where the mesh and plot file names will be derived from the project name, "IceCreamCone" written to the specified folder.
To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:
Parametric equations
Cubic Splines
Lines defined by their end points
Circular arcs
In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.
Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, "IceCreamCone" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.
For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script resets the polynomial order (default = 5) and the plot file format (default = "skeleton").
One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, only the mesh size needs to be specified using
The example sets the background mesh size to be 0.5 in the x and y directions. The z component is ignored.
The script finishes by generating the quad mesh and plotting the results, as shown below
Finally, the script returns the project so that it can be edited further, if desired.
To save a control file for HOHQMesh, simply invoke
saveProject(proj::Project)
where the name of the control file (traditionally with a .control extension) matches the name of the project proj. saveProject is automatically called when a mesh is generated.
Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 25 June 2024. Using Julia version 1.10.4.
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.
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.
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
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.,
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.
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.
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.
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.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 25 June 2024. Using Julia version 1.10.4.
The supplied name will be the default name of the control, mesh, and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.
The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.
If the model is modified and you want to re-plot with the new values, invoke
updatePlot!(proj::Project, options)
but generally the plot will be updated automatically as you build the model.
HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.
The available mesh file formats are "ISM", "ISM-V2", or "ABAQUS". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.
The plot file (which can be viewed with something like VisIt or ParaView) format is either "skeleton" or "sem". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.
By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with
A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available in the documentation and in Minoli2011.
To change the defaults, the smoother parameters can be set/enquired with the functions
There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must be specified after a new project has been created.
Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.
Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).
where name labels the refinement region, the type is either "smooth" or "sharp", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.
The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a "chain" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.
The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.
The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.
See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.
Returns a new set of parametric equation. Equations must be of the form
<function name>(<argument>) = ...
The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
A cubic spline is defined by an array of knots, $t_j$, $x_j$, $y_j$, $z_j$. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the $t$, $x$, $y$, $z$ values, e.g.
The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either "degrees" or "radians". That argument is optional, and defaults to "degrees".
Using the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using
The syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.
Alternatively, all curves on an outer or inner boundary with the same name can have that name changed all at once everywhere in the project with the function
The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.
Several scripts are available in the examples/ folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.
Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.
The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.
To generate a mesh interactively you
Create a project with a user given projectName and folder where any generated files are to be saved
p = newProject(<projectName>, <folder>)
Both of these input arguments are strings.
Create inner and outer boundary curves from the available types
c = newEndPointsLineCurve(<name>, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*
+c = newCircularArcCurve(<name>, center [x, y, z], radius, startAngle, endAngle, units = "degrees" or "radians") *Circular Arc*
+c = newParametricEquationCurve(<name>, xEqn, yEqn, zEqn) *Parametric equation*
+c = newSplineCurve(<name>, dataFile) *Spline with data from a file*
+c = newSpline(<name>, nKnots, knotsMatrix) *Spline with given knot values*
See Defining curves for further details on the different curve type currently supported by HOHQMesh.
The generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.
Add curves to build the model to see what you have added,
addOuterBoundaryCurve!(p, <curveName>) *Add outer boundary curve*
+addInnerBoundaryCurve!(p, <curveName>, <InnerBoundaryName>) *Add curve to an inner boundary*
For a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.
Curves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.
Visualize the project's model, if desired
plotProject!(p, MODEL)
Plots are updated in response to user interactions. However, to update the plot at any time, use
updatePlot!(p, options)
Options are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.
Visualization requirement
The interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.
Set the background grid
When no outer boundary curve is present, the background grid can be set with
addBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])
Or
addBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])
The first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.
When an outer boundary is present the background grid can be set as
addBackgroundGrid!(p, [dx, dy, dz])
where the spacing controls the number of elements in each direction.
Background grid
A background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.
Adjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by
setPolynomialOrder!(p, order)
The background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately
The mesh file will be saved in <folder> with the name <projectName>.mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name <projectName>.control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.
The generate_mesh function has two optional arguments. The first is the Boolean verbose argument. One can pass verbose=true to output additional messages and information during the meshing process. The second is the integer subdivision_maximum argument. The default value is subdivision_maximum=8, meaning that elements can be up to a factor of 2^8 smaller than the existing background grid. Note, think before adjusting the subdivision_maximum level! It is often the case that adjusting the boundary curves, background grid size, adding local refinement regions, or some combination of these adjustments removes the need to adjust the subdivision depth.
All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 25 June 2024. Using Julia version 1.10.4.
Copyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-Lakemper
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 25 June 2024. Using Julia version 1.10.4.
Add the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version
Add the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.
Add an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.
Return a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.
Generate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.
You can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.
You can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.
To override the maximum number of allowable subdivisions in the quad tree during meshing adjust the value of subdivision_maximum. The default value of subdivision_maximum is 8, meaning that elements can be up to a factor of 2^8 smaller than the background grid. Note, think before doing this! It could be adjusting the boundary curves, background grid size, adding local refinement regions, or some combination may remove the need to adjust the subdivision depth.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
Generate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.
This function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.
With the optional argument verbose one can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information.
To override the maximum number of allowable subdivisions in the quad tree during meshing adjust the value of subdivision_maximum. The default value of subdivision_maximum is 8, meaning that elements can be up to a factor of 2^8 smaller than the background grid. Note, think before doing this! It could be adjusting the boundary curves, background grid size, adding local refinement regions, or some combination may remove the need to adjust the subdivision depth.
This function returns the output to stdout of the HOHQMesh binary when generating the mesh.
getCurveType(crv::Dic{String,Any})
+
+Get the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,
+`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.
Get the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.
Plot objects specified by the plotOptions. Construct the plotOptions by the sum of what is to be drawn from the choices MODEL, GRID, MESH, REFINEMENTS.
Example: To plot the model and the grid, plotOptions = MODEL + GRID. To plot just the mesh, plotOptions = MESH.
To plot everything, plotOptions = MODEL + GRID + MESH + REFINEMENTS
Contents are overlaid in the order: GRID, MESH, MODEL, REFINEMENTS
Requires Makie.jl
Please note that for this function to work, you need to load Makie.jl in your REPL (e.g., by calling using GLMakie).
Set the file format for the plot file. Acceptable choices are "sem", which includes interior nodes and boundary nodes and "skeleton", which includes only the corner nodes.
This document was generated with Documenter.jl version 0.27.25 on Tuesday 25 June 2024. Using Julia version 1.10.4.
diff --git a/v0.2.6/search_index.js b/v0.2.6/search_index.js
new file mode 100644
index 00000000..820c187b
--- /dev/null
+++ b/v0.2.6/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"contributing/#Contributing","page":"Contributing","title":"Contributing","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl is an open-source project and we are very happy to accept contributions from the community. Please feel free to open issues or submit patches (preferably as merge requests) any time. For planned larger contributions, it is often beneficial to get in contact with one of the principal developers first (see Authors).","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"HOHQMesh.jl and its contributions are licensed under the MIT license (see License). As a contributor, you certify that all your contributions are in conformance with the Developer Certificate of Origin (Version 1.1), which is reproduced below.","category":"page"},{"location":"contributing/#Developer-Certificate-of-Origin-(Version-1.1)","page":"Contributing","title":"Developer Certificate of Origin (Version 1.1)","text":"","category":"section"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"The following text was taken from https://developercertificate.org:","category":"page"},{"location":"contributing/","page":"Contributing","title":"Contributing","text":"Developer Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n1 Letterman Drive\nSuite D4700\nSan Francisco, CA, 94129\n\nEveryone is permitted to copy and distribute verbatim copies of this\nlicense document, but changing it is not allowed.\n\n\nDeveloper's Certificate of Origin 1.1\n\nBy making a contribution to this project, I certify that:\n\n(a) The contribution was created in whole or in part by me and I\n have the right to submit it under the open source license\n indicated in the file; or\n\n(b) The contribution is based upon previous work that, to the best\n of my knowledge, is covered under an appropriate open source\n license and I have the right under that license to submit that\n work with modifications, whether created in whole or in part\n by me, under the same open source license (unless I am\n permitted to submit under a different license), as indicated\n in the file; or\n\n(c) The contribution was provided directly to me by some other\n person who certified (a), (b) or (c) and I have not modified\n it.\n\n(d) I understand and agree that this project and the contribution\n are public and that a record of the contribution (including all\n personal information I submit with it, including my sign-off) is\n maintained indefinitely and may be redistributed consistent with\n this project or the open source license(s) involved.","category":"page"},{"location":"development/#Development","page":"Development","title":"Development","text":"","category":"section"},{"location":"development/#Text-editors","page":"Development","title":"Text editors","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"When writing code, the choice of text editor can have a significant impact on productivity and developer satisfaction. While using the default text editor of the operating system has its own benefits (specifically the lack of an explicit installation procure), usually it makes sense to switch to a more programming-friendly tool. In the following, a few of the many options are listed and discussed:","category":"page"},{"location":"development/#VS-Code","page":"Development","title":"VS Code","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Visual Studio Code is a modern open source editor with good support for Julia. While Juno had some better support in the past, the developers of Juno and the Julia VS Code plugin are joining forces and concentrating on VS Code since support of Atom has been suspended. Basically, all comments on Juno below also apply to VS Code.","category":"page"},{"location":"development/#Juno","page":"Development","title":"Juno","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"If you are new to programming or do not have a preference for a text editor yet, Juno is a good choice for developing Julia code. It is based on Atom, a sophisticated and widely used editor for software developers, and is enhanced with several Julia-specific features. Furthermore and especially helpful for novice programmers, it has a MATLAB-like appearance with easy and interactive access to the current variables, the help system, and a debugger.","category":"page"},{"location":"development/#Vim-or-Emacs","page":"Development","title":"Vim or Emacs","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Vim and Emacs are both very popular editors that work great with Julia. One of their advantages is that they are text editors without a GUI and as such are available for almost any operating system. They also are preinstalled on virtually all Unix-like systems. However, Vim and Emacs come with their own, steep learning curve if they have never been used before. Therefore, if in doubt, it is probably easier to get started with a classic GUI-based text editor (like VS Code with the Julia extension). If you decide to use Vim or Emacs, make sure that you install the corresponding Vim plugin julia-vim or Emacs major mode julia-emacs.","category":"page"},{"location":"development/#Releasing-a-new-version-of-HOHQMesh","page":"Development","title":"Releasing a new version of HOHQMesh","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"Check whether everything is okay, tests pass etc.\nSet the new version number in Project.toml according to the Julian version of semver. Commit and push.\nComment @JuliaRegistrator register on the commit setting the version number.\nJuliaRegistrator will create a PR with the new version in the General registry. Wait for it to be merged.\nIncrement the version number in Project.toml again with suffix -pre. For example, if you have released version v0.2.0, use v0.2.1-pre as new version number.","category":"page"},{"location":"development/#Preview-the-documentation","page":"Development","title":"Preview the documentation","text":"","category":"section"},{"location":"development/","page":"Development","title":"Development","text":"You can build the documentation of HOHQMesh.jl locally by running","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"julia --project=docs -e 'using Pkg; Pkg.instantiate(); include(\"docs/make.jl\")'","category":"page"},{"location":"development/","page":"Development","title":"Development","text":"from the HOHQMesh.jl main directory. Then, you can look at the html files generated in docs/build. For PRs triggered from branches inside the HOHQMesh.jl main repository previews of the new documentation are generated at https://trixi-framework.github.io/HOHQMesh.jl/previews/PRXXX, where XXX is the number of the PR. Note, this does not work for PRs from forks for security reasons (since anyone could otherwise push arbitrary stuff, including malicious code).","category":"page"},{"location":"tutorials/straight_outer_boundary/#Straight-sided-outer-boundary","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples/ folder.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Synopsis","page":"Straight-sided outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Initialization","page":"Straight-sided outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We create a new project with the name \"box_two_circles\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_project = newProject(\"box_two_circles\", \"out\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Adjusting-project-parameters","page":"Straight-sided outer boundary","title":"Adjusting project parameters","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"For the box_project we first query the current values for the polynomial order and the mesh output format","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"julia> getPolynomialOrder(box_project)\n5\n\njulia> getMeshFileFormat(box_project)\n\"ISM-V2\"","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be 4 and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"setPolynomialOrder!(box_project, 4)\nsetMeshFileFormat!(box_project, \"ABAQUS\")","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-background-grid","page":"Straight-sided outer boundary","title":"Add the background grid","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The domain for this tutorial is a rectangular box with the bounds 030times015. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Set the lower left corner point of the domain (x_0 y_0), define the element size in each spatial direction Delta x and Delta y, and the number of steps taken in each direction N_x N_y. The resulting background grid will have the extent x_0 x_0 + N_x Delta x by y_0 y_0 + N_y Delta y. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands\nlower_left = [0.0, 0.0, 0.0]\nspacing = [1.0, 1.0, 0.0]\nnum_intervals = [30, 15, 0]\naddBackgroundGrid!(box_project, lower_left, spacing, num_intervals)\nSet the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box 030times015 we use\nbounds = [15.0, 0.0, 0.0, 30.0]\nN = [30, 15, 0]\naddBackgroundGrid!(box_project, bounds, N)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we visualize the box_project to ensure that the background grid has been added correctly.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"plotProject!(box_project, GRID)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use the keyword and GRID to indicate that we want the background grid to be included in the visualization.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: background)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Add-the-inner-boundaries","page":"Straight-sided outer boundary","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Next, we add the two circular inner boundary curves with different radii.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The first circle will have radius r=2 and be centered at the point (4 4). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle1 = newCircularArcCurve(\"circle1\", # curve name\n [4.0, 4.0, 0.0], # circle center\n 2.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be \"circle1\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The new circle1 curve is then added to the box_project as an inner boundary curve with","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"addCurveToInnerBoundary!(box_project, circle1, \"inner1\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called \"inner1\" and it contains a single curve \"circle1\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: first_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With analogous steps we create another circular curve with radius r=4, centered at (20 9) and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"circle2 = newCircularArcCurve(\"circle2\", # curve name\n [20.0, 9.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 2.0 * pi, # end angle\n \"radians\") # angle units\naddCurveToInnerBoundary!(box_project, circle2, \"inner2\")","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called \"inner2\" and it contains a single curve \"circle2\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: second_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/#Generate-the-mesh","page":"Straight-sided outer boundary","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"box_two_circles.control: A HOHQMesh control file for the current project.\nbox_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nbox_two_circles.inp: A mesh file with format ABAQUS that was set above.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"generate_mesh(box_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 2.9116999999999997E-002\n Number of nodes = 498\n Number of Edges = 921\n Number of Elements = 422\n Number of Subdivisions = 0\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.34513977 1.15385313 0.91833886 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00000004 1.71084672 1.08736698 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 1.46547984 1.04928616 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00000006 2.43578615 1.16710823 1.00000000 4.00000000 1.00000000\n Jacobian 0.17854786 1.07210200 0.86801191 0.00000000 999.99900000 1.00000000\n Minimum Angle 50.57680338 89.99999787 83.84338772 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00000259 136.97085026 96.70176380 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"(Image: final_circle)","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.","category":"page"},{"location":"tutorials/straight_outer_boundary/#Summary","page":"Straight-sided outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/straight_outer_boundary/","page":"Straight-sided outer boundary","title":"Straight-sided outer boundary","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"github-git/#GitHub-and-Git","page":"GitHub & Git","title":"GitHub & Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This page contains information on how to use GitHub and Git when developing HOHQMesh.","category":"page"},{"location":"github-git/#Development-workflow","page":"GitHub & Git","title":"Development workflow","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For adding modifications to HOHQMesh, we generally follow these steps:","category":"page"},{"location":"github-git/#Create-an-issue-(optional)","page":"GitHub & Git","title":"Create an issue (optional)","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In many cases it makes sense to start by creating an issue on GitHub. For example, if the implementation approach for a new feature is not yet clear or if there should be a discussion about the desired outcome, it is good practice to first get a consensus on what is the expected result of this modification. A GitHub issue is the place to lead this discussion, as it preserves it in the project and - together with the actual code changes - allows in the future to revisit the reasons for a particular choice of implementation or feature.","category":"page"},{"location":"github-git/#Create-a-branch-and-*immediately*-create-a-pull-request","page":"GitHub & Git","title":"Create a branch and immediately create a pull request","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"All feature development, bug fixes etc. should be developed in a branch and not directly on main. If you do not have write access to the main repository on GitHub, first create a fork of the HOHQMesh.jl repository and clone the fork to your machine. Then, create a branch locally by executing git checkout -b yourbranch, push it to the repository, and create a pull request (PR).","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you have already cloned HOHQMesh.jl from the main repo to your local machine, you can also work in that clone. You just need to add your fork as additional remote repository and push your new branch there.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git remote add myfork git@github.com:YOUR_NAME/HOHQMesh.jl.git\n# get latest main from the main repo\ngit checkout main\ngit pull\n# create a new branch for a cool new feature, bug fix, ...\ngit checkout -b YOUR_BRANCH_NAME\n# do some work and push it to your fork\ngit push -u myfork\n# go to https://github.com/trixi-framework/HOHQMesh.jl/pull\n# and create a PR from your new branch","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"info: Why using pull requests?\nImmediately creating a PR for your branch has the benefit that all code discussions can now be held directly next to the corresponding code. Also, the PR allows to easily compare your branch to the upstream branch (usually main) to see what you have changed. Moreover, tests will run automatically.","category":"page"},{"location":"github-git/#Make-changes","page":"GitHub & Git","title":"Make changes","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"With a branch and PR in place, you can now write your code and commit it to your branch. If you request feedback from someone else, make sure to push your branch to the repository such that the others can easily review your changes or dive in and change something themselves.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"warning: Avoid committing unwanted files\nWhen you use git add . or similar catch-all versions, make sure you do not accidentally commit unwanted files (e.g., HOHQMesh output plot and mesh files). If it happens anyways, you can undo the last commit (also multiple times) by running git reset HEAD~ (see also Undo last commit). However, this strategy only works if you have not yet pushed your changes. If you did push your changes, please talk to one of the principal developers on how to proceed.","category":"page"},{"location":"github-git/#Keep-your-branch-in-sync-with-main","page":"GitHub & Git","title":"Keep your branch in sync with main","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"For larger features with longer-living branches, it may make sense to synchronize your branch with the current main, e.g., if there was a bug fix in main that is relevant for you. In this case, perform the following steps to merge the current main to your branch:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Commit all your local changes to your branch and push it. This allows you to delete your clone in case you make a mistake and need to abort the merge.\nExecute git fetch to get the latest changes from the repository.\nMake sure you are in the correct branch by checking the output of git status or by running git checkout yourbranch.\nMerge main using git merge main. If there were no conflicts, hooray!, you are done. Otherwise you need to resolve your merge conflicts and commit the changes afterwards. A good guide for resolving merge conflicts can be found here.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"In general, always use git merge and not git rebase to get the latest changes from main. It is less error-prone and does not create problems on branches that are worked on collaboratively.","category":"page"},{"location":"github-git/#Prepare-for-review","page":"GitHub & Git","title":"Prepare for review","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you feel like your branch is ready to be merged to main, prepare it for review. That is, you should","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"merge the current main to your branch\nrun tests if available, but at least ensure that you did not accidentally change the results for one of the existing example elixirs\nproperly comment your code\ndelete old/unused code, especially commented lines (unless they contain helpful code, in which case you should add a comment on why you keep this around)\nremove debug statements\nadd a script interactive_xxx.jl that uses your feature (only relevant for new features within the interactive mesh functionality)","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"After you are confident that your branch is cleaned up properly, commit all changes and push them to the repository.","category":"page"},{"location":"github-git/#Get-reviewed","page":"GitHub & Git","title":"Get reviewed","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Ask one of the principal developers to review your code. This review will be conducted asynchronously, with the reviewer leaving comments and annotations in the PR. In some cases it will be necessary to do multiple rounds of reviews, especially if there are larger changes to be added. Just commit and push your changes to your branch, and the corresponding pull request will be updated automatically.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Please note that a review has nothing to do with the lack of experience of the person developing changes: We try to review all code before it gets added to main, even from the most experienced developers. This is good practice and helps to keep the error rate low while ensuring the the code is developed in a consistent fashion. Furthermore, do not take criticism of your code personally - we just try to keep HOHQMesh as accessible and easy to use for everyone.","category":"page"},{"location":"github-git/#Merge-branch","page":"GitHub & Git","title":"Merge branch","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once your branch is reviewed and declared ready for merging by the reviewer, make sure that all the latest changes have been pushed. Then, one of the developers will merge your PR. If you are one of the developers, you can also go to the pull request page on GitHub and and click on Merge pull request. Voilá, you are done! Your branch will have been merged to main and the source branch will have been deleted in the GitHub repository (if you are not working in your own fork).","category":"page"},{"location":"github-git/#Update-your-working-copy","page":"GitHub & Git","title":"Update your working copy","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Once you have merged your branch by accepting the PR on GitHub, you should clean up your local working copy of the repository by performing the following steps:","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Update your clone by running git fetch.\nCheck out main using git checkout main.\nDelete merged branch locally with git branch -d yourbranch.\nRemove local references to deleted remote branch by executing git remote prune origin.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"You can now proceed with your next changes by starting again at the top.","category":"page"},{"location":"github-git/#Using-Git","page":"GitHub & Git","title":"Using Git","text":"","category":"section"},{"location":"github-git/#Resources-for-learning-Git","page":"GitHub & Git","title":"Resources for learning Git","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Here are a few resources for learning do use Git that at least one of us found helpful in the past (roughly ordered from novice to advanced to expert):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Git Handbook by GitHub\nLearn Git Branching","category":"page"},{"location":"github-git/#Tips-and-tricks","page":"GitHub & Git","title":"Tips and tricks","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This is an unordered collection of different tips and tricks that can be helpful while working with Git. As usual, your mileage might vary.","category":"page"},{"location":"github-git/#Undo-last-commit","page":"GitHub & Git","title":"Undo last commit","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If you made a mistake in your last commit, e.g., by committing an unwanted file, you can undo the latest commit by running","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"git reset HEAD~","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"This only works if you have not yet pushed your branch to the GitHub repository. In this case, please talk to one of the core developers on how to proceed. Especially when you accidentally committed a large file (image, or video), please let us know as fast as possible, since the effort to fix the repository grows considerably over time.","category":"page"},{"location":"github-git/#Remove-large-file-from-repository","page":"GitHub & Git","title":"Remove large file from repository","text":"","category":"section"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"If a large file was accidentally committed and pushed to the HOHQMesh repository, please talk to one of the principal developers as soon as possible so that they can fix it.","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"danger: Large files\nYou should never try to fix this yourself, as it potentially disrupts/destroys the work of others!","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Based on the instructions found here and here, the following steps need to be taken (as documented for GitLab in issue #33):","category":"page"},{"location":"github-git/","page":"GitHub & Git","title":"GitHub & Git","text":"Tell everyone to commit and push their changes to the repository.\nFix the branch in which the file was committed by removing it and committing the removal. This is especially important on main.\nPerform the following steps to clean up the Git repository:\ncd /tmp\n\n# Download bfg-1.13.0.jar from https://rtyley.github.io/bfg-repo-cleaner/\n\n# Get fresh clone of repo (so you can throw it away in case there is a problem)\ngit clone --mirror git@github.com:trixi-framework/HOHQMesh.jl.git\n\n# Clean up repo of all files larger than 10M\njava -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git\n\n# Enter repo\ncd HOHQMesh.jl.git\n\n# Clean up reflog and force aggressive garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\n\n# Push changes\ngit push\n\n# Delete clone\nrm -rf HOHQMesh.jl.git\nTell everyone to clean up their local working copies by performing the following steps (also do this yourself):\n# Enter repo\ncd HOHQMesh.jl\n\n# Get current changes\ngit fetch\n\n# Check out the fixed branch\ngit checkout branchname\n\n# IMPORTANT: Do a rebase instead of a pull!\ngit rebase\n\n# Clean reflog and force garbage collection\ngit reflog expire --expire=now --all && git gc --prune=now --aggressive\nIMPORTANT: You need to do a git rebase instead of a git pull when updating the fixed branch.","category":"page"},{"location":"interactive-api/#API","page":"API","title":"API","text":"","category":"section"},{"location":"interactive-api/#Project-creation-and-saving","page":"API","title":"Project creation and saving","text":"","category":"section"},{"location":"interactive-api/#New-Project","page":"API","title":"New Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = newProject(name::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied name will be the default name of the control, mesh, and plot files generated by HOHQMesh. The folder is the directory in which those files will be placed. The empty project will include default RunParameters and a default SpringSmoother, both of which can be modified later, if desired. The only thing required to add is the background grid.","category":"page"},{"location":"interactive-api/#Opening-an-existing-project-file","page":"API","title":"Opening an existing project file","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A project can be created from an existing HOHQMesh control file with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Project] proj = openProject(fileName::String, folder::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The supplied fileName will be the name of the project and the generated mesh and plot files will be placed in the supplied folder.","category":"page"},{"location":"interactive-api/#Saving-a-Project","page":"API","title":"Saving a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" saveProject(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"writes a control file to the folder designated when creating the new project. It can be read in again with openProject.","category":"page"},{"location":"interactive-api/#Plotting-a-Project","page":"API","title":"Plotting a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" plotProject!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot options are any combination of MODEL, GRID, REFINEMENTS, and MESH. MODEL refers to any inner / outer boundary curves contained in the project. GRID refers to the background grid, which you an view to make sure that it can resolve the boundary curves in the model. REFINEMENTS will show the placement where user defined manual refinement regions are placed. MESH refers to the actual mesh of quadrilateral elements generated by HOHQMesh. Before meshing one probably wants to view MODEL+GRID, and afterwards, MODEL+MESH.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the model is modified and you want to re-plot with the new values, invoke","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" updatePlot!(proj::Project, options)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"but generally the plot will be updated automatically as you build the model.","category":"page"},{"location":"interactive-api/#Modifying/editing-a-Project","page":"API","title":"Modifying/editing a Project","text":"","category":"section"},{"location":"interactive-api/#Setting-the-name-of-a-Project","page":"API","title":"Setting the name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name is the name under which the mesh, plot, statistics and control files will be written. It can be changed at any time with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setName!(proj::Project,name::String)","category":"page"},{"location":"interactive-api/#Getting-the-current-name-of-a-Project","page":"API","title":"Getting the current name of a Project","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The project name can be fetched and printed to the screen with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getName(proj::Project)","category":"page"},{"location":"interactive-api/#Controlling-the-mesh-generation","page":"API","title":"Controlling the mesh generation","text":"","category":"section"},{"location":"interactive-api/#Editing-the-RunParameters","page":"API","title":"Editing the RunParameters","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The run parameters can be enquired and set with these getter/setter pairs:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setPolynomialOrder!(proj::Project, p::Int)\n [Return:Int] getPolynomialOrder(proj::Project)\n [Return:nothing] setMeshFileFormat!(proj::Project, meshFileFormat::String)\n [Return:String] getMeshFileFormat(proj::Project)\n [Return:nothing] setPlotFileFormat!(proj::Project, plotFileFormat::String)\n [Return:String] getPlotFileFormat(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"HOHQMesh generates mesh files that contain high-order polynomial interpolations for any curved boundaries in the model. The degree of this polynomial representation is controlled by the above getter/setter pair. The default polynomial order is set to 5.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The available mesh file formats are \"ISM\", \"ISM-V2\", or \"ABAQUS\". See the HOHQMesh documentation, Appendix A or Appendix E, as well as the Trixi.jl documentation, Unstructured quadrilateral mesh or P4est-based mesh, for details and discussions on the latter two mesh file formats.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The plot file (which can be viewed with something like VisIt or ParaView) format is either \"skeleton\" or \"sem\". The former is just a low order finite element representation of the mesh. The latter (which is a much bigger file) includes the interior degrees of freedom.","category":"page"},{"location":"interactive-api/#Changing-the-output-file-names","page":"API","title":"Changing the output file names","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"By default, the mesh, plot and stats files will be written with the name and path supplied when newProject is called. They can be changed/enquired with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setName!(proj::Project,name::String)\n [Return:String] getName(proj::Project)\n [Return:nothing] setFolder!(proj::Project,folder::String)\n [Return:String] getFolder(proj::Project)","category":"page"},{"location":"interactive-api/#Smoothing-operations","page":"API","title":"Smoothing operations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A default smoother is created when newProject is called, which sets the status to ON, type to LinearAndCrossbarSpring, and number of iterations = 25. These are generally good enough for most purposes. The most likely parameter to change is the number of iterations. Further details on the smoothing strategy and how it works are available in the documentation and in Minoli2011.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To change the defaults, the smoother parameters can be set/enquired with the functions","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setSmoothingStatus!(proj::Project, status::String)\n [Return:String] getSmoothingStatus(proj::Project)\n [Return:nothing] setSmoothingType!(proj::Project, type::String)\n [Return:String] getSmoothingType(proj::Project)\n [Return:nothing] setSmoothingIterations!(proj::Project, iterations::Int)\n [Return:Int] getSmoothingIterations(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The smooth status is either \"ON\" or \"OFF\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To remove the smoother altogether, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] removeSpringSmoother!(proj::Project)","category":"page"},{"location":"interactive-api/#Adding-the-background-grid","page":"API","title":"Adding the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"There are three forms for the background grid definition, one for when there is an outer boundary, and two for when there is not. One form of background grid must be specified after a new project has been created.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addBackgroundGrid!(proj::Project,\n x0::Array{Float64},\n dx::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n box::Array{Float64},\n N::Array{Int})\n [Return:nothing] addBackgroundGrid!(proj::Project,\n bgSize::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Use one of the first two if there is no outer boundary present in the model. With the first, a rectangular outer boundary will be created of extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second lets you set the bounding box = [top, left, bottom, right], and the number of points in each direction. The arrays x0, dx, and N are all vectors [ *, *, * ] giving the x, y, and z components. When an outer boundary is present use the third variant where one only need specify the desired background grid size with the vector bgSize.","category":"page"},{"location":"interactive-api/#Changing-the-background-grid","page":"API","title":"Changing the background grid","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The size of an existing background grid in a Project can be adjusted with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setBackgroundGridSize!(proj::Project,\n dx::Float64,\n dy::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If a plot is present it will be updated automatically.","category":"page"},{"location":"interactive-api/#Manual-refinement-regions","page":"API","title":"Manual refinement regions","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Refinement can be specified either at a point, using the RefinementCenter, or along a line, using a RefinementLine. You can have as many of these refinement regions as you want. They are useful if you know regions of the solution where refinement is needed (e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To create a RefinementCenter,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementCenter(name::String,\n type::String,\n x0::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where name labels the refinement region, the type is either \"smooth\" or \"sharp\", x0 = [x, y, z] is the location of the center, h is the mesh size, and w is the extent of the refinement region. The z component must be zero.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Similarly, one can create a RefinementLine,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newRefinementLine(name::String,\n type::String,\n x0::Array{Float64}, x1::Array{Float64},\n h::Float64,\n w::Float64)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where x0 is the start position and x1 is the end of the line. The name, type, h, and w parameters are the same as for a RefinementCenter.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To add a refinement region to the project,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] addRefinementRegion!(proj::Project, r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To get a reference to a refinement region with a given name, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] getRefinementRegion(proj::Project, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to get a list of all the refinement regions,","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Array{Dict{String,Any}}] array = allRefinementRegions(proj::Project)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"A refinement region can be edited by using the following:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementType!(r::Dict{String,Any}, type::String)\n [Return:String] getRefinementType(r::Dict{String,Any})\n [Return:nothing] setRefinementLocation!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementLocation(r::Dict{String,Any})\n [Return:nothing] setRefinementGridSize!(r::Dict{String,Any}, h::Float64)\n [Return:Float64] getRefinementGridSize(r::Dict{String,Any})\n [Return:nothing] setRefinementWidth!(r::Dict{String,Any}, w::Float64)\n [Return:Float64] getRefinementWidth(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where r is a dictionary returned by newRefinementCenter!, newRefinementLine!, or getRefinementRegion.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To further edit a RefinementLine, use the methods","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setRefinementStart!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementStart(r::Dict{String,Any})\n [Return:nothing] setRefinementEnd!(r::Dict{String,Any}, x::Array{Float64})\n [Return:Array{Float64}] getRefinementEnd(r::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Boundary-curves","page":"API","title":"Boundary curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The Project contains a model that contains information about any inner and/or outer boundary curves that a user can add to define a domain to be meshed. Each curve is defined as a \"chain\" that can be built from multiple connected curves. More details on boundary curves and HOHQMesh can be found here.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The domain can have a single outer boundary chain and an arbitrary number of inner boundary chains.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The orientation of any curve chains must be counter-clockwise. This orientation is automatically checked in generate_mesh and a warning is thrown if a user attempts to connect the curve chain in an invalid way.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"See the tutorial Creating and editing curves for a demonstration of defining, constructing, and removing curves from a Project.","category":"page"},{"location":"interactive-api/#Defining-curves","page":"API","title":"Defining curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Four curve types can be added to the outer and inner boundary curve chains. They are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"interactive-api/#Parametric-equations","page":"API","title":"Parametric equations","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Creating a new curve equation","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\")","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Returns a new set of parametric equation. Equations must be of the form","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" () = ...","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The name of the function, and the argument are arbitrary. The equation can be any legitimate equation. The constant pi is defined for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" xEqn = \"x(t) = 4*cos(2*pi*t) - 0.6*cos(8*pi*t)^3\"\n yEqn = \"y(t) = 4*sin(2*pi*t) - 0.5*sin(11*pi*t)^2\"\n zEqn = \"z(t) = 0.0\"\n blob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The z-Equation is optional, but for now must define zero for z by default.","category":"page"},{"location":"interactive-api/#Cubic-spline-curve","page":"API","title":"Cubic spline curve","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A cubic spline is defined by an array of knots, t_j, x_j, y_j, z_j. It can either be supplied by a data file whose first line is the number of knots, and succeeding lines define the t, x, y, z values, e.g.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" 9\n 0.000000000000000 -3.50000000000000 3.50000000000000 0.0\n 3.846153846153846E-002 -3.20000000000000 5.00000000000 0.0\n 7.692307692307693E-002 -2.00000000000000 6.00000000000 0.0\n 0.769230769230769 0.000000000000000 -1.00000000000000 0.0\n 0.807692307692308 -1.00000000000000 -1.00000000000000 0.0\n 0.846153846153846 -2.00000000000000 -0.800000000000000 0.0\n 0.884615384615385 -2.50000000000000 0.000000000000000 0.0\n 0.923076923076923 -3.00000000000000 1.00000000000000 0.0\n 1.00000000000000 -3.50000000000000 3.50000000000000 0.0","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"or by constructing the required nKnots x 4 array and supplying it to the new procedure. The respective constructors for a spline curve are","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newSplineCurve(name::String,\n dataFile::String)\n [Return:Dict{String,Any}] newSplineCurve(name::String,\n nKnots::Int,\n data::Matrix{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"If the spline curve is to be closed. The last data point must be the same as the first.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n ex_spline = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"interactive-api/#Line-defined-by-end-points","page":"API","title":"Line defined by end points","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"A straight line is constructed with","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newEndPointsLineCurve(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The xStart and xEnd are arrays of the form [x, y, z]. The z component should be zero and for now is ignored.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" line1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])","category":"page"},{"location":"interactive-api/#Circular-arc","page":"API","title":"Circular arc","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:Dict{String,Any}] newCircularArcCurve(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"The center is an array of the form [x, y, z]. The units argument defines the start and end angle units. It is either \"degrees\" or \"radians\". That argument is optional, and defaults to \"degrees\".","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Example:","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" halfCircle = newCircularArcCurve(\"Dome\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")","category":"page"},{"location":"interactive-api/#Adding-and-removing-outer-and-inner-boundaries","page":"API","title":"Adding and removing outer and inner boundaries","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"Adding an outer boundary curve\nUsing the curve creation routines described above, create curves counter-clockwise along the outer boundary and add them to the outer boundary curve using\n[Return:nothing] addCurveToOuterBoundary!(proj::Project,\n crv::Dict{String,Any})\ncrv is the dictionary that represents the curve.\nExample:\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\nAdding an inner boundary curve\nThe syntax is analogous to the creation of an outer boundary curve. Once interior curves are defined they can be added to chain, again in counter-clockwise orientation. Note that the individual pieces of the curve are given a name. The entire chain is also given a name.\n[Return:nothing] addCurveToInnerBoundary!(proj::Project,\n crv::Dict{String,Any},\n chainName::String)\nExample:\nline1 = newEndPointsLineCurve(\"line_segment\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\naddCurveToInnerBoundary!(p, line1, \"interior_curve\")\nTo edit curves they can be accessed by the name:\n[Return:Dict{String,Any}] getInnerBoundaryCurve(proj::Project,\n curveName::String,\n chainName::String)\n[Return:Dict{String,Any}] getOuterBoundaryCurveWithName(proj::Project,\n name::String)\nDeleting boundary curves\nThe entire outer boundary or an entire inner boundary can be removed from the project.\n[Return:nothing] removeOuterBoundary!(proj::Project)\n[Return:nothing] removeInnerBoundary!(proj::Project, chainName::String)\nAlternatively, individual pieces of the boundary curve chains can be removed.\n[Return:nothing] removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n[Return:nothing] removeInnerBoundaryCurve!(proj::Project,\n name::String,\n chainName::String)\nAs in HOHQMesh the project can have only one outer boundary chain, so the removal does not require a specific chainName.","category":"page"},{"location":"interactive-api/#Editing-curves","page":"API","title":"Editing curves","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"You can determine the type of a curve by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] getCurveType(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"For any of the curves, their name can be changed by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" setCurveName!(crv::Dict{String,Any}, name::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"and checked by","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" getCurveName(crv::Dict{String,Any})","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Alternatively, all curves on an outer or inner boundary with the same name can have that name changed all at once everywhere in the project with the function","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" renameCurve!(proj::Project, oldName::String, newName::String)","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Otherwise there are special functions to change the parameters of curves","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] setXEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setYEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setZEqn!(crv::Dict{String,Any}, eqn::String)\n [Return:nothing] setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcUnits!(arc::Dict{String,Any}, units::String)\n [Return:nothing] setArcCenter!(arc::Dict{String,Any}, point::Array{Float64})\n [Return:nothing] setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n [Return:nothing] setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n [Return:String] getXEqn(crv::Dict{String,Any})\n [Return:String] getYEqn(crv::Dict{String,Any})\n [Return:String] getZEqn(crv::Dict{String,Any})\n [Return:Array{Float64}] getStartPoint(crv::Dict{String,Any})\n [Return:Array{Float64}] getEndPoint(crv::Dict{String,Any})\n [Return:String] getArcUnits(arc::Dict{String,Any})\n [Return:Array{Float64}] getArcCenter(arc::Dict{String,Any})\n [Return:Float64] getArcStartAngle(arc::Dict{String,Any})\n [Return:Float64] getArcEndAngle(arc::Dict{String,Any})\n [Return:Float64] getArcRadius(arc::Dict{String,Any})","category":"page"},{"location":"interactive-api/#Undo/redo","page":"API","title":"Undo/redo","text":"","category":"section"},{"location":"interactive-api/","page":"API","title":"API","text":"The interactive mesh functionality has unlimited undo/redo for most actions.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"In interactive mode, actions can be undone by the commands","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undo()\n [Return:String] redo()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"where the return string contains the name of the action performed.","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"To find out what the next actions are, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:String] undoActionName()\n [Return:String] redoActionName()","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":"Finally, to clear the undo stack, use","category":"page"},{"location":"interactive-api/","page":"API","title":"API","text":" [Return:nothing] clearUndoRedo()","category":"page"},{"location":"tutorials/curved_outer_boundary/#Curved-outer-boundary","page":"Curved outer boundary","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Synopsis","page":"Curved outer boundary","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initialization","page":"Curved outer boundary","title":"Initialization","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We create a new project with the name \"TheBlob\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"blob_project = newProject(\"TheBlob\", \"out\")","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-the-outer-boundary","page":"Curved outer boundary","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The outer boundary curve for the domain of interest in this tutorial is given by the parametric equations","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":" beginaligned\n x(t) = 4cos(2 pi t) - frac35cos^3(8 pi t)02cm\n y(t) = 4sin(2 pi t) - frac12sin^2(11 pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"xEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The name of this curve is assigned to be \"Blob\". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addCurveToOuterBoundary!(blob_project, blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Add-a-background-grid","page":"Curved outer boundary","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for blob_project to have elements with side length two in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"plotProject!(blob_project, MODEL+GRID)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"Blob\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: coarse_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"From the visualization we see that the background grid is likely too coarse to produce a \"good\" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"setBackgroundGridSize!(blob_project, 0.5, 0.5)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: fine_grid)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Initial-mesh-and-user-adjustments","page":"Curved outer boundary","title":"Initial mesh and user adjustments","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"TheBlob.control: A HOHQMesh control file for the current project.\nTheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nTheBlob.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"To do this we execute the command","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 8.4328000000000000E-002\n Number of nodes = 479\n Number of Edges = 895\n Number of Elements = 417\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025286 0.36208840 0.11936333 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002882 2.58443761 1.26335838 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.12867591 1.18585825 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006176 4.77438730 1.51314025 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011275 0.28170345 0.10292806 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.38249259 89.99827733 73.08294187 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132795 156.98701187 109.36585212 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: initial_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point (-4 0) is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"center = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Above we create a circular refinement region centered at the point (-4 -05) with a desired resolution size 04 and a radius of 10. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: refinement_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/#Final-mesh","page":"Curved outer boundary","title":"Final mesh","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"generate_mesh(blob_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 9.2778999999999986E-002\n Number of nodes = 503\n Number of Edges = 940\n Number of Elements = 438\n Number of Subdivisions = 5\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00025286 0.36208840 0.11412688 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00002883 2.47056840 1.26416662 1.00000000 999.99900000 1.00000000\n Condition 1.00000000 3.12867592 1.18429212 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00006176 4.77438730 1.51407242 1.00000000 4.00000000 1.00000000\n Jacobian 0.00011275 0.28170345 0.09814903 0.00000000 999.99900000 1.00000000\n Minimum Angle 29.38249259 89.99827897 72.80049710 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.00132784 156.98701188 109.63478104 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"(Image: final_blob)","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.","category":"page"},{"location":"tutorials/curved_outer_boundary/#Summary","page":"Curved outer boundary","title":"Summary","text":"","category":"section"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/curved_outer_boundary/","page":"Curved outer boundary","title":"Curved outer boundary","text":"# Interactive mesh with a curved outer boundary\n#\n# Create an outer boundary from a set of parametric equations.\n# Add manual refinement in a small region around the point (-4, -0.5).\n#\n# Keywords: outer boundary, parametric equations, refinement center\nusing HOHQMesh\n\n# Instantiate the project\nblob_project = newProject(\"TheBlob\", \"out\")\n\n# Create and add the outer boundary curve\nxEqn = \"x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3\"\nyEqn = \"y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2\"\nzEqn = \"z(t) = 0.0\"\nblob = newParametricEquationCurve(\"Blob\", xEqn, yEqn, zEqn)\naddCurveToOuterBoundary!(blob_project, blob)\n\n# Add the background grid\naddBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])\n\n# Create and add the refinement region\ncenter = newRefinementCenter(\"region\", \"smooth\", [-4.0, -0.5, 0.0], 0.4, 1.0)\naddRefinementRegion!(blob_project, center)\n\n# Generate the mesh\ngenerate_mesh(blob_project)","category":"page"},{"location":"tutorials/create_edit_curves/#Creating-and-editing-curves","page":"Creating and editing curves","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a \"chain\" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/create_edit_curves/#Synopsis","page":"Creating and editing curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/#Initialization","page":"Creating and editing curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a new project with the name \"sandbox\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox_project = newProject(\"sandbox\", \"out\")","category":"page"},{"location":"tutorials/create_edit_curves/#Add-the-outer-boundary-chain","page":"Creating and editing curves","title":"Add the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We first create the outer boundary curve chain that is composed of three pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (0 -7) to (5 3).\nHalf-circle arc of radius r=5 centered at (0 3).\nStraight line segment from (-5 3) to (0 -7).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [0.0, -7.0, 0.0], # start point\n [5.0, 3.0, 0.0]) # end point\n\nouter_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-5.0, 3.0, 0.0], # start point\n [0.0, -7.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from 0 to 180 degrees.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"outer_arc = newCircularArcCurve(\"Arc\", # curve name\n [0.0, 3.0, 0.0], # center\n 5.0, # radius\n 0.0, # start angle\n 180.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", and \"Arc\" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-a-background-grid","page":"Creating and editing curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We visualize the outer boundary curve chain and background grid with the following","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"plotProject!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains three curve segments \"Line1\", \"Arc\", and \"Line2\" labeled in the figure by O.1, O.2, and O.3, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-the-outer-boundary-chain","page":"Creating and editing curves","title":"Edit the outer boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the domain boundary requires a curved segment instead of the straight line \"Line2\". We will replace this line segment in the outer boundary chain with a cubic spline.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"First, we remove the \"Line2\" curve from the \"Outer\" chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Outer curve removal\nAlternatively, we can remove the curve \"Line2\" using its index in the \"Outer\" boundary chain.removeOuterBoundaryCurveAtIndex!(sandbox_project, 3)This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The plot automatically updates and we see that the outer boundary is open and contains two segments: \"Line1\" and \"Arc\".","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve \"Arc\" and end at the first point of the curve \"Line1\". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. The spline curve constructor newSplineCurve also takes the number of points as an input argument.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"spline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Now we add the spline curve outer_spline into the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToOuterBoundary!(sandbox_project, outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates automatically to display the \"Outer\" boundary chain with the new \"Spline\" curve labeled O.3.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: outer_spline)","category":"page"},{"location":"tutorials/create_edit_curves/#Add-an-inner-boundary-chain","page":"Creating and editing curves","title":"Add an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We create a pill shaped inner boundary curve chain composed of four pieces","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Straight line segment from (1 5) to (1 3).\nHalf-circle arc of radius r=1 centered at (0 3).\nStraight line segment from (-1 3) to (-1 5).\nHalf-circle arc of radius r=1 centered at (0 5).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Similar to the construction of the \"Outer\" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_line1 = newEndPointsLineCurve(\"Line1\", # curve name\n [1.0, 5.0, 0.0], # start point\n [1.0, 3.0, 0.0]) # end point\n\ninner_line2 = newEndPointsLineCurve(\"Line2\", # curve name\n [-1.0, 3.0, 0.0], # start point\n [-1.0, 5.0, 0.0]) # end point","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at (0 3) varies from 0 to -180 degrees. The top half-circle arc centered at (0 5) has an angle that varies from 180 to 0 degrees. The construction of the two circle arcs are","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"inner_bottom_arc = newCircularArcCurve(\"BottomArc\", # curve name\n [0.0, 3.0, 0.0], # center\n 1.0, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\n\ninner_top_arc = newCircularArcCurve(\"TopArc\", # curve name\n [0.0, 5.0, 0.0], # center\n 1.0, # radius\n 180.0, # start angle\n 0.0, # end angle\n \"degrees\") # units for angle","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Note, we use \"radians\" to set the angle bounds for inner_bottom_arc and \"degrees\" for the angle bounds of inner_top_arc.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The curve names \"Line1\", \"Line2\", \"BottomArc\", and \"TopArc\" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"This inner boundary chain name \"inner\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments \"Line1\", \"BottomArc\", \"Line2\", and \"TopArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_pill)","category":"page"},{"location":"tutorials/create_edit_curves/#Generate-the-mesh","page":"Creating and editing curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"sandbox.control: A HOHQMesh control file for the current project.\nsandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nsandbox.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 7.5414000000000009E-002\n Number of nodes = 511\n Number of Edges = 933\n Number of Elements = 422\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00002932 1.17335568 0.18813138 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00953438 2.30790024 1.31439620 1.00000000 999.99900000 1.00000000\n Condition 1.00041663 2.41773865 1.21024584 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.01673809 3.68828437 1.59413340 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001750 1.13820387 0.14143901 0.00000000 999.99900000 1.00000000\n Minimum Angle 32.22733574 89.35690571 68.75321248 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.61089476 152.37947944 113.36221513 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: initial_mesh)","category":"page"},{"location":"tutorials/create_edit_curves/#Delete-the-existing-mesh","page":"Creating and editing curves","title":"Delete the existing mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"remove_mesh!(sandbox_project)\nupdatePlot!(sandbox_project, MODEL+GRID)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The remove_mesh! command deletes the mesh information from the sandbox_project as well as the mesh file sandbox.mesh, control file sandbox.control, plot file sandbox.tec, and mesh statistics file sandbox.txt from the out folder.","category":"page"},{"location":"tutorials/create_edit_curves/#Edit-an-inner-boundary-chain","page":"Creating and editing curves","title":"Edit an inner boundary chain","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Suppose that the inner boundary actually requires a curved segment instead of the straight line \"Line1\". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We remove the \"Line1\" curve from the inner chain with the command","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"tip: Inner curve removal\nAlternatively, we can remove the curve \"Line1\" using its index in the inner boundary chain.removeInnerBoundaryCurveAtIndex!(sandbox_project, 1, \"inner\")This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: \"BottomArc\", \"Line2\", and \"TopArc\". Note that the index of the remaining curves has changed as shown below.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_removal)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"note: Brief note about undo / redo\nThe interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.undoActionName()\n\"Remove Inner Boundary Curve\"We can undo the removal of the \"Line1\" curve with undoundo()\n\"Undo Remove Inner Boundary Curve\"In addition to reinstating \"Line1\" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The new inner curve segment will be an oscillating line given by the parametric equations","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":" beginaligned\n x(t) = t + 102cm\n y(t) = -2t + 5 - frac32 cos(pi t) sin(pi t)02cm\n z(t) = 0\n endaligned\n qquad\n tin01","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., sin, cos, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"xEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The name of this new curve is assigned to be \"wiggleLine\". We add this new curve to the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"addCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The automatically updated figure now shows:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_open_chain)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"We see from the figure that this parametric equation curve starts at the point (15) and, therefore, matches the end point of the existing curve \"TopArc\" present in the \"inner\" chain. However, the parametric equation curve ends at the point (23) which does not match the \"BottomArc\" curve. So, the inner boundary chain remains open.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"warning: Attempt to generate a mesh with an open curve chain\nAn open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"To create a closed boundary curve we must remove the \"BottomArc\" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point (2 3) and end at the point (-1 3) to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the \"BottomArc\" from the \"inner\" chain.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"removeInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The figure updates to display the \"inner\" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_remove_arc)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"A half-circle arc that joins the points (2 3) and (-1 3) has a radius r=15, is centered at (05 3) and has an angle that vaires from 0 to -180. We construct this circle arc and directly add it to the sandbox_project.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"new_bottom_arc = newCircularArcCurve(\"wideBottomArc\", # curve name\n [0.5, 3.0, 0.0], # center\n 1.5, # radius\n 0.0, # start angle\n -pi, # end angle\n \"radians\") # units for angle\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The updated plot now gives the modified, closed inner curve chain that now contains four curve segments \"Line2\", \"TopArc\", \"wiggleLine\", and \"wideBottomArc\" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/#Regenerate-the-mesh","page":"Creating and editing curves","title":"Regenerate the mesh","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"generate_mesh(sandbox_project)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.11353599999999998\n Number of nodes = 712\n Number of Edges = 1308\n Number of Elements = 596\n Number of Subdivisions = 7\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00002932 1.15661960 0.12823902 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.01050856 3.14732001 1.34260027 1.00000000 999.99900000 1.00000000\n Condition 1.00037771 2.59434067 1.22850175 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.02744717 3.68828437 1.64751502 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001750 1.13149451 0.09443920 0.00000000 999.99900000 1.00000000\n Minimum Angle 31.87236189 89.33988565 67.86178629 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.44177106 157.27121105 114.35699650 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: inner_modified)","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"(Image: zoom_corner)","category":"page"},{"location":"tutorials/create_edit_curves/#Summary","page":"Creating and editing curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.","category":"page"},{"location":"tutorials/create_edit_curves/","page":"Creating and editing curves","title":"Creating and editing curves","text":"# Interactive mesh with modified outer and inner curve chains\n#\n# Create inner / outer boundary chains composed of the four\n# available HOHQMesh curve types.\n#\n# Keywords: outer boundary, inner boundary, parametric equations,\n# circle arcs, cubic spline, curve removal\nusing HOHQMesh\n\n# Instantiate the project\nsandbox_project = newProject(\"sandbox\", \"out\")\n\n# Add the background grid\naddBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])\n\n# Create and add the original outer boundary curves\nouter_line1 = newEndPointsLineCurve(\"Line1\", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])\nouter_line2 = newEndPointsLineCurve(\"Line2\", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])\nouter_arc = newCircularArcCurve(\"Arc\", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, \"degrees\")\n\naddCurveToOuterBoundary!(sandbox_project, outer_line1)\naddCurveToOuterBoundary!(sandbox_project, outer_arc)\naddCurveToOuterBoundary!(sandbox_project, outer_line2)\n\n# Modify the outer boundary to have a spline instead of a straight line\nremoveOuterBoundaryCurveWithName!(sandbox_project, \"Line2\")\n\nspline_data = [ [0.0 -5.0 3.0 0.0]\n [0.25 -2.0 1.0 0.0]\n [0.5 -4.0 0.5 0.0]\n [0.75 -2.0 -3.0 0.0]\n [1.0 0.0 -7.0 0.0] ]\nouter_spline = newSplineCurve(\"Spline\", 5, spline_data)\naddCurveToOuterBoundary!(sandbox_project, outer_spline)\n\n# Create and add the inner boundary curves\ninner_line1 = newEndPointsLineCurve(\"Line1\", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])\ninner_line2 = newEndPointsLineCurve(\"Line2\", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])\ninner_bottom_arc = newCircularArcCurve(\"BottomArc\", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, \"radians\")\ninner_top_arc = newCircularArcCurve(\"TopArc\", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, \"degrees\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_line1, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_line2, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, inner_top_arc, \"inner\")\n\n# Generate a mesh\ngenerate_mesh(sandbox_project)\n\n# Delete the existing mesh before modifying the inner boundary curve chain\nremove_mesh!(sandbox_project)\n\n# Modify the inner boundary curve with an oscillatory line and a new circle arc\nremoveInnerBoundaryCurve!(sandbox_project, \"Line1\", \"inner\")\nremoveInnerBoundaryCurve!(sandbox_project, \"BottomArc\", \"inner\")\n\nxEqn = \"x(t) = t + 1\"\nyEqn = \"y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)\"\nzEqn = \"z(t) = 0.0\"\ninner_eqn = newParametricEquationCurve(\"wiggleLine\", xEqn, yEqn, zEqn)\n\nnew_bottom_arc = newCircularArcCurve(\"wideBottomArc\", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, \"radians\")\n\naddCurveToInnerBoundary!(sandbox_project, inner_eqn, \"inner\")\naddCurveToInnerBoundary!(sandbox_project, new_bottom_arc, \"inner\")\n\n# Regenerate the final mesh\ngenerate_mesh(sandbox_project)","category":"page"},{"location":"interactive_overview/#InteractiveTool","page":"Overview","title":"Overview","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The interactive functionality is an API to generate a quadrilateral (future: hexahedral) mesh using Julia. It serves as a front end to the HOHQMesh program, and is designed to let one build a meshing project interactively while graphically displaying the results.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Several scripts are available in the examples/ folder to get you started. These example scripts follow the naming convention of interactive_* where the phrase interactive indicates their association with this API and then trailing information will indicate what that script demonstrates. For instance, the file interactive_spline_curves.jl provides an interactive project that creates an manipulates splines for the inner boundaries before generating the mesh.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Below we provide a broad overview of the interactive mesh workflow. Further clarification on this workflow is provided in the Guided tour. Several Tutorials are also available to demonstrate this functionality.","category":"page"},{"location":"interactive_overview/#Workflow-and-basic-moves","page":"Overview","title":"Workflow and basic moves","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The order of the workflow and basic moves follow a logical pattern: The project must be created first. Curves can be added at any time. The background grid can be added any time to the project. A mesh is usually generated after the model (curves) and background grid are completed.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"To generate a mesh interactively you","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"Create a project with a user given projectName and folder where any generated files are to be saved\np = newProject(, )\nBoth of these input arguments are strings.\nCreate inner and outer boundary curves from the available types\nc = newEndPointsLineCurve(, startLocation [x, y, z], endLocation [x, y, z]) *Straight Line*\nc = newCircularArcCurve(, center [x, y, z], radius, startAngle, endAngle, units = \"degrees\" or \"radians\") *Circular Arc*\nc = newParametricEquationCurve(, xEqn, yEqn, zEqn) *Parametric equation*\nc = newSplineCurve(, dataFile) *Spline with data from a file*\nc = newSpline(, nKnots, knotsMatrix) *Spline with given knot values*\nSee Defining curves for further details on the different curve type currently supported by HOHQMesh.\nThe generic name for each of these curve creation methods is new!. The generic can be used instead of the longer descriptive name to save typing during interactive sessions, if desired.\nAdd curves to build the model to see what you have added,\naddOuterBoundaryCurve!(p, ) *Add outer boundary curve*\naddInnerBoundaryCurve!(p, , ) *Add curve to an inner boundary*\nFor a single inner / outer boundary curve the command above directly adds the curve into the Project. If the inner / outer boundary curve is a chain of multiple curves then they must be added to the Project in an order which yields a closed curves with counter-clockwise orientation. See the Guided tour for an example of a chain of curves.\nCurves can be added by using the generic add! function instead of the longer descriptive name to save typing during interactive sessions, if desired.\nVisualize the project's model, if desired\nplotProject!(p, MODEL)\nPlots are updated in response to user interactions. However, to update the plot at any time, use\nupdatePlot!(p, options)\nOptions are MODEL, GRID, MESH, and REFINEMENTS. To plot combinations, sum the options, e.g. MODEL+GRID or MODEL+MESH. You normally are not interested in the background grid once the mesh is generated.\nnote: Visualization requirement\nThe interactive functionality uses Makie.jl to visualize the Project information. Therefore, in addition to HOHQMesh.jl a user must load a Makie backend (for example, GLMakie or CairoMakie) if visualization is desired.\nSet the background grid\nWhen no outer boundary curve is present, the background grid can be set with\naddBackgroundGrid!(p, lower left [x,y,z], spacing [dx,dy,dz], num Intervals [nX,nY,nZ])\nOr\naddBackgroundGrid!(p, [top value, left value, bottom value, right value], num Intervals [nX,nY,nZ])\nThe first method creates the rectangular boundary with extent [x0[1], x0[1] + N*dx[1]] by [x0[2], x0[2] + N*dx[2]]. The second method sets a rectangular bounding box with extent [top value, left value, bottom value, right value] and the number of elements in each direction. The first exists for historical reasons; the second is probably the easiest to use.\nWhen an outer boundary is present the background grid can be set as\naddBackgroundGrid!(p, [dx, dy, dz])\nwhere the spacing controls the number of elements in each direction.\nnote: Background grid\nA background grid is required by HOHQMesh. If one is not present in the Project and a user attempts to generate the mesh a warning is thrown.\nAdjust meshing parameters, if desired. For instance, one can adjust the polynomial order in the Project for any curved boundaries by\nsetPolynomialOrder!(p, order)\nThe background grid size can be adjusted where we can set the grid size in the x and y directions, dx and dy, can be set separately\nsetBackgroundGridSize!(p, 0.5, 0.25)\nSee Controlling the mesh generation for details on adjusting parameters already present in the Project.\nGenerate the mesh\ngenerate_mesh(p)\nThe mesh file will be saved in with the name .mesh. A HOHQMesh control file is automatically created from the contents of the Project and is also saved in that folder with the name .control. This control file can be read in again later and modified, remeshed, etc. The function generate_mesh will print the mesh information and statistics, and will plot the mesh as in the figure above, if a plot is otherwise visible. If not, it can always be plotted with the plotProject! command.","category":"page"},{"location":"interactive_overview/#Advanced","page":"Overview","title":"Advanced","text":"","category":"section"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"The generate_mesh function has two optional arguments. The first is the Boolean verbose argument. One can pass verbose=true to output additional messages and information during the meshing process. The second is the integer subdivision_maximum argument. The default value is subdivision_maximum=8, meaning that elements can be up to a factor of 2^8 smaller than the existing background grid. Note, think before adjusting the subdivision_maximum level! It is often the case that adjusting the boundary curves, background grid size, adding local refinement regions, or some combination of these adjustments removes the need to adjust the subdivision depth.","category":"page"},{"location":"interactive_overview/","page":"Overview","title":"Overview","text":"All objects and information contained in the variable type Project are actually dictionaries of type Dict{String, Any}. Since Julia is not an object oriented language, the parameters and other parts of these internal dictionaries can be accessed and edited directly by key and value. However, if you do that, then certain features like undo/redo and automatic plot updating will not work.","category":"page"},{"location":"testing/#Testing","page":"Testing","title":"Testing","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In HOHQMesh and its related repositories, tests are triggered by","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"each git push to main and\neach git push to any pull request.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test and coverage requirements\nBefore merging a pull request (PR) to main, we require thatthe code passes all functional tests\ncode coverage does not decrease.","category":"page"},{"location":"testing/#Testing-setup","page":"Testing","title":"Testing setup","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> using Pkg; Pkg.test(\"HOHQMesh\")","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"julia> # Run all test for the interactive Curve API\n include(joinpath(\"test\", \"test_curve.jl\"))","category":"page"},{"location":"testing/#Adding-new-tests","page":"Testing","title":"Adding new tests","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Test duration\nAs a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).","category":"page"},{"location":"testing/#Test-coverage","page":"Testing","title":"Test coverage","text":"","category":"section"},{"location":"testing/","page":"Testing","title":"Testing","text":"In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered \"covered\" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The \"Details\" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.","category":"page"},{"location":"testing/","page":"Testing","title":"Testing","text":"note: Coverage requirements\nIn general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.","category":"page"},{"location":"authors/#Authors","page":"Authors","title":"Authors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"HOHQMesh.jl is maintained by the Trixi authors. Its development is coordinated by the principal developers who are its main contributors and can be contacted in case of questions about HOHQMesh. In addition, there are contributors who have provided substantial additions or modifications. The HOHQMesh mesh generator itself is developed by David A. Kopriva.","category":"page"},{"location":"authors/#Principal-Developers","page":"Authors","title":"Principal Developers","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"David A. Kopriva, Florida State University, USA\nAndrew Winters, Linköping University, Sweden","category":"page"},{"location":"authors/#Contributors","page":"Authors","title":"Contributors","text":"","category":"section"},{"location":"authors/","page":"Authors","title":"Authors","text":"The following people contributed major additions or modifications to HOHQMesh and are listed in alphabetical order:","category":"page"},{"location":"authors/","page":"Authors","title":"Authors","text":"David Kopriva\nHendrik Ranocha\nMichael Schlottke-Lakemper\nAndrew Winters","category":"page"},{"location":"reference/#HOHQMesh.jl-API","page":"Reference","title":"HOHQMesh.jl API","text":"","category":"section"},{"location":"reference/","page":"Reference","title":"Reference","text":"CurrentModule = HOHQMesh","category":"page"},{"location":"reference/","page":"Reference","title":"Reference","text":"Modules = [HOHQMesh]","category":"page"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary named boundaryName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.add!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.add!","text":"add!(proj::Project, obj::Dict{String,Any})\n\nAdd a curve to the outer boundary or a refinement reion to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}, Array{Float64}, Array{Int64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})\n\nAdd the background grid block using the left corner, x0, the grid size dx, and the number of intervals in each direction. Use this when there is no outer boundary defined in the model. This version mimics HOHQMesh's backgroundGrid block, but the version\n\naddBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nis a lot easier to use.\n\nTODO: Change HOHQMesh and delete this way to specify the domain and use the bounding box one instead.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}, Array{Int64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, box::Array{Float64}, N::Array{Int} )\n\nAdd the background grid block with bounding box = [TOP, LEFT, BOTTOM, RIGHT] and the number of intervals in each diredction. Use this when there is no outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Array{Float64}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid(proj::Project, bgSize::Array{Float64})\n\nAdd the background grid block with the grid size to be a 3-vector. Use this when there is an outer boundary defined in the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addBackgroundGrid!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addBackgroundGrid!","text":"addBackgroundGrid!(proj::Project, dict::Dict{String,Any})\n\nUsed only for undo/redo.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToInnerBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.addCurveToInnerBoundary!","text":"addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)\n\nAdd a curve to the inner boundary with name boundaryName. If an inner boundary of that name does not exist, one is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addCurveToOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addCurveToOuterBoundary!","text":"addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})\n\nAdd a curve to the outer boundary. The curves must be added in order counter-clockwise\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addInnerBoundaryWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.addInnerBoundaryWithName!","text":"addInnerBoundaryWithName!(proj::Project,name::String)\n\nCreate a new empty inner boundary with the given name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addObserver-Tuple{Any, String, Any}","page":"Reference","title":"HOHQMesh.addObserver","text":"addObserver(observer::Any, note::String, f::Any)\n\nf is the function to be executed (called) when a notification of name note is given.\n\nThe function called upon notification must have the signature f(observer, sender, args...)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addOuterBoundary!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addOuterBoundary!","text":"addOuterBoundary!(proj::Project, outerBoundary::Dict{String,Any})\n\nAdd an empty outer boundary to the project. There can be only one. This function is only used as part of an undo operation removing the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegion!","text":"addRefinementRegion!(proj::Project,r::Dict{String,Any})\n\nAdd the refinement region to the project\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRefinementRegionPoints!-Tuple{HOHQMesh.Project, Dict{String, Any}}","page":"Reference","title":"HOHQMesh.addRefinementRegionPoints!","text":"addRefinementRegionPoints!(proj::Project, r::Dict{String,Any})\n\nCompute and add to the project the plotting points for the refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.addRunParameters!","page":"Reference","title":"HOHQMesh.addRunParameters!","text":"addRunParameters!(proj::Project,\n plotFormat::String = \"skeleton\",\n meshFileFormat::String = \"ISM-V2\",\n polynomialOrder::Int = 5)\n\nAdd a RUN_PARAMETERS block and set all the parameters in one call.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.addSpringSmoother!","page":"Reference","title":"HOHQMesh.addSpringSmoother!","text":"addSpringSmoother!(status::String, type::String, nIterations::Int)\n\nStatus is either ON or OFF Type is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.bboxUnion-Tuple{Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.bboxUnion","text":"bboxUnion(box1::Array{Float64}, box2::Array{Float64})\n\nReturns the union of two bounding boxes\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.curveBounds-Tuple{Matrix{Float64}}","page":"Reference","title":"HOHQMesh.curveBounds","text":"curveBounds(crvPoints::Array{Float64,2})\n\nFind the bounds of a single curve, discretized as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.emptyBounds-Tuple{}","page":"Reference","title":"HOHQMesh.emptyBounds","text":"emptyBounds()\n\nReturns an array that will always be ignored when unioned with another bounding box.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.examples_dir-Tuple{}","page":"Reference","title":"HOHQMesh.examples_dir","text":"examples_dir()\n\nReturn the path to the directory with some example mesh setups.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.extract_mesh_file_format-Tuple{Any}","page":"Reference","title":"HOHQMesh.extract_mesh_file_format","text":"extract_mesh_file_format(control_file)\n\nReturn a string with the desired output format of the HOHQMesh generated mesh file. This information is given within the RUN_PARAMETERS of the CONTROL_INPUT block of the control file. See the HOHQMesh documentation for details.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{Any}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(control_file;\n output_directory=\"out\",\n mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing,\n verbose=false, subdivision_maximum=8)\n\nGenerate a mesh based on the control_file with the HOHQMesh mesh generator and store resulting files in output_directory.\n\nYou can set the mesh filename, the plot filename, and the statistics filename using the keyword arguments mesh_filename, plot_filename, and stats_filename, respectively. If set to nothing, the filenames for the mesh file, plot file, and statistics file are generated automatically from the control file name. For example, path/to/ControlFile.control will result in output files ControlFile.mesh, ControlFile.tec, and ControlFile.txt.\n\nYou can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information with the keyword argument verbose.\n\nTo override the maximum number of allowable subdivisions in the quad tree during meshing adjust the value of subdivision_maximum. The default value of subdivision_maximum is 8, meaning that elements can be up to a factor of 2^8 smaller than the background grid. Note, think before doing this! It could be adjusting the boundary curves, background grid size, adding local refinement regions, or some combination may remove the need to adjust the subdivision depth.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.generate_mesh-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.generate_mesh","text":"generate_mesh(proj::Project; verbose=false, subdivision_maximum=8)\n\nGenerate a mesh from the information stored in a Project created using the interactive mesh functionality. First a check is made if a background grid exists and all inner/outer boundary curves are valid.\n\nThis function will then make a HOHQMesh control file from the control dictionary proj.controlDict and use it to call the wrapper function that interfaces with HOHQMesh. The resulting mesh and control files will be saved to proj.projectDirectory. Also, if there is an active plot of the mesh project it will update to display the generated mesh.\n\nWith the optional argument verbose one can activate verbose output from HOHQMesh that prints additional messages and debugging mesh information.\n\nTo override the maximum number of allowable subdivisions in the quad tree during meshing adjust the value of subdivision_maximum. The default value of subdivision_maximum is 8, meaning that elements can be up to a factor of 2^8 smaller than the background grid. Note, think before doing this! It could be adjusting the boundary curves, background grid size, adding local refinement regions, or some combination may remove the need to adjust the subdivision depth.\n\nThis function returns the output to stdout of the HOHQMesh binary when generating the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getAllRefinementRegions-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getAllRefinementRegions","text":"getAllRefinementRegions(proj::Project)\n\nGet the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcCenter","text":"getArcCenter(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the center of a circular arc as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcEndAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcEndAngle","text":"getArcEndAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcRadius-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcRadius","text":"getArcRadius(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcStartAngle-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcStartAngle","text":"getArcStartAngle(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getArcUnits-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getArcUnits","text":"getArcUnits(crv::Dict{String,Any}, units::String)\n\nGet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridLowerLeft-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridLowerLeft","text":"getBackgroundGridLowerLeft(proj::Project)\n\nReturns the [x,y] of the lower left point of the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSize-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSize","text":"getBackgroundGridSize(proj::Project)\n\nReturns the background grid size array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getBackgroundGridSteps-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getBackgroundGridSteps","text":"getBackgroundGridSteps(proj::Project)\n\nReturns the [Nx,Ny,Nz] for the background grid.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String, boundaryName::String)\n\nGet the curve named curveName from the inner boundary named boundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurve-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getCurve","text":"getCurve(proj::Project, curveName::String)\n\nGet the curve with name curveName from the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveName","text":"getCurveName(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getCurveType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getCurveType","text":"getCurveType(crv::Dic{String,Any})\n\nGet the type of the curve, `END_POINTSLINE_CURVE`, `PARAMETRIC_EQUATION_CURVE`,\n`SPLINE_CURVE`, or `CIRCULAR_ARC` as a string.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getEndPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getEndPoint","text":"getEndPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the end point for a line curve as an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundary-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundary","text":"getInnerBoundary(proj::Project, name::String)\n\nGet the chain of curves from the inner boundary with name name.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryChainWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryChainWithName","text":"getInnerBoundaryChainWithName(proj::Project, name::String)\n\nGet the inner boundary CHAIN with the given name. If one does not exist, it is created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getInnerBoundaryCurve-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.getInnerBoundaryCurve","text":"\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getMeshFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getMeshFileFormat","text":"getMeshFileFormat(proj::Project)\n\nReturns the format in which the mesh will be written.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getName-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getName","text":"getName(proj::Project)\n\nReturns the filename to be used by the mesh, plot, control, and stats files.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryChainList-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getOuterBoundaryChainList","text":"getOuterBoundaryChainList(proj::Project)\n\nGet the array of outer boundary curves.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getOuterBoundaryCurveWithName-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getOuterBoundaryCurveWithName","text":"getOuterBoundaryCurveWithName(proj::Project, name::String)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPlotFileFormat-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPlotFileFormat","text":"getPlotFileFormat(proj::Project)\n\nReturns the plot file format.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getPolynomialOrder-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getPolynomialOrder","text":"getPolynomialOrder(proj::Project)\n\nReturns the polynomial order for boundary curves in the mesh file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementEnd-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementEnd","text":"getRefinementEnd(r::Dict{String,Any})\n\nReturn Array{Float64} of the end location of the refinement line\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementGridSize-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementGridSize","text":"getRefinementGridSize(r::Dict{String,Any})\n\nReturns the grid size,h, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementLocation-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementLocation","text":"getRefinementLocation(r::Dict{String,Any})\n\nReturn Array{Float64} of the location of the refinement center.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementName-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementName","text":"getRefinementName(r::Dict{String,Any})\n\nReturn name of the refinement. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"getRefinementRegion(proj::Project, indx)\n\nGet the refinement region with index, indx from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegion-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.getRefinementRegion","text":"(i,r) = getRefinementRegion(project, name)\n\nGet the refinement region with the given name and its location in the list of refinement regions.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementRegionCenter-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementRegionCenter","text":"getRefinementRegionCenter(r::Dict{String,Any})\n\nGet, or compute, the center of the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementStart-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementStart","text":"getRefinementStart (r::Dict{String,Any})\n\nReturn Array{Float64} of the start location of the refinement line. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementType-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementType","text":"getRefinementType(r::Dict{String,Any})\n\nReturn the type of refinement, either \"smooth\" or \"sharp\". r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getRefinementWidth-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getRefinementWidth","text":"getRefinementWidth(r::Dict{String,Any})\n\nReturns the region width,w, as Float64. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingIterations-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingIterations","text":"getSmoothingIterations(proj::Project)\n\nGet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingStatus-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingStatus","text":"smoothingStatus(proj::Project)\n\nReturns whether the smoother will be \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSmoothingType-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.getSmoothingType","text":"getSmoothingType(proj::Project)\n\nReturns either \"LinearSpring\" or \"LinearAndCrossbarSpring\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplineNKnots-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplineNKnots","text":"getSplineNKnots(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getSplinePoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getSplinePoints","text":"getSplinePoints(spline::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getStartPoint-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getStartPoint","text":"getStartPoint(crv::Dict{String,Any}, point::Array{Float64})\n\nGet the start point for a line curve as an array\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getXEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getXEqn","text":"getXEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getYEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getYEqn","text":"getYEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.getZEqn-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.getZEqn","text":"getZEqn(crv::Dict{String,Any})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.hasBackgroundGrid-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.hasBackgroundGrid","text":"hasBackgroundGrid(proj::Project)\n\nTests to see if the project has a backgroundGrid dictionary defined.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.innerBoundaryIndices-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.innerBoundaryIndices","text":"innerBoundaryIndices(proj::Project, curveName::String)\n\nReturns (curveIndex,chainIndex) for the location of the curve named curveName in it's inner boundary chain.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryAtIndex!-Tuple{HOHQMesh.Project, String, Int64, Dict{String, Any}, Vector{Any}, Vector{String}}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryAtIndex!","text":"insertInnerBoundaryAtIndex!(proj::Project, chainName::String, indx::Int, chain::??)\n\nInsert an entire inner boundary. Primarily meant for undo operation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64, String}","page":"Reference","title":"HOHQMesh.insertInnerBoundaryCurveAtIndex!","text":"insertInnerBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any},\n indx::Int, boundaryName::String)\n\nInsert a curve crv into an inner boundary chain boundaryName at the specified index indx.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertOuterBoundaryCurveAtIndex!","text":"insertOuterBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any}, indx::Int)\n\nInsert a curve into the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.insertRefinementRegion!-Tuple{HOHQMesh.Project, Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.insertRefinementRegion!","text":"insertRefinementRegion!(proj::Project, r::Dict{String,Any}, indx::Int)\n\nUsed by undo()\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelChainIsOK-Tuple{Vector{Dict{String, Any}}, String}","page":"Reference","title":"HOHQMesh.modelChainIsOK","text":"modelChainIsOK(chain::Vector{Dict{String, Any}}, chainName::String)\n\nReturns true if the chain of curves is contiguous and closed; false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.modelCurvesAreOK-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.modelCurvesAreOK","text":"modelCurvesAreOK(proj::Project)\n\nGo through all curves in the model and make sure they are connected and closed. Also, remove any empty outer / inner boundary chains.\n\nReturns true if all curves are connected and closed, false otherwise.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n center::Array{Float64},\n radius::Float64,\n startAngle::Float64,\n endAngle::Float64,\n units::String)\n\nCreate a new circular arc.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-2","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreate a new parametric equation curve.\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.new-Tuple{String, Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String,\n xStart::Array{Float64},\n xEnd::Array{Float64})\n\nCreate a new line defined by its end points.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, nKnots::Int, data::Matrix{Float64})\n\nCreate a spline curve from an array of knots\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.new-Tuple{String, String}","page":"Reference","title":"HOHQMesh.new","text":"new(name::String, dataFile::String)\n\nCreate a spline curve from the contents of a data file.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newCircularArcCurve","page":"Reference","title":"HOHQMesh.newCircularArcCurve","text":"newCircularArcCurve(name::String, center::Array{Float64},\n startAngle::Float64, endAngle::Float64,\n units::String)\n\nCreates and returns a new circular arc curve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newEndPointsLineCurve-Tuple{String, Array{Float64}, Array{Float64}}","page":"Reference","title":"HOHQMesh.newEndPointsLineCurve","text":"newEndPointsLineCurve(name::String, xStart::Array{Float64},xEnd::Array[Float64])\n\nCreates and returns a new curve defined by its end points in the form of a Dictionary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newParametricEquationCurve","page":"Reference","title":"HOHQMesh.newParametricEquationCurve","text":"newParametricEquationCurve(name::String,\n xEqn::String,\n yEqn::String,\n zEqn::String = \"z(t) = 0.0\" )\n\nCreates and returns a new parametricEquationCurve in the form of a Dictionary\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.newProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newProject","text":"newProject(name::String, folder::String)\n\nCreate a new project with the given name. That name will be used for the mesh and plot files in the specified folder.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementCenter-Tuple{String, String, Array{Float64}, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementCenter","text":"newRefinementCenter(name, type,\n center, meshSize,\n width)\n\nCreate refinement center of type \"smooth\" or \"sharp\" centered at center = [x,y,z] with a mesh size meshSize spread over a radius width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newRefinementLine-Tuple{String, String, Array{Float64}, Array{Float64}, Float64, Float64}","page":"Reference","title":"HOHQMesh.newRefinementLine","text":"newRefinementLine(name, type,\n start, end,\n meshSize,\n width)\n\nCreate refinement line of type \"smooth\" or \"sharp\" between start = [x,y,z] and end = [x,y,z] with a mesh size meshSize spread over a width width.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, Int64, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, nKnots::Int, data::Array{Float64,4})\n\nReturns a spline curve given the number of knots and the array of knots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.newSplineCurve-Tuple{String, String}","page":"Reference","title":"HOHQMesh.newSplineCurve","text":"newSplineCurve(name::String, dataFile::String)\n\nReturns a spline curve given a data file that contains the number of knots on the first line, and the spline data following that.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.openProject-Tuple{String, String}","page":"Reference","title":"HOHQMesh.openProject","text":"openProject(fileName::String, folder::String)\n\nOpen existing project described in the control File.\n\nfolder = folder the control file is in\nfileName = the name of the file\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.plotProject!","page":"Reference","title":"HOHQMesh.plotProject!","text":"plotProject!(proj::Project, plotOptions::Int = 0)\n\nPlot objects specified by the plotOptions. Construct the plotOptions by the sum of what is to be drawn from the choices MODEL, GRID, MESH, REFINEMENTS.\n\nExample: To plot the model and the grid, plotOptions = MODEL + GRID. To plot just the mesh, plotOptions = MESH.\n\nTo plot everything, plotOptions = MODEL + GRID + MESH + REFINEMENTS\n\nContents are overlaid in the order: GRID, MESH, MODEL, REFINEMENTS\n\nnote: Requires Makie.jl\nPlease note that for this function to work, you need to load Makie.jl in your REPL (e.g., by calling using GLMakie).\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.postNotificationWithName-Tuple{Any, String, Tuple}","page":"Reference","title":"HOHQMesh.postNotificationWithName","text":"postNotificationWithName(sender::Any, name::String, userInfo::Tuple)\n\nExecutes the function associated with the observer for the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.refinementRegionPoints-Tuple{Dict{String, Any}}","page":"Reference","title":"HOHQMesh.refinementRegionPoints","text":"refinementRegionPoints(r::Dict{String,Any})\n\nReturns Array{Float64,2} being the plotting points of a refinement region\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String, innerBoundaryName::String)\n\nDelete the curve named curveName from the inner boundary named innerBoundaryName\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.remove!","text":"remove!(proj::Project, curveName::String)\n\nDelete the curve named curveName from the outer boundary\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeBackgroundGrid!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeBackgroundGrid!","text":"removeBackgroundGrid!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundary!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundary!","text":"removeInnerBoundary!(proj::Project, chainName::String)\n\nRemove an entire inner boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurve!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurve!","text":"removeInnerBoundaryCurve!(proj::Project, name::String, chainName::String)\n\nRemove the curve with name from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeInnerBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64, String}","page":"Reference","title":"HOHQMesh.removeInnerBoundaryCurveAtIndex!","text":"removeInnerBoundaryCurveAtIndex!(proj::Project, indx::Int, chainName::String)\n\nRemove the curve at index indx from an inner boundary chain with chainName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundary!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeOuterBoundary!","text":"removeOuterBoundary!(proj::Project)\n\nRemove the outer boundary curve if it exists.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveAtIndex!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveAtIndex!","text":"removeOuterBoundaryCurveAtIndex!(proj::Project, indx::Int)\n\nRemove a curve from the outer boundary chain at the specified index.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeOuterBoundaryCurveWithName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeOuterBoundaryCurveWithName!","text":"removeOuterBoundaryCurveWithName!(proj::Project, name::String)\n\nRemove the named curve in the outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRefinementRegion!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.removeRefinementRegion!","text":"removeRefinementRegion!(proj::Project, name::String)\n\nDelete the named refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeRunParameters!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeRunParameters!","text":"removeRunParameters!(proj::Project)\n\nRemove the run parameters block from the project. This is not undo-able.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.removeSpringSmoother!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.removeSpringSmoother!","text":"removeSpringSmoother!(proj::Project)\n\nRemove the background grid block from the project.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.remove_mesh!-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.remove_mesh!","text":"remove_mesh!(proj::Project)\n\nRemove the mesh file, control file, plot file, and stats file from proj.projectDirectory and delete the mesh from the plot.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.renameCurve!-Tuple{HOHQMesh.Project, String, String}","page":"Reference","title":"HOHQMesh.renameCurve!","text":"renameCurve!(proj::Project, oldName::String, newName::String)\n\nAny curve(s) on the outer boundary or in the inner boundary chain(s) with oldName are renamed with newName.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.saveProject-Tuple{HOHQMesh.Project}","page":"Reference","title":"HOHQMesh.saveProject","text":"saveProject(proj::Project)\n\nproj = Project to be saved\n\nSave a project dictionary to the file path specified when the project was created.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcCenter!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setArcCenter!","text":"setArcCenter!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the center of a circular arc.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcEndAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcEndAngle!","text":"setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcRadius!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcRadius!","text":"setArcRadius!(arc::Dict{String,Any}, radius::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcStartAngle!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setArcStartAngle!","text":"setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setArcUnits!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setArcUnits!","text":"setArcUnits(crv::Dict{String,Any}, units::String)\n\nSet the units for the start and end angles of a circular arc curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridLowerLeft!-Tuple{HOHQMesh.Project, Array{Float64}}","page":"Reference","title":"HOHQMesh.setBackgroundGridLowerLeft!","text":"setBackgroundGridLowerLeft!(proj::Project, x0::Array{Float64})\n\nSet the lower left location of the background grid for problems that have no outer boundary.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSpacing!(proj::Project, dx::Float64, dy::Float64, dz::Float64 = 0.0)\n\nUser facing function\n\n\n\n\n\n","category":"function"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Array{Float64}, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Array{Float64}, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, dx is passed an array.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSize!-Tuple{HOHQMesh.Project, Float64, Float64, String}","page":"Reference","title":"HOHQMesh.setBackgroundGridSize!","text":"setBackgroundGridSize!(proj::Project, dx::Float64, dy::Float64, key::String)\n\nSet the grid size dx of an existing background grid within proj. Here, the new grid size in either direction is passed individually with dxand dy.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setBackgroundGridSteps!-Tuple{HOHQMesh.Project, Array{Int64}}","page":"Reference","title":"HOHQMesh.setBackgroundGridSteps!","text":"setBackgroundGridSteps!(proj::Project, N::Array{Int})\n\nSet how many steps of size setBackgroundGridSpacing in each direction the background grid extends from the lower left.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setCurveName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setCurveName!","text":"setCurveName!(curveDict, name)\n\nSet the name of the curve represented by curveDict.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setEndPoint!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setEndPoint!","text":"setEndPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the end point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setMeshFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setMeshFileFormat!","text":"setMeshFileFormat(proj::Project, meshFileFormat::String)\n\nSet the file format for the mesh file. Acceptable choices are \"ISM\", \"ISM-V2\", or \"ABAQUS\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setName!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setName!","text":"setName(proj::Project,name::String)\n\nThe name of the project is the filename to be used by the mesh, plot, and stats files. It is also the name of the control file the tool will produce.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPlotFileFormat!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setPlotFileFormat!","text":"setPlotFileFormat(proj::Project, plotFileFormat::String)\n\nSet the file format for the plot file. Acceptable choices are \"sem\", which includes interior nodes and boundary nodes and \"skeleton\", which includes only the corner nodes.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setPolynomialOrder!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setPolynomialOrder!","text":"setPolynomialOrder(proj::Project, p::Int)\n\nSet the polynomial order for boundary curves in the mesh file to p.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementEnd!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementEnd!","text":"setRefinementEnd!(refinementRegion, location)\n\nSet the end point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementGridSize!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementGridSize!","text":"setRefinementGridSize!(r::Dict{String,Any}, h)\n\nSet the grid size, h for the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementLocation!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementLocation!","text":"setRefinementLocation!(refinementCenter, location)\n\nSet the location of a refinement center to location = [x,y,z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementName!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementName!","text":"setRefinementName!(r::Dict{String,Any}, type)\n\nSet a name for the refinement region.r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementStart!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setRefinementStart!","text":"setRefinementStart!(refinementRegion, location)\n\nSet the start point location of a refinement line, location = [x, y, z].\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementType!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setRefinementType!","text":"setRefinementType!(refinementRegion, type)\n\nSet the type, either \"smooth\" or \"sharp\" for the given refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setRefinementWidth!-Tuple{Dict{String, Any}, Float64}","page":"Reference","title":"HOHQMesh.setRefinementWidth!","text":"setRefinementWidth!(r::Dict{String,Any}, width)\n\nSet the width of the refinement region. r is the dictionary that represents the refinement region.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingIterations!-Tuple{HOHQMesh.Project, Int64}","page":"Reference","title":"HOHQMesh.setSmoothingIterations!","text":"setSmoothingIterations!(proj::Project, iterations::Int)\n\nSet the number of iterations to smooth the mesh.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingStatus!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingStatus!","text":"setSmoothingStatus(proj:Project, status::String)\n\nStatus is either \"ON\" or \"OFF\"\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSmoothingType!-Tuple{HOHQMesh.Project, String}","page":"Reference","title":"HOHQMesh.setSmoothingType!","text":"setSmoothingType!(proj:Project, status::String)\n\nType is either LinearSpring or LinearAndCrossbarSpring\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplineNKnots!-Tuple{Dict{String, Any}, Int64}","page":"Reference","title":"HOHQMesh.setSplineNKnots!","text":"setSplineNKnots!(spline::Dict{String,Any}, nKnots::Int)\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setSplinePoints!-Tuple{Dict{String, Any}, Matrix{Float64}}","page":"Reference","title":"HOHQMesh.setSplinePoints!","text":"setSplinePoints!(spline::Dict{String,Any},points::Array{Float64,4})\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setStartPoint!-Tuple{Dict{String, Any}, Array{Float64}}","page":"Reference","title":"HOHQMesh.setStartPoint!","text":"setStartPoint!(crv::Dict{String,Any}, point::Array{Float64})\n\nSet the start point for a line curve.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setXEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setXEqn!","text":"setXEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the x-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setYEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setYEqn!","text":"setYEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the y-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.setZEqn!-Tuple{Dict{String, Any}, String}","page":"Reference","title":"HOHQMesh.setZEqn!","text":"setZEqn!(parametricEquationCurve, eqn)\n\nFor a parametric equation, set the zEqn-equation.\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.unRegisterForNotification-Tuple{Any, String}","page":"Reference","title":"HOHQMesh.unRegisterForNotification","text":"unRegisterForNotification(observer::Any, note::String)\n\nRemove the observer from being notified by the notification note\n\n\n\n\n\n","category":"method"},{"location":"reference/#HOHQMesh.updatePlot!","page":"Reference","title":"HOHQMesh.updatePlot!","text":"updatePlot!(proj::Project, plotOptions::Int)\n\nReplot with the new plotOptions = combinations (sums) of\n\nGRID, MESH, MODEL, REFINEMENTS\n\nExample: updatePlot!(p, MESH + MODEL)\n\nnote: Requires Makie.jl\nPlease note that for this function to work, you need to load Makie.jl in your REPL (e.g., by calling using GLMakie).\n\n\n\n\n\n","category":"function"},{"location":"tutorials/spline_curves/#Spline-curves","page":"Spline curves","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line \"curves\". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.","category":"page"},{"location":"tutorials/spline_curves/#Synopsis","page":"Spline curves","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/spline_curves/#Initialization","page":"Spline curves","title":"Initialization","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a new project with the name \"spline_curves\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_project = newProject(\"spline_curves\", \"out\")","category":"page"},{"location":"tutorials/spline_curves/#Add-the-outer-boundary","page":"Spline curves","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The outer boundary curve for this tutorial is a circle of radius r=4 centered at the point (0 -1). We define this circular curve with the function newCircularArcCurve as follows","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"circ = newCircularArcCurve(\"outerCircle\", # curve name\n [0.0, -1.0, 0.0], # circle center\n 4.0, # circle radius\n 0.0, # start angle\n 360.0, # end angle\n \"degrees\") # angle units","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We use \"degrees\" to set the angle bounds, but \"radians\" can also be used. The name of the curve stored in the dictionary circ is assigned to be \"outerCircle\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new circ curve is then added to the spline_project as an outer boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToOuterBoundary!(spline_project, circ)","category":"page"},{"location":"tutorials/spline_curves/#Add-a-background-grid","page":"Spline curves","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for spline_project to have elements with side length 06 in each direction","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addBackgroundGrid!(spline_project, [0.6, 0.6, 0.0])","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We next visualize the outer boundary curve and background grid with the following","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"plotProject!(spline_project, MODEL+GRID)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and it contains a single curve \"outerCircle\" labeled in the figure by O.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: background_grid)","category":"page"},{"location":"tutorials/spline_curves/#Add-the-inner-boundaries","page":"Spline curves","title":"Add the inner boundaries","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The domain of this tutorial will contain three inner boundary curves:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Cubic spline curve created from data points read in from a file.\nCubic spline curve created from points directly given in the code.\nTriangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-with-data-from-a-file","page":"Spline curves","title":"Cubic spline with data from a file","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots t_j, x_j, y_j, z_j where j indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"We create a parametric spline curve from a file with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline1 = newSplineCurve(\"big_spline\", joinpath(@__DIR__, \"examples\", \"test_spline_curve_data.txt\"))","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline1 is assigned to be \"big_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline1 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline1, \"inner1\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner1\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve \"big_spline\" labeled in the figure by 1.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: one_curve)","category":"page"},{"location":"tutorials/spline_curves/#Cubic-spline-from-data-in-Julia","page":"Spline curves","title":"Cubic spline from data in Julia","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between 0 and 1. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Below, we construct another parametric spline using this strategy that consists of five data points","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_data = [ [0.0 1.75 -1.0 0.0]\n [0.25 2.1 -0.5 0.0]\n [0.5 2.7 -1.0 0.0]\n [0.75 0.6 -2.0 0.0]\n [1.0 1.75 -1.0 0.0] ]\n\nspline2 = newSplineCurve(\"small_spline\", 5, spline_data)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The name of the curve stored in the dictionary spline2 is assigned to be \"small_spline\". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The new spline2 curve is then added to the spline_project as an inner boundary curve with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, spline2, \"inner2\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"This inner boundary chain name \"inner2\" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve \"small_spline\" labeled in the figure by 2.1.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: two_curves)","category":"page"},{"location":"tutorials/spline_curves/#Triangular-shape","page":"Spline curves","title":"Triangular shape","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"edge1 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.3, -1.0, 0.0], # start point\n [-1.7, -1.0, 0.0]) # end point\n\nedge2 = newEndPointsLineCurve(\"triangle\", # curve name\n [-1.7, -1.0, 0.0], # start point\n [-2.0, -0.4, 0.0]) # end point\n\nedge3 = newEndPointsLineCurve(\"triangle\", # curve name\n [-2.0, -0.4, 0.0], # start point\n [-2.3, -1.0, 0.0]) # end point","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Here, each edge of the curve is given the same name \"triangle\" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"addCurveToInnerBoundary!(spline_project, edge1, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge2, \"inner3\")\naddCurveToInnerBoundary!(spline_project, edge3, \"inner3\")","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The inner boundary chain name \"inner3\" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called \"triangle\" labeled in the figure by 3.1, 3.2, and 3.3.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: three_curves)","category":"page"},{"location":"tutorials/spline_curves/#Generate-the-mesh","page":"Spline curves","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"spline_curves.control: A HOHQMesh control file for the current project.\nspline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nspline_curves.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"To do this we execute the command","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"generate_mesh(spline_project)\n 1 chevron elements removed from mesh.\n 1 chevron elements removed from mesh.\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 0.25359100000000001\n Number of nodes = 1176\n Number of Edges = 2225\n Number of Elements = 1047\n Number of Subdivisions = 4\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00006209 0.15607019 0.04505180 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00008965 2.78091496 1.23178864 1.00000000 999.99900000 1.00000000\n Condition 1.00000055 3.82171291 1.15535543 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00014261 6.78201663 1.46249737 1.00000000 4.00000000 1.00000000\n Jacobian 0.00001491 0.10424647 0.03955817 0.00000000 999.99900000 1.00000000\n Minimum Angle 37.24189766 89.96174556 74.42003031 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.03128071 157.35065162 107.91806148 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of \"bad\" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"(Image: final_spline)","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the \"big_spline\" curve. We decide that we are satisfied with the overall mesh quality.","category":"page"},{"location":"tutorials/spline_curves/#Summary","page":"Spline curves","title":"Summary","text":"","category":"section"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/spline_curves/","page":"Spline curves","title":"Spline curves","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#Tutorials","page":"Overview","title":"Tutorials for HOHQMesh.jl","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"The tutorial section for HOHQMesh.jl provides step-by-step commands and accompanying explanations for the major features of the interactive mesh generation tools.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.","category":"page"},{"location":"tutorials/introduction/#[Straight-sided-outer-boundary](@ref)","page":"Overview","title":"Straight-sided outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.","category":"page"},{"location":"tutorials/introduction/#Synopsis","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Query and adjust the RunParameters of a project.\nDefine a rectangular outer boundary and set the background grid.\nVisualize an interactive mesh project.\nAdd circular inner boundary curves.","category":"page"},{"location":"tutorials/introduction/#[Curved-outer-boundary](@ref)","page":"Overview","title":"Curved outer boundary","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.","category":"page"},{"location":"tutorials/introduction/#Synopsis-2","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Define a curved outer boundary using parametric equations.\nAdd and adjust the background grid.\nVisualize an interactive mesh project.\nAdd manual refinement to a local region of the domain.","category":"page"},{"location":"tutorials/introduction/#[Spline-curves](@ref)","page":"Overview","title":"Spline curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line \"curves\".","category":"page"},{"location":"tutorials/introduction/#Synopsis-3","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create a circular outer boundary curve.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nConstruct and add parametric spline curves.\nConstruct and add an inner boundary chain of straight line segments.","category":"page"},{"location":"tutorials/introduction/#[Creating-and-editing-curves](@ref)","page":"Overview","title":"Creating and editing curves","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve \"chain\" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.","category":"page"},{"location":"tutorials/introduction/#Synopsis-4","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Create and edit an outer boundary chain.\nCreate and edit an inner boundary chain.\nAdd the background grid when an outer boundary curve is present.\nVisualize an interactive mesh project.\nDiscuss undo / redo capabilities.\nConstruct and add parametric spline curves.\nConstruct and add a curve from parametric equations.\nConstruct and add straight line segments.\nConstruct and add circular arc segments.","category":"page"},{"location":"tutorials/introduction/#[Symmetric-mesh](@ref)","page":"Overview","title":"Symmetric mesh","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"This tutorial constructs a mesh given a closed chain of outer boundary curves that is then reflected over a straight line or several co-linear lines indicated by the user. The result is a mesh that is symmetric with respect to the prescribed straight line.","category":"page"},{"location":"tutorials/introduction/#Synopsis-5","page":"Overview","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Demonstrates how to:","category":"page"},{"location":"tutorials/introduction/","page":"Overview","title":"Overview","text":"Indicate a symmetry boundary line.\nConstruct an outer boundary with several connected curves.\nAdd the background grid when an outer boundary curve is present.\nRename boundaries in an existing interactive mesh project.\nVisualize an interactive mesh project.","category":"page"},{"location":"guided-tour/#Guided-tour","page":"Guided tour","title":"Guided tour","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In this brief overview, we highlight two scripts from the examples/ folder that demonstrate the interactive mesh functionality of HOHQMesh.jl. In depth explanations of the functionality are provided in the Tutorials.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"See the HOHQMesh documentation for more details about its terminology and capabilities.","category":"page"},{"location":"guided-tour/#Mesh-from-a-control-file","page":"Guided tour","title":"Mesh from a control file","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A first example script reads in an existing control file from the HOHQMesh examples collection and makes it into a Project. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_from_control_file.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"This command will create mesh and plot files in the out directory.","category":"page"},{"location":"guided-tour/#Build-a-mesh-from-scratch","page":"Guided tour","title":"Build a mesh from scratch","text":"","category":"section"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"A second example script interactive_outer_boundary.jl makes a new project consisting of an outer, circular boundary, and an inner boundary in the shape of an ice cream cone. To run this example, execute","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_boundary.jl\"))","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For completeness, we provide the example script and walk-through each step in the construction of the Project below.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"using HOHQMesh\n\n# Create a new project with the name \"IceCreamCone\", which will also be the\n# name of the mesh, plot and stats files, written to output folder `out`.\n\np = newProject(\"IceCreamCone\", \"out\")\n\n# Outer boundary for this example mesh is a complete circle. Add it into the project.\n\ncirc = newCircularArcCurve(\"outerCircle\", [0.0, -1.0, 0.0], 4.0, 0.0, 360.0, \"degrees\")\naddCurveToOuterBoundary!(p, circ)\n\n# Inner boundary is three curves. Two straight lines and a circular arc.\n# Note the three curve are connected to ensure a counter-clockwise orientation\n# as required by HOHQMesh\n\n# Create the three interior curves. The individual names of each curve in the inner\n# chain are used internally by HOHQMesh and are output as the given boundary names in\n# the mesh file.\n\ncone1 = newEndPointsLineCurve(\"cone1\", [0.0, -3.0, 0.0], [1.0, 0.0, 0.0])\niceCream = newCircularArcCurve(\"iceCream\", [0.0, 0.0, 0.0], 1.0, 0.0, 180.0, \"degrees\")\ncone2 = newEndPointsLineCurve(\"cone2\", [-1.0, 0.0, 0.0], [0.0, -3.0, 0.0])\n\n# Assemble the three curve in a closed chain oriented counter-clockwise. The chain\n# name `IceCreamCone` is only used internally by HOHQMesh.\n\naddCurveToInnerBoundary!(p, cone1, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, iceCream, \"IceCreamCone\")\naddCurveToInnerBoundary!(p, cone2, \"IceCreamCone\")\n\n# Adjust some `RunParameters` and overwrite the defaults values. In this case, we\n# set a new value for the boundary order polynomial representation and adjust the\n# output mesh file format to be `sem`\n\nsetPolynomialOrder!(p, 4)\nsetPlotFileFormat!(p, \"sem\")\n\n# A background grid is required for the mesh generation. In this example we lay a\n# background grid of Cartesian boxes with size 0.5.\n\naddBackgroundGrid!(p, [0.5, 0.5, 0.0])\n\n# Plot the project model curves and background grid\n\nif isdefined(Main, :Makie)\n plotProject!(p, MODEL+GRID)\n @info \"Press enter to generate the mesh and update the plot.\"\n readline()\n else # Throw an informational message about plotting to the user\n @info \"To visualize the project (boundary curves, background grid, mesh, etc.), include `GLMakie` and run again.\"\n end\n\n# Generate the mesh. This produces the mesh and TecPlot files `IceCreamCone.mesh` and `IceCreamCone.tec`\n# and save them to the `out` folder. Also, if there is an active plot in the project `p` it is\n# updated with the mesh that was generated.\n\ngenerate_mesh(p)\n\n# After the mesh successfully generates mesh statistics, such as the number of corner nodes,\n# the number of elements etc., are printed to the REPL","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The first line creates a new project, where the mesh and plot file names will be derived from the project name, \"IceCreamCone\" written to the specified folder.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To develop the model, one adds curves to the outer boundary or to multiple inner boundaries, if desired. As in HOHQMesh, there are four curve classes currently available:","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Parametric equations\nCubic Splines\nLines defined by their end points\nCircular arcs","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"In the example, the outer boundary is a closed circular arc with center at [0.0, 0.0, 0.0] with radius 4, starting at zero and ending at 360 degrees. It is added to the project with addCurveToOuterBoundary!. You can add any number of curves to the outer boundary.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Similarly, you create curves and add them to as many inner boundaries that you want to have. In the example, there is one inner boundary, \"IceCreamCone\" made up of two straight lines and a half circular arc. Again, they are defined counter-clockwise.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"For convenience, newProject will generate default run parameters used by HOHQMesh, like the plot file format and the smoother. The parameters can be edited with setter commands. For example, the script resets the polynomial order (default = 5) and the plot file format (default = \"skeleton\").","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"One run parameter that must be set manually is the background grid. Since there is an outer boundary, that determines the extent of the domain to be meshed, only the mesh size needs to be specified using","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"addBackgroundGrid!(proj::Project, bgSize::Array{Float64})","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The example sets the background mesh size to be 0.5 in the x and y directions. The z component is ignored.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"The script finishes by generating the quad mesh and plotting the results, as shown below","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"(Image: iceCreamCone)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Finally, the script returns the project so that it can be edited further, if desired.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"To save a control file for HOHQMesh, simply invoke","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"saveProject(proj::Project)","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"where the name of the control file (traditionally with a .control extension) matches the name of the project proj. saveProject is automatically called when a mesh is generated.","category":"page"},{"location":"guided-tour/","page":"Guided tour","title":"Guided tour","text":"Note, a third example script interactive_outer_boundary_generic.jl is identical to that which was explained above except that the function calls use the generic versions of functions, e.g., new or add!.","category":"page"},{"location":"license/#License","page":"License","title":"License","text":"","category":"section"},{"location":"license/","page":"License","title":"License","text":"MIT LicenseCopyright (c) 2021-present David Kopriva, Andrew Winters, and Michael Schlottke-LakemperPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"CheatSheet/#Commands-Cheat-Sheet","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"This provides a quick reference for the syntax of the interactive construction of boundary curves, background grid, etc. When possible, the commands presented below give generic versions of the function calls, e.g., for creating a new curve or adding the curve to a boundary chain. The script interactive_outer_boundary_generic.jl in the examples/ folder constructs an identical example mesh as shown in the Guided tour using generic function calls.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"A thorough description of the functions can be found in the API section.","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The general workflow of the interactive mesh functionality within a REPL session is","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Create a project\nAdd boundary curves\nAdd a background grid\nAdd manual refinement (if desired)\nGenerate mesh","category":"page"},{"location":"CheatSheet/#Project","page":"Commands Cheat Sheet","title":"Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" p = newProject(, )","category":"page"},{"location":"CheatSheet/#cs-plotting","page":"Commands Cheat Sheet","title":"Plotting","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" plotProject!(p, options)\n updatePlot!(p, options)","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"The options are any sum of MODEL, GRID, REFINEMENTS, and MESH.","category":"page"},{"location":"CheatSheet/#Curves","page":"Commands Cheat Sheet","title":"Curves","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" c = new(name, startLocation [x,y,z], endLocation [x,y,z]) *Straight Line*\n c = new(name, center [x,y,z], radius, startAngle, endAngle) *Circular Arc*\n c = new(name, xEqn, yEqn, zEqn) *Parametric equation*\n c = new(name, dataFile) *Spline with data from a file*\n c = new(name, nKnots, knotsMatrix) *Spline with given knot values*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function new, which is a shortcut to the full functions, e.g. newCircularArcCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#cs-manual-refinement","page":"Commands Cheat Sheet","title":"Manual Refinement","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" r = newRefinementCenter(name, type, center, gridSize, radius)\n r = newRefinementLine(name, type, startPoint, endPoint, gridSize, width)","category":"page"},{"location":"CheatSheet/#Adding-to-a-Project","page":"Commands Cheat Sheet","title":"Adding to a Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" add!(p, c) *Add outer boundary curve*\n add!(p, c, ) *Add curve to an inner boundary*\n add!(p, r) *Add refinement region*\n\n addBackgroundGrid!(p, [top, left, bottom, right], [nX, nY, nZ]) *No outer boundary*\n addBackgroundGrid!(p, [dx, dy, dz]) *If an outer boundary is present*","category":"page"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"Shown here is the use of the function add!, which is a shortcut to the full functions, e.g. addOuterBoundaryCurve, etc. which have the same arguments.","category":"page"},{"location":"CheatSheet/#Accessing-items","page":"Commands Cheat Sheet","title":"Accessing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" crv = getCurve(p, curveName) *Get a curve in the outer boundary*\n crv = getCurve(p, curveName, boundaryName) *Get a curve in an inner boundary*\n indx, chain = getChain(p, boundaryName) *Get a complete inner boundary curve*\n r = getRefinementRegion(p, name)","category":"page"},{"location":"CheatSheet/#Removing-from-Project","page":"Commands Cheat Sheet","title":"Removing from Project","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" removeOuterBoundary!(p) *Entire outer boundary curve*\n removeInnerBoundary!(p, innerBoundaryName) *Entire inner boundary curve*\n remove!(p, name) *Curve in outer boundary*\n remove!(p, name, innerBoundaryName) *Curve in inner boundary*\n removeRefinementRegion!(p, name)","category":"page"},{"location":"CheatSheet/#Editing-items","page":"Commands Cheat Sheet","title":"Editing items","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":"All items have set/get methods to edit them. Most actions have undo() and redo(). To find out what the next undo/redo actions are, use undoActionName() and redoActionName() to print them to the screen.","category":"page"},{"location":"CheatSheet/#Meshing","page":"Commands Cheat Sheet","title":"Meshing","text":"","category":"section"},{"location":"CheatSheet/","page":"Commands Cheat Sheet","title":"Commands Cheat Sheet","text":" generate_mesh(p)\n remove_mesh!(p)","category":"page"},{"location":"#HOHQMesh.jl","page":"Home","title":"HOHQMesh.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you have not yet installed Julia, please follow the instructions for your operating system. HOHQMesh.jl works with Julia v1.6 and above.","category":"page"},{"location":"","page":"Home","title":"Home","text":"HOHQMesh.jl is a registered Julia package. Hence, you can install it by executing the following commands in the Julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> import Pkg; Pkg.add(\"HOHQMesh\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Usage","page":"Home","title":"Usage","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the Julia REPL, you can load HOHQMesh with","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using HOHQMesh","category":"page"},{"location":"","page":"Home","title":"Home","text":"and then happily generate away!","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> control_file = joinpath(HOHQMesh.examples_dir(), \"GingerbreadMan.control\")\n\njulia> output = generate_mesh(control_file)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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,","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: gingerbreadman_with_edges_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"while the 3D file Snake.control produces this mesh:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: snake_400px)","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.,","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> include(joinpath(HOHQMesh.examples_dir(), \"interactive_outer_box_two_circles.jl\"))","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"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","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using Pkg; Pkg.add(\"GLMakie\")\njulia> using GLMakie","category":"page"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: box_two_circles)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Further explanation of the interactive functionality can be found here. Additional examples are available in the Tutorials.","category":"page"},{"location":"#authors-index-md","page":"Home","title":"Authors","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#License-and-contributing","page":"Home","title":"License and contributing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Acknowledgements","page":"Home","title":"Acknowledgements","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"tutorials/symmetric_mesh/#Symmetric-mesh","page":"Symmetric mesh","title":"Symmetric mesh","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"The purpose of this tutorial is to demonstrate how to create an unstructured mesh that is symmetric with respect to a straight line outer boundary as prescribed by the user. At the end of this tutorial one can find the script necessary to generate the meshes described herein.","category":"page"},{"location":"tutorials/symmetric_mesh/#Synopsis","page":"Symmetric mesh","title":"Synopsis","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"This tutorial demonstrates how to:","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"Indicate a symmetry boundary line.\nConstruct an outer boundary with several connected curves.\nAdd the background grid when an outer boundary curve is present.\nRename boundaries in an existing interactive mesh project.\nVisualize an interactive mesh project.","category":"page"},{"location":"tutorials/symmetric_mesh/#Initialization","page":"Symmetric mesh","title":"Initialization","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"julia> using GLMakie, HOHQMesh","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"Now we are ready to interactively generate unstructured quadrilateral meshes!","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"We create a new project with the name \"symmetric_mesh\" and assign \"out\" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named symmetric_mesh.control. If the folder out does not exist, it will be created automatically in the current working directory.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"symmetric_mesh = newProject(\"symmetric_mesh\", \"out\")","category":"page"},{"location":"tutorials/symmetric_mesh/#Adjusting-project-parameters","page":"Symmetric mesh","title":"Adjusting project parameters","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"For the symmetric_mesh project we query the current values for the polynomial order and the mesh output format","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"julia> getPolynomialOrder(symmetric_mesh)\n5\n\njulia> getMeshFileFormat(symmetric_mesh)\n\"ISM-V2\"","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"We change the default polynomial order in the symmetric_mesh to be 6 with a corresponding setter function","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"setPolynomialOrder!(symmetric_mesh, 6)","category":"page"},{"location":"tutorials/symmetric_mesh/#Add-a-background-grid","page":"Symmetric mesh","title":"Add a background grid","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the x and y directions. To start, we set the background grid for symmetric_mesh to have elements with side length 025 in each direction","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"addBackgroundGrid!(spline_project, [0.25, 0.25, 0.0])","category":"page"},{"location":"tutorials/symmetric_mesh/#Add-the-outer-boundary","page":"Symmetric mesh","title":"Add the outer boundary","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"With the background grid size set, we next build the outer boundary for the present mesh project. This outer boundary is composed of nine straight line segments and a half circle arc. The curves will afterwards be added to the mesh project symmetric_mesh in counter-clockwise order as required by HOHQMesh.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"line1 = newEndPointsLineCurve(\":symmetry\", [-0.05, 2.0, 0.0],\n [-0.05, 0.0, 0.0])\n\nline2 = newEndPointsLineCurve(\"bottom\", [-0.05, 0.0, 0.0],\n [1.0, 0.0, 0.0])\n\nline3 = newEndPointsLineCurve(\"right\", [1.0, 0.0, 0.0],\n [1.0, 0.5, 0.0])\n\nhalf_circle = newCircularArcCurve(\"circle\", # curve name\n [1.0, 0.75, 0.0], # circle center\n 0.25, # circle radius\n 270.0, # start angle\n 90.0, # end angle\n \"degrees\") # angle units\n\nline4 = newEndPointsLineCurve(\"right\", [1.0, 1.0, 0.0],\n [1.0, 1.5, 0.0])\n\nline5 = newEndPointsLineCurve(\"bump\", [1.0, 1.5, 0.0],\n [0.75, 1.5, 0.0])\n\nline6 = newEndPointsLineCurve(\"bump\", [0.75, 1.5, 0.0],\n [0.75, 1.75, 0.0])\n\nline7 = newEndPointsLineCurve(\"bump\", [0.75, 1.75, 0.0],\n [1.0, 1.75, 0.0])\n\nline8 = newEndPointsLineCurve(\"right\", [1.0, 1.75, 0.0],\n [1.0, 2.0, 0.0])\n\nline9 = newEndPointsLineCurve(\"top\", [1.0, 2.0, 0.0],\n [-0.05, 2.0, 0.0])","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"The given boundary names will also be the element boundary names written to the mesh file. The only exception is the first boundary curve that is given the name \":symmetry\". This outer boundary curve name is a special keyword in HOHQMesh that says it is a straight line across which a reflection will occur. Two worthwhile notes are","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"the leading colon on this boundary name keyword is present to avoid conflicts with any other use of the symmetry name.\nif the curve designated as \":symmetry\" is not a straight line, then an error is thrown by HOHQMesh and the mesh will not be reflected.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"tip: Name of the symmetry boundary\nThe name of the reflection boundary line is not case-sensitive, thus\":symmetry\" or \":Symmetry\" or \":SYMMETRY\" are all valid and will be recognized as the keyword for symmetry.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"Now that all the outer boundary curves are defined we add them to the symmetric_mesh project in counter-clockwise order","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"addCurveToOuterBoundary!(symmetric_mesh, line1)\naddCurveToOuterBoundary!(symmetric_mesh, line2)\naddCurveToOuterBoundary!(symmetric_mesh, half_circle)\naddCurveToOuterBoundary!(symmetric_mesh, line3)\naddCurveToOuterBoundary!(symmetric_mesh, line4)\naddCurveToOuterBoundary!(symmetric_mesh, line5)\naddCurveToOuterBoundary!(symmetric_mesh, line6)\naddCurveToOuterBoundary!(symmetric_mesh, line7)\naddCurveToOuterBoundary!(symmetric_mesh, line8)\naddCurveToOuterBoundary!(symmetric_mesh, line9)","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"We visualize the outer boundary curve chain and background grid with the following","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"plotProject!(symmetric_mesh, MODEL+GRID)","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called \"Outer\" and its constituent curve segments are labeled accordingly with the names prescribed in the curve construction above.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"(Image: before_generation)","category":"page"},{"location":"tutorials/symmetric_mesh/#Generate-the-mesh","page":"Symmetric mesh","title":"Generate the mesh","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"We next generate the mesh from the information contained in symmetric_mesh. This will output the following files to the out folder:","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"symmetric_mesh.control: A HOHQMesh control file for the current project.\nsymmetric_mesh.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.\nsymmetric_mesh.mesh: A mesh file with format ISM-V2 (the default format).","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"To do this we execute the command","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"generate_mesh(symmetric_mesh)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 4.0154999999999996E-002\n Number of nodes = 343\n Number of Edges = 626\n Number of Elements = 284\n Number of Subdivisions = 2\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00227157 0.06552808 0.01366911 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00389317 2.07480912 1.22443835 1.00000000 999.99900000 1.00000000\n Condition 1.00048947 1.93007666 1.12853177 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00607156 3.56541719 1.44892631 1.00000000 4.00000000 1.00000000\n Jacobian 0.00158627 0.06202757 0.01120120 0.00000000 999.99900000 1.00000000\n Minimum Angle 48.35050023 89.33703938 75.39251039 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.94150752 129.91539960 106.20679399 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"Note that the call to generate_mesh prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"note: Mesh visualization\nCurrently, only the \"skeleton\" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the mesh file generated.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"(Image: first_reflect_mesh)","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"tip: Boundary names in the mesh file\nThe boundary names of the original outer curves will be those defined by the user in their construction above. The boundary labeled \":symmetry\" is now internal and is marked appropriately as such. The reflected boundary names are appended with _R (for reflected) in the mesh file. For instance, the reflected version of the boundary bottom has the name bottom_R or the boundary named circle has the reflected boundary counterpart named circle_R. These can be changed as desired by editing the mesh file.","category":"page"},{"location":"tutorials/symmetric_mesh/#Changing-the-reflection-line","page":"Symmetric mesh","title":"Changing the reflection line","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"It is also possible to create a symmetry boundary composed of multiple co-linear segments.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"To change the line along which the mesh is reflected, we remove the current mesh that was just generated and re-plot the model curves and background grid.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"remove_mesh!(symmetric_mesh)\nupdatePlot!(symmetric_mesh, MODEL+GRID)","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"The remove_mesh! command deletes the mesh information from the interactive mesh project symmetric_mesh as well as the mesh file symmetric_mesh.mesh, control file symmetric_mesh.control, plot file symmetric_mesh.tec, and mesh statistics file symmetric_mesh.txt from the out folder.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"To illustrate the reflection about multiple boundary curves (which must be co-linear!), we first rename the current symmetry boundary curve O.1 to have the name \"left\". Next, we rename all the co-linear boundary curves O.3, O.5, and O.9 to have the name \":symmetry\". Both are done with the function renameCurve!","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"renameCurve!(symmetric_mesh, \":symmetry\", # existing curve name\n \"left\") # new curve name\nrenameCurve!(symmetric_mesh, \"right\", \":symmetry\")","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"After the boundary names are adjusted the plot updates automatically to give the figure below.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"(Image: before_generation2)","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"We then generate the new mesh from the information contained in symmetric_mesh. Again, a check ensures that the curves designated as \":symmetry\" are co-linear. An error is thrown if this is not the case and the mesh will not be reflected. This saves the control, tec, and mesh files into the out folder and yields","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"generate_mesh(symmetric_mesh)\n\n *******************\n 2D Mesh Statistics:\n *******************\n Total time = 3.7763000000000019E-002\n Number of nodes = 337\n Number of Edges = 622\n Number of Elements = 284\n Number of Subdivisions = 2\n\n Mesh Quality:\n Measure Minimum Maximum Average Acceptable Low Acceptable High Reference\n Signed Area 0.00227157 0.06552808 0.01366911 0.00000000 999.99900000 1.00000000\n Aspect Ratio 1.00389317 2.07480912 1.22443835 1.00000000 999.99900000 1.00000000\n Condition 1.00048947 1.93007666 1.12853177 1.00000000 4.00000000 1.00000000\n Edge Ratio 1.00607156 3.56541719 1.44892631 1.00000000 4.00000000 1.00000000\n Jacobian 0.00158627 0.06202757 0.01120120 0.00000000 999.99900000 1.00000000\n Minimum Angle 48.35050023 89.33703938 75.39251039 40.00000000 90.00000000 90.00000000\n Maximum Angle 90.94150752 129.91539960 106.20679399 90.00000000 135.00000000 90.00000000\n Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"The updated visualization is given below. Note, the flexibility to define multiple co-linear symmetric boundaries creates a symmetric mesh with closed internal boundaries. In this example, a circle and a rectangle.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"(Image: first_reflect_mesh2)","category":"page"},{"location":"tutorials/symmetric_mesh/#Summary","page":"Symmetric mesh","title":"Summary","text":"","category":"section"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"In this tutorial we demonstrated how to:","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"Indicate a symmetry boundary line.\nConstruct an outer boundary with several connected curves.\nAdd the background grid when an outer boundary curve is present.\nRename boundaries in an existing interactive mesh project.\nVisualize an interactive mesh project.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"For completeness, we include two scripts with all the commands to generate the meshes displayed for a reflection about the left boundary line O.1 as well as a reflection about the right boundary composed of the three co-linear segments O.3, O.5, and O.9. Note, we do not include the plotting in these scripts.","category":"page"},{"location":"tutorials/symmetric_mesh/","page":"Symmetric mesh","title":"Symmetric mesh","text":"# Interactive mesh with reflection on the left over a single symmetry boundary\n# as well as a reflection on the right over multiple co-linear symmetry boundaries.\n#\n# Keywords: outer boundary, reflection, symmetric mesh\nusing HOHQMesh\n\n# new project\nsymmetric_mesh = newProject(\"symmetric_mesh\", \"out\")\n\n# reset the polynomial degree of the mesh\nsetPolynomialOrder!(symmetric_mesh, 6)\n\n# A background grid is required for the mesh generation\naddBackgroundGrid!(symmetric_mesh, [0.25, 0.25, 0.0])\n\n# Create all the outer boundary curves and add them to the mesh project.\n# Note: (1) Curve names are those that will be present in the mesh file\n# (2) Boundary named \":symmetry\" is where reflection occurs\n\nline1 = newEndPointsLineCurve(\":symmetry\", [-0.05, 2.0, 0.0],\n [-0.05, 0.0, 0.0])\n\nline2 = newEndPointsLineCurve(\"bottom\", [-0.05, 0.0, 0.0],\n [1.0, 0.0, 0.0])\n\nline3 = newEndPointsLineCurve(\"right\", [1.0, 0.0, 0.0],\n [1.0, 0.5, 0.0])\n\nhalf_circle = newCircularArcCurve(\"circle\", # curve name\n [1.0, 0.75, 0.0], # circle center\n 0.25, # circle radius\n 270.0, # start angle\n 90.0, # end angle\n \"degrees\") # angle units\n\nline4 = newEndPointsLineCurve(\"right\", [1.0, 1.0, 0.0],\n [1.0, 1.5, 0.0])\n\nline5 = newEndPointsLineCurve(\"bump\", [1.0, 1.5, 0.0],\n [0.75, 1.5, 0.0])\n\nline6 = newEndPointsLineCurve(\"bump\", [0.75, 1.5, 0.0],\n [0.75, 1.75, 0.0])\n\nline7 = newEndPointsLineCurve(\"bump\", [0.75, 1.75, 0.0],\n [1.0, 1.75, 0.0])\n\nline8 = newEndPointsLineCurve(\"right\", [1.0, 1.75, 0.0],\n [1.0, 2.0, 0.0])\n\nline9 = newEndPointsLineCurve(\"top\", [1.0, 2.0, 0.0],\n [-0.05, 2.0, 0.0])\n\naddCurveToOuterBoundary!(symmetric_mesh, line1)\naddCurveToOuterBoundary!(symmetric_mesh, line2)\naddCurveToOuterBoundary!(symmetric_mesh, half_circle)\naddCurveToOuterBoundary!(symmetric_mesh, line3)\naddCurveToOuterBoundary!(symmetric_mesh, line4)\naddCurveToOuterBoundary!(symmetric_mesh, line5)\naddCurveToOuterBoundary!(symmetric_mesh, line6)\naddCurveToOuterBoundary!(symmetric_mesh, line7)\naddCurveToOuterBoundary!(symmetric_mesh, line8)\naddCurveToOuterBoundary!(symmetric_mesh, line9)\n\n# Generate the mesh. Saves the mesh file to the directory \"out\".\ngenerate_mesh(symmetric_mesh)\n\n# Delete the existing mesh before modifying boundary names.\nremove_mesh!(symmetric_mesh)\n\n# Rename the outer boundaries appropriately to set the symmetry boundary\n# on the right composed of multiple co-linear segments.\nrenameCurve!(symmetric_mesh, \":symmetry\", # existing curve name\n \"left\") # new curve name\nrenameCurve!(symmetric_mesh, \"right\", \":symmetry\")\n\n# Generate the mesh. Saves the mesh file to the directory \"out\".\ngenerate_mesh(symmetric_mesh)","category":"page"}]
+}
diff --git a/v0.2.6/siteinfo.js b/v0.2.6/siteinfo.js
new file mode 100644
index 00000000..d8d92923
--- /dev/null
+++ b/v0.2.6/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.2.6";
diff --git a/v0.2.6/testing/index.html b/v0.2.6/testing/index.html
new file mode 100644
index 00000000..e03f7852
--- /dev/null
+++ b/v0.2.6/testing/index.html
@@ -0,0 +1,3 @@
+
+Testing · HOHQMesh.jl
During the development of HOHQMesh and its interactive functionality, we rely on continuous testing to ensure that modifications or new features do not break existing functionality or add other errors. In the main HOHQMesh repository, this is facilitated by GitHub Actions, which allows to run tests automatically upon certain events. When, how, and what is tested by GitHub Actions is controlled by the workflow file .github/workflows/ci.yml. In HOHQMesh and its related repositories, tests are triggered by
each git push to main and
each git push to any pull request.
Besides checking functionality, we also analyze the Test coverage to ensure that we do not miss important parts during testing.
Test and coverage requirements
Before merging a pull request (PR) to main, we require that
The entry point for all testing is the file test/runtests.jl, which is run by the automated tests and which can be triggered manually by executing
julia> using Pkg; Pkg.test("HOHQMesh")
in the REPL. Since there already exist many tests, we have split them up into multiple files in the test directory to allow for faster testing of individual parts of the code. Thus in addition to performing all tests, you can also just include one of the files named test_xxx.jl to run only a specific subset, e.g.,
julia> # Run all test for the interactive Curve API
+ include(joinpath("test", "test_curve.jl"))
We use Julia's built-in unit testing capabilities to configure tests. In general, newly added code must be covered by at least one test, and all new scripts added to the examples/ directory must be used at least once during testing. New tests should be added to the corresponding test/test_xxx.jl file, e.g., a test involving visualization capabilities would go into test/test_visualization.jl. Please study one of the existing tests and stay consistent to the current style when creating new tests.
Since we want to test as much as possible, we have a lot of tests and frequently create new ones. Therefore, new tests should be as short as reasonably possible, i.e., without being too insensitive to pick up changes or errors in the code.
When you add new tests, please check whether all CI jobs still take approximately the same time. If the job where you added new tests takes much longer than everything else, please consider moving some tests from one job to another (or report this incident and ask the main developers for help).
Test duration
As a general rule, tests should last no more than 10 seconds when run with a single thread and after compilation (i.e., excluding the first run).
In addition to ensuring that the code produces the expected results, the automated tests also record the code coverage. The resulting coverage reports, i.e., which lines of code were executed by at least one test and are thus considered "covered" by testing, are automatically uploaded to Coveralls for easy analysis. Typically, you see a number of Coveralls results at the bottom of each pull request: One for each parallel job (see Testing setup), which can usually be ignored since they only cover parts of the code by definition, and a cumulative coverage result named coverage/coveralls. The "Details" link takes you to a detailed report on which lines of code are covered by tests, which ones are missed, and especially which new lines the pull requests adds to HOHQMesh's code base that are not yet covered by testing.
Coverage requirements
In general, we require pull requests to not decrease the overall test coverage percentage in main, with a hard lower bound of 97%.
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 25 June 2024. Using Julia version 1.10.4.
diff --git a/v0.2.6/tutorials/create_edit_curves/index.html b/v0.2.6/tutorials/create_edit_curves/index.html
new file mode 100644
index 00000000..83df9d21
--- /dev/null
+++ b/v0.2.6/tutorials/create_edit_curves/index.html
@@ -0,0 +1,166 @@
+
+Creating and editing curves · HOHQMesh.jl
The purpose of this tutorial is to demonstrate how to inner and outer boundary curve chains. By a "chain" we mean a closed curve that is composed of multiple pieces. Each chain can be a combination of different curve types, e.g., a circular arc can connect to a spline. It also shows how to modify, remove, and add new pieces to an existing curve chain. The undo and redo capabilities of the interactive mesh tool are briefly discussed. The outer and inner boundary curves, background grid as well as the mesh will be visualized for quality inspection.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "sandbox" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named sandbox.control. If the folder out does not exist, it will be created automatically in the current file path.
We first create the outer boundary curve chain that is composed of three pieces
Straight line segment from $(0, -7)$ to $(5, 3)$.
Half-circle arc of radius $r=5$ centered at $(0, 3)$.
Straight line segment from $(-5, 3)$ to $(0, -7)$.
Each segment of the curve is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
outer_line1 = newEndPointsLineCurve("Line1", # curve name
+ [0.0, -7.0, 0.0], # start point
+ [5.0, 3.0, 0.0]) # end point
+
+outer_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-5.0, 3.0, 0.0], # start point
+ [0.0, -7.0, 0.0]) # end point
To create the circle arc we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. The arc can have an arbitrary length dictated by the start and end angle, e.g., for a half-circle we take the angle to vary from $0$ to $180$ degrees.
outer_arc = newCircularArcCurve("Arc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 5.0, # radius
+ 0.0, # start angle
+ 180.0, # end angle
+ "degrees") # units for angle
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary outer_arc is assigned to be "Arc".
The curve names "Line1", "Line2", and "Arc" are the labels that HOHQMesh will give to these boundary curve segments in the resulting mesh file.
The three curve segments stored in the variables outer_line1, outer_line2, and outer_arc are then added to the sandbox_project with a counter-clockwise orientation as required by HOHQMesh.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for sandbox_project to have elements with side length one in each direction
We visualize the outer boundary curve chain and background grid with the following
plotProject!(sandbox_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains three curve segments "Line1", "Arc", and "Line2" labeled in the figure by O.1, O.2, and O.3, respectively.
Suppose that the domain boundary requires a curved segment instead of the straight line "Line2". We will replace this line segment in the outer boundary chain with a cubic spline.
First, we remove the "Line2" curve from the "Outer" chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
The plot automatically updates and we see that the outer boundary is open and contains two segments: "Line1" and "Arc".
Next, we create a parametric cubic spline curve from a given set of data points. In order to make a closed outer boundary chain the cubic spline must begin at the endpoint of the curve "Arc" and end at the first point of the curve "Line1". This ensures that the new spline curve connects into the boundary curve chain with the correct orientation. To create a parametric spline curve we directly provide data points in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. The spline curve constructor newSplineCurve also takes the number of points as an input argument.
We create a pill shaped inner boundary curve chain composed of four pieces
Straight line segment from $(1, 5)$ to $(1, 3)$.
Half-circle arc of radius $r=1$ centered at $(0, 3)$.
Straight line segment from $(-1, 3)$ to $(-1, 5)$.
Half-circle arc of radius $r=1$ centered at $(0, 5)$.
Similar to the construction of the "Outer" boundary chain, each segment of this inner boundary chain is created separately. The straight line segments are made with the function newEndPointsLineCurve and given unique names:
inner_line1 = newEndPointsLineCurve("Line1", # curve name
+ [1.0, 5.0, 0.0], # start point
+ [1.0, 3.0, 0.0]) # end point
+
+inner_line2 = newEndPointsLineCurve("Line2", # curve name
+ [-1.0, 3.0, 0.0], # start point
+ [-1.0, 5.0, 0.0]) # end point
To create the circle arcs we use the function newCircularArcCurve where we specify a name for the curve as well as the radius and center of the circle. In order to create an inner curve chain with counter-clockwise orientation the angle for the bottom half-circle arc centered at $(0, 3)$ varies from $0$ to $-180$ degrees. The top half-circle arc centered at $(0, 5)$ has an angle that varies from $180$ to $0$ degrees. The construction of the two circle arcs are
inner_bottom_arc = newCircularArcCurve("BottomArc", # curve name
+ [0.0, 3.0, 0.0], # center
+ 1.0, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+
+inner_top_arc = newCircularArcCurve("TopArc", # curve name
+ [0.0, 5.0, 0.0], # center
+ 1.0, # radius
+ 180.0, # start angle
+ 0.0, # end angle
+ "degrees") # units for angle
Note, we use "radians" to set the angle bounds for inner_bottom_arc and "degrees" for the angle bounds of inner_top_arc.
The curve names "Line1", "Line2", "BottomArc", and "TopArc" are the labels that HOHQMesh will give to these inner boundary curve segments in the resulting mesh file.
The four curve segments stored in the variables inner_line1, inner_line2, inner_bottom_arc and outer_arc are added to the sandbox_project in counter-clockwise order as required by HOHQMesh.
This inner boundary chain name "inner" is used internally by HOHQMesh. The visualization of the background grid automatically detects that curves have been added to the sandbox_project and the plot is updated, as shown below. The chain for the inner boundary curve chain is called inner and it contains a four curve segments "Line1", "BottomArc", "Line2", and "TopArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
We next generate the mesh from the information contained in the sandbox_project. This will output the following files to the out folder:
sandbox.control: A HOHQMesh control file for the current project.
sandbox.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
sandbox.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 7.5414000000000009E-002
+ Number of nodes = 511
+ Number of Edges = 933
+ Number of Elements = 422
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00002932 1.17335568 0.18813138 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00953438 2.30790024 1.31439620 1.00000000 999.99900000 1.00000000
+ Condition 1.00041663 2.41773865 1.21024584 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.01673809 3.68828437 1.59413340 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001750 1.13820387 0.14143901 0.00000000 999.99900000 1.00000000
+ Minimum Angle 32.22733574 89.35690571 68.75321248 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.61089476 152.37947944 113.36221513 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
In preparation of edits we will make to the inner boundary chain we remove the current mesh from the plot and re-plot the model curves and background grid. Note, this step is not required, but it helps avoid confusion when editing several curves.
The remove_mesh! command deletes the mesh information from the sandbox_project as well as the mesh file sandbox.mesh, control file sandbox.control, plot file sandbox.tec, and mesh statistics file sandbox.txt from the out folder.
Suppose that the inner boundary actually requires a curved segment instead of the straight line "Line1". We will replace this line segment in the inner boundary chain with an oscillating segment construct from a set of parametric equations. In doing so, it will also be necessary to remove the BottomArc and replace it with a new, wider circular arc segment.
We remove the "Line1" curve from the inner chain with the command
This removal strategy is useful when the curves in the boundary chain do not have unique names. Be aware that when curves are removed from a chain it is possible that the indexing of the remaining curves changes.
With either removal strategy, the plot automatically updates. We see that the inner boundary is open and contains three segments: "BottomArc", "Line2", and "TopArc". Note that the index of the remaining curves has changed as shown below.
Brief note about undo / redo
The interactive functionality (globally) carries an operation stack of actions that can be undone (or redone) as the case may be. We can query and print to the REPL the top of the undo stack with undoActionName.
undoActionName()
+"Remove Inner Boundary Curve"
We can undo the removal of the "Line1" curve with undo
undo()
+"Undo Remove Inner Boundary Curve"
In addition to reinstating "Line1" into the sandbox_project, this undo prints the action that was undone to the REPL and will update the figure.
Analogously, there is a redo operation stack. We query and print to the REPL the top the redo stack with redoActionName and can use redo to perform the operation.
The new inner curve segment will be an oscillating line given by the parametric equations
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. The following commands create a new curve for the parametric equations above
We see from the figure that this parametric equation curve starts at the point $(1,5)$ and, therefore, matches the end point of the existing curve "TopArc" present in the "inner" chain. However, the parametric equation curve ends at the point $(2,3)$ which does not match the "BottomArc" curve. So, the inner boundary chain remains open.
Attempt to generate a mesh with an open curve chain
An open curve chain is invalid in HOHQMesh. All inner and/or outer curve chains must be closed. If we attempt to send a project that contains an open curve chain to generate_mesh a warning is thrown and no mesh or output files are generated.
To create a closed boundary curve we must remove the "BottomArc" curve and replace it with a wider half-circle arc segment. This new half-circle arc must start at the point $(2, 3)$ and end at the point $(-1, 3)$ to close the inner chain and guarantee the chain is oriented counter-clockwise. So, we first remove the "BottomArc" from the "inner" chain.
The figure updates to display the "inner" curve chain with three segments. Note that the inner curve chain indexing has, again, been automatically adjusted.
A half-circle arc that joins the points $(2, 3)$ and $(-1, 3)$ has a radius $r=1.5$, is centered at $(0.5, 3)$ and has an angle that vaires from $0$ to $-180$. We construct this circle arc and directly add it to the sandbox_project.
new_bottom_arc = newCircularArcCurve("wideBottomArc", # curve name
+ [0.5, 3.0, 0.0], # center
+ 1.5, # radius
+ 0.0, # start angle
+ -pi, # end angle
+ "radians") # units for angle
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
The updated plot now gives the modified, closed inner curve chain that now contains four curve segments "Line2", "TopArc", "wiggleLine", and "wideBottomArc" labeled in the figure by 1.1, 1.2, 1.3, and 1.4, respectively.
With the modifications to the inner curve chain complete we can regenerate the mesh. This will create a new sandbox.mesh file and overwrite the existing sandbox.control and sandbox.tec files in the out directory.
generate_mesh(sandbox_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.11353599999999998
+ Number of nodes = 712
+ Number of Edges = 1308
+ Number of Elements = 596
+ Number of Subdivisions = 7
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00002932 1.15661960 0.12823902 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.01050856 3.14732001 1.34260027 1.00000000 999.99900000 1.00000000
+ Condition 1.00037771 2.59434067 1.22850175 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.02744717 3.68828437 1.64751502 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001750 1.13149451 0.09443920 0.00000000 999.99900000 1.00000000
+ Minimum Angle 31.87236189 89.33988565 67.86178629 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.44177106 157.27121105 114.35699650 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The visualization updates automatically and the background grid is removed after when the mesh is generated.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the sharp corners and fine features of the curved inner and outer boundaries. For example, we zoom into sharp corner at the bottom of the domain and see that, although small, the elements in this region maintain a good quadrilateral shape.
Add the background grid when an outer boundary curve is present.
Visualize an interactive mesh project.
Discuss undo / redo capabilities.
Construct and add parametric spline curves.
Construct and add a curve from parametric equations.
Construct and add straight line segments.
Construct and add circular arc segments.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with modified outer and inner curve chains
+#
+# Create inner / outer boundary chains composed of the four
+# available HOHQMesh curve types.
+#
+# Keywords: outer boundary, inner boundary, parametric equations,
+# circle arcs, cubic spline, curve removal
+using HOHQMesh
+
+# Instantiate the project
+sandbox_project = newProject("sandbox", "out")
+
+# Add the background grid
+addBackgroundGrid!(sandbox_project, [1.0, 1.0, 0.0])
+
+# Create and add the original outer boundary curves
+outer_line1 = newEndPointsLineCurve("Line1", [0.0, -7.0, 0.0], [5.0, 3.0, 0.0])
+outer_line2 = newEndPointsLineCurve("Line2", [-5.0, 3.0, 0.0], [0.0, -7.0, 0.0])
+outer_arc = newCircularArcCurve("Arc", [0.0, 3.0, 0.0], 5.0, 0.0, 180.0, "degrees")
+
+addCurveToOuterBoundary!(sandbox_project, outer_line1)
+addCurveToOuterBoundary!(sandbox_project, outer_arc)
+addCurveToOuterBoundary!(sandbox_project, outer_line2)
+
+# Modify the outer boundary to have a spline instead of a straight line
+removeOuterBoundaryCurveWithName!(sandbox_project, "Line2")
+
+spline_data = [ [0.0 -5.0 3.0 0.0]
+ [0.25 -2.0 1.0 0.0]
+ [0.5 -4.0 0.5 0.0]
+ [0.75 -2.0 -3.0 0.0]
+ [1.0 0.0 -7.0 0.0] ]
+outer_spline = newSplineCurve("Spline", 5, spline_data)
+addCurveToOuterBoundary!(sandbox_project, outer_spline)
+
+# Create and add the inner boundary curves
+inner_line1 = newEndPointsLineCurve("Line1", [1.0, 5.0, 0.0], [1.0, 3.0, 0.0])
+inner_line2 = newEndPointsLineCurve("Line2", [-1.0, 3.0, 0.0], [-1.0, 5.0, 0.0])
+inner_bottom_arc = newCircularArcCurve("BottomArc", [0.0, 3.0, 0.0], 1.0, 0.0, -pi, "radians")
+inner_top_arc = newCircularArcCurve("TopArc", [0.0, 5.0, 0.0], 1.0, 180.0, 0.0, "degrees")
+
+addCurveToInnerBoundary!(sandbox_project, inner_line1, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_bottom_arc, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_line2, "inner")
+addCurveToInnerBoundary!(sandbox_project, inner_top_arc, "inner")
+
+# Generate a mesh
+generate_mesh(sandbox_project)
+
+# Delete the existing mesh before modifying the inner boundary curve chain
+remove_mesh!(sandbox_project)
+
+# Modify the inner boundary curve with an oscillatory line and a new circle arc
+removeInnerBoundaryCurve!(sandbox_project, "Line1", "inner")
+removeInnerBoundaryCurve!(sandbox_project, "BottomArc", "inner")
+
+xEqn = "x(t) = t + 1"
+yEqn = "y(t) = -2 * t + 5 - 1.5 * cos(pi * t) * sin(pi * t)"
+zEqn = "z(t) = 0.0"
+inner_eqn = newParametricEquationCurve("wiggleLine", xEqn, yEqn, zEqn)
+
+new_bottom_arc = newCircularArcCurve("wideBottomArc", [0.5, 3.0, 0.0], 1.5, 0.0, -pi, "radians")
+
+addCurveToInnerBoundary!(sandbox_project, inner_eqn, "inner")
+addCurveToInnerBoundary!(sandbox_project, new_bottom_arc, "inner")
+
+# Regenerate the final mesh
+generate_mesh(sandbox_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 25 June 2024. Using Julia version 1.10.4.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary. This outer boundary curve is defined by parametric equations and contains fine features as well as smooth regions.
The outer boundary, background grid and mesh are visualized for quality inspection. The tutorial also shows how to adjust the background and add a local refinement region in order to better resolve a portion of the curved boundary.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the boundary curve, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "TheBlob" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting mesh file from this tutorial will be named TheBlob.mesh. If the folder out does not exist, it will be created automatically in the current file path.
Parametric equations in HOHQMesh can be any legitimate equation and use intrinsic functions available in Fortran, e.g., $\sin$, $\cos$, exp. The constant pi is available for use. Exponentiation is done with ^. All number literals are interpreted as floating point numbers.
The following commands create a new curve for the parametric equations above
The name of this curve is assigned to be "Blob". This name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
Now that we have created the boundary curve it must be added as an outer boundary in the blob_project.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for blob_project to have elements with side length two in each direction
addBackgroundGrid!(blob_project, [2.0, 2.0, 0.0])
We next visualize the outer boundary curve and background grid with the following
plotProject!(blob_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the curves and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "Blob" labeled in the figure by O.1.
From the visualization we see that the background grid is likely too coarse to produce a "good" quadrilateral mesh for this domain. We reset the background grid size to have elements with size one half in each direction
setBackgroundGridSize!(blob_project, 0.5, 0.5)
Note, that after we execute the command above the visualization updates automatically with the outer boundary curve and the new background grid.
The new background grid that gives a finer initial resolution looks suitable to continue to the mesh generation.
We next generate the mesh from the information contained in the blob_project. This will output the following files to the out folder:
TheBlob.control: A HOHQMesh control file for the current project.
TheBlob.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
TheBlob.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 8.4328000000000000E-002
+ Number of nodes = 479
+ Number of Edges = 895
+ Number of Elements = 417
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025286 0.36208840 0.11936333 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002882 2.58443761 1.26335838 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.12867591 1.18585825 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006176 4.77438730 1.51314025 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011275 0.28170345 0.10292806 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.38249259 89.99827733 73.08294187 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132795 156.98701187 109.36585212 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved outer boundary. Although, we see that the mesh near the point $(-4, 0)$ is still quite coarse. To remedy this we manually add a RefinementCenter near this region of the domain to force HOHQMesh to increase the resolution in this area. We create and add this refinement region to the current project with
Above we create a circular refinement region centered at the point $(-4, -0.5)$ with a desired resolution size $0.4$ and a radius of $1.0$. Upon adding this refinement region to blob_project, the visualization will update to indicate the location and size of the manual refinement region.
With the refinement region added to the project we can regenerate the mesh. Note, this will create and save new output files TheBlob.control, TheBlob.tec, TheBlob.mesh and update the figure.
generate_mesh(blob_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 9.2778999999999986E-002
+ Number of nodes = 503
+ Number of Edges = 940
+ Number of Elements = 438
+ Number of Subdivisions = 5
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00025286 0.36208840 0.11412688 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00002883 2.47056840 1.26416662 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 3.12867592 1.18429212 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00006176 4.77438730 1.51407242 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00011275 0.28170345 0.09814903 0.00000000 999.99900000 1.00000000
+ Minimum Angle 29.38249259 89.99827897 72.80049710 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00132784 156.98701188 109.63478104 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
Note, the circular region indicating the refinement center is removed from the plot when the mesh is generated.
Now we decide that we are satisfied with the mesh quality and resolution of the outer boundary curve.
Define a curved outer boundary using parametric equations.
Add and adjust the background grid.
Visualize an interactive mesh project.
Add manual refinement to a local region of the domain.
For completeness, we include a script with all the commands to generate the mesh displayed in the final image. Note, we do not include the plotting in this script.
# Interactive mesh with a curved outer boundary
+#
+# Create an outer boundary from a set of parametric equations.
+# Add manual refinement in a small region around the point (-4, -0.5).
+#
+# Keywords: outer boundary, parametric equations, refinement center
+using HOHQMesh
+
+# Instantiate the project
+blob_project = newProject("TheBlob", "out")
+
+# Create and add the outer boundary curve
+xEqn = "x(t) = 4 * cos(2 * pi * t) - 0.6 * cos(8 * pi * t)^3"
+yEqn = "y(t) = 4 * sin(2 * pi * t) - 0.5 * sin(11* pi * t)^2"
+zEqn = "z(t) = 0.0"
+blob = newParametricEquationCurve("Blob", xEqn, yEqn, zEqn)
+addCurveToOuterBoundary!(blob_project, blob)
+
+# Add the background grid
+addBackgroundGrid!(blob_project, [0.5, 0.5, 0.0])
+
+# Create and add the refinement region
+center = newRefinementCenter("region", "smooth", [-4.0, -0.5, 0.0], 0.4, 1.0)
+addRefinementRegion!(blob_project, center)
+
+# Generate the mesh
+generate_mesh(blob_project)
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 25 June 2024. Using Julia version 1.10.4.
For a general overview of the capabilities and features of HOHQMesh to generate quadrilateral and hexahedral meshes we refer to the Pre-made Examples of the HOHQMesh documentation.
For more information on how an unstructured mesh generated with HOHQMesh.jl can be used in the simulation framework Trixi.jl see the relevant tutorial.
This tutorial gives an introduction to the main functionality of the interactive meshing. In particular, adding a straight-sided bounding box for the outer domain and two circular inner boundary chains. It also demonstrates how to adjust some of the mesh parameters as well as the output mesh file format.
This tutorial constructs an outer domain boundary using parametric equations. The background grid is then set and a preliminary mesh is generated. It highlights how a user can manually add a refinement region where necessary from this visual inspection.
This tutorial constructs a circular outer domain and three inner boundary curves. Two of the inner curves are constructed using cubic splines and the third inner boundary is a triangular shape built from three straight line "curves".
This tutorial demonstrates how to construct and edit curve segments defined in inner / outer boundary chains. A curve "chain" in the HOHQMesh context means a closed curve that is composed of an arbitrary number of pieces. Each curve segment of a chain can be a different curve type, e.g., a circular arc can connect to a spline that connects to a parametric equation curve. There are details for the removal and replacement of a portion of a chain.
This tutorial constructs a mesh given a closed chain of outer boundary curves that is then reflected over a straight line or several co-linear lines indicated by the user. The result is a mesh that is symmetric with respect to the prescribed straight line.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a domain with a curved outer boundary and three inner boundaries. Two of the inner curves are built from cubic splines. The third inner curve is a triangular shape built from a chain of three straight line "curves". The outer boundary, inner boundaries, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_spline_curves.jl from the examples folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "spline_curves" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named spline_curves.control. If the folder out does not exist, it will be created automatically in the current file path.
The outer boundary curve for this tutorial is a circle of radius $r=4$ centered at the point $(0, -1)$. We define this circular curve with the function newCircularArcCurve as follows
circ = newCircularArcCurve("outerCircle", # curve name
+ [0.0, -1.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circ is assigned to be "outerCircle". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circ curve is then added to the spline_project as an outer boundary curve with
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for spline_project to have elements with side length $0.6$ in each direction
We next visualize the outer boundary curve and background grid with the following
plotProject!(spline_project, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and it contains a single curve "outerCircle" labeled in the figure by O.1.
A parametric cubic spline curve can be constructed from a file of data points. The first line of this plain text file must indicate the number of nodes. Then line-by-line the file contains the knots $t_j$, $x_j$, $y_j$, $z_j$ where $j$ indexes the number of nodes. If the spline curve is to be closed. The last data point must be the same as the first. For examples, see the HOHQMesh documentation or open the file test_spline_curve_data.txt in the examples folder
We create a parametric spline curve from a file with
The name of the curve stored in the dictionary spline1 is assigned to be "big_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline1 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner1 and it contains a single curve "big_spline" labeled in the figure by 1.1.
Alternatively, a parametric cubic spline curve can be constructed directly from data points provided in the code. These points take the form [t, x, y, z] where t is the parameter variable that varies between $0$ and $1$. For the spline construction, the number of points is included as an input argument as well as the actual parametric point data. Again, if the spline curve is to be closed, the first and last data point must match.
Below, we construct another parametric spline using this strategy that consists of five data points
The name of the curve stored in the dictionary spline2 is assigned to be "small_spline". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new spline2 curve is then added to the spline_project as an inner boundary curve with
This inner boundary chain name "inner2" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called inner2 and it contains a single curve "small_spline" labeled in the figure by 2.1.
Finally, we build a triangular shaped inner boundary curve built from a chain of three straight lines. Each line segment is defined using the function newEndPointsLineCurve. We construct the three line segments that define the edges of a triangular shape with
edge1 = newEndPointsLineCurve("triangle", # curve name
+ [-2.3, -1.0, 0.0], # start point
+ [-1.7, -1.0, 0.0]) # end point
+
+edge2 = newEndPointsLineCurve("triangle", # curve name
+ [-1.7, -1.0, 0.0], # start point
+ [-2.0, -0.4, 0.0]) # end point
+
+edge3 = newEndPointsLineCurve("triangle", # curve name
+ [-2.0, -0.4, 0.0], # start point
+ [-2.3, -1.0, 0.0]) # end point
Here, each edge of the curve is given the same name "triangle" as this curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The three line segments edge1, edge2, and edge3 are connected in a counter-clockwise orientation as required by HOHQMesh.
The inner boundary chain name "inner3" is used internally for HOHQMesh. Again, the active visualization automatically detects that new curves have been added to the project and the plot is updated appropriately, as shown below. The chain for the inner triangular boundary is called inner3 and it contains a three curve segments all called "triangle" labeled in the figure by 3.1, 3.2, and 3.3.
With the background grid, outer boundary curve, and all inner boundary curves added to the spline_project we are ready to generate the mesh. This will output the following files to the out folder:
spline_curves.control: A HOHQMesh control file for the current project.
spline_curves.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
spline_curves.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(spline_project)
+ 1 chevron elements removed from mesh.
+ 1 chevron elements removed from mesh.
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 0.25359100000000001
+ Number of nodes = 1176
+ Number of Edges = 2225
+ Number of Elements = 1047
+ Number of Subdivisions = 4
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00006209 0.15607019 0.04505180 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00008965 2.78091496 1.23178864 1.00000000 999.99900000 1.00000000
+ Condition 1.00000055 3.82171291 1.15535543 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00014261 6.78201663 1.46249737 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00001491 0.10424647 0.03955817 0.00000000 999.99900000 1.00000000
+ Minimum Angle 37.24189766 89.96174556 74.42003031 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.03128071 157.35065162 107.91806148 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen. HOHQMesh also reports mesh clean-up that occurred during the generation process, in this case the removal of "bad" chevron shaped elements that were present within the automatic subdivision procedure. The visualization updates automatically and the background grid is removed after when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the generated mesh file.
Inspecting the mesh we see that the automatic subdivision in HOHQMesh does well to capture the fine features of the curved inner boundaries, particularly near the sharp angles of the "big_spline" curve. We decide that we are satisfied with the overall mesh quality.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh on a rectangular domain that contains two circular inner boundaries. Further, we show how to adjust some of the default mesh parameters as well as the output mesh file format. The outer boundary, background grid and mesh will be visualized for quality inspection.
It provides details and clarification for the script interactive_outer_box_two_circles.jl from the examples/ folder.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "box_two_circles" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named box_two_circles.control. If the folder out does not exist, it will be created automatically in the current file path.
When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.
For the box_project we first query the current values for the polynomial order and the mesh output format
We change these quantities in the box_project with the corresponding setter functions. For this we will set the polynomial order to be $4$ and the mesh file format to be ABAQUS. See the P4est-based mesh section of the Trixi.jl documentation for a detailed overview of this mesh file format.
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near any curved boundaries.
The domain for this tutorial is a rectangular box with the bounds $[0,30]\times[0,15]$. Because no outer boundary curve is present there are two (equivalent) strategies for us to define the bounds of a rectangular domain and the size of the background grid:
Set the lower left corner point of the domain $(x_0, y_0)$, define the element size in each spatial direction $\Delta x$ and $\Delta y$, and the number of steps taken in each direction $N_x, N_y$. The resulting background grid will have the extent $[x_0, x_0 + N_x \Delta x]$ by $[y_0, y_0 + N_y \Delta y]$. For this example, we set a background grid of Cartesian elements with size one in each dimension with the following commands
Set the bounding box with extent values ordered as [top, left, bottom, right] and provide the number the number of steps in each direction. To set a background grid of Cartesian elements with size one in each dimension for the rectangular box $[0,30]\times[0,15]$ we use
Next, we add the two circular inner boundary curves with different radii.
The first circle will have radius $r=2$ and be centered at the point $(4, 4)$. We define this circular curve with the function newCircularArcCurve as follows
circle1 = newCircularArcCurve("circle1", # curve name
+ [4.0, 4.0, 0.0], # circle center
+ 2.0, # circle radius
+ 0.0, # start angle
+ 360.0, # end angle
+ "degrees") # angle units
We use "degrees" to set the angle bounds, but "radians" can also be used. The name of the curve stored in the dictionary circle1 is assigned to be "circle1". This curve name is also the label that HOHQMesh will give to this boundary curve in the resulting mesh file.
The new circle1 curve is then added to the box_project as an inner boundary curve with
This inner boundary chain name "inner1" is used internally by HOHQMesh. The visualization of the background grid automatically detects that a curve has been added to the project and the plot is updated appropriately, as shown below. The chain for the inner boundary curve is called "inner1" and it contains a single curve "circle1" labeled in the figure by 1.1.
With analogous steps we create another circular curve with radius $r=4$, centered at $(20, 9)$ and add it as a second inner curve to the box_project. Note, for this curve we use radians for the angle units.
circle2 = newCircularArcCurve("circle2", # curve name
+ [20.0, 9.0, 0.0], # circle center
+ 4.0, # circle radius
+ 0.0, # start angle
+ 2.0 * pi, # end angle
+ "radians") # angle units
+addCurveToInnerBoundary!(box_project, circle2, "inner2")
Again, the box_project detects that a curve has been added to it and the visualization is automatically updated with the second circular curve. The chain for the second inner boundary curve is called "inner2" and it contains a single curve "circle2" labeled in the figure by 2.1.
With the background grid and all inner boundary curves added to the box_project we can generate the mesh. This will output the following files to the out folder:
box_two_circles.control: A HOHQMesh control file for the current project.
box_two_circles.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
box_two_circles.inp: A mesh file with format ABAQUS that was set above.
To do this we execute the command
generate_mesh(box_project)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 2.9116999999999997E-002
+ Number of nodes = 498
+ Number of Edges = 921
+ Number of Elements = 422
+ Number of Subdivisions = 0
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.34513977 1.15385313 0.91833886 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00000004 1.71084672 1.08736698 1.00000000 999.99900000 1.00000000
+ Condition 1.00000000 1.46547984 1.04928616 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00000006 2.43578615 1.16710823 1.00000000 4.00000000 1.00000000
+ Jacobian 0.17854786 1.07210200 0.86801191 0.00000000 999.99900000 1.00000000
+ Minimum Angle 50.57680338 89.99999787 83.84338772 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.00000259 136.97085026 96.70176380 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The call to generate_mesh also prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated and the resulting mesh is visualized instead.
From a visual inspection we decide that we are satisfied with the mesh quality and resolution near the inner circular boundaries.
The purpose of this tutorial is to demonstrate how to create an unstructured mesh that is symmetric with respect to a straight line outer boundary as prescribed by the user. At the end of this tutorial one can find the script necessary to generate the meshes described herein.
From a Julia REPL we load the HOHQMesh package as well as GLMakie, a backend of Makie.jl, to visualize the curves, mesh, etc. from the interactive tool.
julia> using GLMakie, HOHQMesh
Now we are ready to interactively generate unstructured quadrilateral meshes!
We create a new project with the name "symmetric_mesh" and assign "out" to be the folder where any output files from the mesh generation process will be saved. By default, the output files created by HOHQMesh will carry the same name as the project. For example, the resulting HOHQMesh control file from this tutorial will be named symmetric_mesh.control. If the folder out does not exist, it will be created automatically in the current working directory.
When a new project is created it is filled with several default RunParameters such as the polynomial order used to represent curved boundaries or the mesh file format. These RunParameters can be queried and adjusted with appropriate getter/setter pairs, see Controlling the mesh generation for more details.
For the symmetric_mesh project we query the current values for the polynomial order and the mesh output format
HOHQMesh requires a background grid for the mesh generation process. This background grid sets the base resolution of the desired mesh. HOHQMesh will automatically subdivide from this background grid near sharp features of any curved boundaries.
For a domain bounded by an outer boundary curve, this background grid is set by indicating the desired element size in the $x$ and $y$ directions. To start, we set the background grid for symmetric_mesh to have elements with side length $0.25$ in each direction
With the background grid size set, we next build the outer boundary for the present mesh project. This outer boundary is composed of nine straight line segments and a half circle arc. The curves will afterwards be added to the mesh project symmetric_mesh in counter-clockwise order as required by HOHQMesh.
The given boundary names will also be the element boundary names written to the mesh file. The only exception is the first boundary curve that is given the name ":symmetry". This outer boundary curve name is a special keyword in HOHQMesh that says it is a straight line across which a reflection will occur. Two worthwhile notes are
the leading colon on this boundary name keyword is present to avoid conflicts with any other use of the symmetry name.
if the curve designated as ":symmetry" is not a straight line, then an error is thrown by HOHQMesh and the mesh will not be reflected.
Name of the symmetry boundary
The name of the reflection boundary line is not case-sensitive, thus":symmetry" or ":Symmetry" or ":SYMMETRY" are all valid and will be recognized as the keyword for symmetry.
Now that all the outer boundary curves are defined we add them to the symmetric_mesh project in counter-clockwise order
We visualize the outer boundary curve chain and background grid with the following
plotProject!(symmetric_mesh, MODEL+GRID)
Here, we take the sum of the keywords MODEL and GRID in order to simultaneously visualize the outer boundary and background grid. The resulting plot is given below. The chain of outer boundary curves is called "Outer" and its constituent curve segments are labeled accordingly with the names prescribed in the curve construction above.
We next generate the mesh from the information contained in symmetric_mesh. This will output the following files to the out folder:
symmetric_mesh.control: A HOHQMesh control file for the current project.
symmetric_mesh.tec: A TecPlot formatted file to visualize the mesh with other software, e.g., ParaView.
symmetric_mesh.mesh: A mesh file with format ISM-V2 (the default format).
To do this we execute the command
generate_mesh(symmetric_mesh)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 4.0154999999999996E-002
+ Number of nodes = 343
+ Number of Edges = 626
+ Number of Elements = 284
+ Number of Subdivisions = 2
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00227157 0.06552808 0.01366911 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00389317 2.07480912 1.22443835 1.00000000 999.99900000 1.00000000
+ Condition 1.00048947 1.93007666 1.12853177 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00607156 3.56541719 1.44892631 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00158627 0.06202757 0.01120120 0.00000000 999.99900000 1.00000000
+ Minimum Angle 48.35050023 89.33703938 75.39251039 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.94150752 129.91539960 106.20679399 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
Note that the call to generate_mesh prints mesh quality statistics to the screen and updates the visualization. The background grid is removed from the visualization when the mesh is generated.
Mesh visualization
Currently, only the "skeleton" of the mesh is visualized. Thus, the high-order curved boundary information is not seen in the plot but this information is present in the mesh file generated.
Boundary names in the mesh file
The boundary names of the original outer curves will be those defined by the user in their construction above. The boundary labeled ":symmetry" is now internal and is marked appropriately as such. The reflected boundary names are appended with _R (for reflected) in the mesh file. For instance, the reflected version of the boundary bottom has the name bottom_R or the boundary named circle has the reflected boundary counterpart named circle_R. These can be changed as desired by editing the mesh file.
It is also possible to create a symmetry boundary composed of multiple co-linear segments.
To change the line along which the mesh is reflected, we remove the current mesh that was just generated and re-plot the model curves and background grid.
The remove_mesh! command deletes the mesh information from the interactive mesh project symmetric_mesh as well as the mesh file symmetric_mesh.mesh, control file symmetric_mesh.control, plot file symmetric_mesh.tec, and mesh statistics file symmetric_mesh.txt from the out folder.
To illustrate the reflection about multiple boundary curves (which must be co-linear!), we first rename the current symmetry boundary curve O.1 to have the name "left". Next, we rename all the co-linear boundary curves O.3, O.5, and O.9 to have the name ":symmetry". Both are done with the function renameCurve!
renameCurve!(symmetric_mesh, ":symmetry", # existing curve name
+ "left") # new curve name
+renameCurve!(symmetric_mesh, "right", ":symmetry")
After the boundary names are adjusted the plot updates automatically to give the figure below.
We then generate the new mesh from the information contained in symmetric_mesh. Again, a check ensures that the curves designated as ":symmetry" are co-linear. An error is thrown if this is not the case and the mesh will not be reflected. This saves the control, tec, and mesh files into the out folder and yields
generate_mesh(symmetric_mesh)
+
+ *******************
+ 2D Mesh Statistics:
+ *******************
+ Total time = 3.7763000000000019E-002
+ Number of nodes = 337
+ Number of Edges = 622
+ Number of Elements = 284
+ Number of Subdivisions = 2
+
+ Mesh Quality:
+ Measure Minimum Maximum Average Acceptable Low Acceptable High Reference
+ Signed Area 0.00227157 0.06552808 0.01366911 0.00000000 999.99900000 1.00000000
+ Aspect Ratio 1.00389317 2.07480912 1.22443835 1.00000000 999.99900000 1.00000000
+ Condition 1.00048947 1.93007666 1.12853177 1.00000000 4.00000000 1.00000000
+ Edge Ratio 1.00607156 3.56541719 1.44892631 1.00000000 4.00000000 1.00000000
+ Jacobian 0.00158627 0.06202757 0.01120120 0.00000000 999.99900000 1.00000000
+ Minimum Angle 48.35050023 89.33703938 75.39251039 40.00000000 90.00000000 90.00000000
+ Maximum Angle 90.94150752 129.91539960 106.20679399 90.00000000 135.00000000 90.00000000
+ Area Sign 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
The updated visualization is given below. Note, the flexibility to define multiple co-linear symmetric boundaries creates a symmetric mesh with closed internal boundaries. In this example, a circle and a rectangle.
Construct an outer boundary with several connected curves.
Add the background grid when an outer boundary curve is present.
Rename boundaries in an existing interactive mesh project.
Visualize an interactive mesh project.
For completeness, we include two scripts with all the commands to generate the meshes displayed for a reflection about the left boundary line O.1 as well as a reflection about the right boundary composed of the three co-linear segments O.3, O.5, and O.9. Note, we do not include the plotting in these scripts.
# Interactive mesh with reflection on the left over a single symmetry boundary
+# as well as a reflection on the right over multiple co-linear symmetry boundaries.
+#
+# Keywords: outer boundary, reflection, symmetric mesh
+using HOHQMesh
+
+# new project
+symmetric_mesh = newProject("symmetric_mesh", "out")
+
+# reset the polynomial degree of the mesh
+setPolynomialOrder!(symmetric_mesh, 6)
+
+# A background grid is required for the mesh generation
+addBackgroundGrid!(symmetric_mesh, [0.25, 0.25, 0.0])
+
+# Create all the outer boundary curves and add them to the mesh project.
+# Note: (1) Curve names are those that will be present in the mesh file
+# (2) Boundary named ":symmetry" is where reflection occurs
+
+line1 = newEndPointsLineCurve(":symmetry", [-0.05, 2.0, 0.0],
+ [-0.05, 0.0, 0.0])
+
+line2 = newEndPointsLineCurve("bottom", [-0.05, 0.0, 0.0],
+ [1.0, 0.0, 0.0])
+
+line3 = newEndPointsLineCurve("right", [1.0, 0.0, 0.0],
+ [1.0, 0.5, 0.0])
+
+half_circle = newCircularArcCurve("circle", # curve name
+ [1.0, 0.75, 0.0], # circle center
+ 0.25, # circle radius
+ 270.0, # start angle
+ 90.0, # end angle
+ "degrees") # angle units
+
+line4 = newEndPointsLineCurve("right", [1.0, 1.0, 0.0],
+ [1.0, 1.5, 0.0])
+
+line5 = newEndPointsLineCurve("bump", [1.0, 1.5, 0.0],
+ [0.75, 1.5, 0.0])
+
+line6 = newEndPointsLineCurve("bump", [0.75, 1.5, 0.0],
+ [0.75, 1.75, 0.0])
+
+line7 = newEndPointsLineCurve("bump", [0.75, 1.75, 0.0],
+ [1.0, 1.75, 0.0])
+
+line8 = newEndPointsLineCurve("right", [1.0, 1.75, 0.0],
+ [1.0, 2.0, 0.0])
+
+line9 = newEndPointsLineCurve("top", [1.0, 2.0, 0.0],
+ [-0.05, 2.0, 0.0])
+
+addCurveToOuterBoundary!(symmetric_mesh, line1)
+addCurveToOuterBoundary!(symmetric_mesh, line2)
+addCurveToOuterBoundary!(symmetric_mesh, half_circle)
+addCurveToOuterBoundary!(symmetric_mesh, line3)
+addCurveToOuterBoundary!(symmetric_mesh, line4)
+addCurveToOuterBoundary!(symmetric_mesh, line5)
+addCurveToOuterBoundary!(symmetric_mesh, line6)
+addCurveToOuterBoundary!(symmetric_mesh, line7)
+addCurveToOuterBoundary!(symmetric_mesh, line8)
+addCurveToOuterBoundary!(symmetric_mesh, line9)
+
+# Generate the mesh. Saves the mesh file to the directory "out".
+generate_mesh(symmetric_mesh)
+
+# Delete the existing mesh before modifying boundary names.
+remove_mesh!(symmetric_mesh)
+
+# Rename the outer boundaries appropriately to set the symmetry boundary
+# on the right composed of multiple co-linear segments.
+renameCurve!(symmetric_mesh, ":symmetry", # existing curve name
+ "left") # new curve name
+renameCurve!(symmetric_mesh, "right", ":symmetry")
+
+# Generate the mesh. Saves the mesh file to the directory "out".
+generate_mesh(symmetric_mesh)
Settings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 25 June 2024. Using Julia version 1.10.4.