Skip to content

Commit

Permalink
apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwinters5000 committed Apr 29, 2024
1 parent c87a3ce commit f0dfacc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/src/interactive_overview.md
Expand Up @@ -146,7 +146,7 @@ To generate a mesh interactively you

## Advanced

The `generate_mesh` function has two optional arguments. The first is the logical `verbose`
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
Expand Down
7 changes: 3 additions & 4 deletions src/HOHQMesh.jl
Expand Up @@ -180,7 +180,7 @@ This function returns the output to `stdout` of the HOHQMesh binary when generat
function generate_mesh(control_file;
output_directory="out",
mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing,
verbose=false, subdivision_maximum=8)
verbose=false, subdivision_maximum::Int=8)
@assert isfile(control_file) "'$control_file' is not a valid path to an existing file"

# Determine output filenames
Expand Down Expand Up @@ -230,11 +230,10 @@ function generate_mesh(control_file;
flush(tmpio)

# Run HOHQMesh and store output
str_subdivision_maximum = string(subdivision_maximum)
if verbose
readchomp(`$(HOHQMesh_jll.HOHQMesh()) -sLimit $str_subdivision_maximum -verbose -f $tmppath`)
readchomp(`$(HOHQMesh_jll.HOHQMesh()) -sLimit $subdivision_maximum -verbose -f $tmppath`)
else
readchomp(`$(HOHQMesh_jll.HOHQMesh()) -sLimit $str_subdivision_maximum -f $tmppath`)
readchomp(`$(HOHQMesh_jll.HOHQMesh()) -sLimit $subdivision_maximum -f $tmppath`)
end
end

Expand Down
6 changes: 3 additions & 3 deletions src/Mesh/Meshing.jl
@@ -1,6 +1,6 @@

"""
generate_mesh(proj::Project; verbose::Bool, subdivision_maximum::Integer)
generate_mesh(proj::Project; verbose=false, subdivision_maximum=8)
Generate a mesh from the information stored in a `Project` created using the
interactive mesh functionality. First a check is made
Expand Down Expand Up @@ -40,8 +40,8 @@ function generate_mesh(proj::Project; verbose=false, subdivision_maximum=8)

saveProject(proj)
fileName = joinpath(proj.projectDirectory,proj.name)*".control"
mesherOutput = generate_mesh(fileName, output_directory = proj.projectDirectory,
verbose=verbose, subdivision_maximum=subdivision_maximum)
mesherOutput = generate_mesh(fileName; output_directory = proj.projectDirectory,
verbose, subdivision_maximum)
println(mesherOutput)
postNotificationWithName(proj,"MESH_WAS_GENERATED_NOTIFICATION",(nothing,))
return nothing
Expand Down

0 comments on commit f0dfacc

Please sign in to comment.