TrussTopOptProblems
This sub-module of TopOpt defines truss topology optimization problems and the IO helpers to load truss geometries from JSON or .geo files.
Problem types
TopOpt.TrussTopOptProblems.TrussProblem — Type
TrussProblem(::Val{:Linear}, node_points, elements, loads, fixities, mats, crosssecs)Truss topology optimization problem. Construct from node coordinates, element connectivity, loads, fixities, material and cross-section data. Use load_truss_json to load these from a JSON file.
Material and cross-section containers
TopOpt.TrussTopOptProblems.TrussFEAMaterial — Type
TrussFEAMaterial(E, ν)Material container for truss FEA: Young's modulus E and Poisson's ratio ν.
TopOpt.TrussTopOptProblems.TrussFEACrossSec — Type
TrussFEACrossSec(A)Cross-section container for truss FEA with area A.
Grid
TopOpt.TrussTopOptProblems.TrussGrid — Type
TrussGrid(node_points, elements)Ferrite grid for truss problems, built from node coordinates and element connectivity.
Standard truss test problem
TopOpt.TrussTopOptProblems.PointLoadCantileverTruss — Function
PointLoadCantileverTruss(nels::NTuple{dim,Int}, sizes::NTuple{dim}, E = 1.0, ν = 0.3, force = 1.0; k_connect=1) where {dim, CellType}Inputs
nels: number of elements in each direction, a 2-tuple for 2D problems and a 3-tuple for 3D problemssizes: the size of each element in each direction, a 2-tuple for 2D problems and a 3-tuple for 3D problemsE: Young's modulusν: Poisson's rationforce: force at the center right of the cantilever beam (positive is downward)k_connect: k-ring of a node to connect to form the ground mesh. Defaults to 1. For example, for a 2D domain, a node will be connected to8neighboring nodes ifk_connect=1, and8+16=24neighboring nodes ifk_connect=2.
Returns
TrussProblem
Example
nels = (60,20);sizes = (1.0,1.0);E = 1.0;ν = 0.3;force = 1.0;problem = PointLoadCantileverTruss(nels, sizes, E, ν, force, k_connect=2)IO
TopOpt.TrussTopOptProblems.TrussIO.load_truss_json — Function
load_truss_json(path)Load a 2D/3D truss problem from a JSON file. Returns (node_points, elements, mats, crosssecs, fixities, load_cases). Indices in the JSON are zero-based (Python convention).
TopOpt.TrussTopOptProblems.TrussIO.load_truss_geo — Function
load_truss_geo(path)Load truss geometry from a .geo file. Returns node coordinates and element connectivity.