Welcome to HCM,
After going through your history it is true that you are under weight for your height,and you are taking good diet and exercise also.
The weight gain depends on calories intake and calories you burn and your metabolic rate and also on positive nitrogen balance.
You need to plan diet with high calories and proteins
you can take 4 to 5 meals per day and you can take advice from Dietitian for diet and continue your work out as exercise is necessary to gain weight which is lean weight that is muscle and not fats.
You can certainly visit Physician and after examination if required investigation and treatment can be planned.If everything is fine.
You may require Proteins, vitamins
and micronutrients to help metabolism
and gain weight.
Even short chain fatty acids which are very good source of energy may be given helps to gain weight.
You will gain weight , Take care