Open gassmoeller opened 8 years ago
When using a random distribution of particles, we first compute how many particles each cell should get. Let's say that, on each cell K
, we find that we need to distribute N_K
particles randomly. We then create particles randomly in the box that surrounds K
, and take all those that are within K
, until we have N_K
. This works, of course, but it's inefficient because finding out whether a particle is inside or outside a cell K
is expensive.
A better way to do this would be to generate N_K
particles on the reference cell and then map them forward to K
. This is cheap (the forward mapping is far cheaper than the backward mapping from real to reference cell). Furthermore, we can take all particles because we know that they are inside the cell.
Unfortunately, for strongly distorted cells, a uniform distribution of points on the reference cell does not yield a uniform distribution of points on the real cell. But, we can create a uniform distribution on the real cell using importance sampling with a weight equal to |det J|
, as that is how each small part of the reference cell gets extended when mapping to the real cell. This means that we have to create more samples and select a smaller fraction, but we won't have to do the backward mapping.
In fact, we could even take into account that the original probability distribution is not necessarily uniform on cell K
, and include this into the importance sampling factor.
@bangerth knows what this is about.