HOHQMesh.jl API

HOHQMesh.add!Method
add!(proj::Project, crv::Dict{String,Any}, boundaryName::String)

Add a curve to the inner boundary named boundaryName.

source
HOHQMesh.add!Method
add!(proj::Project, obj::Dict{String,Any})

Add a curve to the outer boundary or a refinement reion to the project

source
HOHQMesh.addBackgroundGrid!Method
addBackgroundGrid!(proj::Project, x0::Array{Float64}, dx::Array{Float64}, N::Array{Int})

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

addBackgroundGrid!(proj::Project, box::Array{Float64},  N::Array{Int} )

is a lot easier to use.

TODO: Change HOHQMesh and delete this way to specify the domain and use the bounding box one instead.

source
HOHQMesh.addBackgroundGrid!Method
addBackgroundGrid!(proj::Project, box::Array{Float64},  N::Array{Int} )

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.

source
HOHQMesh.addBackgroundGrid!Method
addBackgroundGrid(proj::Project, bgSize::Array{Float64})

Add 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.

source
HOHQMesh.addCurveToInnerBoundary!Method
addCurveToInnerBoundary!(proj::Project, crv::Dict{String,Any}, boundaryName::String)

Add a curve to the inner boundary with name boundaryName. If an inner boundary of that name does not exist, one is created.

source
HOHQMesh.addCurveToOuterBoundary!Method
addCurveToOuterBoundary!(proj::Project, crv::Dict{String,Any})

Add a curve to the outer boundary. The curves must be added in order counter-clockwise

source
HOHQMesh.addObserverMethod
addObserver(observer::Any, note::String, f::Any)

f is the function to be executed (called) when a notification of name note is given.

The function called upon notification must have the signature f(observer, sender, args...)

source
HOHQMesh.addOuterBoundary!Method
addOuterBoundary!(proj::Project, outerBoundary::Dict{String,Any})

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.

source
HOHQMesh.addRunParameters!Function
addRunParameters!(proj::Project,
                  plotFormat::String     = "skeleton",
                  meshFileFormat::String = "ISM-V2",
                  polynomialOrder::Int   = 5)

Add a RUN_PARAMETERS block and set all the parameters in one call.

source
HOHQMesh.addSpringSmoother!Function
addSpringSmoother!(status::String, type::String, nIterations::Int)

Status is either ON or OFF Type is either LinearSpring or LinearAndCrossbarSpring

source
HOHQMesh.bboxUnionMethod
bboxUnion(box1::Array{Float64}, box2::Array{Float64})

Returns the union of two bounding boxes

source
HOHQMesh.curveBoundsMethod

curveBounds(crvPoints::Array{Float64,2})

Find the bounds of a single curve, discretized as an array

source
HOHQMesh.emptyBoundsMethod
emptyBounds()

Returns an array that will always be ignored when unioned with another bounding box.

source
HOHQMesh.extract_mesh_file_formatMethod
extract_mesh_file_format(control_file)

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.

source
HOHQMesh.generate_meshMethod
generate_mesh(control_file;
              output_directory="out",
              mesh_filename=nothing, plot_filename=nothing, stats_filename=nothing,
              verbose=false, subdivision_maximum=8)

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.

source
HOHQMesh.generate_meshMethod
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 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.

source
HOHQMesh.getArcCenterMethod
getArcCenter(crv::Dict{String,Any}, point::Array{Float64})

Get the center of a circular arc as an array

source
HOHQMesh.getArcUnitsMethod
getArcUnits(crv::Dict{String,Any}, units::String)

Get the units for the start and end angles of a circular arc curve.

source
HOHQMesh.getCurveMethod

getCurve(proj::Project, curveName::String, boundaryName::String)

Get the curve named curveName from the inner boundary named boundaryName

source
HOHQMesh.getCurveMethod

getCurve(proj::Project, curveName::String)

Get the curve with name curveName from the outer boundary.

source
HOHQMesh.getCurveTypeMethod
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.
source
HOHQMesh.getEndPointMethod
getEndPoint(crv::Dict{String,Any}, point::Array{Float64})

Get the end point for a line curve as an array.

source
HOHQMesh.getNameMethod
getName(proj::Project)

Returns the filename to be used by the mesh, plot, control, and stats files.

source
HOHQMesh.getRefinementGridSizeMethod
getRefinementGridSize(r::Dict{String,Any})

Returns the grid size,h, as Float64. r is the dictionary that represents the refinement region.

source
HOHQMesh.getRefinementLocationMethod
getRefinementLocation(r::Dict{String,Any})

Return Array{Float64} of the location of the refinement center.r is the dictionary that represents the refinement region.

source
HOHQMesh.getRefinementNameMethod
getRefinementName(r::Dict{String,Any})

Return name of the refinement. r is the dictionary that represents the refinement region.

source
HOHQMesh.getRefinementRegionMethod
getRefinementRegion(proj::Project, indx)

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.

source
HOHQMesh.getRefinementRegionMethod
(i,r) = getRefinementRegion(project, name)

Get the refinement region with the given name and its location in the list of refinement regions.

source
HOHQMesh.getRefinementStartMethod
getRefinementStart  (r::Dict{String,Any})

Return Array{Float64} of the start location of the refinement line. r is the dictionary that represents the refinement region.

source
HOHQMesh.getRefinementTypeMethod
getRefinementType(r::Dict{String,Any})

Return the type of refinement, either "smooth" or "sharp". r is the dictionary that represents the refinement region.

source
HOHQMesh.getRefinementWidthMethod
getRefinementWidth(r::Dict{String,Any})

Returns the region width,w, as Float64. r is the dictionary that represents the refinement region.

source
HOHQMesh.getStartPointMethod
getStartPoint(crv::Dict{String,Any}, point::Array{Float64})

Get the start point for a line curve as an array

source
HOHQMesh.innerBoundaryIndicesMethod
innerBoundaryIndices(proj::Project, curveName::String)

Returns (curveIndex,chainIndex) for the location of the curve named curveName in it's inner boundary chain.

source
HOHQMesh.insertInnerBoundaryCurveAtIndex!Method
insertInnerBoundaryCurveAtIndex!(proj::Project, crv::Dict{String,Any},
                                 indx::Int, boundaryName::String)

Insert a curve crv into an inner boundary chain boundaryName at the specified index indx.

source
HOHQMesh.modelChainIsOKMethod
modelChainIsOK(chain::Vector{Dict{String, Any}}, chainName::String)

Returns true if the chain of curves is contiguous and closed; false otherwise.

source
HOHQMesh.modelCurvesAreOKMethod
modelCurvesAreOK(proj::Project)

Go through all curves in the model and make sure they are connected and closed. Also, remove any empty outer / inner boundary chains.

Returns true if all curves are connected and closed, false otherwise.

source
HOHQMesh.newFunction
new(name::String,
    center::Array{Float64},
    radius::Float64,
    startAngle::Float64,
    endAngle::Float64,
    units::String)

Create a new circular arc.

source
HOHQMesh.newFunction
new(name::String,
    xEqn::String,
    yEqn::String,
    zEqn::String = "z(t) = 0.0" )

Create a new parametric equation curve.

source
HOHQMesh.newMethod
new(name::String,
         xStart::Array{Float64},
         xEnd::Array{Float64})

Create a new line defined by its end points.

source
HOHQMesh.newMethod
new(name::String, nKnots::Int, data::Matrix{Float64})

Create a spline curve from an array of knots

source
HOHQMesh.newMethod
new(name::String, dataFile::String)

Create a spline curve from the contents of a data file.

source
HOHQMesh.newCircularArcCurveFunction
newCircularArcCurve(name::String, center::Array{Float64},
    startAngle::Float64, endAngle::Float64,
    units::String)

Creates and returns a new circular arc curve in the form of a Dictionary

source
HOHQMesh.newEndPointsLineCurveMethod
newEndPointsLineCurve(name::String, xStart::Array{Float64},xEnd::Array[Float64])

Creates and returns a new curve defined by its end points in the form of a Dictionary

source
HOHQMesh.newParametricEquationCurveFunction
newParametricEquationCurve(name::String,
                           xEqn::String,
                           yEqn::String,
                           zEqn::String = "z(t) = 0.0" )

Creates and returns a new parametricEquationCurve in the form of a Dictionary

source
HOHQMesh.newProjectMethod
newProject(name::String, folder::String)

Create a new project with the given name. That name will be used for the mesh and plot files in the specified folder.

source
HOHQMesh.newRefinementCenterMethod
newRefinementCenter(name, type,
                    center, meshSize,
                    width)

Create refinement center of type "smooth" or "sharp" centered at center = [x,y,z] with a mesh size meshSize spread over a radius width.

source
HOHQMesh.newRefinementLineMethod
newRefinementLine(name, type,
                  start, end,
                  meshSize,
                  width)

Create 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.

source
HOHQMesh.newSplineCurveMethod
newSplineCurve(name::String, nKnots::Int, data::Array{Float64,4})

Returns a spline curve given the number of knots and the array of knots.

source
HOHQMesh.newSplineCurveMethod
newSplineCurve(name::String, dataFile::String)

Returns a spline curve given a data file that contains the number of knots on the first line, and the spline data following that.

source
HOHQMesh.openProjectMethod
openProject(fileName::String, folder::String)

Open existing project described in the control File.

folder   = folder the control file is in
fileName = the name of the file
source
HOHQMesh.plotProject!Function
plotProject!(proj::Project, plotOptions::Int = 0)

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

source
HOHQMesh.remove!Method
remove!(proj::Project, curveName::String, innerBoundaryName::String)

Delete the curve named curveName from the inner boundary named innerBoundaryName

source
HOHQMesh.remove!Method
remove!(proj::Project, curveName::String)

Delete the curve named curveName from the outer boundary

source
HOHQMesh.remove_mesh!Method
remove_mesh!(proj::Project)

Remove the mesh file, control file, plot file, and stats file from proj.projectDirectory and delete the mesh from the plot.

source
HOHQMesh.renameCurve!Method
renameCurve!(proj::Project, oldName::String, newName::String)

Any curve(s) on the outer boundary or in the inner boundary chain(s) with oldName are renamed with newName.

source
HOHQMesh.saveProjectMethod
saveProject(proj::Project)

proj     = Project to be saved

Save a project dictionary to the file path specified when the project was created.

source
HOHQMesh.setArcUnits!Method
setArcUnits(crv::Dict{String,Any}, units::String)

Set the units for the start and end angles of a circular arc curve.

source
HOHQMesh.setBackgroundGridSize!Method
setBackgroundGridSize!(proj::Project, dx::Array{Float64}, key::String)

Set the grid size dx of an existing background grid within proj. Here, dx is passed an array.

source
HOHQMesh.setBackgroundGridSize!Method
setBackgroundGridSize!(proj::Project, dx::Float64, dy::Float64, key::String)

Set 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.

source
HOHQMesh.setBackgroundGridSteps!Method
setBackgroundGridSteps!(proj::Project, N::Array{Int})

Set how many steps of size setBackgroundGridSpacing in each direction the background grid extends from the lower left.

source
HOHQMesh.setMeshFileFormat!Method
setMeshFileFormat(proj::Project, meshFileFormat::String)

Set the file format for the mesh file. Acceptable choices are "ISM", "ISM-V2", or "ABAQUS".

source
HOHQMesh.setName!Method
setName(proj::Project,name::String)

The 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.

source
HOHQMesh.setPlotFileFormat!Method
setPlotFileFormat(proj::Project, plotFileFormat::String)

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.

source
HOHQMesh.setRefinementGridSize!Method
setRefinementGridSize!(r::Dict{String,Any}, h)

Set the grid size, h for the refinement region. r is the dictionary that represents the refinement region.

source
HOHQMesh.setRefinementName!Method
setRefinementName!(r::Dict{String,Any}, type)

Set a name for the refinement region.r is the dictionary that represents the refinement region.

source
HOHQMesh.setRefinementWidth!Method
setRefinementWidth!(r::Dict{String,Any}, width)

Set the width of the refinement region. r is the dictionary that represents the refinement region.

source
HOHQMesh.setXEqn!Method
setXEqn!(parametricEquationCurve, eqn)

For a parametric equation, set the x-equation.

source
HOHQMesh.setYEqn!Method
setYEqn!(parametricEquationCurve, eqn)

For a parametric equation, set the y-equation.

source
HOHQMesh.setZEqn!Method
setZEqn!(parametricEquationCurve, eqn)

For a parametric equation, set the zEqn-equation.

source
HOHQMesh.updatePlot!Function
updatePlot!(proj::Project, plotOptions::Int)

Replot with the new plotOptions = combinations (sums) of

GRID, MESH, MODEL, REFINEMENTS

Example: updatePlot!(p, MESH + MODEL)

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

source