From: Pengfei Jia Date: Tue, 7 Feb 2023 17:17:31 +0000 (-0500) Subject: Fixing random number generator function parser X-Git-Tag: v9.5.0-rc1~579^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58a01419fcbdf6956624966ccb15f6f02a43b149;p=dealii.git Fixing random number generator function parser --- diff --git a/source/base/mu_parser_internal.cc b/source/base/mu_parser_internal.cc index 463d5a5287..eb3173f5cb 100644 --- a/source/base/mu_parser_internal.cc +++ b/source/base/mu_parser_internal.cc @@ -308,8 +308,10 @@ namespace internal parser.DefineFun("log", mu_log, true); parser.DefineFun("pow", mu_pow, true); parser.DefineFun("erfc", mu_erfc, true); - parser.DefineFun("rand_seed", mu_rand_seed, true); - parser.DefineFun("rand", mu_rand, true); + // We need to set optimized=false, because rand will generate + // different number every time. + parser.DefineFun("rand_seed", mu_rand_seed, false); + parser.DefineFun("rand", mu_rand, false); try {