From d6bad4c556d81079ba24285e37c7dac08f9e0fd0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 9 Oct 2008 09:45:31 +0100 Subject: [PATCH 01/15] new dictionary feature --- .../utilities/mesh/manipulation/createPatch/createPatch.C | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C index 01df2c2f28..a993ecf92a 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C +++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.C @@ -625,10 +625,8 @@ int main(int argc, char *argv[]) << " as patch " << destPatchI << " from " << patchDict << endl; - patchDict.remove("nFaces"); - patchDict.add("nFaces", 0); - patchDict.remove("startFace"); - patchDict.add("startFace", startFaceI); + patchDict.set("nFaces", 0); + patchDict.set("startFace", startFaceI); // Add an empty patch. allPatches.append From c713c814e3dbf8087dd9cf514601b945bd3da84d Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 10 Oct 2008 12:34:16 +0100 Subject: [PATCH 02/15] make output compatible with dictionary entries --- src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C b/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C index 11ae6f7140..0695eeaefc 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C @@ -77,7 +77,7 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList& L) } else { - // Putback the openning bracket + // Putback the opening bracket is.putBack(firstToken); } @@ -190,8 +190,9 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList& L) if (uniform) { - // Write size of list and start contents delimiter - os << token::BEGIN_BLOCK; + // Write size of list (so it is valid dictionary entry) and + // start contents delimiter + os << L.size() << token::BEGIN_BLOCK; // Write list contents os << L[0]; @@ -201,7 +202,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList& L) } else if (Size < 11 && contiguous()) { - // Write size of list and start contents delimiter + // Write start of contents delimiter os << token::BEGIN_LIST; // Write list contents @@ -216,7 +217,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList& L) } else { - // Write size of list and start contents delimiter + // Write start of contents delimiter os << nl << token::BEGIN_LIST; // Write list contents From 682c247e006b25618edb819df3621661ec5c7ae1 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 13 Oct 2008 09:33:36 +0100 Subject: [PATCH 03/15] gcc 4.2.1 compiler warning --- .../miscellaneous/postChannel/channelIndexTemplates.C | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/applications/utilities/postProcessing/miscellaneous/postChannel/channelIndexTemplates.C b/applications/utilities/postProcessing/miscellaneous/postChannel/channelIndexTemplates.C index 9fc8ff0360..6f7e548c70 100644 --- a/applications/utilities/postProcessing/miscellaneous/postChannel/channelIndexTemplates.C +++ b/applications/utilities/postProcessing/miscellaneous/postChannel/channelIndexTemplates.C @@ -54,9 +54,11 @@ Foam::Field Foam::channelIndex::collapse ) const { // Average and order + const Field summedField(regionSum(cellField)); + Field regionField ( - regionSum(cellField) + summedField / regionCount_, sortMap_ ); From c49e93d4d45815157cfccf6a4af86d8b6e6fa08f Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 13 Oct 2008 09:34:08 +0100 Subject: [PATCH 04/15] unecessary shrink --- src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H index da6bd13067..9fdfe21bb1 100644 --- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H +++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H @@ -79,8 +79,9 @@ inline void Foam::DynamicList::setSize const label s ) { - if (s < List::size()) + if (s <= List::size()) { + // shrink addressable size, leave allocated size untouched List::size() = s; } else @@ -100,8 +101,9 @@ inline void Foam::DynamicList::setSize const T& t ) { - if (s < List::size()) + if (s <= List::size()) { + // shrink addressable size, leave allocated size untouched List::size() = s; } else From cd41c7d07d1a0b5787f1fcf4f1d6f508bf3bbce2 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 13 Oct 2008 09:34:29 +0100 Subject: [PATCH 05/15] allowing wildcards --- .../layerParameters/layerParameters.C | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C index 17ad2db042..7f7f3d2f5a 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C @@ -279,27 +279,13 @@ Foam::layerParameters::layerParameters { const dictionary& layersDict = dict.subDict("layers"); - forAllConstIter(dictionary, layersDict, iter) + forAll(boundaryMesh, patchI) { - const word& key = iter().keyword(); + const word& patchName = boundaryMesh[patchI].name(); - if (layersDict.isDict(key)) + if (layersDict.found(patchName)) { - label patchI = boundaryMesh.findPatchID(key); - - if (patchI == -1) - { - FatalErrorIn - ( - "layerParameters::layerParameters" - "(const dictionary&, const polyBoundaryMesh&)" - ) << "Specified illegal patch " << key - << " in layer dictionary." << endl - << "Valid patch names are " << boundaryMesh.names() - << exit(FatalError); - } - - const dictionary& layerDict = layersDict.subDict(key); + const dictionary& layerDict = layersDict.subDict(patchName); numLayers_[patchI] = readLabel(layerDict.lookup("nSurfaceLayers")); From 54c28044199feae3eb399cb83855d881d8cccefb Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 13 Oct 2008 09:34:46 +0100 Subject: [PATCH 06/15] missing include file --- src/dynamicMesh/fvMeshAdder/fvMeshAdder.H | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dynamicMesh/fvMeshAdder/fvMeshAdder.H b/src/dynamicMesh/fvMeshAdder/fvMeshAdder.H index d19ccf0325..95ecfd6519 100644 --- a/src/dynamicMesh/fvMeshAdder/fvMeshAdder.H +++ b/src/dynamicMesh/fvMeshAdder/fvMeshAdder.H @@ -40,6 +40,7 @@ SourceFiles #include "polyMeshAdder.H" #include "fvPatchFieldsFwd.H" +#include "fvsPatchFieldsFwd.H" #include "fvPatchFieldMapper.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From c1cb8b6dbc82c02065f2bf41c4cfac5371fb378c Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 13 Oct 2008 17:28:20 +0100 Subject: [PATCH 07/15] setSize mis-usage --- .../polyTopoChange/polyTopoChange/refinementHistory.C | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/refinementHistory.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/refinementHistory.C index 15d28b5b60..45f1cb9e2a 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/refinementHistory.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/refinementHistory.C @@ -410,8 +410,14 @@ Foam::refinementHistory::refinementHistory } else { - splitCells_.setSize(nCells, splitCell8()); - visibleCells_ = identity(nCells); + visibleCells_.setSize(nCells); + splitCells_.setSize(nCells); + + for (label cellI = 0; cellI < nCells; cellI++) + { + visibleCells_[cellI] = cellI; + splitCells_.append(splitCell8()); + } } // Check indices. From d8c44047bf9445b8b2d24e5e2ef16985af185c2a Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 14 Oct 2008 17:05:21 +0100 Subject: [PATCH 08/15] point merging --- .../reconstructParMesh/reconstructParMesh.C | 121 ++++++++++++++---- 1 file changed, 99 insertions(+), 22 deletions(-) diff --git a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C index e824c20e39..bfd6ae083b 100644 --- a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C +++ b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C @@ -46,6 +46,8 @@ Description #include "mapAddedPolyMesh.H" #include "polyMeshAdder.H" #include "faceCoupleInfo.H" +#include "fvMeshAdder.H" +#include "polyTopoChange.H" using namespace Foam; @@ -203,6 +205,78 @@ autoPtr determineCoupledFaces } +autoPtr mergeSharedPoints +( + const scalar mergeDist, + polyMesh& mesh, + labelListList& pointProcAddressing +) +{ + // Find out which sets of points get merged and create a map from + // mesh point to unique point. + Map