From 6645d6d1cdee25d96381a4839c7f5b189b9c8969 Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Thu, 29 Sep 2016 10:30:30 +0100 Subject: [PATCH 1/9] STYLE: Added header documentation to function --- src/OpenFOAM/primitives/strings/word/word.H | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OpenFOAM/primitives/strings/word/word.H b/src/OpenFOAM/primitives/strings/word/word.H index 4b51809306..8f29bdc943 100644 --- a/src/OpenFOAM/primitives/strings/word/word.H +++ b/src/OpenFOAM/primitives/strings/word/word.H @@ -125,7 +125,8 @@ public: // Friend Operators - friend word operator&(const word&, const word&); + //- Join word a and bm capitalising first letter of b + friend word operator&(const word& a, const word& b); // IOstream operators From c4a4c38858c87853896c5a1ad2212d19f4fa2dc1 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 17 Oct 2016 12:24:11 +0100 Subject: [PATCH 2/9] ENH: subTriSurfaceMesh: fixed comment --- src/meshTools/searchableSurface/subTriSurfaceMesh.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meshTools/searchableSurface/subTriSurfaceMesh.H b/src/meshTools/searchableSurface/subTriSurfaceMesh.H index 9d0f508e14..ca7104b92c 100644 --- a/src/meshTools/searchableSurface/subTriSurfaceMesh.H +++ b/src/meshTools/searchableSurface/subTriSurfaceMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,7 @@ Note Example usage: \verbatim - spheres.stl + spheres_solid1 { type subTriSurfaceMesh; From 82c3eed531a23ca964b68a89d1967ddb11dc3857 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 17 Oct 2016 12:25:03 +0100 Subject: [PATCH 3/9] BUG: snappyHexMesh: findCellZoneTopo was copying same value but still setting changed flag which caused infinite while loop. Background info: - findCellZoneTopo tries to find for all named surface intersections which side of the face is in the faceZone - i.e. it tries to make the cellZone consistent with the faceZone (to fix small problems) - this had some logic to assign the neighbour cellZone to the owner cellZone - which didn't check for the neighbour being the same value as the owner - but still set a 'changed' flag which caused the loop to never end. --- .../snappyHexMesh/meshRefinement/meshRefinementBaffles.C | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C index 54c8ce1e42..6871b2f413 100644 --- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C @@ -1779,8 +1779,11 @@ bool Foam::meshRefinement::calcRegionToZone // Special: face is -on faceZone -not real boundary // -not on cellZone // so make regions same on either side - regionToCellZone[ownRegion] = regionToCellZone[neiRegion]; - changed = true; + if (regionToCellZone[neiRegion] != -2) + { + regionToCellZone[ownRegion] = regionToCellZone[neiRegion]; + changed = true; + } } else if (regionToCellZone[neiRegion] == surfZoneI) { From fe6ea956f7b664a6e6951262658a4788885aea9e Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 17 Oct 2016 21:50:30 +0200 Subject: [PATCH 4/9] COMP: compile issue with gcc-5.2 (closes #273) - Superfluous #include "FieldFunctions.H" provokes warnings/errors with newer gcc. --- src/postProcessing/functionObjects/utilities/ddt2/ddt2.C | 1 - 1 file changed, 1 deletion(-) diff --git a/src/postProcessing/functionObjects/utilities/ddt2/ddt2.C b/src/postProcessing/functionObjects/utilities/ddt2/ddt2.C index 58edbf3627..c3cf49bf2b 100644 --- a/src/postProcessing/functionObjects/utilities/ddt2/ddt2.C +++ b/src/postProcessing/functionObjects/utilities/ddt2/ddt2.C @@ -27,7 +27,6 @@ License #include "volFields.H" #include "dictionary.H" -#include "FieldFunctions.H" #include "fvcDdt.H" #include "steadyStateDdtScheme.H" From 03b5d5c108093868aa2718d0cde6f95d22dc6a16 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 18 Oct 2016 09:52:37 +0200 Subject: [PATCH 5/9] BUG: foamCleanPath problem if path contains @ (closes #264) - Can occur with some user names, or mounted paths. Resolve by using '?' for the separation character. Since '?' is a shell-glob, it is highly unlikely to occur appear in filenames. Additionally, it is not a meta-character in standard sed, nor in the GNU extension (which uses '\?'). --- bin/foamCleanPath | 4 ++-- bin/tools/doxyFilter | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/foamCleanPath b/bin/foamCleanPath index 86a8c171fd..d3f8007023 100755 --- a/bin/foamCleanPath +++ b/bin/foamCleanPath @@ -99,7 +99,7 @@ IFS=': ' # or may contain ':' separators set -- $* -# strip out wildcards via sed +# Strip out wildcards via sed. Path and wildcard cannot contain '?'. while [ "$#" -ge 1 ] do wildcard=$1 @@ -107,7 +107,7 @@ do ##DEBUG echo "remove>$wildcard<" 1>&2 if [ -n "$wildcard" ] then - dirList=$(echo "$dirList:" | sed -e "s@${wildcard}[^:]*:@@g") + dirList=$(echo "$dirList:" | sed -e "s?${wildcard}[^:]*:??g") fi done diff --git a/bin/tools/doxyFilter b/bin/tools/doxyFilter index 061c72e526..ed427da104 100755 --- a/bin/tools/doxyFilter +++ b/bin/tools/doxyFilter @@ -39,15 +39,15 @@ if [ "$#" -gt 0 ] then - realFilePath=$(echo $1 | sed -e s@^$WM_PROJECT_DIR@../../..@ ) + realFilePath=$(echo "$1" | sed -e "s?^$WM_PROJECT_DIR?../../..?" ) if [ -n "$FOAM_ONLINE_REPO" ] then - filePath=$(echo $1 | sed -e s@^$WM_PROJECT_DIR@$FOAM_ONLINE_REPO@ ) + filePath=$(echo "$1" | sed -e "s?^$WM_PROJECT_DIR?$FOAM_ONLINE_REPO?" ) else filePath=$realFilePath fi - # dirName=$(echo "$filePath" | sed -e 's@/[^/]*$@@' ) + # dirName=$(echo "$filePath" | sed -e 's?/[^/]*$??' ) dirName=${filePath%/[^/]*} fileName=${filePath##*/} @@ -62,7 +62,7 @@ then # ;; esac - awk -f $WM_PROJECT_DIR/bin/tools/doxyFilter-table.awk $1 | \ + awk -f $WM_PROJECT_DIR/bin/tools/doxyFilter-table.awk "$1" | \ awk -f $awkScript | \ sed -f $WM_PROJECT_DIR/bin/tools/doxyFilter.sed \ -e s@%realFilePath%@$realFilePath@g \ From 175c7744c06c63b503f5242787a3bfd76d37a97a Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 19 Oct 2016 10:42:47 +0200 Subject: [PATCH 6/9] STYLE: adjust mergePoints to ease adoption of different list types (issue #250) - A preliminary minor adjustment only. --- src/OpenFOAM/meshes/meshTools/mergePoints.C | 25 +++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/OpenFOAM/meshes/meshTools/mergePoints.C b/src/OpenFOAM/meshes/meshTools/mergePoints.C index 04d3462197..506082895d 100644 --- a/src/OpenFOAM/meshes/meshTools/mergePoints.C +++ b/src/OpenFOAM/meshes/meshTools/mergePoints.C @@ -39,23 +39,22 @@ Foam::label Foam::mergePoints const Type& origin ) { - Type compareOrigin = origin; - - if (origin == Type::max) - { - if (points.size()) - { - compareOrigin = sum(points)/points.size(); - } - } - // Create a old to new point mapping array pointMap.setSize(points.size()); pointMap = -1; if (points.empty()) { - return points.size(); + return 0; + } + + // Explicitly convert to Field to support various list types + tmp> tPoints(new Field(points)); + + Type compareOrigin = origin; + if (origin == Type::max) + { + compareOrigin = sum(tPoints())/points.size(); } // We're comparing distance squared to origin first. @@ -70,7 +69,7 @@ Foam::label Foam::mergePoints const scalar mergeTolSqr = Foam::sqr(scalar(mergeTol)); // Sort points by magSqr - const Field d(points - compareOrigin); + const Field d(tPoints - compareOrigin); List magSqrD(d.size()); forAll(d, pointI) @@ -98,12 +97,10 @@ Foam::label Foam::mergePoints label newPointI = 0; - // Handle 0th point separately (is always unique) label pointI = order[0]; pointMap[pointI] = newPointI++; - for (label sortI = 1; sortI < order.size(); sortI++) { // Get original point index From 3c496ae4c79cfed602e8ef7c329b31dd81522804 Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Wed, 19 Oct 2016 13:19:34 +0100 Subject: [PATCH 7/9] ENH: noiseModel: Updated check for uniform time step size --- src/randomProcesses/noise/noiseModels/noiseModel/noiseModel.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/randomProcesses/noise/noiseModels/noiseModel/noiseModel.C b/src/randomProcesses/noise/noiseModels/noiseModel/noiseModel.C index 145f992725..21d52bb3dd 100644 --- a/src/randomProcesses/noise/noiseModels/noiseModel/noiseModel.C +++ b/src/randomProcesses/noise/noiseModels/noiseModel/noiseModel.C @@ -53,7 +53,7 @@ Foam::scalar Foam::noiseModel::checkUniformTimeStep deltaT = dT; } - if (mag(deltaT - dT) > SMALL) + if (mag(dT/deltaT - 1) > 1e-8) { FatalErrorInFunction << "Unable to process data with a variable time step" From 509517e996f0872879a6a82822488950bb50a24c Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Wed, 19 Oct 2016 13:20:02 +0100 Subject: [PATCH 8/9] ENH: gmshToFoam: Updated for line entries --- .../mesh/conversion/gmshToFoam/gmshToFoam.C | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index 9d466f64f2..c8703258fb 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -63,12 +63,17 @@ using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Element type numbers + +static label MSHLINE = 1; + static label MSHTRI = 2; static label MSHQUAD = 3; static label MSHTET = 4; -static label MSHPYR = 7; -static label MSHPRISM = 6; + + static label MSHHEX = 5; +static label MSHPRISM = 6; +static label MSHPYR = 7; // Skips till end of section. Returns false if end of file. @@ -424,6 +429,11 @@ void readCells List>& zoneCells ) { + //$Elements + //number-of-elements + //elm-number elm-type number-of-tags < tag > \u2026 node-number-list + + Info<< "Starting to read cells at line " << inFile.lineNumber() << endl; const cellModel& hex = *(cellModeller::lookup("hex")); @@ -473,13 +483,12 @@ void readCells IStringStream lineStr(line); label elmNumber, elmType, regPhys; - if (versionFormat >= 2) { lineStr >> elmNumber >> elmType; label nTags; - lineStr>> nTags; + lineStr >> nTags; if (nTags > 0) { @@ -488,7 +497,7 @@ void readCells for (label i = 1; i < nTags; i++) { label dummy; - lineStr>> dummy; + lineStr >> dummy; } } } @@ -499,8 +508,12 @@ void readCells } // regPhys on surface elements is region number. - - if (elmType == MSHTRI) + if (elmType == MSHLINE) + { + label meshPti; + lineStr >> meshPti >> meshPti; + } + else if (elmType == MSHTRI) { lineStr >> triPoints[0] >> triPoints[1] >> triPoints[2]; From a7bdbccaed2a23acc718ee6713309acd63d1617e Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Wed, 19 Oct 2016 13:20:18 +0100 Subject: [PATCH 9/9] STYLE: Corrected typo --- src/OpenFOAM/global/foamDoc.H | 2 +- src/thermophysicalModels/doc/thermophysicalModels.dox | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/global/foamDoc.H b/src/OpenFOAM/global/foamDoc.H index 1d251618f5..8843b823c6 100644 --- a/src/OpenFOAM/global/foamDoc.H +++ b/src/OpenFOAM/global/foamDoc.H @@ -60,7 +60,7 @@ License - \subpage pageSolvers Modelling - - \subpage pageThermophsyicalModels + - \subpage pageThermophysicalModels - \subpage pageTurbulenceModelling - \subpage pageLagrangianIntermediate diff --git a/src/thermophysicalModels/doc/thermophysicalModels.dox b/src/thermophysicalModels/doc/thermophysicalModels.dox index 9df1640a0b..d3283509be 100644 --- a/src/thermophysicalModels/doc/thermophysicalModels.dox +++ b/src/thermophysicalModels/doc/thermophysicalModels.dox @@ -23,7 +23,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -\page pageThermophsyicalModels Thermophysical Models +\page pageThermophysicalModels Thermophysical Models \section secSchemes Overview The available thermophysical models are grouped into the following categories: