  Driven by the need to accelerate numerical simulations, the use of machine
learning techniques is rapidly growing in the field of computational solid
mechanics. Their application is especially advantageous in concurrent
multiscale finite element analysis (FE$^2$) due to the exceedingly high
computational costs often associated with it and the high number of similar
micromechanical analyses involved. To tackle the issue, using surrogate models
to approximate the microscopic behavior and accelerate the simulations is a
promising and increasingly popular strategy. However, several challenges
related to their data-driven nature compromise the reliability of surrogate
models in material modeling. The alternative explored in this work is to
reintroduce some of the physics-based knowledge of classical constitutive
modeling into a neural network by employing the actual material models used in
the full-order micromodel to introduce non-linearity. Thus, path-dependency
arises naturally since every material model in the layer keeps track of its own
internal variables. For the numerical examples, a composite Representative
Volume Element with elastic fibers and elasto-plastic matrix material is used
as the microscopic model. The network is tested in a series of challenging
scenarios and its performance is compared to that of a state-of-the-art
Recurrent Neural Network (RNN). A remarkable outcome of the novel framework is
the ability to naturally predict unloading/reloading behavior without ever
seeing it during training, a stark contrast with popular but data-hungry models
such as RNNs. Finally, the proposed network is applied to FE$^2$ examples to
assess its robustness for application in nonlinear finite element analysis.
