From 6782067d8d841253bb04611e46c83c9f09f3e436 Mon Sep 17 00:00:00 2001 From: Kjetil Olsen Lye Date: Thu, 3 May 2012 15:35:44 +0200 Subject: [PATCH] Made a maximum number of iterations in wells_test --- examples/wells_example.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/wells_example.cpp b/examples/wells_example.cpp index ccb2a0285..32451a7e9 100644 --- a/examples/wells_example.cpp +++ b/examples/wells_example.cpp @@ -106,7 +106,7 @@ int main(int argc, char** argv) { } // We approximate (for _testing_ that resflows = surfaceflows) - while (!wells.conditionsMet(well_bhp, well_resflows, well_resflows)) { + for (int iter = 0; iter < 10 && !wells.conditionsMet(well_bhp, well_resflows, well_resflows); ++iter) { std::cout << "Conditions not met for well, trying again" << std::endl; pressure_solver.solve(totmob, omega, src, wdp, bcs.c_bcs(), pressure, face_flux, well_bhp, well_rate_per_cell); std::cout << "Solved" << std::endl;