diff --git a/src/meshTools/meshSearch/meshSearch.C b/src/meshTools/meshSearch/meshSearch.C index 713b6ddbcce9609330e2c243e6dbecde5e5e0789..ab0975a43c4eb9c6d63804bf94ce8d9ba0ee594a 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) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -508,7 +508,13 @@ Foam::meshSearch::meshSearch : mesh_(mesh), cellDecompMode_(cellDecompMode) -{} +{ + if (cellDecompMode_ == polyMesh::FACEDIAGTETS) + { + // Force construction of face diagonals + (void)mesh.tetBasePtIs(); + } +} // Construct with a custom bounding box @@ -523,6 +529,12 @@ Foam::meshSearch::meshSearch cellDecompMode_(cellDecompMode) { overallBbPtr_.reset(new treeBoundBox(bb)); + + if (cellDecompMode_ == polyMesh::FACEDIAGTETS) + { + // Force construction of face diagonals + (void)mesh.tetBasePtIs(); + } } diff --git a/src/sampling/probes/patchProbes.C b/src/sampling/probes/patchProbes.C index e1aaadc923b6dc2661f394a34998c1b7dfedad57..3b56f6d229fa9d82e46914680d937465f0de21df 100644 --- a/src/sampling/probes/patchProbes.C +++ b/src/sampling/probes/patchProbes.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,6 +42,7 @@ namespace Foam void Foam::patchProbes::findElements(const fvMesh& mesh) { + (void)mesh.tetBasePtIs(); const polyBoundaryMesh& bm = mesh.boundaryMesh(); diff --git a/src/sampling/sampledSet/cloud/cloudSet.C b/src/sampling/sampledSet/cloud/cloudSet.C index c03c73e3fea234f6fdfc729b605b141979cd691e..9101338e443847de89c8b4971f6c1427735376cd 100644 --- a/src/sampling/sampledSet/cloud/cloudSet.C +++ b/src/sampling/sampledSet/cloud/cloudSet.C @@ -51,9 +51,11 @@ void Foam::cloudSet::calcSamples DynamicList<scalar>& samplingCurveDist ) const { + const meshSearch& queryMesh = searchEngine(); + forAll(sampleCoords_, sampleI) { - label cellI = searchEngine().findCell(sampleCoords_[sampleI]); + label cellI = queryMesh.findCell(sampleCoords_[sampleI]); if (cellI != -1) { diff --git a/src/sampling/sampledSet/patchCloud/patchCloudSet.C b/src/sampling/sampledSet/patchCloud/patchCloudSet.C index 027fafc77e02f6a3a1ab11ef576a1159add16b38..91bf7becb1bd1927d64b06fbf7495d21ecb5c953 100644 --- a/src/sampling/sampledSet/patchCloud/patchCloudSet.C +++ b/src/sampling/sampledSet/patchCloud/patchCloudSet.C @@ -114,7 +114,7 @@ void Foam::patchCloudSet::calcSamples 10, // leafsize 3.0 // duplicity ); - + (void)mesh().tetBasePtIs(); // All the info for nearest. Construct to miss