Adaptable method for modelling optical fields in VCSELs