LutzGross / esys-escript.github.io

Other
29 stars 13 forks source link

Adding Data two masks should create a mask!? #32

Open aellery opened 2 years ago

aellery commented 2 years ago

Adding two masks may lead to a subtle error, that will give users incorrect results without them being aware that they are getting incorrect results.

For example, if a user has two masks defined, mask1 and mask2, then the expression

X=10*(mask1+mask2)

will create a data object X that is equal to 10 where mask1==1 and mask2==1 but which is equal to 20 in regions where mask1==mask2==1. The user may expect X to be equal to 10 instead of 20 in these regions.

It should be possible for a user to tell escript that a Data object is being used as a mask and then have escript avoid this error.