diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H index 39b1c9e551..439966188b 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -278,6 +278,18 @@ public: return internalField_; } + //- Optional patch type + const word& patchType() const + { + return patchType_; + } + + //- Optional patch type + word& patchType() + { + return patchType_; + } + //- Return true if this patch field fixes a value virtual bool fixesValue() const { diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C index 84d26c9998..50a2105dee 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield |2011 OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,6 +89,13 @@ Foam::autoPtr > Foam::pointPatchField::New return patchTypeCstrIter()(p, iF); } } + else + { + if (pointPatchConstructorTablePtr_->found(p.type())) + { + pfPtr().patchType() = actualPatchType; + } + } return pfPtr; } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index d3b2ed4e70..3b9d54a2d3 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -308,6 +308,18 @@ public: return internalField_; } + //- Optional patch type + const word& patchType() const + { + return patchType_; + } + + //- Optional patch type + word& patchType() + { + return patchType_; + } + //- Return the type of the calculated for of fvPatchField static const word& calculatedType(); diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C index dfb73c3607..e9eed24fae 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,15 +60,15 @@ Foam::tmp > Foam::fvPatchField::New << exit(FatalError); } + typename patchConstructorTable::iterator patchTypeCstrIter = + patchConstructorTablePtr_->find(p.type()); + if ( actualPatchType == word::null || actualPatchType != p.type() ) { - typename patchConstructorTable::iterator patchTypeCstrIter = - patchConstructorTablePtr_->find(p.type()); - if (patchTypeCstrIter != patchConstructorTablePtr_->end()) { return patchTypeCstrIter()(p, iF); @@ -80,7 +80,14 @@ Foam::tmp > Foam::fvPatchField::New } else { - return cstrIter()(p, iF); + tmp > tfvp = cstrIter()(p, iF); + + // Check if constraint type override and store patchType if so + if ((patchTypeCstrIter != patchConstructorTablePtr_->end())) + { + tfvp().patchType() = actualPatchType; + } + return tfvp; } }