From f79f79421cacf9ea67b00f6960421dc908af43e8 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 8 Apr 2019 16:58:47 +0200 Subject: [PATCH 1/4] BUG: ensight writer using incorrect first mesh time (fixes #1273) - used fallback of 0 instead of the results time. This discrepancy caused the case file to have two timesets that only differed by the first (incorrect) entry. --- .../sampledSurface/writers/ensight/ensightSurfaceWriterImpl.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriterImpl.C b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriterImpl.C index cb040ff965..b78edb7178 100644 --- a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriterImpl.C +++ b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriterImpl.C @@ -193,7 +193,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeCollated scalar timeValue = 0.0; readScalar(timeDir, timeValue); - scalar meshValue = 0; + scalar meshValue = timeValue; if (!isDir(baseDir)) { From 72bf9a3558d4311533e8c0e13471866bc72957c9 Mon Sep 17 00:00:00 2001 From: sergio Date: Mon, 8 Apr 2019 09:08:07 -0700 Subject: [PATCH 2/4] ENH: Reducing tolerance for the cellVolumeWeight search --- .../cellVolumeWeight/cellVolumeWeightCellCellStencil.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overset/cellCellStencil/cellVolumeWeight/cellVolumeWeightCellCellStencil.C b/src/overset/cellCellStencil/cellVolumeWeight/cellVolumeWeightCellCellStencil.C index 5396d5a727..d78ddf3273 100644 --- a/src/overset/cellCellStencil/cellVolumeWeight/cellVolumeWeightCellCellStencil.C +++ b/src/overset/cellCellStencil/cellVolumeWeight/cellVolumeWeightCellCellStencil.C @@ -48,7 +48,7 @@ namespace cellCellStencils } Foam::scalar -Foam::cellCellStencils::cellVolumeWeight::defaultOverlapTolerance_ = 1e-3; +Foam::cellCellStencils::cellVolumeWeight::defaultOverlapTolerance_ = 1e-9; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // From b4f1092b3aace6ff94e5235290864294c62373e3 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 10 Apr 2019 10:34:50 +0100 Subject: [PATCH 3/4] BUG: snappyHexMesh: attraction distance mapping. Fixes #941. --- .../snappySnapDriverFeature.C | 4 ++-- .../searchableSurfacesQueries.C | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C index 24e02f5ebb..64362f5805 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C @@ -306,7 +306,7 @@ void Foam::snappySnapDriver::calcNearestFace ( labelList(1, zoneSurfi), fc, - sqr(faceSnapDist),// sqr of attract dist + sqr(scalarField(faceSnapDist, ppFaces)),// sqr of attract dist hitSurface, hitInfo, hitRegion, @@ -382,7 +382,7 @@ void Foam::snappySnapDriver::calcNearestFace ( unzonedSurfaces, fc, - sqr(faceSnapDist),// sqr of attract dist + sqr(scalarField(faceSnapDist, ppFaces)),// sqr of attract dist hitSurface, hitInfo, hitRegion, diff --git a/src/meshTools/searchableSurfaces/searchableSurfacesQueries/searchableSurfacesQueries.C b/src/meshTools/searchableSurfaces/searchableSurfacesQueries/searchableSurfacesQueries.C index df5234dc1a..a4bd237f6a 100644 --- a/src/meshTools/searchableSurfaces/searchableSurfacesQueries/searchableSurfacesQueries.C +++ b/src/meshTools/searchableSurfaces/searchableSurfacesQueries/searchableSurfacesQueries.C @@ -354,6 +354,13 @@ void Foam::searchableSurfacesQueries::findNearest { // Find nearest. Return -1 or nearest point + if (samples.size() != nearestDistSqr.size()) + { + FatalErrorInFunction << "Inconsistent sizes. samples:" << samples.size() + << " search-radius:" << nearestDistSqr.size() + << exit(FatalError); + } + // Initialise nearestSurfaces.setSize(samples.size()); nearestSurfaces = -1; @@ -405,6 +412,14 @@ void Foam::searchableSurfacesQueries::findNearest { // Find nearest. Return -1 or nearest point + if (samples.size() != nearestDistSqr.size()) + { + FatalErrorInFunction << "Inconsistent sizes. samples:" << samples.size() + << " search-radius:" << nearestDistSqr.size() + << exit(FatalError); + } + + if (regionIndices.empty()) { findNearest @@ -468,6 +483,15 @@ void Foam::searchableSurfacesQueries::findNearest { // Multi-surface findNearest + + if (start.size() != distSqr.size()) + { + FatalErrorInFunction << "Inconsistent sizes. samples:" << start.size() + << " search-radius:" << distSqr.size() + << exit(FatalError); + } + + vectorField normal; List info; From 64ed81b78ffb77cb9623045e5c5726ee98ab89f0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 11 Apr 2019 11:07:28 +0100 Subject: [PATCH 4/4] BUG: gmsh: skip empty lines. See #1155. Fix provided by Gavin Ridley. --- .../utilities/mesh/conversion/gmshToFoam/gmshToFoam.C | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index b91672b162..56f7cd9179 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -822,6 +822,12 @@ int main(int argc, char *argv[]) { string line; inFile.getLine(line); + + if (line.empty()) + { + continue; + } + IStringStream lineStr(line); word tag(lineStr);