vendredi 7 juillet 2017

Generation of random 2D integration path

I'm trying to compute a direct spatial integration of a scalar field. For technical reasons, I want a single-point boundary condition to start the integration and I want a random integration path in order to avoid directivity effects in error accumulation. But here I have a problem trying to generate efficiently a random 2D integration path. Typically, what should be done is :

  1. Select one random grid index where boundary condition is applied and where the integration starts.
  2. Select randomly one adjacent grid index to integrate.
  3. Select randomly one grid index already integrated AND which has adjacent grid index not integrated. Then repeat 2. and 3. until the whole grid is integrated.

I'm having an issue trying to find an efficient solution to generated such a path, without having to each time look at all the adjacent grid index of all the elements to check the condition in 2.

Does anyone have a couple of leads to find a solution ?

Thanks.




Aucun commentaire:

Enregistrer un commentaire