Modeling the self-healing of biological or bio-inspired nanomaterials