Add debugging assertions to check input in several routines.
This commit is contained in:
parent
fde2d25c86
commit
e6ab4ec4c8
@ -468,6 +468,8 @@ add_well(enum WellType type ,
|
|||||||
|
|
||||||
struct WellMgmt *m;
|
struct WellMgmt *m;
|
||||||
|
|
||||||
|
assert (W != NULL);
|
||||||
|
|
||||||
nw = W->number_of_wells;
|
nw = W->number_of_wells;
|
||||||
nperf_tot = W->well_connpos[nw];
|
nperf_tot = W->well_connpos[nw];
|
||||||
|
|
||||||
@ -532,6 +534,7 @@ append_well_controls(enum WellControlType type,
|
|||||||
struct WellControlMgmt *m;
|
struct WellControlMgmt *m;
|
||||||
|
|
||||||
assert (W != NULL);
|
assert (W != NULL);
|
||||||
|
assert ((0 <= well_index) && (well_index < W->number_of_wells));
|
||||||
|
|
||||||
ctrl = W->ctrls[well_index];
|
ctrl = W->ctrls[well_index];
|
||||||
np = W->number_of_phases;
|
np = W->number_of_phases;
|
||||||
@ -567,8 +570,13 @@ void
|
|||||||
set_current_control(int well_index, int current_control, struct Wells *W)
|
set_current_control(int well_index, int current_control, struct Wells *W)
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
|
assert (W != NULL);
|
||||||
|
assert ((0 <= well_index) && (well_index < W->number_of_wells));
|
||||||
|
|
||||||
assert (W->ctrls[well_index] != NULL);
|
assert (W->ctrls[well_index] != NULL);
|
||||||
|
|
||||||
|
assert (current_control < W->ctrls[well_index]->num);
|
||||||
|
|
||||||
W->ctrls[well_index]->current = current_control;
|
W->ctrls[well_index]->current = current_control;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -578,6 +586,9 @@ void
|
|||||||
clear_well_controls(int well_index, struct Wells *W)
|
clear_well_controls(int well_index, struct Wells *W)
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
|
assert (W != NULL);
|
||||||
|
assert ((0 <= well_index) && (well_index < W->number_of_wells));
|
||||||
|
|
||||||
if (W->ctrls[well_index] != NULL) {
|
if (W->ctrls[well_index] != NULL) {
|
||||||
W->ctrls[well_index]->num = 0;
|
W->ctrls[well_index]->num = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user