diff --git a/docs/src/interactive_overview.md b/docs/src/interactive_overview.md index bf0b9913..90c2757f 100644 --- a/docs/src/interactive_overview.md +++ b/docs/src/interactive_overview.md @@ -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 diff --git a/src/HOHQMesh.jl b/src/HOHQMesh.jl index be12d676..99c1daa6 100644 --- a/src/HOHQMesh.jl +++ b/src/HOHQMesh.jl @@ -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 @@ -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 diff --git a/src/Mesh/Meshing.jl b/src/Mesh/Meshing.jl index 088db3d4..17c0ece2 100644 --- a/src/Mesh/Meshing.jl +++ b/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 @@ -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