Commit Graph

15 Commits

Author SHA1 Message Date
ddeaa566ef 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.
2024-01-10 15:41:57 +00:00
5dade27f25 codedBase: Added support for arbitrary entry names
Non-alphanumeic characters in the name of the coded object are now *all*
replaced by underscores. This means functions with complex names (i.e.,
like those resulting from command line substitutions) can now be
compiled.
2023-08-30 13:53:54 +01:00
cd80831261 string: Added const replace and replaceAll
which return the replaced string rather than modify the string the function is
called for.
2021-10-25 10:15:44 +01:00
ad28cb49b5 codedBase: Added support for '-' in entry names
by mapping '-' to '_' in the generation of the code name.

Resolves bug-report https://bugs.openfoam.org/view.php?id=3744
2021-10-24 11:38:55 +01:00
178828a921 codedBase: Merged with CodedBase to simplify and rationalise the implementation 2021-05-19 17:59:52 +01:00
04cab84af6 basicThermo: Added support for dynamic compilation of thermophysical property packages
If the combination of property models selected in thermophysicalProperties is
not already compiled and present in the standard libraries the thermophysical
property package will be constructed and compiled automatically using the
standard dynamicCode system provided in OpenFOAM.

The thermophysical property package is constructed automatically from the
etc/codeTemplates/dynamicCode files for the corresponding base thermo
type (e.g. fluidThermo), currently these are provided only for fluidThermo but
the others will be added shortly.  If the corresponding codeTemplates files do
not exist the standard thermo lookup error message is generated as before.

As with all other dynamicCode options in OpenFOAM (codeStream,
codedFunctionObject etc.) dynamic compilation of the thermophysical property
package is only enabled if allowSystemOperations is set true.
2021-04-15 16:32:50 +01:00
a728a69c59 codedMixedFvPatchField, codedFixedValuePointPatchField: Updated and simplified using the new CodedBase class
reducing code duplication and maintenance overhead.
2020-02-07 00:05:27 +00:00
aff00a2e7e dlLibraryTable: Simplified and rationalised the handling of dynamic library loading
Rather than being tied to the Time class the dlLibraryTable libs is now a global
variable in the Foam namespace which is accessable by any class needing to load
dynamic libraries, in particular argList, Time and codeStream.
2020-01-31 08:18:10 +00:00
528dccc094 dynamicCode: Fixed handling of options and libs 2019-02-04 09:18:36 +00:00
700f11fa11 dynamicCode: Put code entries on a list
The dynamic code functionality has been generalised so that the names of
the code entries in the specifying dictionary can be set by the caller.
This means that functions which utilise dynamic code but use different
entry names (e.g., codedFunctionObject uses codeExecute, codeEnd,
etc..., instead of code) now function correctly. The differently named
entries now form part of the library hash, and re-building triggers
appropriately as they are modified.
2019-02-01 09:17:26 +00:00
bf54ab67e1 Updated OpenFOAM Foundation web-link in headers 2018-07-06 21:42:54 +01:00
ea67173330 Updated member type comments
Resolves bug-report http://bugs.openfoam.org/view.php?id=2356
2016-11-28 21:23:00 +00:00
f2331a8587 dynamicCode: Renamed 'redirectType' to 'name' to clarify the purpose
of the entry which is to provide the name of the generated class.

'redirectType' is supported for backward-compatibility.
2016-05-18 23:10:42 +01:00
cc99b65d77 src/OpenFOAM: Update ...IOErrorIn -> ...IOErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-10 21:13:04 +00:00
446e5777f0 Add the OpenFOAM source tree 2014-12-10 22:40:10 +00:00