coded: Permit both untyped and typed substitutions

Coded functionality now supports basic un-typed substitutions from the
surrounding dictionary. For example:

    value 1.2345;

    #codeExecute
    {
        scalar s = $value;
        ...
    };

It also now supports the more functional typed substitutions, such as:

    direction (1 0 0);

    #codeExecute
    {
        vector v = $<vector>direction;
        ...
    };

These substitutions are now possible in all code blocks. Blocks with
access to the dictionary (e.g., #codeRead) will do a lookup which will
not require re-compilation if the value is changed. Blocks without
access to the dictionary will have the value directly substituted, and
will require recompilation when the value is changed.
This commit is contained in:
Will Bainbridge
2024-01-10 15:26:01 +00:00
parent 97f88d4991
commit ddeaa566ef
28 changed files with 141 additions and 57 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -89,7 +89,8 @@ public:
dynamicCodeContext
(
const dictionary& dict,
const wordList& codeKeys
const wordList& codeKeys,
const wordList& codeDictVars
);