Added optional dofidarray to giveLocationArray. Removed unused cached locationArray variable from elements.