Written and maintained by CASRAI Editorial Board
Last updated
Topology optimization is a computational design method that decides where material should and should not be placed inside a given design space so that a structure performs as well as possible under stated loads and limits. It is used by engineers and researchers who need to turn a load case into a concept layout, and who need to know which inputs a run depends on.
Short answer
Topology optimization starts from a block of allowable material, applies loads and supports, and lets an algorithm redistribute material to minimize an objective such as compliance (the work done by the applied loads, a measure of flexibility) while respecting a constraint such as a fixed volume fraction. In the widely taught density-based formulation known as SIMP, each point has a density between 0 and 1, and a penalty exponent pushes the result toward solid or void. The output is a concept layout, not a finished part.
Definition and scope
Unlike sizing optimization (changing thicknesses) or shape optimization (moving boundaries), topology optimization can change the connectivity of the design: holes can appear and members can merge or disappear. The DTU TopOpt group, a joint effort of DTU Mechanical Engineering and DTU Compute, describes its work as centred on density-based topology optimization methods, and publishes free teaching codes for them (see Sources).
The method sits within mechanical engineering and aerospace engineering design practice, and it is normally run on top of a finite element model of the structure, in general-purpose multiphysics tools such as COMSOL or in purpose-written research code.
How SIMP works in practice
The COMET-FEniCS tutorial on SIMP topology optimization sets out the formulation, which it attributes to Bendsøe and Sigmund:
- Relaxation. The binary question “is there material here?” is relaxed to a density θ(x) between 0 and 1, so that gradient-based optimization can be used.
- Penalization. Stiffness is scaled as θp times the full-material stiffness, with p greater than 1, “in order to penalize intermediate densities”. Intermediate density then buys little stiffness per unit of material, so the optimizer favours solid or void.
- Objective and constraint. The tutorial minimizes compliance under a volume constraint (it uses 40% of the design volume), handled with a Lagrange multiplier.
- Density floor. The lower bound is set to 0.001 rather than 0 “to avoid degeneracy issue with void material” in the finite element system.
- Penalty continuation. The tutorial reports that p is typically 3 or 4. It starts at p = 1, which gives a diffuse grey design, and increases p in steps, ending with a near black-and-white design. Minimizing directly at a fixed p greater than 1 “does not work well in practice”.
The tutorial’s own update is an alternating minimization with an explicit density update and no filter. Practical codes usually add the filtering and manufacturing controls discussed below.
Related formulations and how SIMP differs
| Item | What the source says | Source |
|---|---|---|
| SIMP density method | Density variable in [0, 1], stiffness penalized by exponent p, compliance minimized under a volume constraint. | COMET-FEniCS tutorial |
| Density-based methods generally | The DTU TopOpt group names density-based methods as its focus and offers 99-line and 88-line MATLAB codes, a 200-line Python code for minimum compliance, and a scalable 3D matrix-free MATLAB code. | DTU TopOpt |
| Level-set with density | The DTU TopOpt group also distributes a code that combines a level-set description with density. | DTU TopOpt |
| Buckling and photonics | The same group lists a buckling code (TopBuck250) and photonics codes, showing the method is not limited to stiffness. | DTU TopOpt |
| Additive manufacturing constraints | A density-based approach adds minimum size on solid and void zones through filtering, and an overhang limit tied to a user-defined printing direction. | Kumar and Fernandez (arXiv 2204.07333) |
Where it matters: a pre-run checklist
Because the result depends entirely on what is specified, the following items need to be fixed before a run. The first four follow from the SIMP formulation above; the last two follow from Kumar and Fernandez’s work on additive manufacturing.
- Objective. For example minimum compliance, as in the tutorial.
- Constraint. For example a volume fraction (40% in the tutorial).
- Design domain, loads and supports. These define the problem the density field is solved on.
- Penalty schedule and density floor. Start at p = 1, increase toward 3 or 4, and keep a small non-zero lower bound.
- Minimum length scale. Kumar and Fernandez impose a minimum size on solid and void zones “through a well-known filtering technique”.
- Build direction and overhang limit. They define overhang as the “inability of printing overhanging parts without the use of sacrificial supporting structures”, limit it by comparing the structural gradient with a critical reference slope, and note that the restriction depends on a user-defined printing direction. They test on 2D stiff-structure and compliant-mechanism benchmarks and supply MATLAB code.
For teams documenting a study, recording these six items alongside the software version and mesh makes the run reproducible and is consistent with good research software practice.
Common misunderstandings
- “The output is the part.” The result is a density field that represents a concept layout. Grey regions remain unless penalization is driven far enough, and the layout still needs interpretation and verification.
- “The optimizer knows how it will be made.” It does not unless manufacturing rules are encoded. Minimum feature size and overhang limits for printing have to be added as constraints, as in the Kumar and Fernandez approach.
- “Penalty can simply be set high from the start.” The tutorial reports that direct minimization at fixed p greater than 1 does not work well, which is why p is raised gradually.
- “Void means zero stiffness.” A strictly zero density degenerates the finite element system, so a small lower bound (0.001 in the tutorial) is used.
- “It is only for stiffness.” The DTU group’s code list includes buckling and photonics examples.
FAQ
What is topology optimization in one sentence?
It is a method that distributes a limited amount of material within a design space to optimize an objective, such as minimizing compliance, under stated loads and constraints.
What does SIMP stand for and what does it do?
The COMET-FEniCS tutorial presents SIMP as a density-based approach in which stiffness is scaled by density raised to an exponent p greater than 1 to penalize intermediate densities. This steers the design toward solid or void.
Where can I find free code to learn from?
The DTU TopOpt group lists free codes including 99-line and 88-line MATLAB programs and a 200-line Python program for minimum compliance.
Can topology optimization account for 3D printing?
Research approaches exist: Kumar and Fernandez (2022) add minimum length scale, overhang and build-orientation constraints to a density-based method.
Sources
- COMET-FEniCS, “SIMP topology optimization” tutorial: comet-fenics.readthedocs.io (read 2026-11-08).
- DTU TopOpt group: topopt.mek.dtu.dk and apps and software (read 2026-11-08).
- Kumar and Fernandez, “Topology optimization for additive manufacturing with length scale, overhang, and building orientation constraints”, submitted 15 April 2022: arXiv:2204.07333 (read 2026-11-08).







