Multi-physics optimisation of multifunctional 3D composites produced by additive manufacturing