diff --git a/src/Allwmake b/src/Allwmake
index f3c4420474..9070e42da0 100755
--- a/src/Allwmake
+++ b/src/Allwmake
@@ -58,7 +58,7 @@ wmake libso randomProcesses
thermophysicalModels/Allwmake
transportModels/Allwmake
turbulenceModels/Allwmake
-wmake libso surfaceFilmModels
+regionModels/Allwmake
lagrangian/Allwmake
postProcessing/Allwmake
mesh/Allwmake
diff --git a/src/regionModels/Allwmake b/src/regionModels/Allwmake
new file mode 100755
index 0000000000..7713ded586
--- /dev/null
+++ b/src/regionModels/Allwmake
@@ -0,0 +1,11 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # run from this directory
+set -x
+
+wmake libso regionModel
+#wmake libso pyrolysisModels
+wmake libso surfaceFilmModels
+#wmake libso regionCoupling
+
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/src/regionModels/regionModel/Make/files b/src/regionModels/regionModel/Make/files
new file mode 100644
index 0000000000..e2989ef8fc
--- /dev/null
+++ b/src/regionModels/regionModel/Make/files
@@ -0,0 +1,14 @@
+/* Region models */
+regionModel/regionModel.C
+singleLayerRegion/singleLayerRegion.C
+regionModel1D/regionModel1D.C
+
+/* Boundary conditions */
+derivedFvPatchFields/directMappedField/directMappedFieldFvPatchFields.C
+
+derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C
+derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C
+derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.C
+
+
+LIB = $(FOAM_LIBBIN)/libregionModels
diff --git a/src/regionModels/regionModel/Make/options b/src/regionModels/regionModel/Make/options
new file mode 100644
index 0000000000..d27c95d033
--- /dev/null
+++ b/src/regionModels/regionModel/Make/options
@@ -0,0 +1,7 @@
+EXE_INC = \
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
+ -I$(LIB_SRC)/meshTools/lnInclude
+
+EXE_LIBS = \
+ -lfiniteVolume \
+ -lmeshTools
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchField.C b/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchField.C
new file mode 100644
index 0000000000..f9be131628
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchField.C
@@ -0,0 +1,313 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2010-2010 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 "directMappedFieldFvPatchField.H"
+
+#include "volFields.H"
+#include "interpolationCell.H"
+#include "mapDistribute.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+directMappedFieldFvPatchField::directMappedFieldFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ directMappedPatchBase(p.patch()),
+ fixedValueFvPatchField(p, iF),
+ fieldName_(iF.name()),
+ setAverage_(false),
+ average_(pTraits::zero)
+{}
+
+
+template
+directMappedFieldFvPatchField::directMappedFieldFvPatchField
+(
+ const directMappedFieldFvPatchField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ directMappedPatchBase(p.patch(), ptf),
+ fixedValueFvPatchField(ptf, p, iF, mapper),
+ fieldName_(ptf.fieldName_),
+ setAverage_(ptf.setAverage_),
+ average_(ptf.average_)
+{}
+
+
+template
+directMappedFieldFvPatchField::directMappedFieldFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ directMappedPatchBase(p.patch(), dict),
+ fixedValueFvPatchField(p, iF, dict),
+ fieldName_(dict.template lookupOrDefault("fieldName", iF.name())),
+ setAverage_(readBool(dict.lookup("setAverage"))),
+ average_(pTraits(dict.lookup("average")))
+{}
+
+
+template
+directMappedFieldFvPatchField::directMappedFieldFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+
+ // directMappedPatchBase
+ const word& sampleRegion,
+ const sampleMode sampleMode,
+ const word& samplePatch,
+ const scalar distance,
+
+ // My settings
+ const word& fieldName,
+ const bool setAverage,
+ const Type average
+)
+:
+ directMappedPatchBase
+ (
+ p.patch(),
+ sampleRegion,
+ sampleMode,
+ samplePatch,
+ distance
+ ),
+ fixedValueFvPatchField(p, iF),
+ fieldName_(fieldName),
+ setAverage_(setAverage),
+ average_(average)
+{}
+
+
+template
+directMappedFieldFvPatchField::directMappedFieldFvPatchField
+(
+ const directMappedFieldFvPatchField& ptf
+)
+:
+ directMappedPatchBase(ptf.patch().patch(), ptf),
+ fixedValueFvPatchField(ptf),
+ fieldName_(ptf.fieldName_),
+ setAverage_(ptf.setAverage_),
+ average_(ptf.average_)
+{}
+
+
+template
+directMappedFieldFvPatchField::directMappedFieldFvPatchField
+(
+ const directMappedFieldFvPatchField& ptf,
+ const DimensionedField& iF
+)
+:
+ directMappedPatchBase(ptf.patch().patch(), ptf),
+ fixedValueFvPatchField(ptf, iF),
+ fieldName_(ptf.fieldName_),
+ setAverage_(ptf.setAverage_),
+ average_(ptf.average_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+template
+const GeometricField&
+directMappedFieldFvPatchField::sampleField() const
+{
+ typedef GeometricField fieldType;
+
+ const fvMesh& nbrMesh = refCast(sampleMesh());
+
+ if (sameRegion())
+ {
+ if (fieldName_ == this->dimensionedInternalField().name())
+ {
+ // Optimisation: bypass field lookup
+ return
+ dynamic_cast
+ (
+ this->dimensionedInternalField()
+ );
+ }
+ else
+ {
+ const fvMesh& thisMesh = this->patch().boundaryMesh().mesh();
+ return thisMesh.template lookupObject(fieldName_);
+ }
+ }
+ else
+ {
+ return nbrMesh.template lookupObject(fieldName_);
+ }
+}
+
+
+template
+void directMappedFieldFvPatchField::updateCoeffs()
+{
+ if (this->updated())
+ {
+ return;
+ }
+
+ typedef GeometricField fieldType;
+
+ const fvMesh& nbrMesh = refCast(sampleMesh());
+ const mapDistribute& distMap = directMappedPatchBase::map();
+
+ // Result of obtaining remote values
+ Field newValues;
+
+ switch (mode())
+ {
+ case NEARESTCELL:
+ {
+ newValues = sampleField();
+
+ distMap.distribute(newValues);
+
+ break;
+ }
+ case NEARESTPATCHFACE:
+ {
+ const label nbrPatchID = nbrMesh.boundaryMesh().findPatchID
+ (
+ samplePatch()
+ );
+ if (nbrPatchID < 0)
+ {
+ FatalErrorIn
+ (
+ "void directMappedFieldFvPatchField::updateCoeffs()"
+ )<< "Unable to find sample patch " << samplePatch()
+ << " in region " << sampleRegion()
+ << " for patch " << this->patch().name() << nl
+ << abort(FatalError);
+ }
+
+ const fieldType& nbrField = sampleField();
+
+ newValues = nbrField.boundaryField()[nbrPatchID];
+ distMap.distribute(newValues);
+
+ break;
+ }
+ case NEARESTFACE:
+ {
+ Field allValues(nbrMesh.nFaces(), pTraits::zero);
+
+ const fieldType& nbrField = sampleField();
+
+ forAll(nbrField.boundaryField(), patchI)
+ {
+ const fvPatchField& pf =
+ nbrField.boundaryField()[patchI];
+ label faceStart = pf.patch().patch().start();
+
+ forAll(pf, faceI)
+ {
+ allValues[faceStart++] = pf[faceI];
+ }
+ }
+
+ distMap.distribute(allValues);
+
+ newValues.transfer(allValues);
+
+ break;
+ }
+ default:
+ {
+ FatalErrorIn("directMappedFieldFvPatchField::updateCoeffs()")
+ << "Unknown sampling mode: " << mode()
+ << nl << abort(FatalError);
+ }
+ }
+
+ if (setAverage_)
+ {
+ Type averagePsi =
+ gSum(this->patch().magSf()*newValues)
+ /gSum(this->patch().magSf());
+
+ if (mag(averagePsi)/mag(average_) > 0.5)
+ {
+ newValues *= mag(average_)/mag(averagePsi);
+ }
+ else
+ {
+ newValues += (average_ - averagePsi);
+ }
+ }
+
+ this->operator==(newValues);
+
+ if (debug)
+ {
+ Info<< "operating on field:" << this->dimensionedInternalField().name()
+ << " patch:" << this->patch().name()
+ << " avg:" << gAverage(*this)
+ << " min:" << gMin(*this)
+ << " max:" << gMax(*this)
+ << endl;
+ }
+
+ fixedValueFvPatchField::updateCoeffs();
+}
+
+
+template
+void directMappedFieldFvPatchField::write(Ostream& os) const
+{
+ fvPatchField::write(os);
+ directMappedPatchBase::write(os);
+ os.writeKeyword("fieldName") << fieldName_ << token::END_STATEMENT << nl;
+ os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl;
+ os.writeKeyword("average") << average_ << token::END_STATEMENT << nl;
+ this->writeEntry("value", os);
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchField.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchField.H
new file mode 100644
index 0000000000..c11a8e71a9
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchField.H
@@ -0,0 +1,201 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2010-2010 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::directMappedFieldFvPatchField
+
+Description
+ Self-contained version of directMapped. Does not use information on
+ patch, instead holds it locally (and possibly duplicate) so use
+ normal directMapped in preference and only use this if you cannot
+ change the underlying patch type to directMapped.
+
+SourceFiles
+ directMappedFieldFvPatchField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef directMappedFieldFvPatchField_H
+#define directMappedFieldFvPatchField_H
+
+#include "directMappedPatchBase.H"
+#include "fixedValueFvPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class directMappedFieldFvPatchField Declaration
+\*---------------------------------------------------------------------------*/
+
+template
+class directMappedFieldFvPatchField
+:
+ public directMappedPatchBase,
+ public fixedValueFvPatchField
+{
+ // Private data
+
+ //- Name of field to sample - defaults to field associated with this
+ // patchField if not specified
+ word fieldName_;
+
+ //- If true adjust the mapped field to maintain average value average_
+ const bool setAverage_;
+
+ //- Average value the mapped field is adjusted to maintain if
+ // setAverage_ is set true
+ const Type average_;
+
+
+ // Private Member Functions
+
+ //- Field to sample. Either on my or nbr mesh
+ const GeometricField& sampleField() const;
+
+
+public:
+
+ //- Runtime type information
+ TypeName("directMappedField");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ directMappedFieldFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ directMappedFieldFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct from patch, internal field and distance for normal type
+ // sampling
+ directMappedFieldFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+
+ // directMappedPatchBase
+ const word& sampleRegion,
+ const sampleMode sampleMode,
+ const word& samplePatch,
+ const scalar distance,
+
+ // My settings
+ const word& fieldName,
+ const bool setAverage,
+ const Type average
+ );
+
+ //- Construct by mapping given
+ // directMappedFieldFvPatchField
+ // onto a new patch
+ directMappedFieldFvPatchField
+ (
+ const directMappedFieldFvPatchField&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ directMappedFieldFvPatchField
+ (
+ const directMappedFieldFvPatchField&
+ );
+
+ //- Construct and return a clone
+ virtual tmp > clone() const
+ {
+ return tmp >
+ (
+ new directMappedFieldFvPatchField
+ (
+ *this
+ )
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ directMappedFieldFvPatchField
+ (
+ const directMappedFieldFvPatchField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp > clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp >
+ (
+ new directMappedFieldFvPatchField
+ (
+ *this,
+ iF
+ )
+ );
+ }
+
+
+ // Member functions
+
+ // Evaluation functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+# include "directMappedFieldFvPatchField.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchFields.C b/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchFields.C
new file mode 100644
index 0000000000..92b3a99576
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchFields.C
@@ -0,0 +1,43 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2010-2010 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 "directMappedFieldFvPatchFields.H"
+#include "volMesh.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+makePatchFields(directMappedField);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchFields.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchFields.H
new file mode 100644
index 0000000000..45517fb557
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchFields.H
@@ -0,0 +1,49 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2010-2010 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 directMappedFieldFvPatchFields_H
+#define directMappedFieldFvPatchFields_H
+
+#include "directMappedFieldFvPatchField.H"
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeFieldTypedefs(directMappedField)
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchFieldsFwd.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchFieldsFwd.H
new file mode 100644
index 0000000000..82b5fe7a14
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedField/directMappedFieldFvPatchFieldsFwd.H
@@ -0,0 +1,50 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2010-2010 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 directMappedFieldFvPatchFieldsFwd_H
+#define directMappedFieldFvPatchFieldsFwd_H
+
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class directMappedFieldFvPatchField;
+
+makePatchTypeFieldTypedefs(directMappedField)
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C
new file mode 100644
index 0000000000..ee04c6ff94
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C
@@ -0,0 +1,157 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2009-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#include "directMappedFixedInternalValueFvPatchField.H"
+#include "UIndirectList.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+Foam::directMappedFixedInternalValueFvPatchField::
+directMappedFixedInternalValueFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ directMappedFixedValueFvPatchField(p, iF)
+{}
+
+
+template
+Foam::directMappedFixedInternalValueFvPatchField::
+directMappedFixedInternalValueFvPatchField
+(
+ const directMappedFixedInternalValueFvPatchField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ directMappedFixedValueFvPatchField(ptf, p, iF, mapper)
+{}
+
+
+template
+Foam::directMappedFixedInternalValueFvPatchField::
+directMappedFixedInternalValueFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ directMappedFixedValueFvPatchField(p, iF, dict)
+{}
+
+
+template
+Foam::directMappedFixedInternalValueFvPatchField::
+directMappedFixedInternalValueFvPatchField
+(
+ const directMappedFixedInternalValueFvPatchField& ptf
+)
+:
+ directMappedFixedValueFvPatchField(ptf)
+{}
+
+
+template
+Foam::directMappedFixedInternalValueFvPatchField::
+directMappedFixedInternalValueFvPatchField
+(
+ const directMappedFixedInternalValueFvPatchField& ptf,
+ const DimensionedField& iF
+)
+:
+ directMappedFixedValueFvPatchField(ptf, iF)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+template
+void Foam::directMappedFixedInternalValueFvPatchField::updateCoeffs()
+{
+ typedef GeometricField FieldType;
+
+ if (this->updated())
+ {
+ return;
+ }
+
+ // Retrieve the neighbour values and assign to this patch boundary field
+ directMappedFixedValueFvPatchField::updateCoeffs();
+
+ // Get the coupling information from the directMappedPatchBase
+ const directMappedPatchBase& mpp =
+ refCast(this->patch().patch());
+ const polyMesh& nbrMesh = mpp.sampleMesh();
+ const fvPatch& nbrPatch =
+ refCast
+ (
+ nbrMesh
+ ).boundary()[mpp.samplePolyPatch().index()];
+
+ // Force recalculation of mapping and schedule
+ const mapDistribute& distMap = mpp.map();
+
+ // Retrieve the neighbour field
+ const fvPatchField& nbrField =
+ nbrPatch.template lookupPatchField
+ (
+ this->dimensionedInternalField().name()
+ );
+
+ // Retrieve the neighbour patch internal field
+ Field nbrIntFld = nbrField.patchInternalField();
+ mapDistribute::distribute
+ (
+ Pstream::defaultCommsType,
+ distMap.schedule(),
+ distMap.constructSize(),
+ distMap.subMap(), // what to send
+ distMap.constructMap(), // what to receive
+ nbrIntFld
+ );
+
+ // Assign (this) patch internal field to its neighbour values
+ Field& intFld = const_cast&>(this->internalField());
+ UIndirectList(intFld, this->patch().faceCells()) = nbrIntFld;
+}
+
+
+template
+void Foam::directMappedFixedInternalValueFvPatchField::write
+(
+ Ostream& os
+) const
+{
+ directMappedFixedValueFvPatchField::write(os);
+}
+
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H
new file mode 100644
index 0000000000..bdc887e185
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H
@@ -0,0 +1,151 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2009-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Class
+ Foam::directMappedFixedInternalValueFvPatchField
+
+Description
+ Recycles the boundary and internal values of a neighbour patch field to
+ the boundary and internal values of *this.
+
+SourceFiles
+ directMappedFixedInternalValueFvPatchField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef directMappedFixedInternalValueFvPatchField_H
+#define directMappedFixedInternalValueFvPatchField_H
+
+#include "directMappedFixedValueFvPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class directMappedFixedInternalValueFvPatchField Declaration
+\*---------------------------------------------------------------------------*/
+
+template
+class directMappedFixedInternalValueFvPatchField
+:
+ public directMappedFixedValueFvPatchField
+{
+
+public:
+
+ //- Runtime type information
+ TypeName("directMappedFixedInternalValue");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ directMappedFixedInternalValueFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ directMappedFixedInternalValueFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping given
+ // directMappedFixedInternalValueFvPatchField onto a new patch
+ directMappedFixedInternalValueFvPatchField
+ (
+ const directMappedFixedInternalValueFvPatchField&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ directMappedFixedInternalValueFvPatchField
+ (
+ const directMappedFixedInternalValueFvPatchField&
+ );
+
+ //- Construct and return a clone
+ virtual tmp > clone() const
+ {
+ return tmp >
+ (
+ new directMappedFixedInternalValueFvPatchField(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ directMappedFixedInternalValueFvPatchField
+ (
+ const directMappedFixedInternalValueFvPatchField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp > clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp >
+ (
+ new directMappedFixedInternalValueFvPatchField(*this, iF)
+ );
+ }
+
+
+ // Member functions
+
+ // Evaluation functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+# include "directMappedFixedInternalValueFvPatchField.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C
new file mode 100644
index 0000000000..e43d668c37
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C
@@ -0,0 +1,44 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2009-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#include "directMappedFixedInternalValueFvPatchFields.H"
+#include "volMesh.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+makePatchFields(directMappedFixedInternalValue);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H
new file mode 100644
index 0000000000..199df76640
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H
@@ -0,0 +1,50 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2009-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef directMappedFixedInternalValueFvPatchFields_H
+#define directMappedFixedInternalValueFvPatchFields_H
+
+#include "directMappedFixedInternalValueFvPatchField.H"
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeFieldTypedefs(directMappedFixedInternalValue)
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H
new file mode 100644
index 0000000000..6433bf0606
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H
@@ -0,0 +1,51 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2009-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef directMappedFixedInternalValueFvPatchFieldsFwd_H
+#define directMappedFixedInternalValueFvPatchFieldsFwd_H
+
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class directMappedFixedInternalValueFvPatchField;
+
+makePatchTypeFieldTypedefs(directMappedFixedInternalValue)
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C
new file mode 100644
index 0000000000..b3eacffa08
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C
@@ -0,0 +1,126 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2009-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#include "directMappedFixedPushedInternalValueFvPatchField.H"
+#include "UIndirectList.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+Foam::directMappedFixedPushedInternalValueFvPatchField::
+directMappedFixedPushedInternalValueFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ directMappedFixedValueFvPatchField(p, iF)
+{}
+
+
+template
+Foam::directMappedFixedPushedInternalValueFvPatchField::
+directMappedFixedPushedInternalValueFvPatchField
+(
+ const directMappedFixedPushedInternalValueFvPatchField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ directMappedFixedValueFvPatchField(ptf, p, iF, mapper)
+{}
+
+
+template
+Foam::directMappedFixedPushedInternalValueFvPatchField::
+directMappedFixedPushedInternalValueFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ directMappedFixedValueFvPatchField(p, iF, dict)
+{}
+
+
+template
+Foam::directMappedFixedPushedInternalValueFvPatchField::
+directMappedFixedPushedInternalValueFvPatchField
+(
+ const directMappedFixedPushedInternalValueFvPatchField& ptf
+)
+:
+ directMappedFixedValueFvPatchField(ptf)
+{}
+
+
+template
+Foam::directMappedFixedPushedInternalValueFvPatchField::
+directMappedFixedPushedInternalValueFvPatchField
+(
+ const directMappedFixedPushedInternalValueFvPatchField& ptf,
+ const DimensionedField& iF
+)
+:
+ directMappedFixedValueFvPatchField(ptf, iF)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+template
+void
+Foam::directMappedFixedPushedInternalValueFvPatchField::updateCoeffs()
+{
+ typedef GeometricField FieldType;
+
+ if (this->updated())
+ {
+ return;
+ }
+
+ // Retrieve the neighbour values and assign to this patch boundary field
+ directMappedFixedValueFvPatchField::updateCoeffs();
+
+ // Assign the patch internal field to its boundary value
+ Field& intFld = const_cast&>(this->internalField());
+ UIndirectList(intFld, this->patch().faceCells()) = *this;
+}
+
+
+template
+void Foam::directMappedFixedPushedInternalValueFvPatchField::write
+(
+ Ostream& os
+) const
+{
+ directMappedFixedValueFvPatchField::write(os);
+}
+
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H
new file mode 100644
index 0000000000..1b8ff45c44
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H
@@ -0,0 +1,158 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2009-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Class
+ Foam::directMappedFixedPushedInternalValueFvPatchField
+
+Description
+ Recycles the boundary values of a neighbour patch field to the boundary
+ and internal values of *this.
+
+SourceFiles
+ directMappedFixedPushedInternalValueFvPatchField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef directMappedFixedPushedInternalValueFvPatchField_H
+#define directMappedFixedPushedInternalValueFvPatchField_H
+
+#include "directMappedFixedValueFvPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class directMappedFixedPushedInternalValueFvPatchField Declaration
+\*---------------------------------------------------------------------------*/
+
+template
+class directMappedFixedPushedInternalValueFvPatchField
+:
+ public directMappedFixedValueFvPatchField
+{
+
+public:
+
+ //- Runtime type information
+ TypeName("directMappedFixedPushedInternalValue");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ directMappedFixedPushedInternalValueFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ directMappedFixedPushedInternalValueFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping given a
+ // directMappedFixedPushedInternalValueFvPatchField onto a new patch
+ directMappedFixedPushedInternalValueFvPatchField
+ (
+ const directMappedFixedPushedInternalValueFvPatchField&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ directMappedFixedPushedInternalValueFvPatchField
+ (
+ const directMappedFixedPushedInternalValueFvPatchField&
+ );
+
+ //- Construct and return a clone
+ virtual tmp > clone() const
+ {
+ return tmp >
+ (
+ new directMappedFixedPushedInternalValueFvPatchField
+ (
+ *this
+ )
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ directMappedFixedPushedInternalValueFvPatchField
+ (
+ const directMappedFixedPushedInternalValueFvPatchField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp > clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp >
+ (
+ new directMappedFixedPushedInternalValueFvPatchField
+ (
+ *this,
+ iF
+ )
+ );
+ }
+
+
+ // Member functions
+
+ // Evaluation functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+# include "directMappedFixedPushedInternalValueFvPatchField.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C
new file mode 100644
index 0000000000..ba56536a60
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C
@@ -0,0 +1,44 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2009-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#include "directMappedFixedPushedInternalValueFvPatchFields.H"
+#include "volMesh.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+makePatchFields(directMappedFixedPushedInternalValue);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H
new file mode 100644
index 0000000000..e333000ed0
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H
@@ -0,0 +1,50 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2009-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef directMappedFixedPushedInternalValueFvPatchFields_H
+#define directMappedFixedPushedInternalValueFvPatchFields_H
+
+#include "directMappedFixedPushedInternalValueFvPatchField.H"
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeFieldTypedefs(directMappedFixedPushedInternalValue)
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H
new file mode 100644
index 0000000000..9c1e26a315
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H
@@ -0,0 +1,51 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2009-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef directMappedFixedPushedInternalValueFvPatchFieldsFwd_H
+#define directMappedFixedPushedInternalValueFvPatchFieldsFwd_H
+
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class directMappedFixedPushedInternalValueFvPatchField;
+
+makePatchTypeFieldTypedefs(directMappedFixedInternalValue)
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.C b/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.C
new file mode 100644
index 0000000000..edbd419b83
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.C
@@ -0,0 +1,336 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2010-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#include "directMappedNamedFixedValueFvPatchField.H"
+#include "directMappedPatchBase.H"
+#include "mapDistribute.H"
+#include "volFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+directMappedNamedFixedValueFvPatchField::
+directMappedNamedFixedValueFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(p, iF),
+ fieldName_(iF.name()),
+ setAverage_(false),
+ average_(pTraits::zero)
+{}
+
+
+template
+directMappedNamedFixedValueFvPatchField::
+directMappedNamedFixedValueFvPatchField
+(
+ const directMappedNamedFixedValueFvPatchField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ fixedValueFvPatchField(ptf, p, iF, mapper),
+ fieldName_(ptf.fieldName_),
+ setAverage_(ptf.setAverage_),
+ average_(ptf.average_)
+{
+ if (!isA(this->patch().patch()))
+ {
+ FatalErrorIn
+ (
+ "directMappedNamedFixedValueFvPatchField::"
+ "directMappedNamedFixedValueFvPatchField\n"
+ "(\n"
+ " const directMappedNamedFixedValueFvPatchField&,\n"
+ " const fvPatch&,\n"
+ " const Field&,\n"
+ " const fvPatchFieldMapper&\n"
+ ")\n"
+ ) << "\n patch type '" << p.type()
+ << "' not type '" << directMappedPatchBase::typeName << "'"
+ << "\n for patch " << p.name()
+ << " of field " << this->dimensionedInternalField().name()
+ << " in file " << this->dimensionedInternalField().objectPath()
+ << exit(FatalError);
+ }
+}
+
+
+template
+directMappedNamedFixedValueFvPatchField::
+directMappedNamedFixedValueFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ fixedValueFvPatchField(p, iF, dict),
+ fieldName_(dict.lookupOrDefault("fieldName", iF.name())),
+ setAverage_(readBool(dict.lookup("setAverage"))),
+ average_(pTraits(dict.lookup("average")))
+{
+ if (!isA(this->patch().patch()))
+ {
+ FatalErrorIn
+ (
+ "directMappedNamedFixedValueFvPatchField::"
+ "directMappedNamedFixedValueFvPatchField"
+ "("
+ " const fvPatch&, "
+ " const DimensionedField& iF, "
+ " const dictionary&"
+ ")"
+ ) << "\n patch type '" << p.type()
+ << "' not type '" << directMappedPatchBase::typeName << "'"
+ << "\n for patch " << p.name()
+ << " of field " << fieldName_
+ << " in file " << this->dimensionedInternalField().objectPath()
+ << exit(FatalError);
+ }
+
+ //// Force calculation of schedule (uses parallel comms)
+ //const directMappedPatchBase& mpp = refCast
+ //(
+ // this->patch().patch()
+ //);
+ //(void)mpp.map().schedule();
+}
+
+
+template
+directMappedNamedFixedValueFvPatchField::
+directMappedNamedFixedValueFvPatchField
+(
+ const directMappedNamedFixedValueFvPatchField& ptf
+)
+:
+ fixedValueFvPatchField(ptf),
+ fieldName_(ptf.fieldName_),
+ setAverage_(ptf.setAverage_),
+ average_(ptf.average_)
+{}
+
+
+template
+directMappedNamedFixedValueFvPatchField::
+directMappedNamedFixedValueFvPatchField
+(
+ const directMappedNamedFixedValueFvPatchField& ptf,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(ptf, iF),
+ fieldName_(ptf.fieldName_),
+ setAverage_(ptf.setAverage_),
+ average_(ptf.average_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+template
+void directMappedNamedFixedValueFvPatchField::updateCoeffs()
+{
+ if (this->updated())
+ {
+ return;
+ }
+
+ typedef GeometricField fieldType;
+
+ // Get the scheduling information from the directMappedPatchBase
+ const directMappedPatchBase& mpp = refCast
+ (
+ directMappedNamedFixedValueFvPatchField::patch().patch()
+ );
+ const mapDistribute& distMap = mpp.map();
+
+ // Force recalculation of schedule
+ (void)distMap.schedule();
+
+ const fvMesh& nbrMesh = refCast(mpp.sampleMesh());
+
+ // Result of obtaining remote values
+ Field newValues;
+
+ switch (mpp.mode())
+ {
+ case directMappedPatchBase::NEARESTCELL:
+ {
+ if (mpp.sameRegion())
+ {
+ newValues = this->internalField();
+ }
+ else
+ {
+ newValues = nbrMesh.lookupObject
+ (
+ fieldName_
+ ).internalField();
+ }
+ mapDistribute::distribute
+ (
+ Pstream::defaultCommsType,
+ distMap.schedule(),
+ distMap.constructSize(),
+ distMap.subMap(),
+ distMap.constructMap(),
+ newValues
+ );
+
+ break;
+ }
+ case directMappedPatchBase::NEARESTPATCHFACE:
+ {
+ const label nbrPatchID =
+ nbrMesh.boundaryMesh().findPatchID(mpp.samplePatch());
+ if (nbrPatchID < 0)
+ {
+ FatalErrorIn
+ (
+ "void directMappedNamedFixedValueFvPatchField::"
+ "updateCoeffs()"
+ )<< "Unable to find sample patch " << mpp.samplePatch()
+ << " in region " << mpp.sampleRegion()
+ << " for patch " << this->patch().name() << nl
+ << abort(FatalError);
+ }
+
+ const fieldType& nbrField =
+ nbrMesh.lookupObject(fieldName_);
+ newValues = nbrField.boundaryField()[nbrPatchID];
+ mapDistribute::distribute
+ (
+ Pstream::defaultCommsType,
+ distMap.schedule(),
+ distMap.constructSize(),
+ distMap.subMap(),
+ distMap.constructMap(),
+ newValues
+ );
+
+ break;
+ }
+ case directMappedPatchBase::NEARESTFACE:
+ {
+ Field allValues(nbrMesh.nFaces(), pTraits::zero);
+
+ const fieldType& nbrField =
+ nbrMesh.lookupObject(fieldName_);
+ forAll(nbrField.boundaryField(), patchI)
+ {
+ const fvPatchField& pf =
+ nbrField.boundaryField()[patchI];
+ label faceStart = pf.patch().patch().start();
+
+ forAll(pf, faceI)
+ {
+ allValues[faceStart++] = pf[faceI];
+ }
+ }
+
+ mapDistribute::distribute
+ (
+ Pstream::defaultCommsType,
+ distMap.schedule(),
+ distMap.constructSize(),
+ distMap.subMap(),
+ distMap.constructMap(),
+ allValues
+ );
+
+ newValues = this->patch().patchSlice(allValues);
+
+ break;
+ }
+ default:
+ {
+ FatalErrorIn
+ (
+ "directMappedNamedFixedValueFvPatchField::updateCoeffs()"
+ )<< "Unknown sampling mode: " << mpp.mode()
+ << nl << abort(FatalError);
+ }
+ }
+
+ if (setAverage_)
+ {
+ Type averagePsi =
+ gSum(this->patch().magSf()*newValues)
+ /gSum(this->patch().magSf());
+
+ if (mag(averagePsi)/mag(average_) > 0.5)
+ {
+ newValues *= mag(average_)/mag(averagePsi);
+ }
+ else
+ {
+ newValues += (average_ - averagePsi);
+ }
+ }
+
+ this->operator==(newValues);
+
+ if (debug)
+ {
+ Info<< "directMapped on field:" << fieldName_
+ << " patch:" << this->patch().name()
+ << " avg:" << gAverage(*this)
+ << " min:" << gMin(*this)
+ << " max:" << gMax(*this)
+ << endl;
+ }
+
+ fixedValueFvPatchField::updateCoeffs();
+}
+
+
+template
+void directMappedNamedFixedValueFvPatchField::write(Ostream& os) const
+{
+ fvPatchField::write(os);
+ os.writeKeyword("fieldName") << fieldName_ << token::END_STATEMENT << nl;
+ os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl;
+ os.writeKeyword("average") << average_ << token::END_STATEMENT << nl;
+ this->writeEntry("value", os);
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.H
new file mode 100644
index 0000000000..248c6690ff
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.H
@@ -0,0 +1,165 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2010-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Class
+ Foam::directMappedNamedFixedValueFvPatchField
+
+Description
+ Variant of directMappedFixedValueFvPatch where the name of the field to
+ map is input.
+
+SourceFiles
+ directMappedNamedFixedValueFvPatchField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef directMappedNamedFixedValueFvPatchField_H
+#define directMappedNamedFixedValueFvPatchField_H
+
+#include "fixedValueFvPatchField.H"
+#include "directMappedFvPatch.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class directMappedNamesFixedValueFvPatchField Declaration
+\*---------------------------------------------------------------------------*/
+
+template
+class directMappedNamedFixedValueFvPatchField
+:
+ public fixedValueFvPatchField
+{
+ // Private data
+
+ //- Name of field to sample - defaults to field associated with this
+ // patch if not specified
+ word fieldName_;
+
+ //- If true adjust the mapped field to maintain average value average_
+ bool setAverage_;
+
+ //- Average value the mapped field is adjusted to maintain if
+ // setAverage_ is set true
+ Type average_;
+
+
+public:
+
+ //- Runtime type information
+ TypeName("directMappedNamedFixedValue");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ directMappedNamedFixedValueFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ directMappedNamedFixedValueFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping given directMappedNamedFixedValueFvPatchField
+ // onto a new patch
+ directMappedNamedFixedValueFvPatchField
+ (
+ const directMappedNamedFixedValueFvPatchField&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ directMappedNamedFixedValueFvPatchField
+ (
+ const directMappedNamedFixedValueFvPatchField&
+ );
+
+ //- Construct and return a clone
+ virtual tmp > clone() const
+ {
+ return tmp >
+ (
+ new directMappedNamedFixedValueFvPatchField(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ directMappedNamedFixedValueFvPatchField
+ (
+ const directMappedNamedFixedValueFvPatchField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp > clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp >
+ (
+ new directMappedNamedFixedValueFvPatchField(*this, iF)
+ );
+ }
+
+
+ // Member functions
+
+ // Evaluation functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+# include "directMappedNamedFixedValueFvPatchField.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.C b/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.C
new file mode 100644
index 0000000000..5725af6d74
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.C
@@ -0,0 +1,44 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2010-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#include "directMappedNamedFixedValueFvPatchFields.H"
+#include "volMesh.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+makePatchFields(directMappedNamedFixedValue);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.H
new file mode 100644
index 0000000000..cd61e50493
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.H
@@ -0,0 +1,50 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2010-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef directMappedNamedFixedValueFvPatchFields_H
+#define directMappedNamedFixedValueFvPatchFields_H
+
+#include "directMappedNamedFixedValueFvPatchField.H"
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeFieldTypedefs(directMappedNamedFixedValue)
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFieldsFwd.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFieldsFwd.H
new file mode 100644
index 0000000000..75e3046e24
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFieldsFwd.H
@@ -0,0 +1,51 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2010-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef directMappedNamedFixedValueFvPatchFieldsFwd_H
+#define directMappedNamedFixedValueFvPatchFieldsFwd_H
+
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class directMappedNamedFixedValueFvPatchField;
+
+makePatchTypeFieldTypedefs(directMappedNamedFixedValue)
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamesFixedValueFvPatchFieldsFwd.H b/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamesFixedValueFvPatchFieldsFwd.H
new file mode 100644
index 0000000000..75e3046e24
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamesFixedValueFvPatchFieldsFwd.H
@@ -0,0 +1,51 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2010-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef directMappedNamedFixedValueFvPatchFieldsFwd_H
+#define directMappedNamedFixedValueFvPatchFieldsFwd_H
+
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class directMappedNamedFixedValueFvPatchField;
+
+makePatchTypeFieldTypedefs(directMappedNamedFixedValue)
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/regionModels/regionModel/derivedFvPatchFields/filmMappedFixedInternalValue/regionMappedFixedInternalValueFvPatchField.C b/src/regionModels/regionModel/derivedFvPatchFields/filmMappedFixedInternalValue/regionMappedFixedInternalValueFvPatchField.C
new file mode 100644
index 0000000000..733e156862
--- /dev/null
+++ b/src/regionModels/regionModel/derivedFvPatchFields/filmMappedFixedInternalValue/regionMappedFixedInternalValueFvPatchField.C
@@ -0,0 +1,170 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2009-2010 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 2 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, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#include "regionMappedFixedInternalValueFvPatchField.H"
+#include "UIndirectList.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+Foam::regionMappedFixedInternalValueFvPatchField::
+regionMappedFixedInternalValueFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(p, iF)
+{}
+
+
+template
+Foam::regionMappedFixedInternalValueFvPatchField::
+regionMappedFixedInternalValueFvPatchField
+(
+ const regionMappedFixedInternalValueFvPatchField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ fixedValueFvPatchField(ptf, p, iF, mapper)
+{}
+
+
+template
+Foam::regionMappedFixedInternalValueFvPatchField::
+regionMappedFixedInternalValueFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField