Skip to content
Snippets Groups Projects
Commit 3d34c514 authored by Mark Olesen's avatar Mark Olesen
Browse files

BUG: codedFixedValueFvPatchScalarField oldLibPath_ not copied

- prevented the reloading from working properly (thanks Mattijs!)
parent 336fa744
No related merge requests found
......@@ -38,20 +38,16 @@ using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
extern "C"
{
void ${typeName}
(
Ostream& os,
const dictionary& dict
)
{
void ${typeName}(Ostream& os, const dictionary& dict)
{
//{{{ begin code
${code};
${code};
//}}} end code
}
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -45,6 +45,7 @@ const Foam::word Foam::codedFixedValueFvPatchScalarField::codeTemplateC
const Foam::word Foam::codedFixedValueFvPatchScalarField::codeTemplateH
= "fixedValueFvPatchScalarFieldTemplate.H";
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
void* Foam::codedFixedValueFvPatchScalarField::loadLibrary
......@@ -352,7 +353,7 @@ codedFixedValueFvPatchScalarField
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
dict_(ptf.dict_),
redirectType_(ptf.redirectType_),
oldLibPath_(),
oldLibPath_(ptf.oldLibPath_),
redirectPatchFieldPtr_()
{}
......@@ -384,7 +385,7 @@ codedFixedValueFvPatchScalarField
fixedValueFvPatchField<scalar>(ptf),
dict_(ptf.dict_),
redirectType_(ptf.redirectType_),
oldLibPath_(),
oldLibPath_(ptf.oldLibPath_),
redirectPatchFieldPtr_()
{}
......@@ -399,7 +400,7 @@ codedFixedValueFvPatchScalarField
fixedValueFvPatchField<scalar>(ptf, iF),
dict_(ptf.dict_),
redirectType_(ptf.redirectType_),
oldLibPath_(),
oldLibPath_(ptf.oldLibPath_),
redirectPatchFieldPtr_()
{}
......@@ -412,7 +413,7 @@ Foam::codedFixedValueFvPatchScalarField::redirectPatchField() const
if (!redirectPatchFieldPtr_.valid())
{
// Construct a patch
// Make sure to construct the patchfield with uptodate value.
// Make sure to construct the patchfield with up-to-date value
OStringStream os;
os.writeKeyword("type") << redirectType_ << token::END_STATEMENT
......@@ -420,19 +421,6 @@ Foam::codedFixedValueFvPatchScalarField::redirectPatchField() const
static_cast<const scalarField&>(*this).writeEntry("value", os);
IStringStream is(os.str());
dictionary dict(is);
// Info<< "constructing patchField from :" << dict << endl;
// if (fvPatchScalarField::dictionaryConstructorTablePtr_)
// {
// fvPatchScalarField::dictionaryConstructorPtr funcPtr =
// (
// fvPatchScalarField::dictionaryConstructorTablePtr_->
// find(redirectType_)()
// );
//
// Info<< redirectType_ << " FunctionPtr => "
// << long(funcPtr) << endl;
// }
redirectPatchFieldPtr_.set
(
......@@ -455,7 +443,7 @@ void Foam::codedFixedValueFvPatchScalarField::updateCoeffs()
return;
}
// Make sure library containing user-defined fvPatchField is uptodate
// Make sure library containing user-defined fvPatchField is up-to-date
updateLibrary();
const fvPatchScalarField& fvp = redirectPatchField();
......@@ -474,7 +462,7 @@ void Foam::codedFixedValueFvPatchScalarField::evaluate
const Pstream::commsTypes commsType
)
{
// Make sure library containing user-defined fvPatchField is uptodate
// Make sure library containing user-defined fvPatchField is up-to-date
updateLibrary();
const fvPatchScalarField& fvp = redirectPatchField();
......
......@@ -119,6 +119,7 @@ class codedFixedValueFvPatchScalarField
//- Global loader/unloader function type
typedef void (*loaderFunctionType)(bool);
//- Load specified library and execute globalFuncName(true)
static void* loadLibrary
(
const fileName& libPath,
......@@ -126,6 +127,7 @@ class codedFixedValueFvPatchScalarField
const dictionary& contextDict
);
//- Execute globalFuncName(false) and unload specified library
static void unloadLibrary
(
const fileName& libPath,
......@@ -134,6 +136,7 @@ class codedFixedValueFvPatchScalarField
);
//- Create library based on the dynamicCodeContext
void createLibrary(dynamicCode&, const dynamicCodeContext&) const;
//- Update library as required
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment