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:
@ -28,7 +28,9 @@ License
|
|||||||
#include "fieldMapper.H"
|
#include "fieldMapper.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
|
#include "read.H"
|
||||||
#include "unitConversion.H"
|
#include "unitConversion.H"
|
||||||
|
|
||||||
//{{{ begin codeInclude
|
//{{{ begin codeInclude
|
||||||
${codeInclude}
|
${codeInclude}
|
||||||
//}}} end codeInclude
|
//}}} end codeInclude
|
||||||
|
|||||||
@ -27,7 +27,9 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "fieldMapper.H"
|
#include "fieldMapper.H"
|
||||||
#include "pointFields.H"
|
#include "pointFields.H"
|
||||||
|
#include "read.H"
|
||||||
#include "unitConversion.H"
|
#include "unitConversion.H"
|
||||||
|
|
||||||
//{{{ begin codeInclude
|
//{{{ begin codeInclude
|
||||||
${codeInclude}
|
${codeInclude}
|
||||||
//}}} end codeInclude
|
//}}} end codeInclude
|
||||||
|
|||||||
@ -24,6 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "codedFunction1Template.H"
|
#include "codedFunction1Template.H"
|
||||||
|
#include "read.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "codedFunction2Template.H"
|
#include "codedFunction2Template.H"
|
||||||
|
#include "read.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,7 @@ License
|
|||||||
|
|
||||||
#include "codedFunctionObjectTemplate.H"
|
#include "codedFunctionObjectTemplate.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
#include "read.H"
|
||||||
#include "unitConversion.H"
|
#include "unitConversion.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,7 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
|
#include "read.H"
|
||||||
#include "unitConversion.H"
|
#include "unitConversion.H"
|
||||||
#include "fvMatrix.H"
|
#include "fvMatrix.H"
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,9 @@ License
|
|||||||
#include "fieldMapper.H"
|
#include "fieldMapper.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
|
#include "read.H"
|
||||||
#include "unitConversion.H"
|
#include "unitConversion.H"
|
||||||
|
|
||||||
//{{{ begin codeInclude
|
//{{{ begin codeInclude
|
||||||
${codeInclude}
|
${codeInclude}
|
||||||
//}}} end codeInclude
|
//}}} end codeInclude
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -92,7 +92,8 @@ Foam::functionEntries::codeStream::getFunction
|
|||||||
const dynamicCodeContext context
|
const dynamicCodeContext context
|
||||||
(
|
(
|
||||||
codeDict,
|
codeDict,
|
||||||
{"code", "codeInclude", "localCode"}
|
{"code", "codeInclude", "localCode"},
|
||||||
|
{"dict", word::null, word::null}
|
||||||
);
|
);
|
||||||
|
|
||||||
// codeName: codeStream + _<sha1>
|
// codeName: codeStream + _<sha1>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -322,7 +322,7 @@ void Foam::codedBase::updateLibrary() const
|
|||||||
dict
|
dict
|
||||||
);
|
);
|
||||||
|
|
||||||
dynamicCodeContext context(dict, codeKeys());
|
dynamicCodeContext context(dict, codeKeys(), codeDictVars());
|
||||||
|
|
||||||
// codeName: name + _<sha1>
|
// codeName: name + _<sha1>
|
||||||
// codeDir : name
|
// codeDir : name
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -112,6 +112,9 @@ protected:
|
|||||||
//- Get the keywords associated with source code
|
//- Get the keywords associated with source code
|
||||||
virtual wordList codeKeys() const = 0;
|
virtual wordList codeKeys() const = 0;
|
||||||
|
|
||||||
|
//- Get the name of the dictionary variables in the source code
|
||||||
|
virtual wordList codeDictVars() const = 0;
|
||||||
|
|
||||||
//- Adapt the context for the current object
|
//- Adapt the context for the current object
|
||||||
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const = 0;
|
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const = 0;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -73,6 +73,12 @@ class compileTemplate
|
|||||||
return wordList::null();
|
return wordList::null();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Get the name of the dictionary variables in the source code
|
||||||
|
virtual wordList codeDictVars() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Adapt the context for the current object
|
//- Adapt the context for the current object
|
||||||
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -45,7 +45,8 @@ void Foam::dynamicCodeContext::addLineDirective
|
|||||||
Foam::dynamicCodeContext::dynamicCodeContext
|
Foam::dynamicCodeContext::dynamicCodeContext
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const wordList& codeKeys
|
const wordList& codeKeys,
|
||||||
|
const wordList& codeDictVars
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
dict_(dict),
|
dict_(dict),
|
||||||
@ -64,7 +65,7 @@ Foam::dynamicCodeContext::dynamicCodeContext
|
|||||||
if (codePtrs[i])
|
if (codePtrs[i])
|
||||||
{
|
{
|
||||||
string s(stringOps::trim(verbatimString(codePtrs[i]->stream())));
|
string s(stringOps::trim(verbatimString(codePtrs[i]->stream())));
|
||||||
stringOps::inplaceExpandCodeString(s, dict);
|
stringOps::inplaceExpandCodeString(s, dict, codeDictVars[i]);
|
||||||
code_.insert(key, s);
|
code_.insert(key, s);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -78,7 +79,7 @@ Foam::dynamicCodeContext::dynamicCodeContext
|
|||||||
if (optionsPtr)
|
if (optionsPtr)
|
||||||
{
|
{
|
||||||
options_ = stringOps::trim(verbatimString(optionsPtr->stream()));
|
options_ = stringOps::trim(verbatimString(optionsPtr->stream()));
|
||||||
stringOps::inplaceExpandCodeString(options_, dict);
|
stringOps::inplaceExpandCodeString(options_, dict, word::null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Libs
|
// Libs
|
||||||
@ -86,7 +87,7 @@ Foam::dynamicCodeContext::dynamicCodeContext
|
|||||||
if (libsPtr)
|
if (libsPtr)
|
||||||
{
|
{
|
||||||
libs_ = stringOps::trim(verbatimString(libsPtr->stream()));
|
libs_ = stringOps::trim(verbatimString(libsPtr->stream()));
|
||||||
stringOps::inplaceExpandCodeString(libs_, dict);
|
stringOps::inplaceExpandCodeString(libs_, dict, word::null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate SHA1 digest from all entries
|
// Calculate SHA1 digest from all entries
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -89,7 +89,8 @@ public:
|
|||||||
dynamicCodeContext
|
dynamicCodeContext
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const wordList& codeKeys
|
const wordList& codeKeys,
|
||||||
|
const wordList& codeDictVars
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -35,12 +35,14 @@ License
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::wordList Foam::codedFixedValuePointPatchField<Type>::codeKeys() const
|
Foam::wordList Foam::codedFixedValuePointPatchField<Type>::codeKeys() const
|
||||||
{
|
{
|
||||||
return
|
return {"code", "codeInclude", "localCode"};
|
||||||
{
|
}
|
||||||
"code",
|
|
||||||
"codeInclude",
|
|
||||||
"localCode"
|
template<class Type>
|
||||||
};
|
Foam::wordList Foam::codedFixedValuePointPatchField<Type>::codeDictVars() const
|
||||||
|
{
|
||||||
|
return {word::null, word::null, word::null};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -110,6 +110,9 @@ class codedFixedValuePointPatchField
|
|||||||
//- Get the keywords associated with source code
|
//- Get the keywords associated with source code
|
||||||
virtual wordList codeKeys() const;
|
virtual wordList codeKeys() const;
|
||||||
|
|
||||||
|
//- Get the name of the dictionary variables in the source code
|
||||||
|
virtual wordList codeDictVars() const;
|
||||||
|
|
||||||
//- Adapt the context for the current object
|
//- Adapt the context for the current object
|
||||||
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,11 +32,14 @@ License
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::wordList Foam::Function1s::Coded<Type>::codeKeys() const
|
Foam::wordList Foam::Function1s::Coded<Type>::codeKeys() const
|
||||||
{
|
{
|
||||||
return
|
return {"code", "codeInclude"};
|
||||||
{
|
}
|
||||||
"code",
|
|
||||||
"codeInclude"
|
|
||||||
};
|
template<class Type>
|
||||||
|
Foam::wordList Foam::Function1s::Coded<Type>::codeDictVars() const
|
||||||
|
{
|
||||||
|
return {word::null, word::null};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -98,6 +98,9 @@ class Coded
|
|||||||
//- Get the keywords associated with source code
|
//- Get the keywords associated with source code
|
||||||
virtual wordList codeKeys() const;
|
virtual wordList codeKeys() const;
|
||||||
|
|
||||||
|
//- Get the name of the dictionary variables in the source code
|
||||||
|
virtual wordList codeDictVars() const;
|
||||||
|
|
||||||
//- Adapt the context for the current object
|
//- Adapt the context for the current object
|
||||||
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,11 +32,14 @@ License
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::wordList Foam::Function2s::Coded<Type>::codeKeys() const
|
Foam::wordList Foam::Function2s::Coded<Type>::codeKeys() const
|
||||||
{
|
{
|
||||||
return
|
return {"code", "codeInclude"};
|
||||||
{
|
}
|
||||||
"code",
|
|
||||||
"codeInclude"
|
|
||||||
};
|
template<class Type>
|
||||||
|
Foam::wordList Foam::Function2s::Coded<Type>::codeDictVars() const
|
||||||
|
{
|
||||||
|
return {word::null, word::null};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -83,6 +83,9 @@ class Coded
|
|||||||
//- Get the keywords associated with source code
|
//- Get the keywords associated with source code
|
||||||
virtual wordList codeKeys() const;
|
virtual wordList codeKeys() const;
|
||||||
|
|
||||||
|
//- Get the name of the dictionary variables in the source code
|
||||||
|
virtual wordList codeDictVars() const;
|
||||||
|
|
||||||
//- Adapt the context for the current object
|
//- Adapt the context for the current object
|
||||||
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -587,7 +587,7 @@ Foam::string& Foam::stringOps::inplaceExpandCodeString
|
|||||||
// If the dictionary is not accessible but the
|
// If the dictionary is not accessible but the
|
||||||
// type is known, then read the substituted value
|
// type is known, then read the substituted value
|
||||||
// from a string
|
// from a string
|
||||||
buf << "read<" << varType << ">(\"";
|
buf << "Foam::read<" << varType << ">(\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the dictionary is not accessible and/or the type
|
// If the dictionary is not accessible and/or the type
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -35,12 +35,14 @@ License
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::wordList Foam::codedFixedValueFvPatchField<Type>::codeKeys() const
|
Foam::wordList Foam::codedFixedValueFvPatchField<Type>::codeKeys() const
|
||||||
{
|
{
|
||||||
return
|
return {"code", "codeInclude", "localCode"};
|
||||||
{
|
}
|
||||||
"code",
|
|
||||||
"codeInclude",
|
|
||||||
"localCode"
|
template<class Type>
|
||||||
};
|
Foam::wordList Foam::codedFixedValueFvPatchField<Type>::codeDictVars() const
|
||||||
|
{
|
||||||
|
return {word::null, word::null, word::null};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -108,6 +108,9 @@ class codedFixedValueFvPatchField
|
|||||||
//- Get the keywords associated with source code
|
//- Get the keywords associated with source code
|
||||||
virtual wordList codeKeys() const;
|
virtual wordList codeKeys() const;
|
||||||
|
|
||||||
|
//- Get the name of the dictionary variables in the source code
|
||||||
|
virtual wordList codeDictVars() const;
|
||||||
|
|
||||||
//- Adapt the context for the current object
|
//- Adapt the context for the current object
|
||||||
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -35,12 +35,14 @@ License
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::wordList Foam::codedMixedFvPatchField<Type>::codeKeys() const
|
Foam::wordList Foam::codedMixedFvPatchField<Type>::codeKeys() const
|
||||||
{
|
{
|
||||||
return
|
return {"code", "codeInclude", "localCode"};
|
||||||
{
|
}
|
||||||
"code",
|
|
||||||
"codeInclude",
|
|
||||||
"localCode"
|
template<class Type>
|
||||||
};
|
Foam::wordList Foam::codedMixedFvPatchField<Type>::codeDictVars() const
|
||||||
|
{
|
||||||
|
return {word::null, word::null, word::null};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -118,6 +118,9 @@ class codedMixedFvPatchField
|
|||||||
//- Get the keywords associated with source code
|
//- Get the keywords associated with source code
|
||||||
virtual wordList codeKeys() const;
|
virtual wordList codeKeys() const;
|
||||||
|
|
||||||
|
//- Get the name of the dictionary variables in the source code
|
||||||
|
virtual wordList codeDictVars() const;
|
||||||
|
|
||||||
//- Adapt the context for the current object
|
//- Adapt the context for the current object
|
||||||
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -66,6 +66,22 @@ Foam::wordList Foam::codedFunctionObject::codeKeys() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::codedFunctionObject::codeDictVars() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
{
|
||||||
|
word::null,
|
||||||
|
word::null,
|
||||||
|
word::null,
|
||||||
|
word::null,
|
||||||
|
"dict",
|
||||||
|
word::null,
|
||||||
|
word::null,
|
||||||
|
word::null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::codedFunctionObject::prepare
|
void Foam::codedFunctionObject::prepare
|
||||||
(
|
(
|
||||||
dynamicCode& dynCode,
|
dynamicCode& dynCode,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -99,6 +99,9 @@ class codedFunctionObject
|
|||||||
//- Get the keywords associated with source code
|
//- Get the keywords associated with source code
|
||||||
virtual wordList codeKeys() const;
|
virtual wordList codeKeys() const;
|
||||||
|
|
||||||
|
//- Get the name of the dictionary variables in the source code
|
||||||
|
virtual wordList codeDictVars() const;
|
||||||
|
|
||||||
//- Adapt the context for the current object
|
//- Adapt the context for the current object
|
||||||
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -144,6 +144,19 @@ Foam::wordList Foam::fv::codedFvModel::codeKeys() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::fv::codedFvModel::codeDictVars() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
{
|
||||||
|
word::null,
|
||||||
|
word::null,
|
||||||
|
word::null,
|
||||||
|
word::null,
|
||||||
|
word::null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::fvModel& Foam::fv::codedFvModel::redirectFvModel() const
|
Foam::fvModel& Foam::fv::codedFvModel::redirectFvModel() const
|
||||||
{
|
{
|
||||||
if (!redirectFvModelPtr_.valid())
|
if (!redirectFvModelPtr_.valid())
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -126,6 +126,9 @@ class codedFvModel
|
|||||||
//- Get the keywords associated with source code
|
//- Get the keywords associated with source code
|
||||||
virtual wordList codeKeys() const;
|
virtual wordList codeKeys() const;
|
||||||
|
|
||||||
|
//- Get the name of the dictionary variables in the source code
|
||||||
|
virtual wordList codeDictVars() const;
|
||||||
|
|
||||||
//- Dynamically compiled fvModel
|
//- Dynamically compiled fvModel
|
||||||
fvModel& redirectFvModel() const;
|
fvModel& redirectFvModel() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user