Computing geologically consistent models from geophysical data