The penalty boundary method