If the commissioners appointed to make partition report that the premises, or any portion thereof, are so situated that a partition cannot be made without great prejudice to the owners, the court may, if satisfied that the report is just and correct, order a sale of the premises, whether prayed for or not in the petition, or asked by the defendant.