diff --git a/applications/utilities/mesh/advanced/selectCells/selectCells.C b/applications/utilities/mesh/advanced/selectCells/selectCells.C index ae7525f1275ca42363aa7f58a05aac99eb84f40a..dfa2a5ce24385391a8775ab1ce38c2ceda59b43f 100644 --- a/applications/utilities/mesh/advanced/selectCells/selectCells.C +++ b/applications/utilities/mesh/advanced/selectCells/selectCells.C @@ -381,7 +381,7 @@ int main(int argc, char *argv[]) (void)edgeCalc.minLen(Info); // Search engine on mesh. Face decomposition since faces might be warped. - meshSearch queryMesh(mesh, polyMesh::FACEDIAGTETS); + meshSearch queryMesh(mesh); // Check all 'outside' points forAll(outsidePts, outsideI) diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index 2d75cc36efdc69bc90094c44888bd085a4b444a6..b34676fac5c0d7d0975f0e9029133d06399b4fae 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -2194,7 +2194,7 @@ int main(int argc, char *argv[]) label regionI = -1; - label cellI = mesh.findCell(insidePoint, polyMesh::FACEDIAGTETS); + label cellI = mesh.findCell(insidePoint); Info<< nl << "Found point " << insidePoint << " in cell " << cellI << endl; diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 1a92c9bc398f3546c1e96d0ba625ca4ac612917b..fd58570b34842158ceeb23fcffa956d4f1d582d4 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -528,11 +528,7 @@ int main(int argc, char *argv[]) << "Cell number should be between 0 and " << mesh.nCells()-1 << nl << "On this mesh the particle should be in cell " - << mesh.findCell - ( - iter().position(), - polyMesh::FACEDIAGTETS - ) + << mesh.findCell(iter().position()) << exit(FatalError); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.H b/src/OpenFOAM/meshes/polyMesh/polyMesh.H index ed67ef6a32d27b6b2342e9ad52d0621a802c6236..d67896744f9b0b3bb9b67b538442c53e2ca438ca 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.H @@ -558,14 +558,14 @@ public: ( const point&, label cellI, - const cellRepresentation + const cellRepresentation = FACEDIAGTETS ) const; //- Find cell enclosing this location (-1 if not in mesh) label findCell ( const point&, - const cellRepresentation + const cellRepresentation = FACEDIAGTETS ) const; }; diff --git a/src/engine/ignition/ignitionSite.C b/src/engine/ignition/ignitionSite.C index 758d84449da18daea5ff4b5b3e0e58aa98a57461..3ecdd632715253c4ec36539cca93a6174b3af5f2 100644 --- a/src/engine/ignition/ignitionSite.C +++ b/src/engine/ignition/ignitionSite.C @@ -36,7 +36,7 @@ void Foam::ignitionSite::findIgnitionCells(const fvMesh& mesh) const volVectorField& centres = mesh.C(); const scalarField& vols = mesh.V(); - label ignCell = mesh.findCell(location_, polyMesh::FACEDIAGTETS); + label ignCell = mesh.findCell(location_); if (ignCell == -1) { return; diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.C index 5f454974f2fac571a1173335681be93a81185b0c..da790fab4d93f59189ac855948ff98ec15e4a933 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.C @@ -104,11 +104,7 @@ void Foam::basicSource::setCellSet() forAll(points_, i) { - label cellI = mesh_.findCell - ( - points_[i], - polyMesh::FACEDIAGTETS - ); + label cellI = mesh_.findCell(points_[i]); if (cellI >= 0) { selectedCells.insert(cellI); diff --git a/src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C b/src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C index eb6048f939a476556d6e37590b6aa84a1b07cb4a..c96f7e5fad255a4e6e06b521990faad4da38f695 100644 --- a/src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C +++ b/src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C @@ -76,10 +76,16 @@ void Foam::setRefCell else if (dict.found(refPointName)) { point refPointi(dict.lookup(refPointName)); + + // Note: find reference cell using facePlanes to avoid constructing + // face decomposition structure. Most likely the reference + // cell is an undistorted one so this should not be a + // problem. + refCelli = field.mesh().findCell ( refPointi, - polyMesh::FACEDIAGTETS + polyMesh::FACEPLANES ); label hasRef = (refCelli >= 0 ? 1 : 0); label sumHasRef = returnReduce<label>(hasRef, sumOp<label>()); diff --git a/src/lagrangian/dieselSpray/spray/findInjectorCell.H b/src/lagrangian/dieselSpray/spray/findInjectorCell.H index bf1ca82cecd1c5fae44f640297fc35f513e97eb7..9ff2141c4c26701d34e2d27564287c3180d1d7d9 100644 --- a/src/lagrangian/dieselSpray/spray/findInjectorCell.H +++ b/src/lagrangian/dieselSpray/spray/findInjectorCell.H @@ -6,12 +6,7 @@ if (injectorCell >= 0) const vector& C = mesh_.C()[injectorCell]; injectionPosition += 1.0e-9*(C - injectionPosition); - foundCell = mesh_.pointInCell - ( - injectionPosition, - injectorCell, - polyMesh::FACEDIAGTETS - ); + foundCell = mesh_.pointInCell(injectionPosition, injectorCell); } reduce(foundCell, orOp<bool>()); @@ -37,12 +32,7 @@ if (!foundCell) const vector& C = mesh_.C()[injectorCell]; injectionPosition += 1.0e-6*(C - injectionPosition); - foundCell = mesh_.pointInCell - ( - injectionPosition, - injectorCell, - polyMesh::FACEDIAGTETS - ); + foundCell = mesh_.pointInCell(injectionPosition, injectorCell); } reduce(foundCell, orOp<bool>()); @@ -60,12 +50,7 @@ if (!foundCell) const vector& C = mesh_.C()[injectorCell]; injectionPosition += 1.0e-9*(C - injectionPosition); - foundCell = mesh_.pointInCell - ( - injectionPosition, - injectorCell, - polyMesh::FACEDIAGTETS - ); + foundCell = mesh_.pointInCell(injectionPosition, injectorCell); } reduce(foundCell, orOp<bool>()); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index 256ff8d1668ce7c41d6cbe0b4bef3e78e93d62e5..28d211397e8b470e41ba701edd6fb1840d33c506 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -205,15 +205,7 @@ bool Foam::InjectionModel<CloudType>::findCellAtPosition { position += SMALL*(cellCentres[cellI] - position); - if - ( - this->owner().mesh().pointInCell - ( - position, - cellI, - polyMesh::FACEDIAGTETS - ) - ) + if (this->owner().mesh().pointInCell(position, cellI)) { procI = Pstream::myProcNo(); } diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C index 653e34c1cac497bd7fe02b1231ad8a291e9a9bd8..ba8d0f4200e1399963613581f3e82d91c8cc775b 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C @@ -86,7 +86,7 @@ Foam::labelList Foam::refinementParameters::findCells(const polyMesh& mesh) { const point& keepPoint = keepPoints_[i]; - label localCellI = mesh.findCell(keepPoint, polyMesh::FACEDIAGTETS); + label localCellI = mesh.findCell(keepPoint); label globalCellI = -1; diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C index 71349d061e00e2738bd2533d0b67890b3727a10c..059e2a9d6d3b328bb36d5c77c2a694bcb30062bf 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C @@ -1825,7 +1825,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMeshRegions label regionI = -1; - label cellI = mesh_.findCell(keepPoint, polyMesh::FACEDIAGTETS); + label cellI = mesh_.findCell(keepPoint); if (cellI != -1) { diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C index 175ce9ca53bab12ae66d796dedc4935d8a956c97..a9c6badb3b2c17bcaac824bfd3e2dd4110bf1460 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C @@ -1248,7 +1248,7 @@ void Foam::meshRefinement::findCellZoneInsideWalk // Find the region containing the insidePoint label keepRegionI = -1; - label cellI = mesh_.findCell(insidePoint, polyMesh::FACEDIAGTETS); + label cellI = mesh_.findCell(insidePoint); if (cellI != -1) { @@ -1418,7 +1418,7 @@ void Foam::meshRefinement::findCellZoneTopo // Find the region containing the keepPoint label keepRegionI = -1; - label cellI = mesh_.findCell(keepPoint, polyMesh::FACEDIAGTETS); + label cellI = mesh_.findCell(keepPoint); if (cellI != -1) { @@ -1959,7 +1959,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh // Find the region containing the keepPoint label keepRegionI = -1; - label cellI = mesh_.findCell(keepPoint, polyMesh::FACEDIAGTETS); + label cellI = mesh_.findCell(keepPoint); if (cellI != -1) { diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C index b78495e443b69a7584dd91ad4ca203bb893f6648..9d7ed47e892f17121aa18af4b64b698844b389fb 100644 --- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C +++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C @@ -174,7 +174,7 @@ void Foam::mappedPatchBase::findSamples } // Octree based search engine - meshSearch meshSearchEngine(mesh, polyMesh::FACEDIAGTETS); + meshSearch meshSearchEngine(mesh); forAll(samples, sampleI) { @@ -291,7 +291,7 @@ void Foam::mappedPatchBase::findSamples } // Octree based search engine - meshSearch meshSearchEngine(mesh, polyMesh::FACEDIAGTETS); + meshSearch meshSearchEngine(mesh); forAll(samples, sampleI) { diff --git a/src/meshTools/octree/octreeDataCell.C b/src/meshTools/octree/octreeDataCell.C index 9ddf44f9aef81eb83481351cc0c119a62f444206..4dcc838a0e58b92ea8b2ce3cbbafec73f7373a86 100644 --- a/src/meshTools/octree/octreeDataCell.C +++ b/src/meshTools/octree/octreeDataCell.C @@ -116,12 +116,7 @@ bool Foam::octreeDataCell::contains const point& sample ) const { - return mesh_.pointInCell - ( - sample, - cellLabels_[index], - polyMesh::FACEDIAGTETS - ); + return mesh_.pointInCell(sample, cellLabels_[index]); } diff --git a/src/meshTools/sets/cellSources/regionToCell/regionToCell.C b/src/meshTools/sets/cellSources/regionToCell/regionToCell.C index 375d9d18943716a4272da651734af63ebed5e00a..77948ca5a5c263cc3b46ed56ee339725e9ea1268 100644 --- a/src/meshTools/sets/cellSources/regionToCell/regionToCell.C +++ b/src/meshTools/sets/cellSources/regionToCell/regionToCell.C @@ -60,7 +60,7 @@ Foam::topoSetSource::addToUsageTable Foam::regionToCell::usage_ void Foam::regionToCell::combine(topoSet& set, const bool add) const { - label cellI = mesh_.findCell(insidePoint_, polyMesh::FACEDIAGTETS); + label cellI = mesh_.findCell(insidePoint_); // Load the subset of cells boolList blockedFace(mesh_.nFaces(), false); diff --git a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C index 16c031f1beb7ca66c2bf8d5f4a1f9b05fd1ef32e..daf56a94d14938af0c60278cee691a2edba94b38 100644 --- a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C +++ b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C @@ -166,7 +166,7 @@ void Foam::surfaceToCell::combine(topoSet& set, const bool add) const // Construct search engine on mesh - meshSearch queryMesh(mesh_, polyMesh::FACEDIAGTETS); + meshSearch queryMesh(mesh_); // Check all 'outside' points diff --git a/src/meshTools/surfaceSets/surfaceSets.C b/src/meshTools/surfaceSets/surfaceSets.C index a9689e0d2a62910ad33c637b3a02982b86b9f54b..850df22698f1d50186cfecab665d4489e6e9c2da 100644 --- a/src/meshTools/surfaceSets/surfaceSets.C +++ b/src/meshTools/surfaceSets/surfaceSets.C @@ -235,7 +235,7 @@ void Foam::surfaceSets::getSurfaceSets ) { // Construct search engine on mesh - meshSearch queryMesh(mesh, polyMesh::FACEDIAGTETS); + meshSearch queryMesh(mesh); // Cut faces with surface and classify cells cellClassification cellType diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLine.C b/src/postProcessing/functionObjects/field/streamLine/streamLine.C index 67fe11c29a59542412664171841fa3d6d9b27d6c..30d805251332d3662886eb199286d5336e4cf5af 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLine.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLine.C @@ -363,7 +363,7 @@ void Foam::streamLine::read(const dictionary& dict) const fvMesh& mesh = dynamic_cast<const fvMesh&>(obr_); - meshSearchPtr_.reset(new meshSearch(mesh, polyMesh::FACEDIAGTETS)); + meshSearchPtr_.reset(new meshSearch(mesh)); const dictionary& coeffsDict = dict.subDict(seedSet_ + "Coeffs"); sampledSetPtr_ = sampledSet::New diff --git a/src/sampling/meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C b/src/sampling/meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C index c93db3f3162c2f9459201b247c08833ea42a143b..831565bd13ea39c4da22b2aa6ec17c2c03f163f3 100644 --- a/src/sampling/meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C +++ b/src/sampling/meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C @@ -267,7 +267,7 @@ void Foam::meshToMesh::cellAddresses cellAddressing_[toI] = -1; // Check point is actually in the nearest cell - if (fromMesh.pointInCell(p, curCell, polyMesh::FACEDIAGTETS)) + if (fromMesh.pointInCell(p, curCell)) { cellAddressing_[toI] = curCell; } @@ -292,15 +292,7 @@ void Foam::meshToMesh::cellAddresses { // search through all the neighbours. // If point is in neighbour reset current cell - if - ( - fromMesh.pointInCell - ( - p, - neighbours[nI], - polyMesh::FACEDIAGTETS - ) - ) + if (fromMesh.pointInCell(p, neighbours[nI])) { cellAddressing_[toI] = neighbours[nI]; found = true; @@ -324,15 +316,7 @@ void Foam::meshToMesh::cellAddresses { // search through all the neighbours. // If point is in neighbour reset current cell - if - ( - fromMesh.pointInCell - ( - p, - nn[nI], - polyMesh::FACEDIAGTETS - ) - ) + if (fromMesh.pointInCell(p, nn[nI])) { cellAddressing_[toI] = nn[nI]; found = true; diff --git a/src/sampling/probes/probes.C b/src/sampling/probes/probes.C index 8bca017d4b1666028564d7fd157a32a72d1e2e49..b0a073e1e400b8b3cef254c9e0b1f06bbca603f2 100644 --- a/src/sampling/probes/probes.C +++ b/src/sampling/probes/probes.C @@ -45,7 +45,7 @@ void Foam::probes::findElements(const fvMesh& mesh) { const vector& location = operator[](probeI); - elementList_[probeI] = mesh.findCell(location, polyMesh::FACEDIAGTETS); + elementList_[probeI] = mesh.findCell(location); if (debug && elementList_[probeI] != -1) { diff --git a/src/sampling/sampledSet/sampledSets/sampledSets.C b/src/sampling/sampledSet/sampledSets/sampledSets.C index 68826497821224b089702142b909a1db49a673a1..1a1fc34bfc149c15ba7b2af04bdec020bac0ea02 100644 --- a/src/sampling/sampledSet/sampledSets/sampledSets.C +++ b/src/sampling/sampledSet/sampledSets/sampledSets.C @@ -138,7 +138,7 @@ Foam::sampledSets::sampledSets mesh_(refCast<const fvMesh>(obr)), loadFromFiles_(loadFromFiles), outputPath_(fileName::null), - searchEngine_(mesh_, polyMesh::FACEDIAGTETS), + searchEngine_(mesh_), interpolationScheme_(word::null), writeFormat_(word::null) { diff --git a/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C b/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C index e88c87ebc7331ebd3bd112dff2e45d9d550cc1f4..3704f950e0345eb72d4e7b2a4a0a4b89495c2a99 100644 --- a/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C +++ b/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C @@ -53,11 +53,7 @@ void Foam::triSurfaceMeshPointSet::calcSamples { forAll(sampleCoords_, sampleI) { - label cellI = searchEngine().findCell - ( - sampleCoords_[sampleI], - polyMesh::FACEDIAGTETS - ); + label cellI = searchEngine().findCell(sampleCoords_[sampleI]); if (cellI != -1) {