Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small edits across docs and tutorials #43

Merged
merged 4 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/src/CheatSheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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
`interactive_outer_boundary_generic.jl` in the `examples/` folder
constructs an identical example mesh as shown in the [Guided tour](@ref)
using generic function calls.

Expand Down Expand Up @@ -36,11 +36,11 @@ The `options` are any sum of `MODEL`, `GRID`, `REFINEMENTS`, and `MESH`.
## Curves

```
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*
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.
Expand All @@ -55,9 +55,9 @@ Shown here is the use of the function `new`, which is a shortcut to the full fun
## Adding to a Project

```
add!(p, c) *Add outer boundary curve*
add!(p, c, <InnerBoundaryName>) *Add curve to an inner boundary*
add!(p, r) *Add refinement region*
add!(p, c) *Add outer boundary curve*
add!(p, c, <InnerBoundaryName>) *Add curve to an inner boundary*
add!(p, r) *Add refinement region*

addBackgroundGrid!(p, [top, left, bottom, right], [nX, nY, nZ]) *No outer boundary*
addBackgroundGrid!(p, [dx, dy, dz]) *If an outer boundary is present*
Expand All @@ -76,7 +76,7 @@ Shown here is the use of the function `add!`, which is a shortcut to the full fu
## Removing from Project

```
removeOuterboundary!(p) *Entire outer boundary curve*
removeOuterBoundary!(p) *Entire outer boundary curve*
removeInnerBoundary!(p, innerBoundaryName) *Entire inner boundary curve*
remove!(p, name) *Curve in outer boundary*
remove!(p, name, innerBoundaryName) *Curve in inner boundary*
Expand Down
2 changes: 1 addition & 1 deletion docs/src/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ 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
VS Code). If you decide to use Vim or Emacs, make sure that you install the
andrewwinters5000 marked this conversation as resolved.
Show resolved Hide resolved
corresponding Vim plugin
[julia-vim](https://github.com/JuliaEditorSupport/julia-vim) or Emacs major
mode [julia-emacs](https://github.com/JuliaEditorSupport/julia-emacs).
Expand Down
2 changes: 1 addition & 1 deletion docs/src/github-git.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ the following steps need to be taken (as documented for GitLab in issue
java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 10M HOHQMesh.jl.git

# Enter repo
cd Trixi.jl.git
cd HOHQMesh.jl.git

# Clean up reflog and force aggressive garbage collection
git reflog expire --expire=now --all && git gc --prune=now --aggressive
Expand Down
15 changes: 8 additions & 7 deletions docs/src/guided-tour.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Guided tour

In this brief overview, we highlight two scripts from the `examples` folder
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](@ref).

Expand Down Expand Up @@ -82,7 +82,7 @@ if isdefined(Main, :Makie)
@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`
# 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.

Expand Down Expand Up @@ -112,16 +112,16 @@ 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").
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, so only the mesh size needs
boundary, that determines the extent of the domain to be meshed, only the mesh size needs
to be specified using
```
addBackgroundGrid!(proj::Project, bgSize::Array{Float64})
```

The example sets the background mesh size to be 0.1 in the x and y directions.
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
Expand All @@ -132,9 +132,10 @@ Finally, the script returns the project so that it can be edited further, if des

To save a control file for HOHQMesh, simply invoke
```
saveProject(proj::Project, outFile::String)
saveProject(proj::Project)
```
where `outFile` is the name of the control file (traditionally with a .control extension).
where the name of the control file (traditionally with a .control extension) matches the
andrewwinters5000 marked this conversation as resolved.
Show resolved Hide resolved
name of the `proj`.
andrewwinters5000 marked this conversation as resolved.
Show resolved Hide resolved
`saveProject` is automatically called when a mesh is generated.

Note, a third example script `interactive_outer_boundary_generic.jl` is identical to that
Expand Down
16 changes: 13 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ This package is a Julia frontend to the Fortran-based *High Order Hex-Quad Meshe
[David A. Kopriva](https://www.math.fsu.edu/~kopriva/). It augments HOHQMesh with
[interactive functionality](@ref InteractiveTool) 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](https://trixi-framework.github.io/Trixi.jl/stable/tutorials/hohqmesh_tutorial/).
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](https://youtu.be/_N4ozHr-t9E),
originally given as part of JuliaCon 2022, outlines how to use HOHQMesh.jl together
with [Trixi.jl](https://github.com/trixi-framework/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](https://github.com/trixi-framework/talk-2022-juliacon_toolchain)
for the presentation.
An additional resource is a
[tutorial](https://trixi-framework.github.io/Trixi.jl/stable/tutorials/hohqmesh_tutorial/)
available in the Trixi.jl documentation that describes how to run a simulation
on an unstructured quadrilateral mesh.

## Installation
If you have not yet installed Julia, please [follow the instructions for your
operating system](https://julialang.org/downloads/platform/). HOHQMesh.jl works
Expand Down
27 changes: 15 additions & 12 deletions docs/src/interactive-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
```
[Return:Project] proj = newProject(name::String, folder::String)
```
The supplied name will be the default name of the mesh and plot files generated by HOHQMesh. The folder is
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.
and a default `SpringSmoother`, both of which can be modified later, if desired.
The only thing required to add is the background grid.

### Opening an existing project file

A project can be created from an existing HOHQMesh control file with
```
[Return:Project] proj = openProject(fileName::String, folder::String)
```
The supplied `fileName` will be the name of the project and the generated mesh and plot files will be placed
in the supplied `folder`.
The supplied `fileName` will be the name of the project and the generated mesh and
plot files will be placed in the supplied `folder`.

### Saving a `Project`
```
Expand Down Expand Up @@ -106,10 +107,12 @@ By default, the mesh, plot and stats files will be written with the name and pat

### Smoothing operations

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](https://trixi-framework.github.io/HOHQMesh/the-control-input/#the-smoother).
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](https://trixi-framework.github.io/HOHQMesh/the-control-input/#the-smoother).
andrewwinters5000 marked this conversation as resolved.
Show resolved Hide resolved

To change the defaults, the smoother parameters can be set/enquired with the functions
```
Expand All @@ -130,7 +133,7 @@ To remove the smoother altogether, use
### Adding the background grid

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
and two for when there is not. One form of background grid **must** be specified
after a new project has been created.
```
[Return:nothing] addBackgroundGrid!(proj::Project,
Expand Down Expand Up @@ -165,7 +168,7 @@ If a plot is present it will be updated automatically.
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).
(e.g. a wake) or in problematic areas of the geometry (e.g. a sharp corner).

To create a `RefinementCenter`,
```
Expand Down Expand Up @@ -202,7 +205,7 @@ To get a reference to a refinement region with a given name, use

Finally, to get a list of all the refinement regions,
```
[Return:Array{Dict{String,Any}}] array = allRefinementRegions(proj::Project)
[Return:Array{Dict{String,Any}}] array = allRefinementRegions(proj::Project)
```

A refinement region can be edited by using the following:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/interactive_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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
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`
Expand Down
2 changes: 1 addition & 1 deletion docs/src/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ functionality or add other errors. In the main
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`](https://github.com/trixi-framework/HOHQMesh.jl/blob/main/.github/workflows/ci.yml).
In Trixi and its related repositories, tests are triggered by
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](@ref) to
Expand Down
36 changes: 18 additions & 18 deletions docs/src/tutorials/create_edit_curves.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,21 +243,21 @@ generate_mesh(sandbox_project)
*******************
2D Mesh Statistics:
*******************
Total time = 8.7928000000000006E-002
Number of nodes = 513
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.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
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
Expand Down Expand Up @@ -413,21 +413,21 @@ generate_mesh(sandbox_project)
*******************
2D Mesh Statistics:
*******************
Total time = 0.13299600000000000
Number of nodes = 714
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.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
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.
Expand Down
Loading