Reference

This section describes the API in detail.

Main Struct

DegenGeom

VSPGeom.VSPComponentType
VSPComponent(name::String)

Parameters defining the VSPComponent object.

Arguments

  • name::String: Name
  • type::String: Type
  • GeomID::String: Geometry ID
  • SurfNdx::Int: Surface index
  • MainSurfNdx::Int: Main surface index
  • SymCopyNdx::Int: Symmetry copy index
  • surface_node::DataFrame: Surface node DegenGeom
  • surface_face::DataFrame: Surface face DegenGeom
  • plate::DataFrame: Plate DegenGeom
  • stick_node::DataFrame: Stick node DegenGeom
  • stick_face::DataFrame: Stick face DegenGeom
  • point::DataFrame: Point DegenGeom
VSPGeom.readDegenGeomFunction
readDegenGeom(filename::String; verbose::Bool=false)

Read DegenGeom CSV file written out by OpenVSP to obtain geometry and components.

Arguments

  • filename::String: DegenGeom filename
  • verbose::Bool: Set to true to print status messages during file read operation

Returns

VSPGeom.degenGeomSizeFunction
degenGeomSize(degenGeom::DataFrame)

Get size of the 2d mesh data structure that describes the degenerate geometry. This is different from the DataFrame size obtained using size(degenGeom) which is the number of variables and total number of points in the DataFrame.

Arguments

  • degenGeom::DataFrame: One of the degenGeom inside the VSPComponent object

Returns

  • nx::Int: Usually represents the number of cross-sections, referred to as Xsecs in OpenVSP
  • ny::Int: Usually represents the number of points in each cross-section in OpenVSP

STL

VSPGeom.TriMeshType
TriMesh(name::String)
  • name::String: Name
  • ncells::Int: No. of cells
  • normals::Vector{Vector{Float64}}: Vector of normals for each cell
  • zeroBased::Vector{Bool}: If true, indices in connectivity information have zero-based indexing. A vector to make it mutable.
  • points::Vector{Vector{Float64}}: Vector of unique points
  • cells::Vector{Vector{Int}}: Vector of vertices for each cell as indices of points
VSPGeom.readSTLFunction
readSTL(filename::String; verbose::Bool=false, tol::Float64=eps(Float64), zeroBased::Bool=false)

Read STL file to obtain geometry. This function can also handle the non-standard Tagged Multi Solid file type that OpenVSP writes out. Connectivity information for the mesh is not available at present.

Arguments

  • filename::String: STL filename
  • verbose::Bool: Set to true to print status messages during file read operation
  • tol::Float64: Set absolute tolerance when comparing points to obtain connectivity
  • zeroBased::Bool: Set true to use zero-based numbering for indices in connectivity information

Returns

VSPGeom.getVerticesFunction
getVertices(mesh::TriMesh, icell::Int)

Obtain vertices of a cell from a mesh

Arguments

  • mesh::TriMesh: TriMesh object
  • icell::Int: Index of queried cell

Returns

  • vtxs: Vector containing the 3 vertices of the queried cell
VSPGeom.setZeroBased!Function
setZeroBased!(mesh::TriMesh; value::Bool=true)

Set connectivity information to be 0 or 1 based numbering.

Arguments

  • mesh::TriMesh: TriMesh object
  • value::Bool: Value of the variable zeroBased. Set true to use zero-based numbering
VSPGeom.getVTKElementsFunction
getVTKElements(mesh::TriMesh)

Convenience function that returns the datastructures points and cells required to write to a VTK file using the WriteVTK package. The user may write out a VTK file using,

WriteVTK.vtk_grid(filename, points, cells) do vtk
end

Arguments

Returns

  • points::Array{Float64}: Array of coordinates in the STL mesh
  • mesh::Array{meshCell}: Array of MeshCell objects that WriteVTK uses