From d5efa1cc8aeae61ce3b78ffbe02ec156cba7064d Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 6 Jul 2010 17:47:12 +0200 Subject: [PATCH 01/42] STYLE: consistent naming of files containing the 'New' method - as per commit 937e0d23d02657c05879136aefb3b421ab2aa69f --- .../atomizationModel/newAtomizationModel.C | 74 ------------------- .../CollisionModel/CollisionModel.C | 2 +- .../CollisionModel/CollisionModel.H | 2 +- ...ewCollisionModel.C => CollisionModelNew.C} | 0 .../PairModel/PairModel/PairModel.C | 2 +- .../PairModel/PairModel/PairModel.H | 2 +- .../{NewPairModel.C => PairModelNew.C} | 0 .../WallModel/WallModel/WallModel.C | 2 +- .../WallModel/WallModel/WallModel.H | 2 +- .../{NewWallModel.C => WallModelNew.C} | 0 .../basicSolidThermo/Make/files | 2 +- ...sicSolidThermo.C => basicSolidThermoNew.C} | 0 12 files changed, 7 insertions(+), 81 deletions(-) delete mode 100644 src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/newAtomizationModel.C rename src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/{NewCollisionModel.C => CollisionModelNew.C} (100%) rename src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/{NewPairModel.C => PairModelNew.C} (100%) rename src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/{NewWallModel.C => WallModelNew.C} (100%) rename src/thermophysicalModels/basicSolidThermo/basicSolidThermo/{newBasicSolidThermo.C => basicSolidThermoNew.C} (100%) diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/newAtomizationModel.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/newAtomizationModel.C deleted file mode 100644 index 5304ea008d..0000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/newAtomizationModel.C +++ /dev/null @@ -1,74 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "error.H" -#include "atomizationModel.H" -#include "LISA.H" -#include "noAtomization.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -autoPtr atomizationModel::New -( - const dictionary& dict, - spray& sm -) -{ - word atomizationModelType - ( - dict.lookup("atomizationModel") - ); - - Info<< "Selecting atomizationModel " - << atomizationModelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(atomizationModelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalError - << "atomizationModel::New(const dictionary&, const spray&) : " << endl - << " unknown atomizationModelType type " - << atomizationModelType - << ", constructor not in hash table" << endl << endl - << " Valid atomizationModel types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); - } - - return autoPtr(cstrIter()(dict, sm)); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.C index 47db7f93da..5f22f04750 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.C @@ -59,6 +59,6 @@ Foam::CollisionModel::~CollisionModel() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "NewCollisionModel.C" +#include "CollisionModelNew.C" // ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H index cbce0ee43a..fc6f9a4886 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H @@ -29,7 +29,7 @@ Description SourceFiles CollisionModel.C - NewCollisionModel.C + CollisionModelNew.C \*---------------------------------------------------------------------------*/ diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/NewCollisionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C similarity index 100% rename from src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/NewCollisionModel.C rename to src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.C index 79adb906c1..cbd869d822 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.C @@ -75,6 +75,6 @@ Foam::PairModel::coeffDict() const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "NewPairModel.C" +#include "PairModelNew.C" // ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.H index b5b36fdb68..bbfb8f4aec 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.H @@ -29,7 +29,7 @@ Description SourceFiles PairModel.C - NewPairModel.C + PairModelNew.C \*---------------------------------------------------------------------------*/ diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/NewPairModel.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModelNew.C similarity index 100% rename from src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/NewPairModel.C rename to src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModelNew.C diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.C index d25cc29c6a..a26f9b1e11 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.C @@ -83,6 +83,6 @@ Foam::WallModel::coeffDict() const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "NewWallModel.C" +#include "WallModelNew.C" // ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H index 392825f829..3d6a6cfcf1 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H @@ -29,7 +29,7 @@ Description SourceFiles WallModel.C - NewWallModel.C + WallModelNew.C \*---------------------------------------------------------------------------*/ diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/NewWallModel.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModelNew.C similarity index 100% rename from src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/NewWallModel.C rename to src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModelNew.C diff --git a/src/thermophysicalModels/basicSolidThermo/Make/files b/src/thermophysicalModels/basicSolidThermo/Make/files index f7f64d01d2..e550ce2035 100644 --- a/src/thermophysicalModels/basicSolidThermo/Make/files +++ b/src/thermophysicalModels/basicSolidThermo/Make/files @@ -1,7 +1,7 @@ constSolidThermo/constSolidThermo.C directionalSolidThermo/directionalSolidThermo.C basicSolidThermo/basicSolidThermo.C -basicSolidThermo/newBasicSolidThermo.C +basicSolidThermo/basicSolidThermoNew.C interpolatedSolidThermo/interpolatedSolidThermo.C LIB = $(FOAM_LIBBIN)/libbasicSolidThermo diff --git a/src/thermophysicalModels/basicSolidThermo/basicSolidThermo/newBasicSolidThermo.C b/src/thermophysicalModels/basicSolidThermo/basicSolidThermo/basicSolidThermoNew.C similarity index 100% rename from src/thermophysicalModels/basicSolidThermo/basicSolidThermo/newBasicSolidThermo.C rename to src/thermophysicalModels/basicSolidThermo/basicSolidThermo/basicSolidThermoNew.C From 239da7b023cd524e95687b6ea7dfb08752ac6a7a Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 8 Jul 2010 10:21:22 +0100 Subject: [PATCH 02/42] ENH: chtMultiRegionFoam: protect against Co and Di both 0 --- .../chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H index cfb9592a2b..16ebfdfb82 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H @@ -33,13 +33,12 @@ if (adjustTimeStep) { if ((runTime.timeIndex() == 0) && ((CoNum > SMALL) || (DiNum > SMALL))) { - - if (CoNum == -GREAT) + if (CoNum < SMALL) { CoNum = SMALL; } - if (DiNum == -GREAT) + if (DiNum < SMALL) { DiNum = SMALL; } From 48696bdb45c5f9852cdbd35eeb8bcf4d8cef8447 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 12 Jul 2010 11:48:24 +0200 Subject: [PATCH 03/42] ENH: silently remove leading ~OpenFOAM/ in bin/foamEtcFile - makes it easier to cut-and-paste from dictionary contents that use the Foam::findEtcFile expansion --- bin/foamEtcFile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/foamEtcFile b/bin/foamEtcFile index 7cea635885..5bae566b55 100755 --- a/bin/foamEtcFile +++ b/bin/foamEtcFile @@ -195,9 +195,10 @@ done # done -# Save the essential bits of information: +# Save the essential bits of information +# silently remove leading ~OpenFOAM/ (used in Foam::findEtcFile) nArgs=$# -fileName="$1" +fileName="${1#~OpenFOAM/}" # Define the various places to be searched: unset dirList From 065bf825b8671ffcc22aebe0c8cd7b6a9573e8a6 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 12 Jul 2010 18:13:53 +0100 Subject: [PATCH 04/42] COMP: debian/ assume version 170 so we can reuse files --- debian/changelog | 2 +- debian/control | 4 ++-- debian/postinst | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 37d8825189..5951d0a84a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -openfoamdev (0-1) unstable; urgency=low +openfoam170 (0-1) unstable; urgency=low * Initial release diff --git a/debian/control b/debian/control index 7f1ffece57..c5957a03ec 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: openfoamdev +Source: openfoam170 Section: optional Priority: optional Maintainer: OpenCFD Ltd. @@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 7), quilt Standards-Version: 3.8.4 Homepage: http://www.openfoam.com -Package: openfoamdev +Package: openfoam170 Architecture: any Depends: csh,g++,${shlibs:Depends}, ${misc:Depends},binutils-dev,flex,libscotch-dev,libopenmpi-dev,libxt-dev,openmpi-bin Description: OpenFOAM diff --git a/debian/postinst b/debian/postinst index e28adbc93f..f4a492c84a 100755 --- a/debian/postinst +++ b/debian/postinst @@ -24,7 +24,7 @@ case "$1" in echo "" echo "** To use OpenFOAM please add" echo "**" - echo "** . /opt/openfoamdev/etc/bashrc" + echo "** . /opt/openfoam170/etc/bashrc" echo "**" echo "** To your ~/.bashrc" echo "" From e3e52ee2df0a7cf3bcd483da0803bf73054359f0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 13 Jul 2010 21:44:34 +0100 Subject: [PATCH 05/42] ENH: blockMeshTopology: added error checking on boundary syntax --- src/mesh/blockMesh/blockMesh/blockMeshTopology.C | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C index 9a96248368..4aeed7b3b3 100644 --- a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C +++ b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C @@ -208,6 +208,13 @@ bool Foam::blockMesh::readBoundary { const entry& patchInfo = patchesInfo[patchI]; + if (!patchInfo.isDict()) + { + FatalIOErrorIn("blockMesh::readBoundary(..)", meshDescription) + << "Entry " << patchInfo << " in boundary section is not a" + << " valid dictionary." << exit(FatalIOError); + } + // Construct dictionary and add name patchDicts.set(patchI, new dictionary(patchInfo.dict())); patchDicts[patchI].set("name", patchInfo.keyword()); From c05ac8062d5ac9a5bd6046a1ecd0a0c4cf8a0bd2 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 15 Jul 2010 09:25:31 +0100 Subject: [PATCH 06/42] BUG: fileMonitor : did not handle combined messages --- src/OSspecific/POSIX/fileMonitor.C | 31 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C index a812dec942..adeebbdcb6 100644 --- a/src/OSspecific/POSIX/fileMonitor.C +++ b/src/OSspecific/POSIX/fileMonitor.C @@ -257,24 +257,21 @@ void Foam::fileMonitor::checkFiles() const // << "watchFd:" << inotifyEvent.wd << nl // << "watchName:" << watchFile_[inotifyEvent.wd] << endl; - switch (inotifyEvent.mask) + if (inotifyEvent.mask % IN_DELETE_SELF) { - case IN_DELETE_SELF: - { - Map::iterator iter = - state_.find(label(inotifyEvent.wd)); - iter() = DELETED; - } - break; - - case IN_MODIFY: - case IN_CLOSE_WRITE: - { - Map::iterator iter = - state_.find(label(inotifyEvent.wd)); - iter() = MODIFIED; - } - break; + Map::iterator iter = + state_.find(label(inotifyEvent.wd)); + iter() = DELETED; + } + else if + ( + (inotifyEvent.mask % IN_MODIFY) + || (inotifyEvent.mask % IN_CLOSE_WRITE) + ) + { + Map::iterator iter = + state_.find(label(inotifyEvent.wd)); + iter() = MODIFIED; } } else From 8197dd3ce5533ee61c9e62dab864e5f9786749a7 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 15 Jul 2010 09:26:37 +0100 Subject: [PATCH 07/42] ENH: plane : added dictionary writing --- src/OpenFOAM/meshes/primitiveShapes/plane/plane.C | 15 ++++++++++++++- src/OpenFOAM/meshes/primitiveShapes/plane/plane.H | 5 ++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C index 5cdc5e9d89..d4407a7d68 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C +++ b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -440,6 +440,19 @@ Foam::point Foam::plane::planePlaneIntersect } +void Foam::plane::writeDict(Ostream& os) const +{ + os.writeKeyword("planeType") << "pointAndNormal" + << token::END_STATEMENT << nl; + os << indent << "pointAndNormalDict" << nl + << indent << token::BEGIN_BLOCK << incrIndent << nl; + os.writeKeyword("basePoint") << basePoint_ << token::END_STATEMENT << nl; + os.writeKeyword("normalVector") << unitVector_ << token::END_STATEMENT + << nl; + os << decrIndent << indent << token::END_BLOCK << endl; +} + + // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // bool Foam::operator==(const plane& a, const plane& b) diff --git a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H index 36dac89224..44eb20cbc0 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H +++ b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -182,6 +182,9 @@ public: //- Return the cutting point between this plane and two other planes point planePlaneIntersect(const plane&, const plane&) const; + //- Write to dictionary + void writeDict(Ostream&) const; + // friend Operators From f38ad5e44d43d6af671c147f77cc1da7d4666bf8 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 15 Jul 2010 09:27:05 +0100 Subject: [PATCH 08/42] BUG: renumberMesh : writing XXXProcAddressing --- .../manipulation/renumberMesh/renumberMesh.C | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index c04d87bc91..00913b8817 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -742,6 +742,27 @@ int main(int argc, char *argv[]) Info<< "Writing mesh to " << mesh.facesInstance() << endl; mesh.write(); + if (cellProcAddressing.headerOk()) + { + cellProcAddressing.instance() = mesh.facesInstance(); + cellProcAddressing.write(); + } + if (faceProcAddressing.headerOk()) + { + faceProcAddressing.instance() = mesh.facesInstance(); + faceProcAddressing.write(); + } + if (pointProcAddressing.headerOk()) + { + pointProcAddressing.instance() = mesh.facesInstance(); + pointProcAddressing.write(); + } + if (boundaryProcAddressing.headerOk()) + { + boundaryProcAddressing.instance() = mesh.facesInstance(); + boundaryProcAddressing.write(); + } + if (writeMaps) { From f6670f8dec4507fe82df38d4736e82994b73083a Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 15 Jul 2010 09:38:52 +0100 Subject: [PATCH 09/42] COMP: Make/options added indirect libs for Solaris linker. --- applications/solvers/combustion/PDRFoam/Make/options | 1 + applications/solvers/combustion/XiFoam/Make/options | 1 + applications/solvers/combustion/coldEngineFoam/Make/options | 1 + applications/solvers/combustion/dieselEngineFoam/Make/options | 1 + applications/solvers/combustion/dieselFoam/Make/options | 1 + applications/solvers/combustion/engineFoam/Make/options | 1 + applications/solvers/combustion/fireFoam/Make/options | 1 + applications/solvers/combustion/reactingFoam/Make/options | 1 + applications/solvers/combustion/rhoReactingFoam/Make/options | 1 + applications/solvers/compressible/rhoPimpleFoam/Make/options | 1 + .../solvers/compressible/rhoPorousMRFPimpleFoam/Make/options | 1 + .../solvers/compressible/rhoPorousSimpleFoam/Make/options | 1 + applications/solvers/compressible/rhoSimpleFoam/Make/options | 1 + applications/solvers/compressible/sonicDyMFoam/Make/options | 1 + applications/solvers/compressible/sonicFoam/Make/options | 1 + .../heatTransfer/buoyantBoussinesqPimpleFoam/Make/options | 1 + .../heatTransfer/buoyantBoussinesqSimpleFoam/Make/options | 1 + .../solvers/heatTransfer/buoyantPimpleFoam/Make/options | 1 + .../solvers/heatTransfer/buoyantSimpleFoam/Make/options | 1 + .../heatTransfer/buoyantSimpleRadiationFoam/Make/options | 1 + .../solvers/heatTransfer/chtMultiRegionFoam/Make/options | 2 ++ .../chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options | 4 +++- applications/solvers/incompressible/boundaryFoam/Make/options | 1 + applications/solvers/incompressible/pimpleFoam/Make/options | 1 + applications/solvers/incompressible/pisoFoam/Make/options | 1 + .../solvers/incompressible/porousSimpleFoam/Make/options | 1 + applications/solvers/incompressible/simpleFoam/Make/options | 1 + .../solvers/lagrangian/coalChemistryFoam/Make/options | 1 + .../porousExplicitSourceReactingParcelFoam/Make/options | 1 + .../solvers/lagrangian/reactingParcelFoam/Make/options | 1 + .../lagrangian/uncoupledKinematicParcelFoam/Make/options | 1 + applications/solvers/multiphase/cavitatingFoam/Make/options | 1 + .../solvers/multiphase/compressibleInterDyMFoam/Make/options | 1 + .../solvers/multiphase/compressibleInterFoam/Make/options | 3 ++- applications/solvers/multiphase/interDyMFoam/Make/options | 1 + applications/solvers/multiphase/interFoam/Make/options | 1 + applications/solvers/multiphase/interMixingFoam/Make/options | 1 + .../solvers/multiphase/interPhaseChangeFoam/Make/options | 1 + .../solvers/multiphase/multiphaseInterFoam/Make/options | 1 + .../solvers/multiphase/twoLiquidMixingFoam/Make/options | 1 + 40 files changed, 44 insertions(+), 2 deletions(-) diff --git a/applications/solvers/combustion/PDRFoam/Make/options b/applications/solvers/combustion/PDRFoam/Make/options index a1469d0ef0..3432f09ef7 100644 --- a/applications/solvers/combustion/PDRFoam/Make/options +++ b/applications/solvers/combustion/PDRFoam/Make/options @@ -20,6 +20,7 @@ EXE_INC = \ EXE_LIBS = \ -lengine \ -lmeshTools \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lbasicThermophysicalModels \ -lreactionThermophysicalModels \ diff --git a/applications/solvers/combustion/XiFoam/Make/options b/applications/solvers/combustion/XiFoam/Make/options index c328b2c1b3..66dae7fcb3 100644 --- a/applications/solvers/combustion/XiFoam/Make/options +++ b/applications/solvers/combustion/XiFoam/Make/options @@ -10,6 +10,7 @@ EXE_INC = \ EXE_LIBS = \ -lengine \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lbasicThermophysicalModels \ diff --git a/applications/solvers/combustion/coldEngineFoam/Make/options b/applications/solvers/combustion/coldEngineFoam/Make/options index 53aa22b25a..dfd9248ded 100644 --- a/applications/solvers/combustion/coldEngineFoam/Make/options +++ b/applications/solvers/combustion/coldEngineFoam/Make/options @@ -10,6 +10,7 @@ EXE_INC = \ EXE_LIBS = \ -lengine \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lbasicThermophysicalModels \ diff --git a/applications/solvers/combustion/dieselEngineFoam/Make/options b/applications/solvers/combustion/dieselEngineFoam/Make/options index 60558513fe..d0a572b86f 100644 --- a/applications/solvers/combustion/dieselEngineFoam/Make/options +++ b/applications/solvers/combustion/dieselEngineFoam/Make/options @@ -18,6 +18,7 @@ EXE_INC = \ EXE_LIBS = \ -lengine \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lreactionThermophysicalModels \ diff --git a/applications/solvers/combustion/dieselFoam/Make/options b/applications/solvers/combustion/dieselFoam/Make/options index 28605eb830..9096934c2d 100644 --- a/applications/solvers/combustion/dieselFoam/Make/options +++ b/applications/solvers/combustion/dieselFoam/Make/options @@ -16,6 +16,7 @@ EXE_INC = \ -I$(LIB_SRC)/ODE/lnInclude EXE_LIBS = \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lreactionThermophysicalModels \ diff --git a/applications/solvers/combustion/engineFoam/Make/options b/applications/solvers/combustion/engineFoam/Make/options index 31775e03d6..cf5fa5febe 100644 --- a/applications/solvers/combustion/engineFoam/Make/options +++ b/applications/solvers/combustion/engineFoam/Make/options @@ -10,6 +10,7 @@ EXE_INC = \ EXE_LIBS = \ -lengine \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lbasicThermophysicalModels \ diff --git a/applications/solvers/combustion/fireFoam/Make/options b/applications/solvers/combustion/fireFoam/Make/options index 3b19a78173..cba08b2629 100644 --- a/applications/solvers/combustion/fireFoam/Make/options +++ b/applications/solvers/combustion/fireFoam/Make/options @@ -14,6 +14,7 @@ EXE_LIBS = \ -lreactionThermophysicalModels \ -lbasicThermophysicalModels \ -lfiniteVolume \ + -lcompressibleTurbulenceModel \ -lcompressibleLESModels \ -lcompressibleRASModels \ -lradiation diff --git a/applications/solvers/combustion/reactingFoam/Make/options b/applications/solvers/combustion/reactingFoam/Make/options index d85350297a..6386af8c55 100644 --- a/applications/solvers/combustion/reactingFoam/Make/options +++ b/applications/solvers/combustion/reactingFoam/Make/options @@ -8,6 +8,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lreactionThermophysicalModels \ diff --git a/applications/solvers/combustion/rhoReactingFoam/Make/options b/applications/solvers/combustion/rhoReactingFoam/Make/options index d85350297a..6386af8c55 100644 --- a/applications/solvers/combustion/rhoReactingFoam/Make/options +++ b/applications/solvers/combustion/rhoReactingFoam/Make/options @@ -8,6 +8,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lreactionThermophysicalModels \ diff --git a/applications/solvers/compressible/rhoPimpleFoam/Make/options b/applications/solvers/compressible/rhoPimpleFoam/Make/options index 4858e53f30..47a62ae92a 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/Make/options +++ b/applications/solvers/compressible/rhoPimpleFoam/Make/options @@ -7,6 +7,7 @@ EXE_INC = \ EXE_LIBS = \ -lbasicThermophysicalModels \ -lspecie \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ diff --git a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/Make/options b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/Make/options index 61c1b6fe46..809b4a63a1 100644 --- a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/Make/options +++ b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/Make/options @@ -9,6 +9,7 @@ EXE_INC = \ EXE_LIBS = \ -lbasicThermophysicalModels \ -lspecie \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options b/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options index 4f198992b9..a4cdecf368 100644 --- a/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options +++ b/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options @@ -11,6 +11,7 @@ EXE_LIBS = \ -lbasicThermophysicalModels \ -lthermalPorousZone \ -lspecie \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/compressible/rhoSimpleFoam/Make/options b/applications/solvers/compressible/rhoSimpleFoam/Make/options index d51be54abf..700a6a6753 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/Make/options +++ b/applications/solvers/compressible/rhoSimpleFoam/Make/options @@ -8,6 +8,7 @@ EXE_INC = \ EXE_LIBS = \ -lbasicThermophysicalModels \ -lspecie \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/compressible/sonicDyMFoam/Make/options b/applications/solvers/compressible/sonicDyMFoam/Make/options index f05f52d427..81495fb1f6 100644 --- a/applications/solvers/compressible/sonicDyMFoam/Make/options +++ b/applications/solvers/compressible/sonicDyMFoam/Make/options @@ -9,6 +9,7 @@ EXE_INC = \ EXE_LIBS = \ -lbasicThermophysicalModels \ -lspecie \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ diff --git a/applications/solvers/compressible/sonicFoam/Make/options b/applications/solvers/compressible/sonicFoam/Make/options index ecfde60eee..a5b9436ac6 100644 --- a/applications/solvers/compressible/sonicFoam/Make/options +++ b/applications/solvers/compressible/sonicFoam/Make/options @@ -6,6 +6,7 @@ EXE_INC = \ EXE_LIBS = \ -lbasicThermophysicalModels \ -lspecie \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options index 041d2e0605..cadaf0850d 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options @@ -9,5 +9,6 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleTransportModels diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options index a53061a93c..6905967f04 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options @@ -8,5 +8,6 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleTransportModels diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options index f26563fc0f..8d01214e6c 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options @@ -7,6 +7,7 @@ EXE_LIBS = \ -lmeshTools \ -lbasicThermophysicalModels \ -lspecie \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options index ec604cf28c..c8a3b02a0f 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options @@ -9,5 +9,6 @@ EXE_LIBS = \ -lmeshTools \ -lbasicThermophysicalModels \ -lspecie \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lfiniteVolume diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options index 89d7787af6..7058e8a503 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options @@ -12,6 +12,7 @@ EXE_LIBS = \ -lbasicThermophysicalModels \ -lspecie \ -lradiation \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options index e7a1103a4f..7edc67dc75 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options @@ -13,6 +13,8 @@ EXE_LIBS = \ -lbasicThermophysicalModels \ -lbasicSolidThermo \ -lspecie \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ + -lmeshTools \ -lfiniteVolume diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options index 1664808079..a255d65f6c 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options @@ -17,4 +17,6 @@ EXE_LIBS = \ -lbasicThermophysicalModels \ -lbasicSolidThermo \ -lspecie \ - -lcompressibleRASModels + -lcompressibleTurbulenceModel \ + -lcompressibleRASModels \ + -lcompressibleLESModels diff --git a/applications/solvers/incompressible/boundaryFoam/Make/options b/applications/solvers/incompressible/boundaryFoam/Make/options index b5a6f5b406..d993beac0a 100644 --- a/applications/solvers/incompressible/boundaryFoam/Make/options +++ b/applications/solvers/incompressible/boundaryFoam/Make/options @@ -7,6 +7,7 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleTransportModels \ -lfiniteVolume \ diff --git a/applications/solvers/incompressible/pimpleFoam/Make/options b/applications/solvers/incompressible/pimpleFoam/Make/options index d0e8dd740d..47d95d97ce 100644 --- a/applications/solvers/incompressible/pimpleFoam/Make/options +++ b/applications/solvers/incompressible/pimpleFoam/Make/options @@ -6,6 +6,7 @@ EXE_INC = \ EXE_LIBS = \ -lincompressibleTransportModels \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume \ diff --git a/applications/solvers/incompressible/pisoFoam/Make/options b/applications/solvers/incompressible/pisoFoam/Make/options index 419f1ffcba..259f95f7b9 100644 --- a/applications/solvers/incompressible/pisoFoam/Make/options +++ b/applications/solvers/incompressible/pisoFoam/Make/options @@ -5,6 +5,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lincompressibleTransportModels \ diff --git a/applications/solvers/incompressible/porousSimpleFoam/Make/options b/applications/solvers/incompressible/porousSimpleFoam/Make/options index f490133ba6..c658bfe518 100644 --- a/applications/solvers/incompressible/porousSimpleFoam/Make/options +++ b/applications/solvers/incompressible/porousSimpleFoam/Make/options @@ -8,6 +8,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleTransportModels \ -lfiniteVolume \ diff --git a/applications/solvers/incompressible/simpleFoam/Make/options b/applications/solvers/incompressible/simpleFoam/Make/options index 1223bdd06f..dbc45d3844 100644 --- a/applications/solvers/incompressible/simpleFoam/Make/options +++ b/applications/solvers/incompressible/simpleFoam/Make/options @@ -6,6 +6,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleTransportModels \ -lfiniteVolume diff --git a/applications/solvers/lagrangian/coalChemistryFoam/Make/options b/applications/solvers/lagrangian/coalChemistryFoam/Make/options index 22f2dd7fe2..b4758dace7 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/Make/options +++ b/applications/solvers/lagrangian/coalChemistryFoam/Make/options @@ -22,6 +22,7 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -llagrangian \ diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options index c2ffc71a78..3639d884a2 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options @@ -22,6 +22,7 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -llagrangian \ diff --git a/applications/solvers/lagrangian/reactingParcelFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFoam/Make/options index b007da1d1b..33d575609b 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFoam/Make/options @@ -21,6 +21,7 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -llagrangian \ diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options index 34d4d29c1f..35a21df21a 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options @@ -17,6 +17,7 @@ EXE_LIBS = \ -lbasicThermophysicalModels \ -lspecie \ -lradiation \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ diff --git a/applications/solvers/multiphase/cavitatingFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/Make/options index 9cb749d63c..836301986d 100644 --- a/applications/solvers/multiphase/cavitatingFoam/Make/options +++ b/applications/solvers/multiphase/cavitatingFoam/Make/options @@ -7,6 +7,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude EXE_LIBS = \ + -lincompressibleTurbulenceModel \ -lincompressibleTransportModels \ -lincompressibleRASModels \ -lincompressibleLESModels \ diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options index 75094c8b16..2a732d1a72 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options @@ -11,6 +11,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ -lincompressibleTransportModels \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume \ diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options index d7a537fc10..9309873692 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options @@ -1,4 +1,4 @@ -EXE_INC = -ggdb3 \ +EXE_INC = \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -8,6 +8,7 @@ EXE_INC = -ggdb3 \ EXE_LIBS = \ -linterfaceProperties \ -lincompressibleTransportModels \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume diff --git a/applications/solvers/multiphase/interDyMFoam/Make/options b/applications/solvers/multiphase/interDyMFoam/Make/options index 6bbea18fd6..dd6e8ee57c 100644 --- a/applications/solvers/multiphase/interDyMFoam/Make/options +++ b/applications/solvers/multiphase/interDyMFoam/Make/options @@ -12,6 +12,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ -lincompressibleTransportModels \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume \ diff --git a/applications/solvers/multiphase/interFoam/Make/options b/applications/solvers/multiphase/interFoam/Make/options index 0e21fc2d64..9309873692 100644 --- a/applications/solvers/multiphase/interFoam/Make/options +++ b/applications/solvers/multiphase/interFoam/Make/options @@ -8,6 +8,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ -lincompressibleTransportModels \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume diff --git a/applications/solvers/multiphase/interMixingFoam/Make/options b/applications/solvers/multiphase/interMixingFoam/Make/options index d8e4da2313..62271c2bb7 100644 --- a/applications/solvers/multiphase/interMixingFoam/Make/options +++ b/applications/solvers/multiphase/interMixingFoam/Make/options @@ -12,6 +12,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ -lincompressibleTransportModels \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options index 24e523f249..fb77739916 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options @@ -9,6 +9,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ -lincompressibleTransportModels \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Make/options b/applications/solvers/multiphase/multiphaseInterFoam/Make/options index 6e9363f13f..92c738c687 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/Make/options +++ b/applications/solvers/multiphase/multiphaseInterFoam/Make/options @@ -11,6 +11,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ -lincompressibleTransportModels \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume \ No newline at end of file diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options index 0e21fc2d64..9309873692 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options @@ -8,6 +8,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ -lincompressibleTransportModels \ + -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume From 4a31516441b2c034690265c3e4b589f0bd2e5386 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 15 Jul 2010 13:06:40 +0100 Subject: [PATCH 10/42] STYLE: update copyriht year. --- src/mesh/blockMesh/blockMesh/blockMeshTopology.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C index 4aeed7b3b3..d1fe81c2f1 100644 --- a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C +++ b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License From 10d9c8a17444ceef388f6a86e33dd687063f7b4f Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 15 Jul 2010 15:03:23 +0100 Subject: [PATCH 11/42] BUG: wedgePolyPatch : did not like getting constructed with 0 faces (done by createPatch) --- .../constraint/wedge/wedgePolyPatch.C | 105 +++++++++--------- 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C index 7cbf7a5534..0e2c4e9620 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,59 +42,62 @@ namespace Foam void Foam::wedgePolyPatch::initTransforms() { - const pointField& points = this->points(); - - patchNormal_ = operator[](0).normal(points); - patchNormal_ /= mag(patchNormal_); - - centreNormal_ = - vector - ( - sign(patchNormal_.x())*(max(mag(patchNormal_.x()), 0.5) - 0.5), - sign(patchNormal_.y())*(max(mag(patchNormal_.y()), 0.5) - 0.5), - sign(patchNormal_.z())*(max(mag(patchNormal_.z()), 0.5) - 0.5) - ); - centreNormal_ /= mag(centreNormal_); - - if - ( - mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z()) - < (1 - SMALL) - ) + if (size() > 0) { - FatalErrorIn + const pointField& points = this->points(); + + patchNormal_ = operator[](0).normal(points); + patchNormal_ /= mag(patchNormal_); + + centreNormal_ = + vector + ( + sign(patchNormal_.x())*(max(mag(patchNormal_.x()), 0.5) - 0.5), + sign(patchNormal_.y())*(max(mag(patchNormal_.y()), 0.5) - 0.5), + sign(patchNormal_.z())*(max(mag(patchNormal_.z()), 0.5) - 0.5) + ); + centreNormal_ /= mag(centreNormal_); + + if ( - "wedgePolyPatch::wedgePolyPatch(const polyPatch&, " - "const fvBoundaryMesh&)" - ) << "wedge " << name() - << " centre plane does not align with a coordinate plane by " - << 1 - - mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z()) - << exit(FatalError); + mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z()) + < (1 - SMALL) + ) + { + FatalErrorIn + ( + "wedgePolyPatch::wedgePolyPatch(const polyPatch&, " + "const fvBoundaryMesh&)" + ) << "wedge " << name() + << " centre plane does not align with a coordinate plane by " + << 1 + - mag(centreNormal_.x()+centreNormal_.y()+centreNormal_.z()) + << exit(FatalError); + } + + axis_ = centreNormal_ ^ patchNormal_; + scalar magAxis = mag(axis_); + axis_ /= magAxis; + + if (magAxis < SMALL) + { + FatalErrorIn + ( + "wedgePolyPatch::initTransforms()" + ) << "wedge " << name() + << " plane aligns with a coordinate plane." << nl + << " The wedge plane should make a small angle (~2.5deg)" + " with the coordinate plane" << nl + << " and the the pair of wedge planes should be symmetric" + << " about the coordinate plane." << nl + << " Normal of face " << 0 << " is " << patchNormal_ + << " , implied coordinate plane direction is " << centreNormal_ + << exit(FatalError); + } + + faceT_ = rotationTensor(centreNormal_, patchNormal_); + cellT_ = faceT_ & faceT_; } - - axis_ = centreNormal_ ^ patchNormal_; - scalar magAxis = mag(axis_); - axis_ /= magAxis; - - if (magAxis < SMALL) - { - FatalErrorIn - ( - "wedgePolyPatch::initTransforms()" - ) << "wedge " << name() - << " plane aligns with a coordinate plane." << nl - << " The wedge plane should make a small angle (~2.5deg)" - " with the coordinate plane" << nl - << " and the the pair of wedge planes should be symmetric" - << " about the coordinate plane." << nl - << " Normal of face " << 0 << " is " << patchNormal_ - << " , implied coordinate plane direction is " << centreNormal_ - << exit(FatalError); - } - - faceT_ = rotationTensor(centreNormal_, patchNormal_); - cellT_ = faceT_ & faceT_; } From a2995ae0e5cea28288d27f9aa9b8ee9d2e24f246 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 20 Jul 2010 18:52:34 +0100 Subject: [PATCH 12/42] ENH: decomposePar : allow -constant to override controlDict setting --- .../decomposePar/decomposePar.C | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 2009375040..91a51e2ae5 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,6 +42,9 @@ Usage @param -copyUniform \n Copy any @a uniform directories too. + @param -constant \n + Override controlDict settings and use constant directory. + @param -fields \n Use existing geometry decomposition and convert fields only. @@ -119,6 +122,11 @@ int main(int argc, char *argv[]) "ifRequired", "only decompose geometry if the number of domains has changed" ); + argList::addBoolOption + ( + "constant", + "include the 'constant/' dir in the times list" + ); #include "setRootCase.H" @@ -139,6 +147,20 @@ int main(int argc, char *argv[]) #include "createTime.H" + // Allow -constant to override controlDict settings. + if (args.optionFound("constant")) + { + instantList timeDirs = timeSelector::select0(runTime, args); + if (runTime.timeName() != runTime.constant()) + { + FatalErrorIn(args.executable()) + << "No '" << runTime.constant() << "' time present." << endl + << "Valid times are " << runTime.times() + << exit(FatalError); + } + } + + Info<< "Time = " << runTime.timeName() << endl; // determine the existing processor count directly From 47a63dc90e3953ed1d59e4b5d53491219c2987b2 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 20 Jul 2010 22:15:45 +0100 Subject: [PATCH 13/42] ENH: indexedOctree: added find-inside query. Adapted meshSearch and sampledTriSurfaceMesh to use it. --- src/meshTools/indexedOctree/indexedOctree.C | 53 ++++ src/meshTools/indexedOctree/indexedOctree.H | 8 +- src/meshTools/indexedOctree/treeDataCell.C | 10 + src/meshTools/indexedOctree/treeDataCell.H | 7 + src/meshTools/indexedOctree/treeDataEdge.H | 5 + src/meshTools/meshSearch/meshSearch.C | 281 ++++++++---------- src/meshTools/meshSearch/meshSearch.H | 22 +- .../sampledTriSurfaceMesh.C | 6 +- 8 files changed, 213 insertions(+), 179 deletions(-) diff --git a/src/meshTools/indexedOctree/indexedOctree.C b/src/meshTools/indexedOctree/indexedOctree.C index e6b77b1d9d..a572cad3b8 100644 --- a/src/meshTools/indexedOctree/indexedOctree.C +++ b/src/meshTools/indexedOctree/indexedOctree.C @@ -2495,6 +2495,59 @@ Foam::labelBits Foam::indexedOctree::findNode } +template +Foam::label Foam::indexedOctree::find(const point& sample) const +{ + labelBits index = findNode(0, sample); + + const node& nod = nodes_[getNode(index)]; + + labelBits contentIndex = nod.subNodes_[getOctant(index)]; + + // Need to check for the presence of content, in-case the node is empty + if (isContent(contentIndex)) + { + labelList indices = contents_[getContent(contentIndex)]; + + forAll(indices, elemI) + { + label shapeI = indices[elemI]; + + if (shapes_.contains(shapeI, sample)) + { + return shapeI; + } + } + } + + return -1; +} + + +template +Foam::labelList Foam::indexedOctree::findIndices +( + const point& sample +) const +{ + labelBits index = findNode(0, sample); + + const node& nod = nodes_[getNode(index)]; + + labelBits contentIndex = nod.subNodes_[getOctant(index)]; + + // Need to check for the presence of content, in-case the node is empty + if (isContent(contentIndex)) + { + return contents_[getContent(contentIndex)]; + } + else + { + return labelList(0); + } +} + + // Determine type (inside/outside/mixed) per node. template typename Foam::indexedOctree::volumeType diff --git a/src/meshTools/indexedOctree/indexedOctree.H b/src/meshTools/indexedOctree/indexedOctree.H index d72d8de4ab..2a5b9c247f 100644 --- a/src/meshTools/indexedOctree/indexedOctree.H +++ b/src/meshTools/indexedOctree/indexedOctree.H @@ -549,9 +549,15 @@ public: //- Find deepest node (as parent+octant) containing point. Starts // off from starting index in nodes_ (use 0 to start from top) - // Use getNode, getOctant to extract info. + // Use getNode and getOctant to extract info, or call findIndices. labelBits findNode(const label nodeI, const point&) const; + //- Find shape containing point in tree + label find(const point&) const; + + //- Find the shape indices that occupy the result of findNode + labelList findIndices(const point&) const; + //- Determine type (inside/outside/mixed) for point. unknown if // cannot be determined (e.g. non-manifold surface) volumeType getVolumeType(const point&) const; diff --git a/src/meshTools/indexedOctree/treeDataCell.C b/src/meshTools/indexedOctree/treeDataCell.C index 7988d55301..3377402eab 100644 --- a/src/meshTools/indexedOctree/treeDataCell.C +++ b/src/meshTools/indexedOctree/treeDataCell.C @@ -145,6 +145,16 @@ bool Foam::treeDataCell::overlaps } +bool Foam::treeDataCell::contains +( + const label index, + const point& sample +) const +{ + return mesh_.pointInCell(sample, cellLabels_[index]); +} + + // Calculate nearest point to sample. Updates (if any) nearestDistSqr, minIndex, // nearestPoint. void Foam::treeDataCell::findNearest diff --git a/src/meshTools/indexedOctree/treeDataCell.H b/src/meshTools/indexedOctree/treeDataCell.H index f6371198a2..de0aee58d0 100644 --- a/src/meshTools/indexedOctree/treeDataCell.H +++ b/src/meshTools/indexedOctree/treeDataCell.H @@ -142,6 +142,13 @@ public: const treeBoundBox& sampleBb ) const; + //- Does shape at index contain sample + bool contains + ( + const label index, + const point& sample + ) const; + //- Calculates nearest (to sample) point in shape. // Returns actual point and distance (squared) void findNearest diff --git a/src/meshTools/indexedOctree/treeDataEdge.H b/src/meshTools/indexedOctree/treeDataEdge.H index 30ef2329ba..9b47a300c7 100644 --- a/src/meshTools/indexedOctree/treeDataEdge.H +++ b/src/meshTools/indexedOctree/treeDataEdge.H @@ -103,6 +103,11 @@ public: // Access + const labelList& edgeLabels() const + { + return edgeLabels_; + } + label size() const { return edgeLabels_.size(); diff --git a/src/meshTools/meshSearch/meshSearch.C b/src/meshTools/meshSearch/meshSearch.C index 4ae5ffc616..a326030f89 100644 --- a/src/meshTools/meshSearch/meshSearch.C +++ b/src/meshTools/meshSearch/meshSearch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,7 +99,7 @@ bool Foam::meshSearch::findNearer // tree based searching Foam::label Foam::meshSearch::findNearestCellTree(const point& location) const { - const indexedOctree& tree = cellCentreTree(); + const indexedOctree& tree = cellTree(); scalar span = tree.bb().mag(); @@ -176,7 +176,7 @@ Foam::label Foam::meshSearch::findNearestCellWalk Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const { // Search nearest cell centre. - const indexedOctree& tree = cellCentreTree(); + const indexedOctree& tree = cellTree(); scalar span = tree.bb().mag(); @@ -320,6 +320,80 @@ Foam::label Foam::meshSearch::findCellLinear(const point& location) const } +// walking from seed +Foam::label Foam::meshSearch::findCellWalk +( + const point& location, + const label seedCellI +) const +{ + if (seedCellI < 0) + { + FatalErrorIn + ( + "meshSearch::findCellWalk(const point&, const label)" + ) << "illegal seedCell:" << seedCellI << exit(FatalError); + } + + if (pointInCell(location, seedCellI)) + { + return seedCellI; + } + + // Walk in direction of face that decreases distance + label curCellI = seedCellI; + scalar nearestDistSqr = magSqr(mesh_.cellCentres()[curCellI] - location); + + while(true) + { + // Try neighbours of curCellI + + const cell& cFaces = mesh_.cells()[curCellI]; + + label nearestCellI = -1; + + forAll(cFaces, i) + { + label faceI = cFaces[i]; + + if (mesh_.isInternalFace(faceI)) + { + label cellI = mesh_.faceOwner()[faceI]; + if (cellI == curCellI) + { + cellI = mesh_.faceNeighbour()[faceI]; + } + + // Check if this is the correct cell + if (pointInCell(location, cellI)) + { + return cellI; + } + + // Also calculate the nearest cell + scalar distSqr = magSqr(mesh_.cellCentres()[cellI] - location); + + if (distSqr < nearestDistSqr) + { + nearestDistSqr = distSqr; + nearestCellI = cellI; + } + } + } + + if (nearestCellI == -1) + { + return -1; + } + + // Continue with the nearest cell + curCellI = nearestCellI; + } + + return -1; +} + + Foam::label Foam::meshSearch::findNearestBoundaryFaceWalk ( const point& location, @@ -426,11 +500,7 @@ Foam::vector Foam::meshSearch::offset Foam::meshSearch::meshSearch(const polyMesh& mesh, const bool faceDecomp) : mesh_(mesh), - faceDecomp_(faceDecomp), - cloud_(mesh_, "meshSearchCloud", IDLList()), - boundaryTreePtr_(NULL), - cellTreePtr_(NULL), - cellCentreTreePtr_(NULL) + faceDecomp_(faceDecomp) {} @@ -447,7 +517,7 @@ Foam::meshSearch::~meshSearch() const Foam::indexedOctree& Foam::meshSearch::boundaryTree() const { - if (!boundaryTreePtr_) + if (!boundaryTreePtr_.valid()) { // // Construct tree @@ -466,85 +536,59 @@ const Foam::indexedOctree& Foam::meshSearch::boundaryTree() overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); - boundaryTreePtr_ = new indexedOctree + boundaryTreePtr_.reset ( - treeDataFace // all information needed to search faces + new indexedOctree ( - false, // do not cache bb - mesh_, - bndFaces // boundary faces only - ), - overallBb, // overall search domain - 8, // maxLevel - 10, // leafsize - 3.0 // duplicity + treeDataFace // all information needed to search faces + ( + false, // do not cache bb + mesh_, + bndFaces // boundary faces only + ), + overallBb, // overall search domain + 8, // maxLevel + 10, // leafsize + 3.0 // duplicity + ) ); } - return *boundaryTreePtr_; + return boundaryTreePtr_(); } const Foam::indexedOctree& Foam::meshSearch::cellTree() - const +const { - if (!cellTreePtr_) + if (!cellTreePtr_.valid()) { - // - // Construct tree - // - treeBoundBox overallBb(mesh_.points()); - Random rndGen(123456); + + Random rndGen(261782); + overallBb = overallBb.extend(rndGen, 1E-4); overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); - cellTreePtr_ = new indexedOctree + cellTreePtr_.reset ( - treeDataCell + new indexedOctree ( - false, // not cache bb - mesh_ - ), - overallBb, // overall search domain - 8, // maxLevel - 10, // leafsize - 3.0 // duplicity + treeDataCell + ( + false, // not cache bb + mesh_ + ), + overallBb, + 8, // maxLevel + 10, // leafsize + 3.0 // duplicity + ) ); } - return *cellTreePtr_; - -} - - -const Foam::indexedOctree& - Foam::meshSearch::cellCentreTree() const -{ - if (!cellCentreTreePtr_) - { - // - // Construct tree - // - - treeBoundBox overallBb(mesh_.cellCentres()); - Random rndGen(123456); - overallBb = overallBb.extend(rndGen, 1E-4); - overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); - overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); - - cellCentreTreePtr_ = new indexedOctree - ( - treeDataPoint(mesh_.cellCentres()), - overallBb, // overall search domain - 10, // max levels - 10.0, // maximum ratio of cubes v.s. cells - 100.0 // max. duplicity; n/a since no bounding boxes. - ); - } - - return *cellCentreTreePtr_; + return cellTreePtr_(); } @@ -697,107 +741,21 @@ Foam::label Foam::meshSearch::findCell ) const { // Find the nearest cell centre to this location - label nearCellI = findNearestCell(location, seedCellI, useTreeSearch); - - if (debug) - { - Pout<< "findCell : nearCellI:" << nearCellI - << " ctr:" << mesh_.cellCentres()[nearCellI] - << endl; - } - - if (pointInCell(location, nearCellI)) - { - return nearCellI; - } - else + if (seedCellI == -1) { if (useTreeSearch) { - // Start searching from cell centre of nearCell - point curPoint = mesh_.cellCentres()[nearCellI]; - - vector edgeVec = location - curPoint; - edgeVec /= mag(edgeVec); - - do - { - // Walk neighbours (using tracking) to get closer - passiveParticle tracker(cloud_, curPoint, nearCellI); - - if (debug) - { - Pout<< "findCell : tracked from curPoint:" << curPoint - << " nearCellI:" << nearCellI; - } - - tracker.track(location); - - if (debug) - { - Pout<< " to " << tracker.position() - << " need:" << location - << " onB:" << tracker.onBoundary() - << " cell:" << tracker.cell() - << " face:" << tracker.face() << endl; - } - - if (!tracker.onBoundary()) - { - // stopped not on boundary -> reached location - return tracker.cell(); - } - - // stopped on boundary face. Compare positions - scalar typDim = sqrt(mag(mesh_.faceAreas()[tracker.face()])); - - if ((mag(tracker.position() - location)/typDim) < SMALL) - { - return tracker.cell(); - } - - // tracking stopped at boundary. Find next boundary - // intersection from current point (shifted out a little bit) - // in the direction of the destination - - curPoint = - tracker.position() - + offset(tracker.position(), tracker.face(), edgeVec); - - if (debug) - { - Pout<< "Searching for next boundary from curPoint:" - << curPoint - << " to location:" << location << endl; - } - pointIndexHit curHit = intersection(curPoint, location); - if (debug) - { - Pout<< "Returned from line search with "; - curHit.write(Pout); - Pout<< endl; - } - - if (!curHit.hit()) - { - return -1; - } - else - { - nearCellI = mesh_.faceOwner()[curHit.index()]; - curPoint = - curHit.hitPoint() - + offset(curHit.hitPoint(), curHit.index(), edgeVec); - } - } - while (true); + return cellTree().find(location); } else { return findCellLinear(location); } } - return -1; + else + { + return findCellWalk(location, seedCellI); + } } @@ -947,9 +905,8 @@ bool Foam::meshSearch::isInside(const point& p) const // Delete all storage void Foam::meshSearch::clearOut() { - deleteDemandDrivenData(boundaryTreePtr_); - deleteDemandDrivenData(cellTreePtr_); - deleteDemandDrivenData(cellCentreTreePtr_); + boundaryTreePtr_.clear(); + cellTreePtr_.clear(); } diff --git a/src/meshTools/meshSearch/meshSearch.H b/src/meshTools/meshSearch/meshSearch.H index dfaf71229b..e39d2b75cd 100644 --- a/src/meshTools/meshSearch/meshSearch.H +++ b/src/meshTools/meshSearch/meshSearch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,7 +37,7 @@ SourceFiles #define meshSearch_H #include "pointIndexHit.H" -#include "passiveParticleCloud.H" +#include "pointField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -48,7 +48,6 @@ namespace Foam class polyMesh; class treeDataCell; class treeDataFace; -class treeDataPoint; template class indexedOctree; /*---------------------------------------------------------------------------*\ @@ -65,14 +64,10 @@ class meshSearch //- Whether to use face decomposition for all geometric tests const bool faceDecomp_; - //- Dummy cloud to put particles on for tracking. - passiveParticleCloud cloud_; - //- demand driven octrees - mutable indexedOctree* boundaryTreePtr_; - mutable indexedOctree* cellTreePtr_; - mutable indexedOctree* cellCentreTreePtr_; + mutable autoPtr > boundaryTreePtr_; + mutable autoPtr > cellTreePtr_; // Private Member Functions @@ -112,8 +107,12 @@ class meshSearch //- cell containing location. Linear search. label findCellLinear(const point&) const; + //- walk from seed. Does not 'go around' boundary, just returns + // last cell before boundary. + label findCellWalk(const point&, const label) const; - // Cells + + // Faces label findNearestFaceTree(const point&) const; @@ -188,9 +187,6 @@ public: //- Get (demand driven) reference to octree holding all cells const indexedOctree& cellTree() const; - //- Get (demand driven) reference to octree holding all cell centres - const indexedOctree& cellCentreTree() const; - // Queries diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C index 2619818647..fc5c31911e 100644 --- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C +++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C @@ -28,6 +28,7 @@ License #include "meshSearch.H" #include "Tuple2.H" #include "globalIndex.H" +#include "treeDataCell.H" #include "addToRunTimeSelectionTable.H" @@ -166,8 +167,7 @@ bool Foam::sampledTriSurfaceMesh::update() meshSearch meshSearcher(mesh(), false); - const indexedOctree& cellCentreTree = - meshSearcher.cellCentreTree(); + const indexedOctree& cellTree = meshSearcher.cellTree(); // Global numbering for cells - only used to uniquely identify local cells. @@ -182,7 +182,7 @@ bool Foam::sampledTriSurfaceMesh::update() // Search triangles using nearest on local mesh forAll(fc, triI) { - pointIndexHit nearInfo = cellCentreTree.findNearest + pointIndexHit nearInfo = cellTree.findNearest ( fc[triI], sqr(GREAT) From 7186f052423beb6538d7142097012af855b2194b Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 20 Jul 2010 22:17:31 +0100 Subject: [PATCH 14/42] COMP: missing include files. --- src/meshTools/cellClassification/cellClassification.C | 4 +++- .../directMappedPolyPatch/directMappedPatchBase.C | 3 +++ src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C | 1 + .../sets/pointSources/surfaceToPoint/surfaceToPoint.C | 3 ++- .../triSurfaceMeshPointSet/triSurfaceMeshPointSet.C | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/meshTools/cellClassification/cellClassification.C b/src/meshTools/cellClassification/cellClassification.C index dbc8bf29fb..a723665477 100644 --- a/src/meshTools/cellClassification/cellClassification.C +++ b/src/meshTools/cellClassification/cellClassification.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,6 +33,8 @@ License #include "MeshWave.H" #include "ListOps.H" #include "meshTools.H" +#include "cpuTime.H" +#include "globalMeshData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C index e5d6a0d713..776d6a9c86 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C @@ -32,6 +32,9 @@ License #include "Random.H" #include "treeDataFace.H" #include "indexedOctree.H" +#include "polyMesh.H" +#include "polyPatch.H" +#include "Time.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C index cd7f0305db..1bde7003b6 100644 --- a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C +++ b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C @@ -29,6 +29,7 @@ License #include "triSurface.H" #include "triSurfaceSearch.H" #include "cellClassification.H" +#include "cpuTime.H" #include "addToRunTimeSelectionTable.H" diff --git a/src/meshTools/sets/pointSources/surfaceToPoint/surfaceToPoint.C b/src/meshTools/sets/pointSources/surfaceToPoint/surfaceToPoint.C index 173f771f73..2dadffa9b1 100644 --- a/src/meshTools/sets/pointSources/surfaceToPoint/surfaceToPoint.C +++ b/src/meshTools/sets/pointSources/surfaceToPoint/surfaceToPoint.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,7 @@ License #include "polyMesh.H" #include "meshSearch.H" #include "triSurfaceSearch.H" +#include "cpuTime.H" #include "addToRunTimeSelectionTable.H" diff --git a/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C b/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C index 7cfa11de21..fc0bee4e4b 100644 --- a/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C +++ b/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C @@ -29,6 +29,7 @@ License #include "polyMesh.H" #include "addToRunTimeSelectionTable.H" #include "triSurfaceMesh.H" +#include "Time.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // From 8dacc7bdb3404bf8af7f57182b02fab6bc85ab66 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 20 Jul 2010 22:20:41 +0100 Subject: [PATCH 15/42] STYLE: updated date in header --- .../directMapped/directMappedPolyPatch/directMappedPatchBase.C | 2 +- src/meshTools/indexedOctree/indexedOctree.C | 2 +- src/meshTools/indexedOctree/indexedOctree.H | 2 +- src/meshTools/indexedOctree/treeDataCell.C | 2 +- src/meshTools/indexedOctree/treeDataCell.H | 2 +- src/meshTools/indexedOctree/treeDataEdge.H | 2 +- src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C | 2 +- .../sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C index 776d6a9c86..f48abc08eb 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/meshTools/indexedOctree/indexedOctree.C b/src/meshTools/indexedOctree/indexedOctree.C index a572cad3b8..9fef714a75 100644 --- a/src/meshTools/indexedOctree/indexedOctree.C +++ b/src/meshTools/indexedOctree/indexedOctree.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/meshTools/indexedOctree/indexedOctree.H b/src/meshTools/indexedOctree/indexedOctree.H index 2a5b9c247f..74a3fdf844 100644 --- a/src/meshTools/indexedOctree/indexedOctree.H +++ b/src/meshTools/indexedOctree/indexedOctree.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/meshTools/indexedOctree/treeDataCell.C b/src/meshTools/indexedOctree/treeDataCell.C index 3377402eab..87b5dde123 100644 --- a/src/meshTools/indexedOctree/treeDataCell.C +++ b/src/meshTools/indexedOctree/treeDataCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/meshTools/indexedOctree/treeDataCell.H b/src/meshTools/indexedOctree/treeDataCell.H index de0aee58d0..7e42a6d906 100644 --- a/src/meshTools/indexedOctree/treeDataCell.H +++ b/src/meshTools/indexedOctree/treeDataCell.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/meshTools/indexedOctree/treeDataEdge.H b/src/meshTools/indexedOctree/treeDataEdge.H index 9b47a300c7..68f3a5924a 100644 --- a/src/meshTools/indexedOctree/treeDataEdge.H +++ b/src/meshTools/indexedOctree/treeDataEdge.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C index 1bde7003b6..f060a3f078 100644 --- a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C +++ b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C b/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C index fc0bee4e4b..ebf4a7978c 100644 --- a/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C +++ b/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License From 4e1e1c9c730cbd26d2278cea61a1f13581e6d7f3 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 20 Jul 2010 22:21:38 +0100 Subject: [PATCH 16/42] STYLE: line length --- src/meshTools/indexedOctree/indexedOctree.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/meshTools/indexedOctree/indexedOctree.C b/src/meshTools/indexedOctree/indexedOctree.C index 9fef714a75..c251ccfc44 100644 --- a/src/meshTools/indexedOctree/indexedOctree.C +++ b/src/meshTools/indexedOctree/indexedOctree.C @@ -1046,7 +1046,8 @@ Foam::point Foam::indexedOctree::pushPointIntoFace } -//// Takes a bb and a point on the outside of the bb. Checks if on multiple faces +//// Takes a bb and a point on the outside of the bb. Checks if on multiple +// faces //// and if so perturbs point so it is only on one face. //template //void Foam::indexedOctree::checkMultipleFaces From 6a03ebdd24df7e1a4c257e599ab849902300935f Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 21 Jul 2010 10:19:03 +0200 Subject: [PATCH 17/42] ENH: support keyType for porousZones - allows a regex to collect several cellZones. For example, ( "cat1?(Back|Front)*" { coordinateSystem system_10; porosity 0.781; ... } ) --- .../cfdTools/general/porousMedia/porousZone.C | 61 ++++++++------ .../cfdTools/general/porousMedia/porousZone.H | 30 +++---- .../general/porousMedia/porousZoneTemplates.C | 67 ++++++++++------ .../thermalPorousZone/thermalPorousZone.C | 31 ++++---- .../thermalPorousZone/thermalPorousZone.H | 15 +--- .../thermalPorousZoneTemplates.C | 79 ------------------- .../thermalPorousZone/thermalPorousZones.C | 2 +- .../thermalPorousZone/thermalPorousZones.H | 10 ++- 8 files changed, 120 insertions(+), 175 deletions(-) delete mode 100644 src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZoneTemplates.C diff --git a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C index 745c66c58d..b7aef80850 100644 --- a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C +++ b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,7 @@ License #include "fvMesh.H" #include "fvMatrices.H" #include "geometricOneField.H" +#include "stringListOps.H" // * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // @@ -62,15 +63,15 @@ void Foam::porousZone::adjustNegativeResistance(dimensionedVector& resist) Foam::porousZone::porousZone ( - const word& name, + const keyType& key, const fvMesh& mesh, const dictionary& dict ) : - name_(name), + key_(key), mesh_(mesh), dict_(dict), - cellZoneID_(mesh_.cellZones().findZoneID(name)), + cellZoneIds_(0), coordSys_(dict, mesh), porosity_(1), intensity_(0), @@ -80,9 +81,27 @@ Foam::porousZone::porousZone D_("D", dimensionSet(0, -2, 0, 0, 0), tensor::zero), F_("F", dimensionSet(0, -1, 0, 0, 0), tensor::zero) { - Info<< "Creating porous zone: " << name_ << endl; + Info<< "Creating porous zone: " << key_ << endl; - bool foundZone = (cellZoneID_ != -1); + if (key_.isPattern()) + { + cellZoneIds_ = findStrings + ( + key_, + mesh_.cellZones().names() + ); + } + else + { + const label zoneId = mesh_.cellZones().findZoneID(key_); + if (zoneId != -1) + { + cellZoneIds_.setSize(1); + cellZoneIds_[0] = zoneId; + } + } + + bool foundZone = !cellZoneIds_.empty(); reduce(foundZone, orOp()); if (!foundZone && Pstream::master()) @@ -90,8 +109,8 @@ Foam::porousZone::porousZone FatalErrorIn ( "Foam::porousZone::porousZone" - "(const fvMesh&, const word&, const dictionary&)" - ) << "cannot find porous cellZone " << name_ + "(const keyType&, const fvMesh&, const dictionary&)" + ) << "cannot find porous cellZone " << key_ << exit(FatalError); } @@ -106,7 +125,7 @@ Foam::porousZone::porousZone FatalIOErrorIn ( "Foam::porousZone::porousZone" - "(const fvMesh&, const word&, const dictionary&)", + "(const keyType&, const fvMesh&, const dictionary&)", dict_ ) << "out-of-range porosity value " << porosity_ @@ -123,7 +142,7 @@ Foam::porousZone::porousZone FatalIOErrorIn ( "Foam::porousZone::porousZone" - "(const fvMesh&, const word&, const dictionary&)", + "(const keyType&, const fvMesh&, const dictionary&)", dict_ ) << "out-of-range turbulent intensity value " << intensity_ @@ -140,7 +159,7 @@ Foam::porousZone::porousZone FatalIOErrorIn ( "Foam::porousZone::porousZone" - "(const fvMesh&, const word&, const dictionary&)", + "(const keyType&, const fvMesh&, const dictionary&)", dict_ ) << "out-of-range turbulent length scale " << mixingLength_ @@ -169,7 +188,7 @@ Foam::porousZone::porousZone FatalIOErrorIn ( "Foam::porousZone::porousZone" - "(const fvMesh&, const word&, const dictionary&)", + "(const keyType&, const fvMesh&, const dictionary&)", dict_ ) << "incorrect dimensions for d: " << d.dimensions() << " should be " << D_.dimensions() @@ -192,7 +211,7 @@ Foam::porousZone::porousZone FatalIOErrorIn ( "Foam::porousZone::porousZone" - "(const fvMesh&, const word&, const dictionary&)", + "(const keyType&, const fvMesh&, const dictionary&)", dict_ ) << "incorrect dimensions for f: " << f.dimensions() << " should be " << F_.dimensions() @@ -220,7 +239,7 @@ Foam::porousZone::porousZone FatalIOErrorIn ( "Foam::porousZone::porousZone" - "(const fvMesh&, const word&, const dictionary&)", + "(const keyType&, const fvMesh&, const dictionary&)", dict_ ) << "neither powerLaw (C0/C1) " "nor Darcy-Forchheimer law (d/f) specified" @@ -239,7 +258,7 @@ Foam::porousZone::porousZone void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const { - if (cellZoneID_ == -1) + if (cellZoneIds_.empty()) { return; } @@ -250,7 +269,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const compressible = true; } - const labelList& cells = mesh_.cellZones()[cellZoneID_]; const scalarField& V = mesh_.V(); scalarField& Udiag = UEqn.diag(); vectorField& Usource = UEqn.source(); @@ -263,7 +281,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const addPowerLawResistance ( Udiag, - cells, V, mesh_.lookupObject("rho"), U @@ -274,7 +291,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const addPowerLawResistance ( Udiag, - cells, V, geometricOneField(), U @@ -293,7 +309,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const ( Udiag, Usource, - cells, V, mesh_.lookupObject("rho"), mesh_.lookupObject("mu"), @@ -306,7 +321,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const ( Udiag, Usource, - cells, V, geometricOneField(), mesh_.lookupObject("nu"), @@ -324,7 +338,7 @@ void Foam::porousZone::addResistance bool correctAUprocBC ) const { - if (cellZoneID_ == -1) + if (cellZoneIds_.empty()) { return; } @@ -335,7 +349,6 @@ void Foam::porousZone::addResistance compressible = true; } - const labelList& cells = mesh_.cellZones()[cellZoneID_]; const vectorField& U = UEqn.psi(); if (C0_ > VSMALL) @@ -345,7 +358,6 @@ void Foam::porousZone::addResistance addPowerLawResistance ( AU, - cells, mesh_.lookupObject("rho"), U ); @@ -355,7 +367,6 @@ void Foam::porousZone::addResistance addPowerLawResistance ( AU, - cells, geometricOneField(), U ); @@ -372,7 +383,6 @@ void Foam::porousZone::addResistance addViscousInertialResistance ( AU, - cells, mesh_.lookupObject("rho"), mesh_.lookupObject("mu"), U @@ -383,7 +393,6 @@ void Foam::porousZone::addResistance addViscousInertialResistance ( AU, - cells, geometricOneField(), mesh_.lookupObject("nu"), U diff --git a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.H b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.H index 59a83a24a5..6bd909143c 100644 --- a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.H +++ b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -110,8 +110,8 @@ class porousZone { // Private data - //- Name of this zone - word name_; + //- Name of this zone, or a regular expression + keyType key_; //- Reference to the finite volume mesh this zone is part of const fvMesh& mesh_; @@ -119,8 +119,8 @@ class porousZone //- Dictionary containing the parameters dictionary dict_; - //- Cell zone ID - label cellZoneID_; + //- Cell zone Ids + labelList cellZoneIds_; //- Coordinate system used for the zone (Cartesian) coordinateSystem coordSys_; @@ -159,7 +159,6 @@ class porousZone void addPowerLawResistance ( scalarField& Udiag, - const labelList& cells, const scalarField& V, const RhoFieldType& rho, const vectorField& U @@ -171,7 +170,6 @@ class porousZone ( scalarField& Udiag, vectorField& Usource, - const labelList& cells, const scalarField& V, const RhoFieldType& rho, const scalarField& mu, @@ -184,7 +182,6 @@ class porousZone void addPowerLawResistance ( tensorField& AU, - const labelList& cells, const RhoFieldType& rho, const vectorField& U ) const; @@ -194,7 +191,6 @@ class porousZone void addViscousInertialResistance ( tensorField& AU, - const labelList& cells, const RhoFieldType& rho, const scalarField& mu, const vectorField& U @@ -213,7 +209,7 @@ public: // Constructors //- Construct from components - porousZone(const word& name, const fvMesh&, const dictionary&); + porousZone(const keyType& key, const fvMesh&, const dictionary&); //- Return clone autoPtr clone() const @@ -237,10 +233,10 @@ public: autoPtr operator()(Istream& is) const { - word name(is); + keyType key(is); dictionary dict(is); - return autoPtr(new porousZone(name, mesh_, dict)); + return autoPtr(new porousZone(key, mesh_, dict)); } }; @@ -255,9 +251,9 @@ public: // Access //- cellZone name - const word& zoneName() const + const keyType& zoneName() const { - return name_; + return key_; } //- Return mesh @@ -266,10 +262,10 @@ public: return mesh_; } - //- cellZone number - label zoneId() const + //- cellZone numbers + const labelList& zoneIds() const { - return cellZoneID_; + return cellZoneIds_; } //- dictionary values used for the porousZone diff --git a/src/finiteVolume/cfdTools/general/porousMedia/porousZoneTemplates.C b/src/finiteVolume/cfdTools/general/porousMedia/porousZoneTemplates.C index 46a60ca782..4e72859f80 100644 --- a/src/finiteVolume/cfdTools/general/porousMedia/porousZoneTemplates.C +++ b/src/finiteVolume/cfdTools/general/porousMedia/porousZoneTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,12 +33,15 @@ void Foam::porousZone::modifyDdt(fvMatrix& m) const { if (porosity_ < 1) { - const labelList& cells = mesh_.cellZones()[cellZoneID_]; - - forAll(cells, i) + forAll(cellZoneIds_, zoneI) { - m.diag()[cells[i]] *= porosity_; - m.source()[cells[i]] *= porosity_; + const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]]; + + forAll(cells, i) + { + m.diag()[cells[i]] *= porosity_; + m.source()[cells[i]] *= porosity_; + } } } } @@ -48,7 +51,6 @@ template void Foam::porousZone::addPowerLawResistance ( scalarField& Udiag, - const labelList& cells, const scalarField& V, const RhoFieldType& rho, const vectorField& U @@ -57,10 +59,15 @@ void Foam::porousZone::addPowerLawResistance const scalar C0 = C0_; const scalar C1m1b2 = (C1_ - 1.0)/2.0; - forAll(cells, i) + forAll(cellZoneIds_, zoneI) { - Udiag[cells[i]] += + const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]]; + + forAll(cells, i) + { + Udiag[cells[i]] += V[cells[i]]*rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2); + } } } @@ -70,7 +77,6 @@ void Foam::porousZone::addViscousInertialResistance ( scalarField& Udiag, vectorField& Usource, - const labelList& cells, const scalarField& V, const RhoFieldType& rho, const scalarField& mu, @@ -80,14 +86,21 @@ void Foam::porousZone::addViscousInertialResistance const tensor& D = D_.value(); const tensor& F = F_.value(); - forAll(cells, i) + forAll(cellZoneIds_, zoneI) { - tensor dragCoeff = mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F; - scalar isoDragCoeff = tr(dragCoeff); + const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]]; - Udiag[cells[i]] += V[cells[i]]*isoDragCoeff; - Usource[cells[i]] -= - V[cells[i]]*((dragCoeff - I*isoDragCoeff) & U[cells[i]]); + forAll(cells, i) + { + const tensor dragCoeff = mu[cells[i]]*D + + (rho[cells[i]]*mag(U[cells[i]]))*F; + + const scalar isoDragCoeff = tr(dragCoeff); + + Udiag[cells[i]] += V[cells[i]]*isoDragCoeff; + Usource[cells[i]] -= + V[cells[i]]*((dragCoeff - I*isoDragCoeff) & U[cells[i]]); + } } } @@ -96,7 +109,6 @@ template void Foam::porousZone::addPowerLawResistance ( tensorField& AU, - const labelList& cells, const RhoFieldType& rho, const vectorField& U ) const @@ -104,10 +116,15 @@ void Foam::porousZone::addPowerLawResistance const scalar C0 = C0_; const scalar C1m1b2 = (C1_ - 1.0)/2.0; - forAll(cells, i) + forAll(cellZoneIds_, zoneI) { - AU[cells[i]] = AU[cells[i]] - + I*(rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2)); + const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]]; + + forAll(cells, i) + { + AU[cells[i]] = AU[cells[i]] + + I*(rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2)); + } } } @@ -116,7 +133,6 @@ template void Foam::porousZone::addViscousInertialResistance ( tensorField& AU, - const labelList& cells, const RhoFieldType& rho, const scalarField& mu, const vectorField& U @@ -125,9 +141,14 @@ void Foam::porousZone::addViscousInertialResistance const tensor& D = D_.value(); const tensor& F = F_.value(); - forAll(cells, i) + forAll(cellZoneIds_, zoneI) { - AU[cells[i]] += mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F; + const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]]; + + forAll(cells, i) + { + AU[cells[i]] += mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F; + } } } diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C index 322260c643..df6a32d84b 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C +++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,12 +32,12 @@ License Foam::thermalPorousZone::thermalPorousZone ( - const word& name, + const keyType& key, const fvMesh& mesh, const dictionary& dict ) : - porousZone(name, mesh, dict), + porousZone(key, mesh, dict), T_("T", dimTemperature, -GREAT) { if (const dictionary* dictPtr = dict.subDictPtr("thermalModel")) @@ -53,11 +53,7 @@ Foam::thermalPorousZone::thermalPorousZone FatalIOErrorIn ( "thermalPorousZone::thermalPorousZone" - "(" - "const word& name, " - "const fvMesh& mesh, " - "const dictionary& dict" - ")", + "(const keyType&, const fvMesh&, const dictionary&)", *dictPtr ) << "thermalModel " << thermalModel << " is not supported" << nl << " Supported thermalModels are: fixedTemperature" @@ -76,23 +72,28 @@ void Foam::thermalPorousZone::addEnthalpySource fvScalarMatrix& hEqn ) const { - if (zoneId() == -1 || T_.value() < 0.0) + const labelList& zones = this->zoneIds(); + if (zones.empty() || T_.value() < 0.0) { return; } - const labelList& cells = mesh().cellZones()[zoneId()]; const scalarField& V = mesh().V(); scalarField& hDiag = hEqn.diag(); scalarField& hSource = hEqn.source(); - scalarField hZone = thermo.h(scalarField(cells.size(), T_.value()), cells); - scalar rate = 1e6; + // TODO: generalize for non-fixedTemperature methods + const scalar rate = 1e6; - forAll(cells, i) + forAll(zones, zoneI) { - hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]]; - hSource[cells[i]] += rate*V[cells[i]]*rho[cells[i]]*hZone[i]; + const labelList& cells = mesh().cellZones()[zones[zoneI]]; + + forAll(cells, i) + { + hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]]; + hSource[cells[i]] += rate*V[cells[i]]*rho[cells[i]]*T_.value(); + } } } diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.H b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.H index f3cf5b3396..7278f4ec98 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.H +++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,6 @@ See Also SourceFiles thermalPorousZone.C - thermalPorousZoneTemplates.C \*---------------------------------------------------------------------------*/ @@ -76,7 +75,7 @@ public: // Constructors //- Construct from components - thermalPorousZone(const word& name, const fvMesh&, const dictionary&); + thermalPorousZone(const keyType& key, const fvMesh&, const dictionary&); //- Return clone autoPtr clone() const @@ -101,12 +100,12 @@ public: autoPtr operator()(Istream& is) const { - word name(is); + keyType key(is); dictionary dict(is); return autoPtr ( - new thermalPorousZone(name, mesh_, dict) + new thermalPorousZone(key, mesh_, dict) ); } }; @@ -149,12 +148,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository -//# include "thermalPorousZoneTemplates.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZoneTemplates.C b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZoneTemplates.C deleted file mode 100644 index 261abb18e9..0000000000 --- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZoneTemplates.C +++ /dev/null @@ -1,79 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 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 "porousZone.H" -#include "fvMesh.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -template -void Foam::porousZone::addPowerLawResistance -( - scalarField& Udiag, - const labelList& cells, - const scalarField& V, - const RhoFieldType& rho, - const vectorField& U -) const -{ - const scalar C0 = C0_; - const scalar C1m1b2 = (C1_ - 1.0)/2.0; - - forAll(cells, i) - { - Udiag[cells[i]] += - V[cells[i]]*rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2); - } -} - - -template -void Foam::porousZone::addViscousInertialResistance -( - scalarField& Udiag, - vectorField& Usource, - const labelList& cells, - const scalarField& V, - const RhoFieldType& rho, - const scalarField& mu, - const vectorField& U -) const -{ - const tensor& D = D_.value(); - const tensor& F = F_.value(); - - forAll(cells, i) - { - tensor dragCoeff = mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F; - scalar isoDragCoeff = tr(dragCoeff); - - Udiag[cells[i]] += V[cells[i]]*isoDragCoeff; - Usource[cells[i]] -= - V[cells[i]]*((dragCoeff - I*isoDragCoeff) & U[cells[i]]); - } -} - - -// ************************************************************************* // diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.C b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.C index a98b0e064c..c35bd5c0dd 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.C +++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.H b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.H index e696f2bb5b..5d72c6f90e 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.H +++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,11 @@ Description d d [0 -2 0 0 0] (-1000 -1000 0.50753e+08); f f [0 -1 0 0 0] (-1000 -1000 12.83); } - Temperature [0 0 1 0 0] 600; + thermalModel + { + type fixedTemperature; + T T [0 0 1 0 0] 600; + } } ) @endverbatim @@ -69,7 +73,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class thermalPorousZones Declaration + Class thermalPorousZones Declaration \*---------------------------------------------------------------------------*/ class thermalPorousZones From 82dec4824e3d560092777a83d43a3cae50f47c65 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 21 Jul 2010 11:11:42 +0200 Subject: [PATCH 18/42] ENH: support find via keyType for coordinateSystems - findAll() method returns a labelList of all matching names - find() method returns the index to the first matching name For example, use a regex to specify alternative coordinate systems in porousZones ( "cat1?(Back|Front)*" { coordinateSystem "(cat1|system_10)"; porosity 0.781; ... } ) --- .../coordinateSystems/coordinateSystem.C | 21 ++++---- .../coordinateSystems/coordinateSystem.H | 2 +- .../coordinateSystems/coordinateSystems.C | 52 ++++++++++++++++--- .../coordinateSystems/coordinateSystems.H | 13 +++-- 4 files changed, 64 insertions(+), 24 deletions(-) diff --git a/src/meshTools/coordinateSystems/coordinateSystem.C b/src/meshTools/coordinateSystems/coordinateSystem.C index 8e5fc7bceb..0a5fe400f7 100644 --- a/src/meshTools/coordinateSystems/coordinateSystem.C +++ b/src/meshTools/coordinateSystems/coordinateSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -136,37 +136,36 @@ Foam::coordinateSystem::coordinateSystem { const entry* entryPtr = dict.lookupEntryPtr(typeName_(), false, false); - // a simple entry is a lookup into global coordinateSystems + // non-dictionary entry is a lookup into global coordinateSystems if (entryPtr && !entryPtr->isDict()) { - word csName; - entryPtr->stream() >> csName; + keyType key(entryPtr->stream()); - const coordinateSystems& csLst = coordinateSystems::New(obr); + const coordinateSystems& lst = coordinateSystems::New(obr); + const label id = lst.find(key); - label csId = csLst.find(csName); if (debug) { Info<< "coordinateSystem::coordinateSystem" "(const dictionary&, const objectRegistry&):" << nl << "using global coordinate system: " - << csName << "=" << csId << endl; + << key << "=" << id << endl; } - if (csId < 0) + if (id < 0) { FatalErrorIn ( "coordinateSystem::coordinateSystem" "(const dictionary&, const objectRegistry&)" - ) << "could not find coordinate system: " << csName << nl - << "available coordinate systems: " << csLst.toc() << nl << nl + ) << "could not find coordinate system: " << key << nl + << "available coordinate systems: " << lst.toc() << nl << nl << exit(FatalError); } // copy coordinateSystem, but assign the name as the typeName // to avoid strange things in writeDict() - operator=(csLst[csId]); + operator=(lst[id]); name_ = typeName_(); } else diff --git a/src/meshTools/coordinateSystems/coordinateSystem.H b/src/meshTools/coordinateSystems/coordinateSystem.H index e2a8f47aff..11a48d6eb7 100644 --- a/src/meshTools/coordinateSystems/coordinateSystem.H +++ b/src/meshTools/coordinateSystems/coordinateSystem.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/meshTools/coordinateSystems/coordinateSystems.C b/src/meshTools/coordinateSystems/coordinateSystems.C index 28632d0ae0..4d82900408 100644 --- a/src/meshTools/coordinateSystems/coordinateSystems.C +++ b/src/meshTools/coordinateSystems/coordinateSystems.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,6 +26,7 @@ License #include "coordinateSystems.H" #include "IOPtrList.H" #include "Time.H" +#include "stringListOps.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -97,13 +98,25 @@ const Foam::coordinateSystems& Foam::coordinateSystems::New // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::label Foam::coordinateSystems::find(const word& keyword) const +Foam::label Foam::coordinateSystems::find(const keyType& key) const { - forAll(*this, i) + if (key.isPattern()) { - if (keyword == operator[](i).name()) + labelList allFound = findAll(key); + // return first element + if (!allFound.empty()) { - return i; + return allFound[0]; + } + } + else + { + forAll(*this, i) + { + if (key == operator[](i).name()) + { + return i; + } } } @@ -111,9 +124,34 @@ Foam::label Foam::coordinateSystems::find(const word& keyword) const } -bool Foam::coordinateSystems::found(const word& keyword) const +Foam::labelList Foam::coordinateSystems::findAll(const keyType& key) const { - return find(keyword) >= 0; + labelList allFound; + if (key.isPattern()) + { + allFound = findStrings(key, toc()); + } + else + { + allFound.setSize(size()); + label nFound = 0; + forAll(*this, i) + { + if (key == operator[](i).name()) + { + allFound[nFound++] = i; + } + } + allFound.setSize(nFound); + } + + return allFound; +} + + +bool Foam::coordinateSystems::found(const keyType& key) const +{ + return find(key) >= 0; } diff --git a/src/meshTools/coordinateSystems/coordinateSystems.H b/src/meshTools/coordinateSystems/coordinateSystems.H index 60bd169ba0..2976a6f94e 100644 --- a/src/meshTools/coordinateSystems/coordinateSystems.H +++ b/src/meshTools/coordinateSystems/coordinateSystems.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,11 +97,14 @@ public: // Member Functions - //- Find and return index for a given keyword, returns -1 if not found - label find(const word& key) const; + //- Find and return index for the first match, returns -1 if not found + label find(const keyType& key) const; - //- Search for given keyword - bool found(const word& keyword) const; + //- Find and return indices for all matches + labelList findAll(const keyType& key) const; + + //- Search for given key + bool found(const keyType& key) const; //- Return the table of contents (list of all keywords) wordList toc() const; From 7faf359bc1d105e390dc00956c60af2fbb08ee65 Mon Sep 17 00:00:00 2001 From: graham Date: Wed, 21 Jul 2010 10:58:53 +0100 Subject: [PATCH 19/42] COMP: adding -traditional-cpp to CPP variable. --- wmake/rules/SiCortex64Gcc/general | 1 + wmake/rules/linux64Gcc/general | 2 ++ wmake/rules/linux64Gcc43/general | 2 ++ wmake/rules/linux64Gcc44/general | 2 ++ wmake/rules/linux64Gcc45/general | 1 - wmake/rules/linux64Icc/general | 2 ++ wmake/rules/linuxGcc/general | 1 + wmake/rules/linuxGcc43/general | 1 + wmake/rules/linuxGcc44/general | 1 + wmake/rules/linuxGcc45/general | 1 - wmake/rules/linuxIA64Gcc/general | 1 + wmake/rules/linuxIA64Icc/general | 2 +- wmake/rules/linuxIcc/general | 1 + wmake/rules/linuxPPC64Gcc/general | 1 + 14 files changed, 16 insertions(+), 3 deletions(-) diff --git a/wmake/rules/SiCortex64Gcc/general b/wmake/rules/SiCortex64Gcc/general index eb820ab36d..aeab411b5b 100644 --- a/wmake/rules/SiCortex64Gcc/general +++ b/wmake/rules/SiCortex64Gcc/general @@ -1,3 +1,4 @@ +CPP = cpp -traditional-cpp $(GFLAGS) LD = ld -A64 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl diff --git a/wmake/rules/linux64Gcc/general b/wmake/rules/linux64Gcc/general index e7faa0c0f2..809751cd0a 100644 --- a/wmake/rules/linux64Gcc/general +++ b/wmake/rules/linux64Gcc/general @@ -1,3 +1,5 @@ +CPP = cpp -traditional-cpp $(GFLAGS) + PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl include $(GENERAL_RULES)/standard diff --git a/wmake/rules/linux64Gcc43/general b/wmake/rules/linux64Gcc43/general index e7faa0c0f2..809751cd0a 100644 --- a/wmake/rules/linux64Gcc43/general +++ b/wmake/rules/linux64Gcc43/general @@ -1,3 +1,5 @@ +CPP = cpp -traditional-cpp $(GFLAGS) + PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl include $(GENERAL_RULES)/standard diff --git a/wmake/rules/linux64Gcc44/general b/wmake/rules/linux64Gcc44/general index e7faa0c0f2..809751cd0a 100644 --- a/wmake/rules/linux64Gcc44/general +++ b/wmake/rules/linux64Gcc44/general @@ -1,3 +1,5 @@ +CPP = cpp -traditional-cpp $(GFLAGS) + PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl include $(GENERAL_RULES)/standard diff --git a/wmake/rules/linux64Gcc45/general b/wmake/rules/linux64Gcc45/general index f9bb2e6b1e..fcd79624e9 100644 --- a/wmake/rules/linux64Gcc45/general +++ b/wmake/rules/linux64Gcc45/general @@ -1,4 +1,3 @@ -# need single-line output from cpp CPP = cpp -traditional-cpp PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl diff --git a/wmake/rules/linux64Icc/general b/wmake/rules/linux64Icc/general index e7faa0c0f2..4f411aec98 100644 --- a/wmake/rules/linux64Icc/general +++ b/wmake/rules/linux64Icc/general @@ -1,3 +1,5 @@ +CPP = /lib/cpp -traditional-cpp $(GFLAGS) + PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl include $(GENERAL_RULES)/standard diff --git a/wmake/rules/linuxGcc/general b/wmake/rules/linuxGcc/general index ce84842fee..97ce8c940c 100644 --- a/wmake/rules/linuxGcc/general +++ b/wmake/rules/linuxGcc/general @@ -1,3 +1,4 @@ +CPP = cpp -traditional-cpp $(GFLAGS) LD = ld -melf_i386 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl diff --git a/wmake/rules/linuxGcc43/general b/wmake/rules/linuxGcc43/general index ce84842fee..97ce8c940c 100644 --- a/wmake/rules/linuxGcc43/general +++ b/wmake/rules/linuxGcc43/general @@ -1,3 +1,4 @@ +CPP = cpp -traditional-cpp $(GFLAGS) LD = ld -melf_i386 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl diff --git a/wmake/rules/linuxGcc44/general b/wmake/rules/linuxGcc44/general index ce84842fee..97ce8c940c 100644 --- a/wmake/rules/linuxGcc44/general +++ b/wmake/rules/linuxGcc44/general @@ -1,3 +1,4 @@ +CPP = cpp -traditional-cpp $(GFLAGS) LD = ld -melf_i386 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl diff --git a/wmake/rules/linuxGcc45/general b/wmake/rules/linuxGcc45/general index 91c54db85d..fdd03dc9a5 100644 --- a/wmake/rules/linuxGcc45/general +++ b/wmake/rules/linuxGcc45/general @@ -1,4 +1,3 @@ -# need single-line output from cpp CPP = cpp -traditional-cpp LD = ld -melf_i386 diff --git a/wmake/rules/linuxIA64Gcc/general b/wmake/rules/linuxIA64Gcc/general index 7285501d98..44c2e33667 100644 --- a/wmake/rules/linuxIA64Gcc/general +++ b/wmake/rules/linuxIA64Gcc/general @@ -1,3 +1,4 @@ +CPP = cpp -traditional-cpp $(GFLAGS) PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl include $(GENERAL_RULES)/standard diff --git a/wmake/rules/linuxIA64Icc/general b/wmake/rules/linuxIA64Icc/general index 66953a9652..748cfe770d 100644 --- a/wmake/rules/linuxIA64Icc/general +++ b/wmake/rules/linuxIA64Icc/general @@ -1,4 +1,4 @@ -CPP = cpp -DICC_IA64_PREFETCH +CPP = /lib/cpp -traditional-cpp $(GFLAGS) -DICC_IA64_PREFETCH GLIBS = -liberty diff --git a/wmake/rules/linuxIcc/general b/wmake/rules/linuxIcc/general index ce84842fee..e4d0cb7d7b 100644 --- a/wmake/rules/linuxIcc/general +++ b/wmake/rules/linuxIcc/general @@ -1,3 +1,4 @@ +CPP = /lib/cpp -traditional-cpp $(GFLAGS) LD = ld -melf_i386 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl diff --git a/wmake/rules/linuxPPC64Gcc/general b/wmake/rules/linuxPPC64Gcc/general index 81927e682b..ad4126abe8 100644 --- a/wmake/rules/linuxPPC64Gcc/general +++ b/wmake/rules/linuxPPC64Gcc/general @@ -1,3 +1,4 @@ +CPP = cpp -traditional-cpp $(GFLAGS) LD = ld -m elf64ppc PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl From c7bc9216d4ff3f559ba69cd15c95d7ed31e66622 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 21 Jul 2010 11:18:50 +0100 Subject: [PATCH 20/42] ENH: indexedOctree : renamed find to findInside, changed findIndices to return reference. --- src/OpenFOAM/containers/Lists/ListOps/ListOps.C | 8 +++++++- src/OpenFOAM/containers/Lists/ListOps/ListOps.H | 12 +++++++++++- src/meshTools/indexedOctree/indexedOctree.C | 6 +++--- src/meshTools/indexedOctree/indexedOctree.H | 7 ++++--- src/meshTools/meshSearch/meshSearch.C | 2 +- 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOps.C b/src/OpenFOAM/containers/Lists/ListOps/ListOps.C index 47fc409a2a..96b1b30182 100644 --- a/src/OpenFOAM/containers/Lists/ListOps/ListOps.C +++ b/src/OpenFOAM/containers/Lists/ListOps/ListOps.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,12 @@ License #include "ListOps.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +const Foam::labelList Foam::emptyLabelList = Foam::labelList(0); + + // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // Foam::labelList Foam::invert diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOps.H b/src/OpenFOAM/containers/Lists/ListOps/ListOps.H index 98cb8cf89e..ce16f5431a 100644 --- a/src/OpenFOAM/containers/Lists/ListOps/ListOps.H +++ b/src/OpenFOAM/containers/Lists/ListOps/ListOps.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,6 +43,16 @@ SourceFiles namespace Foam { +extern const labelList emptyLabelList; + +//- Return reference to zero-sized list. Compare to List::null() which returns +// null pointer cast as list reference. +template +static const List& emptyList() +{ + return *reinterpret_cast* >(&emptyLabelList); +} + //- Renumber the values (not the indices) of a list. // Negative ListType elements are left as is. template diff --git a/src/meshTools/indexedOctree/indexedOctree.C b/src/meshTools/indexedOctree/indexedOctree.C index c251ccfc44..2f1e13648b 100644 --- a/src/meshTools/indexedOctree/indexedOctree.C +++ b/src/meshTools/indexedOctree/indexedOctree.C @@ -2497,7 +2497,7 @@ Foam::labelBits Foam::indexedOctree::findNode template -Foam::label Foam::indexedOctree::find(const point& sample) const +Foam::label Foam::indexedOctree::findInside(const point& sample) const { labelBits index = findNode(0, sample); @@ -2526,7 +2526,7 @@ Foam::label Foam::indexedOctree::find(const point& sample) const template -Foam::labelList Foam::indexedOctree::findIndices +const Foam::labelList& Foam::indexedOctree::findIndices ( const point& sample ) const @@ -2544,7 +2544,7 @@ Foam::labelList Foam::indexedOctree::findIndices } else { - return labelList(0); + return emptyList