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

Add interactive HQMTool and testing #15

Merged
merged 165 commits into from
Jun 24, 2022
Merged
Changes from 1 commit
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
77bd6ca
Add HQMtool folder
DavidAKopriva Sep 9, 2021
e3b5b5c
Integrate HQMTool into existing infrastructure (#11)
sloede Sep 11, 2021
47d0152
Add source and docs
DavidAKopriva Mar 1, 2022
16be727
add capability to set ABAQUS for the meshFileFormat
andrewwinters5000 Mar 11, 2022
8bbc47f
add ability to plot mesh from ISM format version
andrewwinters5000 Mar 11, 2022
164dda5
Merge branch 'main' into InteractiveTool
andrewwinters5000 Mar 12, 2022
0d25434
add capability to plot from the ABAQUS format as well
andrewwinters5000 Mar 12, 2022
3e0de6c
Add Curve tests
DavidAKopriva Mar 19, 2022
8ae2f29
Add API tests
DavidAKopriva Mar 20, 2022
4093443
Add Refinement Tests
DavidAKopriva Mar 21, 2022
0296c84
More refinement tests
DavidAKopriva Mar 22, 2022
8c50f6a
Update RefinementTests.jl
DavidAKopriva Mar 22, 2022
b83619d
BackgroundGridTests
DavidAKopriva Mar 22, 2022
fb169f5
Smoother tests
DavidAKopriva Mar 22, 2022
1c98f77
Finish Run Parameters
DavidAKopriva Mar 22, 2022
8f8c1d4
Update Spline tests
DavidAKopriva Mar 23, 2022
d849404
Create Model Tests
DavidAKopriva Mar 24, 2022
a7a8442
Update Tests.jl
DavidAKopriva Mar 24, 2022
fdc632b
Project Tests
DavidAKopriva Mar 24, 2022
1ad7a7b
Update Tests.jl
DavidAKopriva Mar 24, 2022
8b2cd90
fix image rendering in HQMTool docs
andrewwinters5000 Mar 25, 2022
b329830
update the docs for the new plotting capabilities
andrewwinters5000 Mar 25, 2022
1aff854
remove doc files in HQMTool folder from the repo
andrewwinters5000 Mar 25, 2022
c2e0382
remove duplicate HQMTool.jl from repo
andrewwinters5000 Mar 25, 2022
635b2ce
give capability to set ABAQUS format and remove duplicate RunParamete…
andrewwinters5000 Mar 25, 2022
86a836f
add capability to plot all three mesh file formats
andrewwinters5000 Mar 25, 2022
b989631
remove dulplicate Viz files from the HQMTool folder
andrewwinters5000 Mar 25, 2022
30c951b
debug plotting of all three mesh file formats
andrewwinters5000 Mar 25, 2022
3ba64ed
remove remaining duplicate source files and HQMTool folder. All files…
andrewwinters5000 Mar 25, 2022
8f83954
attempt to properly include HQMTool functionality such that simply us…
andrewwinters5000 Mar 25, 2022
b071946
for now make GLMakie a required dependency
andrewwinters5000 Mar 25, 2022
9eee284
perform tests on the background grid functions from HQMTool
andrewwinters5000 Mar 26, 2022
0d0739e
export all HQMTool functions, can cleanup later
andrewwinters5000 Mar 31, 2022
f8fdb2f
move all tests into exisitng test folder
andrewwinters5000 Mar 31, 2022
db980c7
typo fix in CheatSheet
andrewwinters5000 Mar 31, 2022
22db877
spacing adjustment and flag possible extra println
andrewwinters5000 Mar 31, 2022
0d1d4db
generalize file name creation. Tests should pass on Windows now
andrewwinters5000 Mar 31, 2022
01c65fd
rename testing files for consistency
andrewwinters5000 Mar 31, 2022
27d03c8
properly adjust the Makie reuqirements and exporting
andrewwinters5000 Mar 31, 2022
9ed90f8
add CairoMakie to the testing Project.toml
andrewwinters5000 Mar 31, 2022
dc110e9
change generic function from get => getCurve to avoid collision with …
andrewwinters5000 Mar 31, 2022
89dfb9c
Meshing.jl does not need to use HOHQMesh
andrewwinters5000 Mar 31, 2022
a254bfe
make the individual test files module and able to be included indepen…
andrewwinters5000 Mar 31, 2022
4f5a0a7
add testing for the visualization routines
andrewwinters5000 Mar 31, 2022
558d87d
rearrange Makie includes. shrink resolution
andrewwinters5000 Mar 31, 2022
b5c0c54
adjust function names in Meshing.jl, exporting is easier
andrewwinters5000 Mar 31, 2022
58e181f
make figure bigger
andrewwinters5000 Mar 31, 2022
7b586a9
demos now use generate_mesh
andrewwinters5000 Mar 31, 2022
8cd9046
update visualization tests to cover more code
andrewwinters5000 Mar 31, 2022
130a029
add keyword argument to demos such that testing can call them
andrewwinters5000 Mar 31, 2022
25c7c4d
add testing for the HQMTool demos
andrewwinters5000 Mar 31, 2022
add93ae
update docs to match changes to the HQMTool structure
andrewwinters5000 Mar 31, 2022
ab88d02
add a 3D smoke test for a simple extrusion
andrewwinters5000 Apr 1, 2022
0719c9c
remove TODO
andrewwinters5000 Apr 1, 2022
3fe0180
remove unnecessary test data files
andrewwinters5000 Apr 1, 2022
601eec0
add to tests that trigger some of the error statement printing
andrewwinters5000 Apr 1, 2022
f0833d7
add testing for spline read in from a file
andrewwinters5000 Apr 1, 2022
7775864
add attempt to generate mesh without background grid to trigger error…
andrewwinters5000 Apr 1, 2022
97732bb
add tests using the getCurve and getInnerBoundary functions
andrewwinters5000 Apr 1, 2022
f37439a
added a test for the generic spline creation
andrewwinters5000 Apr 1, 2022
0141839
add comment and blank line to control file
andrewwinters5000 Apr 1, 2022
6382105
export parametric equation evaluators
andrewwinters5000 Apr 1, 2022
629aa2d
move plotProject outside if statement. Should cover more routines
andrewwinters5000 Apr 1, 2022
bd8c989
exercise parametric eqn eval at a single point and the redoActionName
andrewwinters5000 Apr 1, 2022
36aea70
exercise more curve arc and spline routines
andrewwinters5000 Apr 1, 2022
657eff7
Fix two bugs
DavidAKopriva Apr 1, 2022
60082fa
added NACA0012 read in and some tests
andrewwinters5000 Apr 2, 2022
09d6ad1
add tests that purposly has curves that do not join
andrewwinters5000 Apr 2, 2022
749bfd5
add generic remove of the outer boundary
andrewwinters5000 Apr 2, 2022
fefa9e3
Update ModelAPI.jl
DavidAKopriva Apr 2, 2022
7d623af
fix bug in VizMesh and actually make the model test fail
andrewwinters5000 Apr 4, 2022
152d46f
fix bug in removeInnerBoundary. Add output if a requested curveName b…
andrewwinters5000 Apr 4, 2022
cacec95
bug fix in the chain index count of getInnerBoundaryChainWithName
andrewwinters5000 Apr 4, 2022
817e2ff
add calls to the generic remove for inner boundaries
andrewwinters5000 Apr 4, 2022
68376eb
query getCurve incorrectly to throw a warning
andrewwinters5000 Apr 4, 2022
7c85d92
trigger warning of mismatched chain and boundary names in removal
andrewwinters5000 Apr 4, 2022
dff4bc0
adjust logic in the removeInnerBoundaryCurve to be more robust and no…
andrewwinters5000 Apr 4, 2022
6698958
add tests for the error that is now thrown by remove for the inner bo…
andrewwinters5000 Apr 4, 2022
a4335b7
fix error message in the refinement regions API
andrewwinters5000 Apr 4, 2022
87d3ef5
fix error message bugs that used C style printing
andrewwinters5000 Apr 4, 2022
76e2f47
add additional tests to fire the progressive plotting of project
andrewwinters5000 Apr 4, 2022
d10da37
add explicit set radius in order to trigger curveDidChange in the new…
andrewwinters5000 Apr 4, 2022
87a86bb
add refinement region to trigger auto plotting when it is not in the …
andrewwinters5000 Apr 4, 2022
7ab1ba4
Add undo to removeInnerBoundary
DavidAKopriva Apr 5, 2022
e54bdeb
improve undo robustness and test it better
andrewwinters5000 Apr 5, 2022
6db101b
Add a true error when the control file SPLINE does not have the nKnot…
andrewwinters5000 Apr 5, 2022
c93c330
update action names for the outer boundary removal / insert
andrewwinters5000 Apr 5, 2022
738fcc5
bug fix in addOuterBoundary, now undo() works properly plus plots and…
andrewwinters5000 Apr 5, 2022
7b4536f
small typo change
andrewwinters5000 Apr 5, 2022
73cfc2c
move lines around in the printing
andrewwinters5000 Apr 5, 2022
2f460af
exercise empty undo/redo outputs
andrewwinters5000 Apr 5, 2022
3a6a4ed
remove extraneous logic in curve point(s) computation
andrewwinters5000 Apr 5, 2022
4fe6a5d
throw error is parametric equation does not have an equal sign
andrewwinters5000 Apr 5, 2022
72b3ef9
remove extraneous logic from refinementDidChange because the plot opt…
andrewwinters5000 Apr 5, 2022
b96977c
adjust visualization tests. Should cover special logic for automatic …
andrewwinters5000 Apr 5, 2022
c2efc16
add another test for the visualization logic
andrewwinters5000 Apr 5, 2022
a2e7c0b
added test for updating the background grid size
andrewwinters5000 Apr 5, 2022
89b79a5
add proper error throwing for the background grid queries
andrewwinters5000 Apr 5, 2022
bad6321
small cleanup of the test files
andrewwinters5000 Apr 5, 2022
8bb3249
Catch a typo
DavidAKopriva Apr 5, 2022
9c150b3
comment out docstring of duplicateCurve
andrewwinters5000 Apr 6, 2022
d3674fe
add the unRegisterForNotification function back in and test it
andrewwinters5000 Apr 6, 2022
8eea84f
Change Curve labeling
DavidAKopriva Apr 6, 2022
73f74a8
update comment in background tests
andrewwinters5000 Apr 6, 2022
330c95d
adjust how the project name is set in openProject from a control file…
andrewwinters5000 Apr 7, 2022
94b4c3e
update authors in the docs
andrewwinters5000 Apr 7, 2022
f636891
adjust spacing in the cheatsheet
andrewwinters5000 Apr 7, 2022
4019f3f
spacing in cheat sheet
andrewwinters5000 Apr 7, 2022
903f3f8
wrap commands in a code environment
andrewwinters5000 Apr 7, 2022
ac8b27c
remove any tabs from CheatSheet spacing
andrewwinters5000 Apr 7, 2022
5c90798
remove tabs, adjust spacing, introduce code environments, and adjust …
andrewwinters5000 Apr 7, 2022
bf04082
add cleanup of preview docs
andrewwinters5000 Apr 7, 2022
28d1699
switch to three spaces for indent. Renders better with githubs markdown
andrewwinters5000 Apr 7, 2022
132cf2d
add quotes to certain code pieces as suggested in review
andrewwinters5000 Apr 7, 2022
2dc2fe4
typo fixes float64 to Float64
andrewwinters5000 Apr 7, 2022
3af695a
make global arrayRegex type stable
andrewwinters5000 Apr 7, 2022
bf52aa7
change Int64 to Int
andrewwinters5000 Apr 7, 2022
cf173d6
use Perl style string concatenation for literals
andrewwinters5000 Apr 7, 2022
4c5e035
Remove dependency of Printf with Perl style concatenation
andrewwinters5000 Apr 7, 2022
38343ea
set constants for better type stability
andrewwinters5000 Apr 8, 2022
df2cb4e
export plotting constants for better user experience
andrewwinters5000 Apr 8, 2022
d83af6e
adjust includes. Now only the main module has them
andrewwinters5000 Apr 8, 2022
e3b8555
adjust spacing throughout between functions to make code easier to read
andrewwinters5000 Apr 8, 2022
652df2c
add proper warnings for undefined status types or unjoined curves
andrewwinters5000 Apr 8, 2022
a3b4943
int types change
andrewwinters5000 Apr 8, 2022
57f3c17
add compat for AbaqusReader to testing Project toml
andrewwinters5000 Apr 12, 2022
e640d8f
update the global license
andrewwinters5000 Apr 12, 2022
e57c590
remove license from the individual files
andrewwinters5000 Apr 12, 2022
08b0edb
Update src/Curves/CurveOperations.jl
DavidAKopriva Apr 12, 2022
3710c10
Edit documentation
DavidAKopriva Apr 12, 2022
96260d9
Update ControlFileOperations.jl
DavidAKopriva Apr 12, 2022
d9cfb63
Add routines to check integrity of boundary curves
DavidAKopriva Apr 13, 2022
7f52b2e
add some comments as suggested in review
andrewwinters5000 Apr 14, 2022
5ef8283
add tests for the internal modelCurvesAreOK function
andrewwinters5000 Apr 14, 2022
ea26a68
throw an error if one tries to remove an outer boundary curve that is…
andrewwinters5000 Apr 14, 2022
7d6b076
dummy commit testing GitHub for Andrew
ranocha Apr 14, 2022
4c753f9
switch off demo tests
andrewwinters5000 Apr 14, 2022
468e8fb
Changes to curve adding behavior
DavidAKopriva Apr 16, 2022
91c57ea
properly export the examples folder
andrewwinters5000 Apr 14, 2022
b48611e
move runDemo into an external example script
andrewwinters5000 Apr 14, 2022
8be0539
remove demo tests from test folder
andrewwinters5000 Apr 15, 2022
5eb27e6
small patch to throw an error in new chain creation
andrewwinters5000 Apr 16, 2022
839d7c7
fix new error to be more general
andrewwinters5000 Apr 16, 2022
0d6eafd
add a few tests for new interactive example files; replacing the func…
andrewwinters5000 Apr 16, 2022
b292b6d
adjust test for new strategy of adding curves in arbitrary order
andrewwinters5000 Apr 16, 2022
51dacf8
automatically update the file names if the mesh format changes
andrewwinters5000 Apr 20, 2022
b236f5c
bug fix in model curves check.
andrewwinters5000 Apr 22, 2022
c83e86d
improve comments in ice cream cone example file
andrewwinters5000 Apr 22, 2022
f6ef83f
move demos out of library and into example files
andrewwinters5000 Apr 22, 2022
b72a013
add new example file with staight-sided outer boundary
andrewwinters5000 Apr 22, 2022
79999ea
update header of new two circle example
andrewwinters5000 Apr 22, 2022
955dc20
add another example file with splines
andrewwinters5000 Apr 22, 2022
08968d9
better spacing
andrewwinters5000 Apr 22, 2022
96254d3
add proper plotting logic and output statements for the user
andrewwinters5000 Apr 29, 2022
1d2eb46
fix comment in two circles example
andrewwinters5000 Apr 29, 2022
d641654
remove unnecessary tests
andrewwinters5000 May 2, 2022
9442d40
Bump compat of CairoMakie in the testing Project.toml
andrewwinters5000 Jun 15, 2022
741fe41
update docstrings
andrewwinters5000 Jun 15, 2022
03834ae
update more docstrings
andrewwinters5000 Jun 16, 2022
2db2d2e
no longer export examples_dir to avoid warning / confusion
andrewwinters5000 Jun 16, 2022
111cb8a
Update documentation with HQMTool (#17)
andrewwinters5000 Jun 23, 2022
dd29e70
remove unnecessary part of github docs
andrewwinters5000 Jun 23, 2022
1675a08
further cleanup of exporting
andrewwinters5000 Jun 23, 2022
1907598
update tests
andrewwinters5000 Jun 23, 2022
dde3e22
add creation of output folder if not present
andrewwinters5000 Jun 23, 2022
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
Prev Previous commit
Next Next commit
add a few tests for new interactive example files; replacing the func…
…tions
  • Loading branch information
andrewwinters5000 committed Apr 16, 2022
commit 0d6eafdcdfa4d94a7a3bcd47075abc89ea47a125
119 changes: 66 additions & 53 deletions docs/src/HQMTool.md
Original file line number Diff line number Diff line change
@@ -24,62 +24,75 @@ HQMTool is an API to generate a quad (Future:Hex) mesh using Julia. It serves as

## Introduction

HQMTool is an API to build quad/hex meshes. Three 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
```
run_demo("out")
HQMTool is an API to build quad/hex meshes. Several examples 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 HQMTool and then trailing information
will indicate what that interactive demonstrates. For instance, the file `interactive_splines.jl`
provides an interactive project that creates an manipulates splines for the inner boundaries before
generating the mesh.

Below we highlight three fundamental scripts that demonstrate the functionality of HQMTool. More in depth
explanations of the functionality is provided in the tutuorials TODO: ADD LINK

First is a basic example script that reads in an existing control file from the HOHQMesh examples collection.
To run that example, execute
```julia
include("interactive_from_control_file.jl")
```
where `"out"` specifies the folder where the resulting mesh and TecPlot files will be saved.
This command will create mesh and plot files in the `out` directory.

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 "verbose" version of the script is given below.
The second example `interactive_outer_boundary.jl` builds a new project consisting of an outer,
circular boundary, and an inner boundary in the shape of an ice cream cone.
The "verbose" example script, where all functions arevalled with their full name, is given below.
```julia
function ice_cream_cone_verbose_demo(folder::String; called_by_user=true)
#
# Create a project with the name "IceCreamCone", which will be the name of the mesh, plot and stats files,
# written to `folder`. The keyword arguement `called_by_user` is there for testing purposes.
#
p = newProject("IceCreamCone", folder)
#
# Outer boundary
#
circ = newCircularArcCurve("outerCircle", [0.0,-1.0,0.0], 4.0, 0.0, 360.0, "degrees")
addCurveToOuterBoundary!(p, circ)
#
# Inner boundary
#
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])
addCurveToInnerBoundary!(p, cone1, "IceCreamCone")
addCurveToInnerBoundary!(p, iceCream, "IceCreamCone")
addCurveToInnerBoundary!(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.5,0.5,0.0])

if called_by_user
#
# Show the model and grid
#
plotProject!(p, MODEL+GRID)
println("Press enter to continue and generate the mesh")
readline()
end
#
# Generate the mesh and plot
#
generate_mesh(p)

return p
end
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

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])
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])

# To plot the project model curves and the background grid, type `using GLMakie`
# in the REPL session, uncomment this line, and rerun this script

# plotProject!(p, MODEL+GRID)

# 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 sucessfully 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.
56 changes: 56 additions & 0 deletions examples/interactive_outer_boundary.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Interactive mesh with an outer boundary constructed by a user
#
# Create a circular outer boundary and an inner ice cream cone shaped boundary
# consisting of three curves, lay a background grid and generate a HOHQMesh
# directly from the project object.
#
# Keywords: outer boundary chain, inner boundary chain, verbose commands

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

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])
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])

# To plot the project model curves and the background grid, type `using GLMakie`
# in the REPL session, uncomment this line, and rerun this script

# plotProject!(p, MODEL+GRID)

# 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 sucessfully generates mesh statistics, such as the number of corner nodes,
# the number of elements etc., are printed to the REPL
86 changes: 43 additions & 43 deletions src/HOHQMesh.jl
Original file line number Diff line number Diff line change
@@ -360,50 +360,50 @@ include("Mesh/Meshing.jl")
# end


function ice_cream_cone_verbose_demo(folder::String; called_by_user=true)
#
# Create a project with the name "IceCreamCone", which will be the name of the mesh, plot and stats files,
# written to `folder`.
#
p = newProject("IceCreamCone", folder)
#
# Outer boundary
#
circ = newCircularArcCurve("outerCircle", [0.0,-1.0,0.0], 4.0, 0.0, 360.0, "degrees")
addCurveToOuterBoundary!(p, circ)
#
# Inner boundary
#
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])
addCurveToInnerBoundary!(p, cone1, "IceCreamCone")
addCurveToInnerBoundary!(p, iceCream, "IceCreamCone")
addCurveToInnerBoundary!(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.5,0.5,0.0])
#
# Show the model and grid
#
plotProject!(p, MODEL+GRID)
println("Press enter to continue and generate the mesh")
if called_by_user
readline()
end
#
# Generate the mesh and plot
#
generate_mesh(p)
# function ice_cream_cone_verbose_demo(folder::String; called_by_user=true)
# #
# # Create a project with the name "IceCreamCone", which will be the name of the mesh, plot and stats files,
# # written to `folder`.
# #
# p = newProject("IceCreamCone", folder)
# #
# # Outer boundary
# #
# circ = newCircularArcCurve("outerCircle", [0.0,-1.0,0.0], 4.0, 0.0, 360.0, "degrees")
# addCurveToOuterBoundary!(p, circ)
# #
# # Inner boundary
# #
# 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])
# addCurveToInnerBoundary!(p, cone1, "IceCreamCone")
# addCurveToInnerBoundary!(p, iceCream, "IceCreamCone")
# addCurveToInnerBoundary!(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.5,0.5,0.0])
# #
# # Show the model and grid
# #
# plotProject!(p, MODEL+GRID)
# println("Press enter to continue and generate the mesh")
# if called_by_user
# readline()
# end
# #
# # Generate the mesh and plot
# #
# generate_mesh(p)

return p
end
# return p
# end


function ice_cream_cone_demo(folder::String; called_by_user=true)
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -68,6 +68,9 @@ include("test_model.jl")
# HQMTool project test routines
include("test_hqmtool_project.jl")

# HQMTool interactive examples available in examples folder
include("test_examples.jl")

# HQMTool project + visualzation test routines
include("test_project_with_viz.jl")

22 changes: 22 additions & 0 deletions test/test_examples.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module TestInteractiveExamples

using HOHQMesh
using Test

# We use CairoMakie to avoid some CI-related issues with GLMakie. CairoMakie can be used
# as a testing backend for HQMTool's Makie-based visualization.
#using CairoMakie

@testset "Interactive Examples Tests" begin

test_file = joinpath(examples_dir(), "interactive_from_control_file.jl")
include(test_file)
@test p.name == "AllFeatures"

test_file = joinpath(examples_dir(), "interactive_outer_boundary.jl")
include(test_file)
@test p.name == "IceCreamCone"

end

end #module