A study on matter distributions with electromagenetic fields and some other fields in general theory of relativity