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.addObserver — Method
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.bboxUnion — Method
bboxUnion(box1::Array{Float64}, box2::Array{Float64})

Returns the union of two bounding boxes

source
HOHQMesh.curveBounds — Method

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

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

source
HOHQMesh.emptyBounds — Method
emptyBounds()

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

source
HOHQMesh.extract_mesh_file_format — Method
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_mesh — Method
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_mesh — Method
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.getArcRadius — Function
getArcRadius(arc::Dict{String,Any}, key::String = "radius")

Returns the current radius of an arc. Default behavior expects a CIRCULAR_ARC with key = "radius". For an ELLIPTIC_ARC use either key = "xRadius" or key = "yRadius".

source
HOHQMesh.getArcUnits — Method
getArcUnits(crv::Dict{String,Any})

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

source
HOHQMesh.getCurve — Method

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

Get the curve named curveName from the inner boundary named boundaryName

source
HOHQMesh.getCurve — Method

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

Get the curve with name curveName from the outer boundary.

source
HOHQMesh.getCurveType — Method
getCurveType(crv::Dic{String,Any})

Get the type of the curve stored in crv. Generic for any curve dictionary END_POINTSLINE_CURVE, PARAMETRIC_EQUATION_CURVE, SPLINE_CURVE, CIRCULAR_ARC, or ELLIPTIC_ARC as a string.

source
HOHQMesh.getInnerBoundaryChainConnect — Method
getInnerBoundaryChainConnect(proj::Project, chainName::String)

Returns the current connect setting for the boundary curve optimization of an inner boundary CHAIN with chainName.

source
HOHQMesh.getInnerBoundaryChainContinuity — Method
getInnerBoundaryChainContinuity(proj::Project, chainName::String)

Returns the current continuity (number of continuous derivatives) for the boundary curve optimization of an inner boundary CHAIN with chainName.

source
HOHQMesh.getInnerBoundaryChainTolerance — Method
getInnerBoundaryChainTolerance(proj::Project, chainName::String)

Returns the current tolerance for the boundary curve optimization of an inner boundary CHAIN with chainName.

source
HOHQMesh.getName — Method
getName(proj::Project)

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

source
HOHQMesh.getOuterBoundaryContinuity — Method
getOuterBoundaryContinuity(proj::Project)

Returns the current continuity (number of continuous derivatives) for the boundary optimization of the outer boundary chain.

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

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

source
HOHQMesh.getRefinementLocation — Method
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.getRefinementName — Method
getRefinementName(r::Dict{String,Any})

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

source
HOHQMesh.getRefinementRegion — Method
getRefinementRegion(proj::Project, index)

Get the refinement region with index, index from the project. Returns nothing if there is none. The return value is a dictionary that represents the refinement region.

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

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

source
HOHQMesh.getRefinementStart — Method
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.getRefinementType — Method
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.getRefinementWidth — Method
getRefinementWidth(r::Dict{String,Any})

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

source
HOHQMesh.getSplinePoints — Method
getSplinePoints(spline::Dict{String,Any})

Return the parametric spline point data from the spline curve dictionary.

source
HOHQMesh.getXEqn — Method
getXEqn(crv::Dict{String,Any})

Return the expression for the x(t) equation of a PARAMETRIC_EQUATION_CURVE.

source
HOHQMesh.getYEqn — Method
getYEqn(crv::Dict{String,Any})

Return the expression for the y(t) equation of a PARAMETRIC_EQUATION_CURVE.

source
HOHQMesh.getZEqn — Method
getZEqn(crv::Dict{String,Any})

Return the expression for the z(t) equation of a PARAMETRIC_EQUATION_CURVE.

source
HOHQMesh.innerBoundaryIndices — Method
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},
                                 index::Int, boundaryName::String)

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

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

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

source
HOHQMesh.modelCurvesAreOK — Method
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.new — Function
new(name::String,
    xEqn::String,
    yEqn::String,
    zEqn::String = "z(t) = 0.0" )

Create a new parametric equation curve.

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

Create a new circular arc.

source
HOHQMesh.new — Function
new(name::String,
    center::Array{Float64},
    xradius::Float64,
    yradius::Float64,
    startAngle::Float64,
    endAngle::Float64,
    rotation::Float64,
    units::String)

Create a new elliptic arc.

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

Create a new line defined by its end points.

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

Create a spline curve from an array of knots

source
HOHQMesh.new — Method
new(name::String, dataFile::String)

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

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

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

source
HOHQMesh.newEllipticArcCurve — Function
newEllipticArcCurve(name::String, center::Array{Float64},
                    xRadius::Float64, yRadius::Float64,
                    startAngle::Float64, endAngle::Float64,
                    rotation::Float64, units::String)

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

source
HOHQMesh.newEndPointsLineCurve — Method
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.newParametricEquationCurve — Function
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.newProject — Method
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.newRefinementCenter — Method
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.newRefinementLine — Method
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.newSplineCurve — Method
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.newSplineCurve — Method
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.openProject — Method
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.saveProject — Method
saveProject(proj::Project)

proj     = Project to be saved

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

source
HOHQMesh.setArcCenter! — Method
setArcCenter!(crv::Dict{String,Any}, point::Array{Float64})

Set the center of a circular or elliptic arc.

source
HOHQMesh.setArcEndAngle! — Method
setArcEndAngle!(arc::Dict{String,Any}, angle::Float64)

Sets a new value for the end angle of a CIRCULAR_ARC or ELLIPTIC_ARC.

source
HOHQMesh.setArcRadius! — Function
setArcRadius!(arc::Dict{String,Any}, radius::Float64, key::String)

Sets a new value for the radius of an arc. Default behavior expects a CIRCULAR_ARC with key = "radius". For an ELLIPTIC_ARC use either key = "xRadius" or key = "yRadius".

source
HOHQMesh.setArcStartAngle! — Method
setArcStartAngle!(arc::Dict{String,Any}, angle::Float64)

Sets a new value for the start angle of a CIRCULAR_ARC or ELLIPTIC_ARC.

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

Set the units for the start and end angles of a circular or elliptic 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.setInnerBoundaryChainConnect! — Method
setInnerBoundaryChainConnect!(proj::Project, chainName::String, connect::String)

Sets the connect setting for the boundary curve optimization of an inner boundary CHAIN with chainName.

By default, boundary curve optimization is done curve by curve within the chain with an "empty" connect = "[]" key, as usually there will be discontinuities (e.g. corners) between the curves. If it is desired to define a more global approximation across multiple curves update the connect key. For example, if the chain has four segments then connect = "2-3" requests that optimization occurs across curve segments two and three in the list, where as curves 1 and 4 are optimized individually.

source
HOHQMesh.setInnerBoundaryChainContinuity! — Method
setInnerBoundaryChainContinuity!(proj::Project, chainName::String, continuity::Int)

Sets the continuity (number of continuous derivatives) for the boundary curve optimization of an inner boundary CHAIN with chainName.

source
HOHQMesh.setInnerBoundaryChainOptimizeStatus! — Method
setInnerBoundaryChainOptimizeStatus!(proj:Project, chainName::String, type::String)

Adjust the type for the boundary curve optimization of an inner boundary CHAIN with chainName. Available types are none, L2Norm, or H1Norm.

source
HOHQMesh.setInnerBoundaryChainTolerance! — Method
setInnerBoundaryChainTolerance!(proj::Project, chainName::String, tolerance::Float64)

Sets the tolerance for the boundary curve optimization of an inner boundary CHAIN with chainName.

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.setOuterBoundaryConnect! — Method
setOuterBoundaryConnect!(proj::Project, connect::String)

Sets the connect setting for the boundary optimization of the outer boundary chain.

By default, boundary curve optimization is done curve by curve within the chain with an "empty" connect = "[]" key, as usually there will be discontinuities (e.g. corners) between the curves. If it is desired to define a more global approximation across multiple curves update the connect key. For example, if the chain has four segments then connect = "2-3" requests that optimization occurs across curve segments two and three in the list, where as curves 1 and 4 are optimized individually.

source
HOHQMesh.setOuterBoundaryContinuity! — Method
setOuterBoundaryContinuity!(proj::Project, continuity::Int)

Sets the continuity (number of continuous derivatives) for the boundary optimization of the outer boundary chain.

source
HOHQMesh.setOuterBoundaryOptimizeStatus! — Method
setOuterBoundaryOptimizeStatus!(proj:Project, type::String)

Adjust the type for the boundary curve optimization for the outer boundary chain. Available types are none, L2Norm, or H1Norm.

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.setSplineNKnots! — Method
setSplineNKnots!(spline::Dict{String,Any}, nKnots::Int)

Set a new value for the number of points (or knots) in a spline.

source
HOHQMesh.setSplinePoints! — Method
setSplinePoints!(spline::Dict{String,Any},points::Array{Float64,4})

Set the parametric spline point data into the spline curve dictionary.

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