diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.C
new file mode 100644
index 0000000000..41a3a18891
--- /dev/null
+++ b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.C
@@ -0,0 +1,532 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
+ \\/ M anipulation |
+-------------------------------------------------------------------------------
+License
+ This file is part of OpenFOAM.
+
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "codedFixedValueFvPatchField.H"
+#include "addToRunTimeSelectionTable.H"
+#include "fvPatchFieldMapper.H"
+#include "surfaceFields.H"
+#include "volFields.H"
+#include "dlLibraryTable.H"
+#include "IFstream.H"
+#include "OFstream.H"
+#include "SHA1Digest.H"
+#include "dynamicCode.H"
+#include "dynamicCodeContext.H"
+#include "stringOps.H"
+#include "IOdictionary.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+template
+const Foam::word Foam::codedFixedValueFvPatchField::codeTemplateC
+ = "fixedValueFvPatchFieldTemplate.C";
+
+template
+const Foam::word Foam::codedFixedValueFvPatchField::codeTemplateH
+ = "fixedValueFvPatchFieldTemplate.H";
+
+
+// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
+
+template
+void* Foam::codedFixedValueFvPatchField::loadLibrary
+(
+ const fileName& libPath,
+ const string& globalFuncName,
+ const dictionary& contextDict
+)
+{
+ void* lib = 0;
+
+ // avoid compilation by loading an existing library
+ if (!libPath.empty() && dlLibraryTable::open(libPath, false))
+ {
+ lib = dlLibraryTable::findLibrary(libPath);
+
+ // verify the loaded version and unload if needed
+ if (lib)
+ {
+ // provision for manual execution of code after loading
+ if (dlSymFound(lib, globalFuncName))
+ {
+ loaderFunctionType function =
+ reinterpret_cast
+ (
+ dlSym(lib, globalFuncName)
+ );
+
+ if (function)
+ {
+ (*function)(true); // force load
+ }
+ else
+ {
+ FatalIOErrorIn
+ (
+ "codedFixedValueFvPatchField::updateLibrary()",
+ contextDict
+ ) << "Failed looking up symbol " << globalFuncName << nl
+ << "from " << libPath << exit(FatalIOError);
+ }
+ }
+ else
+ {
+ FatalIOErrorIn
+ (
+ "codedFixedValueFvPatchField::loadLibrary()",
+ contextDict
+ ) << "Failed looking up symbol " << globalFuncName << nl
+ << "from " << libPath << exit(FatalIOError);
+
+ lib = 0;
+ if (!dlLibraryTable::close(libPath, false))
+ {
+ FatalIOErrorIn
+ (
+ "codedFixedValueFvPatchField::loadLibrary()",
+ contextDict
+ ) << "Failed unloading library "
+ << libPath
+ << exit(FatalIOError);
+ }
+ }
+ }
+ }
+
+ return lib;
+}
+
+
+template
+void Foam::codedFixedValueFvPatchField::unloadLibrary
+(
+ const fileName& libPath,
+ const string& globalFuncName,
+ const dictionary& contextDict
+)
+{
+ void* lib = 0;
+
+ if (!libPath.empty())
+ {
+ lib = dlLibraryTable::findLibrary(libPath);
+ }
+
+ if (!lib)
+ {
+ return;
+ }
+
+ // provision for manual execution of code before unloading
+ if (dlSymFound(lib, globalFuncName))
+ {
+ loaderFunctionType function =
+ reinterpret_cast
+ (
+ dlSym(lib, globalFuncName)
+ );
+
+ if (function)
+ {
+ (*function)(false); // force unload
+ }
+ else
+ {
+ FatalIOErrorIn
+ (
+ "codedFixedValueFvPatchField::unloadLibrary()",
+ contextDict
+ ) << "Failed looking up symbol " << globalFuncName << nl
+ << "from " << libPath << exit(FatalIOError);
+ }
+ }
+
+ if (!dlLibraryTable::close(libPath, false))
+ {
+ FatalIOErrorIn
+ (
+ "codedFixedValueFvPatchField::"
+ "updateLibrary()",
+ contextDict
+ ) << "Failed unloading library " << libPath
+ << exit(FatalIOError);
+ }
+}
+
+
+template
+void Foam::codedFixedValueFvPatchField::setFieldTemplates
+(
+ dynamicCode& dynCode
+)
+{
+ word fieldType(pTraits::typeName);
+
+ // template type for fvPatchField
+ dynCode.setFilterVariable("TemplateType", fieldType);
+
+ // Name for fvPatchField - eg, ScalarField, VectorField, ...
+ fieldType[0] = toupper(fieldType[0]);
+ dynCode.setFilterVariable("FieldType", fieldType + "Field");
+}
+
+
+// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+
+template
+const Foam::IOdictionary& Foam::codedFixedValueFvPatchField::dict() const
+{
+ const objectRegistry& obr = this->db();
+
+ if (obr.foundObject("codeDict"))
+ {
+ return obr.lookupObject("codeDict");
+ }
+ else
+ {
+ return obr.store
+ (
+ new IOdictionary
+ (
+ IOobject
+ (
+ "codeDict",
+ this->db().time().system(),
+ this->db(),
+ IOobject::MUST_READ_IF_MODIFIED,
+ IOobject::NO_WRITE
+ )
+ )
+ );
+ }
+}
+
+
+template
+void Foam::codedFixedValueFvPatchField::createLibrary
+(
+ dynamicCode& dynCode,
+ const dynamicCodeContext& context
+) const
+{
+ bool create = Pstream::master();
+
+ if (create)
+ {
+ // Write files for new library
+ if (!dynCode.upToDate(context))
+ {
+ // filter with this context
+ dynCode.reset(context);
+
+ // take no chances - typeName must be identical to redirectType_
+ dynCode.setFilterVariable("typeName", redirectType_);
+
+ // set TemplateType and FieldType filter variables
+ // (for fvPatchField)
+ setFieldTemplates(dynCode);
+
+ // compile filtered C template
+ dynCode.addCompileFile(codeTemplateC);
+
+ // copy filtered H template
+ dynCode.addCopyFile(codeTemplateH);
+
+
+ // debugging: make BC verbose
+ // dynCode.setFilterVariable("verbose", "true");
+ // Info<<"compile " << redirectType_ << " sha1: "
+ // << context.sha1() << endl;
+
+ // define Make/options
+ dynCode.setMakeOptions
+ (
+ "EXE_INC = -g \\\n"
+ "-I$(LIB_SRC)/finiteVolume/lnInclude\\\n"
+ + context.options()
+ + "\n\nLIB_LIBS = "
+ );
+
+ if (!dynCode.copyOrCreateFiles(true))
+ {
+ FatalIOErrorIn
+ (
+ "codedFixedValueFvPatchField::createLibrary(..)",
+ context.dict()
+ ) << "Failed writing files for" << nl
+ << dynCode.libRelPath() << nl
+ << exit(FatalIOError);
+ }
+ }
+
+ if (!dynCode.wmakeLibso())
+ {
+ FatalIOErrorIn
+ (
+ "codedFixedValueFvPatchField::createLibrary(..)",
+ context.dict()
+ ) << "Failed wmake " << dynCode.libRelPath() << nl
+ << exit(FatalIOError);
+ }
+ }
+
+
+ // all processes must wait for compile to finish
+ reduce(create, orOp());
+}
+
+
+template
+void Foam::codedFixedValueFvPatchField::updateLibrary() const
+{
+ dynamicCode::checkSecurity
+ (
+ "codedFixedValueFvPatchField::updateLibrary()",
+ dict_
+ );
+
+ // use system/codeDict or in-line
+ const dictionary& codeDict =
+ (
+ dict_.found("code")
+ ? dict_
+ : this->dict().subDict(redirectType_)
+ );
+
+ dynamicCodeContext context(codeDict);
+
+ // codeName: redirectType + _
+ // codeDir : redirectType
+ dynamicCode dynCode
+ (
+ redirectType_ + context.sha1().str(true),
+ redirectType_
+ );
+ const fileName libPath = dynCode.libPath();
+
+
+ // the correct library was already loaded => we are done
+ if (dlLibraryTable::findLibrary(libPath))
+ {
+ return;
+ }
+
+ // remove instantiation of fvPatchField provided by library
+ redirectPatchFieldPtr_.clear();
+
+ // may need to unload old library
+ unloadLibrary
+ (
+ oldLibPath_,
+ dynamicCode::libraryBaseName(oldLibPath_),
+ context.dict()
+ );
+
+ // try loading an existing library (avoid compilation when possible)
+ if (!loadLibrary(libPath, dynCode.codeName(), context.dict()))
+ {
+ createLibrary(dynCode, context);
+
+ loadLibrary(libPath, dynCode.codeName(), context.dict());
+ }
+
+ // retain for future reference
+ oldLibPath_ = libPath;
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+Foam::codedFixedValueFvPatchField::codedFixedValueFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(p, iF),
+ oldLibPath_(),
+ redirectPatchFieldPtr_()
+{}
+
+
+template
+Foam::codedFixedValueFvPatchField::codedFixedValueFvPatchField
+(
+ const codedFixedValueFvPatchField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ fixedValueFvPatchField(ptf, p, iF, mapper),
+ dict_(ptf.dict_),
+ redirectType_(ptf.redirectType_),
+ oldLibPath_(ptf.oldLibPath_),
+ redirectPatchFieldPtr_()
+{}
+
+
+template
+Foam::codedFixedValueFvPatchField::codedFixedValueFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ fixedValueFvPatchField(p, iF, dict),
+ dict_(dict),
+ redirectType_(dict.lookup("redirectType")),
+ oldLibPath_(),
+ redirectPatchFieldPtr_()
+{
+ updateLibrary();
+}
+
+
+template
+Foam::codedFixedValueFvPatchField::codedFixedValueFvPatchField
+(
+ const codedFixedValueFvPatchField& ptf
+)
+:
+ fixedValueFvPatchField(ptf),
+ dict_(ptf.dict_),
+ redirectType_(ptf.redirectType_),
+ oldLibPath_(ptf.oldLibPath_),
+ redirectPatchFieldPtr_()
+{}
+
+
+template
+Foam::codedFixedValueFvPatchField::codedFixedValueFvPatchField
+(
+ const codedFixedValueFvPatchField& ptf,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(ptf, iF),
+ dict_(ptf.dict_),
+ redirectType_(ptf.redirectType_),
+ oldLibPath_(ptf.oldLibPath_),
+ redirectPatchFieldPtr_()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+template
+const Foam::fvPatchField&
+Foam::codedFixedValueFvPatchField::redirectPatchField() const
+{
+ if (!redirectPatchFieldPtr_.valid())
+ {
+ // Construct a patch
+ // Make sure to construct the patchfield with up-to-date value
+
+ OStringStream os;
+ os.writeKeyword("type") << redirectType_ << token::END_STATEMENT
+ << nl;
+ static_cast&>(*this).writeEntry("value", os);
+ IStringStream is(os.str());
+ dictionary dict(is);
+
+ redirectPatchFieldPtr_.set
+ (
+ fvPatchField::New
+ (
+ this->patch(),
+ this->dimensionedInternalField(),
+ dict
+ ).ptr()
+ );
+ }
+ return redirectPatchFieldPtr_();
+}
+
+
+template
+void Foam::codedFixedValueFvPatchField::updateCoeffs()
+{
+ if (this->updated())
+ {
+ return;
+ }
+
+ // Make sure library containing user-defined fvPatchField is up-to-date
+ updateLibrary();
+
+ const fvPatchField& fvp = redirectPatchField();
+
+ const_cast&>(fvp).updateCoeffs();
+
+ // Copy through value
+ this->operator==(fvp);
+
+ fixedValueFvPatchField::updateCoeffs();
+}
+
+
+template
+void Foam::codedFixedValueFvPatchField::evaluate
+(
+ const Pstream::commsTypes commsType
+)
+{
+ // Make sure library containing user-defined fvPatchField is up-to-date
+ updateLibrary();
+
+ const fvPatchField& fvp = redirectPatchField();
+
+ const_cast&>(fvp).evaluate(commsType);
+
+ fixedValueFvPatchField::evaluate(commsType);
+}
+
+
+template
+void Foam::codedFixedValueFvPatchField::write(Ostream& os) const
+{
+ fixedValueFvPatchField::write(os);
+ os.writeKeyword("redirectType") << redirectType_
+ << token::END_STATEMENT << nl;
+
+ if (dict_.found("code"))
+ {
+ os.writeKeyword("code")
+ << token::HASH << token::BEGIN_BLOCK;
+
+ os.writeQuoted(string(dict_["code"]), false)
+ << token::HASH << token::END_BLOCK
+ << token::END_STATEMENT << nl;
+ }
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.H
new file mode 100644
index 0000000000..4d5bf99a79
--- /dev/null
+++ b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.H
@@ -0,0 +1,260 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
+ \\/ M anipulation |
+-------------------------------------------------------------------------------
+License
+ This file is part of OpenFOAM.
+
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+Class
+ Foam::codedFixedValueFvPatchField
+
+Description
+ Constructs on-the-fly a new boundary condition (derived from
+ fixedValueFvPatchField) which is then used to evaluate.
+
+ Example:
+ \verbatim
+ movingWall
+ {
+ type codedFixedValue;
+ value uniform 0;
+ redirectType rampedFixedValue; // name of generated bc
+
+ code
+ #{
+ operator==(min(10, 0.1*this->db().time().value()));
+ #};
+
+ //codeInclude
+ //#{
+ // #include "fvCFD.H"
+ //#};
+
+ //codeOptions
+ //#{
+ // -I$(LIB_SRC)/finiteVolume/lnInclude
+ //#};
+ }
+ \endverbatim
+
+ A special form is if the 'code' section is not supplied. In this case
+ the code gets read from a (runTimeModifiable!) dictionary system/codeDict
+ which would have a corresponding entry
+
+ \verbatim
+ rampedFixedValue
+ {
+ code
+ #{
+ operator==(min(10, 0.1*this->db().time().value()));
+ #};
+ }
+ \endverbatim
+
+SeeAlso
+ Foam::dynamicCode and Foam::functionEntries::codeStream
+
+SourceFiles
+ codedFixedValueFvPatchField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef codedFixedValueFvPatchField_H
+#define codedFixedValueFvPatchField_H
+
+#include "fixedValueFvPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// Forward declaration of classes
+class dynamicCode;
+class dynamicCodeContext;
+class IOdictionary;
+
+/*---------------------------------------------------------------------------*\
+ Class codedFixedValueFvPatch Declaration
+\*---------------------------------------------------------------------------*/
+
+template
+class codedFixedValueFvPatchField
+:
+ public fixedValueFvPatchField
+{
+ // Private data
+
+ //- Dictionary contents for the boundary condition
+ mutable dictionary dict_;
+
+ const word redirectType_;
+
+ //- Previously loaded library
+ mutable fileName oldLibPath_;
+
+ mutable autoPtr > redirectPatchFieldPtr_;
+
+
+ // Private Member Functions
+
+ const IOdictionary& dict() const;
+
+ //- Global loader/unloader function type
+ typedef void (*loaderFunctionType)(bool);
+
+ //- Load specified library and execute globalFuncName(true)
+ static void* loadLibrary
+ (
+ const fileName& libPath,
+ const string& globalFuncName,
+ const dictionary& contextDict
+ );
+
+ //- Execute globalFuncName(false) and unload specified library
+ static void unloadLibrary
+ (
+ const fileName& libPath,
+ const string& globalFuncName,
+ const dictionary& contextDict
+ );
+
+ //- Set the rewrite vars controlling the Type
+ static void setFieldTemplates(dynamicCode& dynCode);
+
+ //- Create library based on the dynamicCodeContext
+ void createLibrary(dynamicCode&, const dynamicCodeContext&) const;
+
+ //- Update library as required
+ void updateLibrary() const;
+
+
+public:
+
+ // Static data members
+
+ //- Name of the C code template to be used
+ static const word codeTemplateC;
+
+ //- Name of the H code template to be used
+ static const word codeTemplateH;
+
+
+ //- Runtime type information
+ TypeName("codedFixedValue");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ codedFixedValueFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ codedFixedValueFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping given codedFixedValueFvPatchField
+ // onto a new patch
+ codedFixedValueFvPatchField
+ (
+ const codedFixedValueFvPatchField&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ codedFixedValueFvPatchField
+ (
+ const codedFixedValueFvPatchField&
+ );
+
+ //- Construct and return a clone
+ virtual tmp > clone() const
+ {
+ return tmp >
+ (
+ new codedFixedValueFvPatchField(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ codedFixedValueFvPatchField
+ (
+ const codedFixedValueFvPatchField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp > clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp >
+ (
+ new codedFixedValueFvPatchField(*this, iF)
+ );
+ }
+
+
+
+
+ // Member functions
+
+ //- Get reference to the underlying patch
+ const fvPatchField& redirectPatchField() const;
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+
+ //- Evaluate the patch field, sets Updated to false
+ virtual void evaluate
+ (
+ const Pstream::commsTypes commsType=Pstream::blocking
+ );
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+# include "codedFixedValueFvPatchField.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchFields.C
new file mode 100644
index 0000000000..b3dbcaf36c
--- /dev/null
+++ b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchFields.C
@@ -0,0 +1,43 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
+ \\/ M anipulation |
+-------------------------------------------------------------------------------
+License
+ This file is part of OpenFOAM.
+
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "codedFixedValueFvPatchFields.H"
+#include "addToRunTimeSelectionTable.H"
+#include "volFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+makePatchFields(codedFixedValue);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchFields.H
new file mode 100644
index 0000000000..9ef037bd79
--- /dev/null
+++ b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchFields.H
@@ -0,0 +1,49 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
+ \\/ M anipulation |
+-------------------------------------------------------------------------------
+License
+ This file is part of OpenFOAM.
+
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef codedFixedValueFvPatchFields_H
+#define codedFixedValueFvPatchFields_H
+
+#include "codedFixedValueFvPatchField.H"
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeFieldTypedefs(codedFixedValue);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchFieldsFwd.H
new file mode 100644
index 0000000000..978d711ea3
--- /dev/null
+++ b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchFieldsFwd.H
@@ -0,0 +1,50 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
+ \\/ M anipulation |
+-------------------------------------------------------------------------------
+License
+ This file is part of OpenFOAM.
+
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef codedFixedValueFvPatchFieldsFwd_H
+#define codedFixedValueFvPatchFieldsFwd_H
+
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class codedFixedValueFvPatchField;
+
+makePatchTypeFieldTypedefs(codedFixedValue);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //