Machine learning (ML) enhanced fast structural analysis and design recently attracted considerable attention. In most related works, however, the generalization ability of the ML model and the massive cost of dataset generation are the two most criticized aspects. This work combines the advantages of the universality of the substructure method and the superior predictive ability of the operator learning architecture. Specifically, using a novel mechanics-based loss function, lightweight neural network mapping from the material distribution inside a substructure and the corresponding continuous multiscale shape function is well-trained without preparing a dataset. In this manner, a problem machine learning model (PIML) that is generally applicable for efficient linear elastic analysis and design optimization of large-scale structures with arbitrary size and various boundary conditions is proposed. Several examples validate the effectiveness of the present work on efficiency improvement and different kinds of optimization problems. This PIML model-based design and optimization framework can be extended to large-scale multiphysics problems.