No, peritonitis is an inflammation of the peritoneum, the membrane that lines the abdominal cavity and covers the abdominal organs.
The peritoneum is the serous membrane that lines the abdominal cavity and covers the abdominal organs. Due to bacterial infection or rupture of an abdominal organ, the peritoneum can get inflamed, a condition known as peritonitis.
The pericardium is two thin layers of a sac-like tissue surrounding the heart that helps hold the heart in place. These two layers have a small amount of fluid between them naturally for lubrication.
Pericarditis is a condition causing inflammation of the pericardium and increase in the fluid content which puts pressure on the heart and results in pain. There can be various reasons for this such as viral infections, post-operative infections, autoimmune disorders like lupus, injuries, etc.