@JasonB, not sure what causes this. It's probably best to use ElementIncidents and ElementMarkers to extract those from the mesh element anyways. Using Position on these is not going to be efficient (will unpack).
I don't know if it is a suitable question, but I have got a coding problem for about 6 months.
It is too long to explain on this site, and the code I wrote is very complicated because of my incomplete knowledge of Mathematica. I think that now I solve my enigma, but it is very very slow!
Often ...
@user76284 Right, x == 0 is not enough to guarantee x is an integer, since it could be the approximate zero 0.. Machine numbers are treated as having an uncertainty; from the point of view of a symbolic mathematics program, this is by design. Compare Interval[0.] and Interval[0], for instance. OTOH, == means equal to a certain tolerance (depends on the precision of the numbers and Internal`$EqualTolerance). The symbol x has an unknown precision, so M treats it cautiously.
@user76284 I think my x === 0 above was thoughtless. It evaluates to False immediately because SameQ (===) always evaluates to True or False and x is not the same as 0. Sorry about that.
Reduce[x == 0 && x \[Element] Integers] handles you simpler case, but not the original....