TopOpt.jl Tutorials

Interactive, executable examples that walk through complete topology optimization workflows — from problem setup to visualization.

Density-based methods

BESO: Bi-directional Evolutionary Structural Optimization

2D compliance minimization on the HalfMBB beam with problem setup, FEA solver, sensitivity filtering, and BESO algorithm loop.

SIMP: Solid Isotropic Material with Penalization

3D compliance minimization on a cantilever with density filtering, Nonconvex.jl + MMA87, and Makie visualization.

GESO: Genetic Evolutionary Structural Optimization

2D compliance minimization with genetic algorithm — binary encoding, crossover, and mutation for global search.

Continuation SIMP

Penalty ramp (1.0 → 5.0) for improved convergence on cantilever, Half MBB, L-beam, and tie-beam benchmarks.

TOBS: Topological Optimization of Binary Structures

Binary (0/1) topology optimization with sequential linearization and Cbc.jl branch-and-cut for 16,000+ variables.

Comparing Penalty Functions

Power, rational, hyperbolic-sine, and projected penalties: their curves, their effect on gray elements, and parameter sensitivity.

Projected Density Filter

Filter + Heaviside/Sigmoid projection for near-binary designs, with β-continuation and comparison to the plain density filter.

Minimizing Volume Subject to a Compliance Constraint

The dual of compliance minimization: least material for a required stiffness, on continuum cantilevers and 2D/3D trusses.

Level-set method

Level-Set Topology Optimization (OpenLSTO)

Boundary-based optimization with a signed-distance level set: compliance minimization on a cantilever and p-norm stress minimization on an L-beam, using the OpenLSTO port.

Heat conduction

Heat Conduction: Conductivity Tree

Thermal compliance minimization with the classic branching tree benchmark — heat flux on top, fixed temperature at bottom.

Heat Sink with Temperature BCs

Asymmetric temperature BCs (T=100 left, T=0 right), distributed flux from top, and Zygote gradient verification.

Stress and buckling

Global Stress Constraints

Stress-constrained L-bracket with relaxed stress and p-norm/KS/ε-relaxation aggregation. Minimizes volume subject to a global stress constraint, reproducing the classic rounded-corner design.

Local Stress Constraints

Element-wise stress limits using Percival.jl for large-scale constrained optimization with continuation SIMP.

Buckling-Constrained Truss Optimization

Semidefinite programming (SDP) constraints for stability via NonconvexSemidefinite.jl. Enforces K + c·Kσ ≽ 0.

Stochastic and uncertainty

Stochastic Compliance Minimization

Mean and standard-deviation compliance objectives over random load scenarios, exact and randomized (Hutchinson/Hadamard/SVD) trace estimators, and a maximum-compliance-constrained problem solved with the augmented Lagrangian method.

Advanced parametrization

Multi-Material Optimization

Softmax parametrization for distributing 3+ candidate materials with mass constraints and MaterialInterpolation.

Neural Network Parametrization (IPOPT)

4-layer MLP parametrization with feasibility restoration and augmented-Lagrangian refinement using IPOPT.

Neural Network Parametrization (Adam)

6-layer MLP with Adam optimizer and continuation on penalty and constraint aggregation weight.

Fixed Element Regions

Reserve solid/void regions with FixedElementProjectorFun — support and load regions, keep-out zones — and optimize only the free elements.

Simultaneous Analysis and Design (SAND)

Treat displacements as design variables and enforce K u = f as a constraint with the augmented Lagrangian method, using the differentiable assembly blocks.

Truss optimization

Truss Topology Optimization

Compliance minimization on bar structures with JSON-defined geometry, power-law penalization, and MMA87 optimizer.

Mixed-Integer Truss Optimization

Binary (0/1) truss design via Juniper.jl branch-and-bound with IPOPT relaxation — crisp layouts with no intermediate densities.

3D Truss Topology Optimization

Compliance minimization on a 3D space truss with the interactive static browser viewer and camera controls.

Solvers, IO and post-processing

Iterative and Matrix-Free Solvers

DirectSolver vs CGAssemblySolver vs CGMatrixFreeSolver on a 3D problem, with preconditioning and convergence criteria.

Custom Linear Solver and Preconditioner

Define your own linear solver (subtyping AbstractLinearSolver) and a from-scratch Jacobi preconditioner that plugs into the FEASolver interface.

Importing Abaqus INP Files

Import a CAD/FEA mesh from an Abaqus .inp file with InpStiffness and optimize it directly.

Exporting VTK Meshes

Write optimized designs (and heat-conduction temperature fields) as .vtu files for ParaView and other post-processors.

Problem types

Continuum Problem Types

Standard benchmarks: point load cantilever (2D/3D), Half MBB, L-beam, tie-beam, INP import, and defining a custom problem type.

Truss Problem Types

Ground structure via JSON files, programmatic truss cantilever construction, and 2D vs 3D truss differences.


← Back to TopOpt.jl documentation