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