  This paper presents an efficient and compact MATLAB code for
three-dimensional stress-based sensitivity analysis. The 146 lines code
includes the finite element analysis and p-norm stress sensitivity analysis
based on the adjoint method. The 3D sensitivity analysis for p-norm global
stress measure is derived and explained in detail accompanied by corresponding
MATLAB code. The correctness of the analytical sensitivity is verified by
comparison with finite difference approximation. The nonlinear optimization
solver is chosen as the Method of moving asymptotes (MMA). Three typical
volume-constrained stress minimization problems are presented to verify the
effectiveness of sensitivity analysis code. The MATLAB code presented in this
paper can be extended to resolve different stress related 3D topology
optimization problems. The complete program for sensitivity analysis is given
in the Appendix and is intended for educational purposes only.

Numerical Analysis;Computational Engineering, Finance, and Science;Numerical Analysis