diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index 7e273aa9fd..5eb896084a 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.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. @@ -83,7 +83,7 @@ readField // 2. Patch-groups. (using non-wild card entries of dictionaries) // (patchnames already matched above) // Note: in reverse order of entries in the dictionary (last - // patchGroups wins). This is so is consistent with dictionary wildcard + // patchGroups wins). This is so it is consistent with dictionary wildcard // behaviour if (dict.size()) { @@ -570,14 +570,7 @@ void Foam::GeometricField::Boundary:: writeEntry(const word& keyword, Ostream& os) const { os.beginBlock(keyword); - - forAll(*this, patchi) - { - os.beginBlock(this->operator[](patchi).patch().name()); - os << this->operator[](patchi); - os.endBlock(); - } - + this->writeEntries(os); os.endBlock() << flush; // Check state of IOstream @@ -589,6 +582,19 @@ writeEntry(const word& keyword, Ostream& os) const } +template class PatchField, class GeoMesh> +void Foam::GeometricField::Boundary:: +writeEntries(Ostream& os) const +{ + forAll(*this, patchi) + { + os.beginBlock(this->operator[](patchi).patch().name()); + os << this->operator[](patchi); + os.endBlock(); + } +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template class PatchField, class GeoMesh> diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H index 01337ebe66..c56bcd9a59 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.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 | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -218,6 +218,9 @@ public: //- Write boundary field as dictionary entry void writeEntry(const word& keyword, Ostream& os) const; + //- Write dictionary entries of the individual boundary fields. + void writeEntries(Ostream& os) const; + // Member operators