underworld3
underworld3 copied to clipboard
What is the defined output of <mesh>.points_in_domain() when input is empty?
What should we define as the output of basic swarm and a rank has no particles in it:
swarm_coord_array = swarm.dm.getField("DMSwarmPIC_coor").reshape((-1, swarm.dim)) # [] if rank has no particles
in_or_not = swarm.mesh.points_in_domain(swarm_coord_array) # in_or_not is False if swarm_coord_array is []
swarm.dm.restoreField("DMSwarmPIC_coor")
The intention is that it should return an indexing array that can be used to mask out particles that are not in the domain. It should not fall over if the domain has no particles.
If this is failing, we should fix it !
After discussion we now think - numpy.ndarray(shape=(0,0), dtype=bool)