mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-21 06:53:27 -06:00
Make wells_equal work for null wells.
This is needed to run test cases without wells with debugging on. Without this commit we get segmentation fault in an assert statement.
This commit is contained in:
parent
24fa367fda
commit
88ebfeba28
@ -545,6 +545,12 @@ bool
|
|||||||
wells_equal(const struct Wells *W1, const struct Wells *W2 , bool verbose)
|
wells_equal(const struct Wells *W1, const struct Wells *W2 , bool verbose)
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
|
// Cater the case where W1 and W2 are the same (null) pointers.
|
||||||
|
if( W1 == W2 )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool are_equal = true;
|
bool are_equal = true;
|
||||||
are_equal = (W1->number_of_wells == W2->number_of_wells);
|
are_equal = (W1->number_of_wells == W2->number_of_wells);
|
||||||
are_equal = are_equal && (W1->number_of_phases == W2->number_of_phases);
|
are_equal = are_equal && (W1->number_of_phases == W2->number_of_phases);
|
||||||
|
Loading…
Reference in New Issue
Block a user