diff --git a/src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.C b/src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.C index 76eac53ccf..98e8e041b3 100644 --- a/src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.C +++ b/src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,6 +41,19 @@ Foam::TimeFunction1::TimeFunction1 {} +template +Foam::TimeFunction1::TimeFunction1 +( + const Time& time, + const Function1& function +) +: + time_(time), + name_(function.name()), + function_(function.clone().ptr()) +{} + + template Foam::TimeFunction1::TimeFunction1 ( diff --git a/src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.H b/src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.H index ec9be22f1e..31668e5788 100644 --- a/src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.H +++ b/src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -86,6 +86,13 @@ public: const dictionary& dict ); + //- Construct from time and Function1 + TimeFunction1 + ( + const Time& time, + const Function1& function + ); + //- Construct null from time and name TimeFunction1 (