Ostwald ripening and its application to precipitates and colloids in ionic crystals and glasses