mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: codedFunctionObject:get codeData to work
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -63,6 +63,7 @@ void Foam::codedFunctionObject::prepare
|
|||||||
dynCode.setFilterVariable("codeRead", codeRead_);
|
dynCode.setFilterVariable("codeRead", codeRead_);
|
||||||
dynCode.setFilterVariable("codeExecute", codeExecute_);
|
dynCode.setFilterVariable("codeExecute", codeExecute_);
|
||||||
dynCode.setFilterVariable("codeEnd", codeEnd_);
|
dynCode.setFilterVariable("codeEnd", codeEnd_);
|
||||||
|
dynCode.setFilterVariable("codeData", codeData_);
|
||||||
//dynCode.setFilterVariable("codeWrite", codeWrite_);
|
//dynCode.setFilterVariable("codeWrite", codeWrite_);
|
||||||
|
|
||||||
// compile filtered C template
|
// compile filtered C template
|
||||||
@ -191,6 +192,24 @@ bool Foam::codedFunctionObject::read(const dictionary& dict)
|
|||||||
{
|
{
|
||||||
dict.lookup("redirectType") >> redirectType_;
|
dict.lookup("redirectType") >> redirectType_;
|
||||||
|
|
||||||
|
const entry* dataPtr = dict.lookupEntryPtr
|
||||||
|
(
|
||||||
|
"codeData",
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
if (dataPtr)
|
||||||
|
{
|
||||||
|
codeData_ = stringOps::trim(dataPtr->stream());
|
||||||
|
stringOps::inplaceExpand(codeData_, dict);
|
||||||
|
dynamicCodeContext::addLineDirective
|
||||||
|
(
|
||||||
|
codeData_,
|
||||||
|
dataPtr->startLineNumber(),
|
||||||
|
dict.name()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const entry* readPtr = dict.lookupEntryPtr
|
const entry* readPtr = dict.lookupEntryPtr
|
||||||
(
|
(
|
||||||
"codeRead",
|
"codeRead",
|
||||||
@ -233,7 +252,7 @@ bool Foam::codedFunctionObject::read(const dictionary& dict)
|
|||||||
false,
|
false,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
if (execPtr)
|
if (endPtr)
|
||||||
{
|
{
|
||||||
codeEnd_ = stringOps::trim(endPtr->stream());
|
codeEnd_ = stringOps::trim(endPtr->stream());
|
||||||
stringOps::inplaceExpand(codeEnd_, dict);
|
stringOps::inplaceExpand(codeEnd_, dict);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -64,6 +64,7 @@ protected:
|
|||||||
|
|
||||||
word redirectType_;
|
word redirectType_;
|
||||||
|
|
||||||
|
string codeData_;
|
||||||
string codeRead_;
|
string codeRead_;
|
||||||
string codeExecute_;
|
string codeExecute_;
|
||||||
string codeEnd_;
|
string codeEnd_;
|
||||||
|
|||||||
Reference in New Issue
Block a user