Parametric structure generators
A family of one-line generators (absorbed from AsapToolkit) builds, loads, and solves common structural typologies — handy for testing, benchmarking, and optimization studies:
sec = Section(Steel_kNm, 1e-3, 1e-6, 1e-6, 1e-6)
truss = Warren2D(11, 1.5, 2.0, sec; load = [0.0, -20.0, 0.0]) # 2D Warren arch
grid = SpaceFrame(6, 1.2, 6, 1.2, 1.0, sec; support = :corner) # double-layer grid
# variable-depth spaceframe: any callable surface(u, v) on [0,1]² sets the top layer
vault = SpaceFrame(6, 1.2, 6, 1.2, 1.0, (u, v) -> 0.5 * sinpi(u) * sinpi(v), sec)
# every generator returns a solved model plus its generation parameters
maximum(abs, truss.model.results.u)0.02797570579500178# 3D building frame: columns, primary beams, joists (with releases), braces
fsec = Section(Steel_kNm, 1e-2, 1e-4, 5e-5, 1e-6)
bldg = Frame(2, 6.0, 2, 5.0, 2, 4.0, 2.0, fsec, fsec, fsec, fsec)Frame (parametric structure generator)
model = Model: 39 nodes, 78 elements (solved)
nx = 2
dx = 6.0
ny = 2
dy = 5.0
nz = 2
dz = 4.0
joistSpacing = 2.0
columnSection = Section (EA = 2.0e6)
primarySection = Section (EA = 2.0e6)
joistSection = Section (EA = 2.0e6)
braceSection = Section (EA = 2.0e6)
columnRelease = fixedfixed
primaryRelease = fixedfixed
joistRelease = joist
braceRelease = freefree
columnPsi = 0.0
primaryPsi = 1.5707963267948966
joistPsi = 1.5707963267948966
base = [0.0, 0.0, 0.0]
iExteriorXnodes = 18 array (index bookkeeping)
iExteriorYnodes = 18 array (index bookkeeping)
iExteriorXjoists = 8 array (index bookkeeping)
iExteriorYprimaries = 16 array (index bookkeeping)
access the solved structure via the model/network field# ground structures for layout optimization: dense candidate grids → models
gs = XGroundStructure(6.0, 4, 4.0, 3)
candidates = to_truss(gs, sec; load = [1.0, 0.0, 0.0])Model
12 nodes, 29 elements (0 frame, 29 truss)
2 loads, 0 nodal springs
processed: 4 free / 56 fixed / 12 inactive DOFs
solved (see model.results)The full set: Warren2D, Pratt2D, BakerTruss, TrussFrame, SpaceFrame, SpaceFrameBeam, Frame, GridFrame, GridNetwork (FDM), and the XGroundStructure / DenseGroundStructure / BoundedGroundStructure family with to_truss / to_frame.