Skip to content
Snippets Groups Projects
Commit 095c9bc4 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

BUG: expressions rand() ignores objectRegistry timeIndex (fixes #2923)

parent 20c7f097
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019-2021 OpenCFD Ltd. Copyright (C) 2019-2023 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -41,9 +41,11 @@ void Foam::expressions::exprDriver::fill_random ...@@ -41,9 +41,11 @@ void Foam::expressions::exprDriver::fill_random
{ {
if (seed <= 0) if (seed <= 0)
{ {
if (timeStatePtr_) const TimeState* ts = this->timeState();
if (ts)
{ {
seed = (timeStatePtr_->timeIndex() - seed); seed = (ts->timeIndex() - seed);
} }
else else
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment