Yes, it seems indeed easy. I'll try to learn how to send it through the 
official channel in github.

On Tuesday, 26 May 2020 05:40:57 UTC+2, Wolfgang Bangerth wrote:
>
> On 5/25/20 9:20 PM, David F wrote: 
> > 
> > I would like to apply many random distortions to a triangulation. 
> However, the 
> > function GridTools::distort_random seems to produce always the same 
> > distortion. Is there a way to use different seeds in order to generate 
> always 
> > different distortions? It seems that it's not possible through the 
> interface 
> > of GridTools::distort_random but I wonder if there is another way to do 
> it, 
> > since this seems to me a very basic feature for the users of this 
> function. 
>
> Interesting question! 
>
> The function doesn't currently allow that, it uses the same sequence of 
> random 
> numbers every time -- by design: This way, if you run your program twice 
> in a 
> row, it'll produce the same result. 
>
> But it wouldn't be very difficult to change that. The function is here: 
>
> https://github.com/dealii/dealii/blob/master/source/grid/grid_tools.cc#L1013-L1244
>  
> The random number generator is initialized in line 1099. It wouldn't be 
> very 
> difficult to add an argument to the function that acts as a random seed 
> and is 
> used in that line to seed the boost::random::mt19937 generator. Want to 
> give 
> this a try and implement such a change? We'd of course be very happy to 
> take a 
> patch! 
>
> Best 
>   Wolfgang 
>
>
> -- 
> ------------------------------------------------------------------------ 
> Wolfgang Bangerth          email:                 bang...@colostate.edu 
> <javascript:> 
>                             www: http://www.math.colostate.edu/~bangerth/ 
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/1d6b5b3f-03b4-4de0-b186-f7ca9612f2a2%40googlegroups.com.

Reply via email to