diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.C index 5432ece12f..22a1e1b0f7 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.C @@ -118,6 +118,12 @@ Foam::genericPolyPatch::~genericPolyPatch() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +const Foam::word& Foam::genericPolyPatch::actualType() const +{ + return actualTypeName_; +} + + void Foam::genericPolyPatch::write(Ostream& os) const { os.writeKeyword("type") << actualTypeName_ << token::END_STATEMENT << nl; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.H index 6a22d8af6f..ac412bcae0 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,8 +25,9 @@ Class Foam::genericPolyPatch Description - Substitute for unknown patches. Used for postprocessing when only - basic polyPatch info is needed. + Substitute for unknown patches. + Used for postprocessing when only basic polyPatch info is needed + or if the real patch type is unavailable. Note Storage is not optimal. It stores all face centres and cells on all @@ -57,7 +58,7 @@ class genericPolyPatch { // Private data - word actualTypeName_; + const word actualTypeName_; dictionary dict_; public: @@ -162,6 +163,9 @@ public: // Member functions + //- Return the actual type + const word& actualType() const; + //- Write the polyPatch data as a dictionary virtual void write(Ostream&) const; }; diff --git a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C index 374aa5eac6..5237887644 100644 --- a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C +++ b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C @@ -764,6 +764,13 @@ Foam::genericFvPatchField::gradientBoundaryCoeffs() const } +template +const Foam::word& Foam::genericFvPatchField::actualType() const +{ + return actualTypeName_; +} + + template void Foam::genericFvPatchField::write(Ostream& os) const { diff --git a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H index ec3be385b4..88091b90bb 100644 --- a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H +++ b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H @@ -59,7 +59,7 @@ class genericFvPatchField { // Private data - word actualTypeName_; + const word actualTypeName_; dictionary dict_; HashPtrTable scalarFields_; @@ -179,6 +179,9 @@ public: tmp> gradientBoundaryCoeffs() const; + //- Return the actual type + const word& actualType() const; + //- Write virtual void write(Ostream&) const; }; diff --git a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C index 8f4970855f..c1d1dd42ec 100644 --- a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C +++ b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -557,6 +557,13 @@ void Foam::genericPointPatchField::rmap } +template +const Foam::word& Foam::genericPointPatchField::actualType() const +{ + return actualTypeName_; +} + + template void Foam::genericPointPatchField::write(Ostream& os) const { diff --git a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H index e68ce631b1..33880fd723 100644 --- a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H +++ b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -55,7 +55,7 @@ class genericPointPatchField { // Private data - word actualTypeName_; + const word actualTypeName_; dictionary dict_; HashPtrTable scalarFields_; @@ -151,6 +151,9 @@ public: ); + //- Return the actual type + const word& actualType() const; + //- Write virtual void write(Ostream&) const; };