Finite Element Formulation For Self-Writing Of Polymer Optical Fiber Sensors