diff --git a/src/OpenFOAM/db/dictionary/dictionary.C b/src/OpenFOAM/db/dictionary/dictionary.C index e6f7c6c7db..57ebd84f76 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.C +++ b/src/OpenFOAM/db/dictionary/dictionary.C @@ -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 @@ -222,6 +222,21 @@ Foam::dictionary::~dictionary() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +const Foam::dictionary& Foam::dictionary::topDict() const +{ + const dictionary& p = parent(); + + if (&p != this && !p.name().empty()) + { + return p.topDict(); + } + else + { + return p; + } +} + + Foam::label Foam::dictionary::startLineNumber() const { if (size()) diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H index 2eab9e2778..f7e7f8668c 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.H +++ b/src/OpenFOAM/db/dictionary/dictionary.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 @@ -250,6 +250,9 @@ public: return parent_; } + //- Return the top of the tree + const dictionary& topDict() const; + //- Return line number of first token in dictionary label startLineNumber() const; diff --git a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C index 1c774c352b..f855f79bc2 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C @@ -65,30 +65,12 @@ const Foam::word Foam::functionEntries::codeStream::codeTemplateC // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -const Foam::dictionary& Foam::functionEntries::codeStream::topDict -( - const dictionary& dict -) -{ - const dictionary& p = dict.parent(); - - if (&p != &dict && !p.name().empty()) - { - return topDict(p); - } - else - { - return dict; - } -} - - Foam::dlLibraryTable& Foam::functionEntries::codeStream::libs ( const dictionary& dict ) { - const IOdictionary& d = static_cast(topDict(dict)); + const IOdictionary& d = static_cast(dict.topDict()); return const_cast(d.time()).libs(); } @@ -114,7 +96,7 @@ Foam::functionEntries::codeStream::getFunction // see if library is loaded void* lib = NULL; - if (isA(topDict(parentDict))) + if (isA(parentDict.topDict())) { lib = libs(parentDict).findLibrary(libPath); } @@ -129,7 +111,7 @@ Foam::functionEntries::codeStream::getFunction // avoid compilation if possible by loading an existing library if (!lib) { - if (isA(topDict(parentDict))) + if (isA(parentDict.topDict())) { // Cached access to dl libs. Guarantees clean up upon destruction // of Time. @@ -267,7 +249,7 @@ Foam::functionEntries::codeStream::getFunction } } - if (isA(topDict(parentDict))) + if (isA(parentDict.topDict())) { // Cached access to dl libs. Guarantees clean up upon destruction // of Time. diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C index f892a0d7c8..faf2922955 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.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 @@ -26,11 +26,8 @@ License #include "mapPolyMesh.H" #include "polyMesh.H" -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::mapPolyMesh::mapPolyMesh ( const polyMesh& mesh, @@ -115,7 +112,6 @@ Foam::mapPolyMesh::mapPolyMesh } -// Construct from components and optionally reuse storage Foam::mapPolyMesh::mapPolyMesh ( const polyMesh& mesh, @@ -177,31 +173,32 @@ Foam::mapPolyMesh::mapPolyMesh oldPatchStarts_(oldPatchStarts, reUse), oldPatchNMeshPoints_(oldPatchNMeshPoints, reUse) { - // Calculate old patch sizes - for (label patchI = 0; patchI < oldPatchStarts_.size() - 1; patchI++) + if (oldPatchStarts_.size() > 0) { - oldPatchSizes_[patchI] = - oldPatchStarts_[patchI + 1] - oldPatchStarts_[patchI]; - } - - // Set the last one by hand - const label lastPatchID = oldPatchStarts_.size() - 1; - - oldPatchSizes_[lastPatchID] = nOldFaces_ - oldPatchStarts_[lastPatchID]; - - if (polyMesh::debug) - { - if (min(oldPatchSizes_) < 0) + // Calculate old patch sizes + for (label patchI = 0; patchI < oldPatchStarts_.size() - 1; patchI++) { - FatalErrorIn("mapPolyMesh::mapPolyMesh(...)") - << "Calculated negative old patch size. Error in mapping data" - << abort(FatalError); + oldPatchSizes_[patchI] = + oldPatchStarts_[patchI + 1] - oldPatchStarts_[patchI]; + } + + // Set the last one by hand + const label lastPatchID = oldPatchStarts_.size() - 1; + + oldPatchSizes_[lastPatchID] = nOldFaces_ - oldPatchStarts_[lastPatchID]; + + if (polyMesh::debug) + { + if (min(oldPatchSizes_) < 0) + { + FatalErrorIn("mapPolyMesh::mapPolyMesh(...)") + << "Calculated negative old patch size." + << " Error in mapping data" + << abort(FatalError); + } } } } -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - - // ************************************************************************* // diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModels.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModels.C deleted file mode 100644 index e8d96e9b63..0000000000 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModels.C +++ /dev/null @@ -1,44 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation - \\/ 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 "makeCombustionTypes.H" -#include "psiCombustionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace combustionModels -{ - makeCombustionTypes - ( - infinitelyFastChemistry, - psiCombustionModel - ); -} -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dynamicMesh/layerAdditionRemoval/layerAdditionRemoval.C b/src/dynamicMesh/layerAdditionRemoval/layerAdditionRemoval.C index b052b4de86..f99612eed6 100644 --- a/src/dynamicMesh/layerAdditionRemoval/layerAdditionRemoval.C +++ b/src/dynamicMesh/layerAdditionRemoval/layerAdditionRemoval.C @@ -58,10 +58,8 @@ void Foam::layerAdditionRemoval::checkDefinition() { if (!faceZoneID_.active()) { - FatalErrorIn - ( - "void Foam::layerAdditionRemoval::checkDefinition()" - ) << "Master face zone named " << faceZoneID_.name() + FatalErrorIn("void Foam::layerAdditionRemoval::checkDefinition()") + << "Master face zone named " << faceZoneID_.name() << " cannot be found." << abort(FatalError); } @@ -79,13 +77,15 @@ void Foam::layerAdditionRemoval::checkDefinition() << abort(FatalError); } - if (topoChanger().mesh().faceZones()[faceZoneID_.index()].empty()) + label nFaces = topoChanger().mesh().faceZones()[faceZoneID_.index()].size(); + + reduce(nFaces, sumOp