The following video shows how to create a mesh for the 2D geometry. We stick with the default "Q8" elements (eight nodes per element including mid-side nodes). The element edge sizes are controlled by inserting a "face sizing."
We improve the mesh obtained above by refining the mesh in the transition region between the larger and smaller cross sections where stress concentration is expected. We do so by: