To interpret physical phenomena, traditional mesh-based methods, such as finite element method, have proven effective for engineering problems. However, as system complexity increases, whether due to larger scales, finer resolutions, or intricate geometries, these methods face significant limitations in term of computational cost and time. Complex problems, particularly those involving irregular boundaries or nonlinear behaviour, require finer meshes and greater computational power, making real-time analysis difficult. This challenge is especially relevant in agricultural systems, which are subject to high uncertainty and constantly changing environmental conditions. In this study, we proposed a method referred to as piecewise physics-informed neural networks (PINNs) to solve non-smooth problems in structural mechanics using neural networks by decomposing the computational domain. To quantitatively evaluate the performance of this method, three representative structural mechanics problems with non-smooth characteristics are employed. Results demonstrated that the piecewise PINNs provided more accurate solutions compared to conventional PINNs on these benchmark problems. Additionally, we developed a surrogate model for the non-smooth problems using piecewise PINNs without any labelled data and compared it with a model trained using deep neural networks. The proposed model outperformed the deep neural network model in cases of plane-stress problem. The results also showed that the surrogate model trained with piecewise PINNs exhibited an advantage in terms of execution time over the finite element analysis software.