convert users of the ASSERT and the ASSERT2 macros to standard assert()

This commit is contained in:
Andreas Lauser
2013-08-28 14:00:35 +02:00
parent cb76a0fd7f
commit d6fa31b452
17 changed files with 48 additions and 48 deletions

View File

@@ -488,7 +488,7 @@ namespace Opm
// only inject pure fluids.
props_.matrix(1, &perf_p, comp_frac, &c, wpA, NULL);
props_.viscosity(1, &perf_p, comp_frac, &c, &mu[0], NULL);
ASSERT(std::fabs(std::accumulate(comp_frac, comp_frac + np, 0.0) - 1.0) < 1e-6);
assert(std::fabs(std::accumulate(comp_frac, comp_frac + np, 0.0) - 1.0) < 1e-6);
props_.relperm (1, comp_frac, &c, wpM , NULL);
for (int phase = 0; phase < np; ++phase) {
wpM[phase] /= mu[phase];

View File

@@ -182,9 +182,9 @@ namespace Opm
ix /= dims[dim];
}
ASSERT2 (ix == 0,
"Lexicographic index is not consistent "
"with grid dimensions.");
// Make sure that lexicographic index is consistent with
// grid dimensions.
assert(ix == 0);
}
@@ -202,12 +202,12 @@ namespace Opm
OPM_THROW(std::runtime_error, "Faces not tagged - cannot extract " << sideString(side) << " faces.");
}
ASSERT2 (grid.dimensions <= 3,
"Grid must have three dimensions or less.");
// make sure that grid has three dimensions or less.
assert(grid.dimensions <= 3);
ASSERT2 (side < 2 * grid.dimensions,
"Boundary condition side not consistent with "
"number of physical grid dimensions.");
// Make sure boundary condition side is consistent with
// number of physical grid dimensions.
assert(side < 2 * grid.dimensions);
// Get all boundary faces with the correct tag and with
// min/max i/j/k (depending on side).

View File

@@ -186,14 +186,14 @@ namespace Opm
linsolver_.solve(h_->A, h_->b, h_->x);
// Obtain solution.
ASSERT(int(state.pressure().size()) == grid_.number_of_cells);
ASSERT(int(state.faceflux().size()) == grid_.number_of_faces);
assert(int(state.pressure().size()) == grid_.number_of_cells);
assert(int(state.faceflux().size()) == grid_.number_of_faces);
ifs_tpfa_solution soln = { NULL, NULL, NULL, NULL };
soln.cell_press = &state.pressure()[0];
soln.face_flux = &state.faceflux()[0];
if (wells_ != NULL) {
ASSERT(int(well_state.bhp().size()) == wells_->number_of_wells);
ASSERT(int(well_state.perfRates().size()) == wells_->well_connpos[ wells_->number_of_wells ]);
assert(int(well_state.bhp().size()) == wells_->number_of_wells);
assert(int(well_state.perfRates().size()) == wells_->well_connpos[ wells_->number_of_wells ]);
soln.well_flux = &well_state.perfRates()[0];
soln.well_press = &well_state.bhp()[0];
}
@@ -473,8 +473,8 @@ namespace Opm
// Make sure h_->x contains the direct solution vector.
ASSERT(int(state.pressure().size()) == grid_.number_of_cells);
ASSERT(int(state.faceflux().size()) == grid_.number_of_faces);
assert(int(state.pressure().size()) == grid_.number_of_cells);
assert(int(state.faceflux().size()) == grid_.number_of_faces);
std::copy(state.pressure().begin(), state.pressure().end(), h_->x);
std::copy(well_state.bhp().begin(), well_state.bhp().end(), h_->x + grid_.number_of_cells);
@@ -483,8 +483,8 @@ namespace Opm
soln.cell_press = &state.pressure()[0];
soln.face_flux = &state.faceflux()[0];
if (wells_ != NULL) {
ASSERT(int(well_state.bhp().size()) == wells_->number_of_wells);
ASSERT(int(well_state.perfRates().size()) == wells_->well_connpos[ wells_->number_of_wells ]);
assert(int(well_state.bhp().size()) == wells_->number_of_wells);
assert(int(well_state.perfRates().size()) == wells_->well_connpos[ wells_->number_of_wells ]);
soln.well_flux = &well_state.perfRates()[0];
soln.well_press = &well_state.bhp()[0];
}