Detecting stress elds in an optimal structure I Two-dimensional case and analyzer