From 852634047ffac65b4d7261aeb72d5ec7b784f5cb Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 3 Jun 2013 12:24:12 +0100 Subject: [PATCH 1/8] faceMDLimitedGrad: Corrected addressing --- .../limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C index 137850e65f..51ed234a78 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C @@ -235,7 +235,7 @@ Foam::fv::faceMDLimitedGrad::calcGrad g[own], maxFace - vvfOwn, minFace - vvfOwn, - Cf[facei] - C[nei] + Cf[facei] - C[own] ); From 6dda5c251f58565ed602830e1d164271db9bd10c Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 3 Jun 2013 12:24:37 +0100 Subject: [PATCH 2/8] linearUpwind: Removed historical warning messages --- .../schemes/linearUpwind/linearUpwind.H | 29 ++--------------- .../schemes/linearUpwind/linearUpwindV.H | 31 ++----------------- 2 files changed, 6 insertions(+), 54 deletions(-) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.H index 453603d287..1ef0c000f7 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.H @@ -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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,16 +111,7 @@ public: mesh.gradScheme(gradSchemeName_) ) ) - { - if (!schemeData.eof()) - { - IOWarningIn("linearUpwind(const fvMesh&, Istream&)", schemeData) - << "unexpected additional entries in stream." << nl - << " Only the name of the gradient scheme in the" - " 'gradSchemes' dictionary should be specified." - << endl; - } - } + {} //- Construct from faceFlux and Istream linearUpwind @@ -140,21 +131,7 @@ public: mesh.gradScheme(gradSchemeName_) ) ) - { - - if (!schemeData.eof()) - { - IOWarningIn - ( - "linearUpwind(const fvMesh&, " - "const surfaceScalarField& faceFlux, Istream&)", - schemeData - ) << "unexpected additional entries in stream." << nl - << " Only the name of the gradient scheme in the" - " 'gradSchemes' dictionary should be specified." - << endl; - } - } + {} // Member Functions diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.H index 862e79b812..88034a7de9 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.H @@ -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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -110,19 +110,7 @@ public: mesh.gradScheme(gradSchemeName_) ) ) - { - if (!schemeData.eof()) - { - IOWarningIn - ( - "linearUpwindV(const fvMesh&, Istream&)", - schemeData - ) << "unexpected additional entries in stream." << nl - << " Only the name of the gradient scheme in the" - " 'gradSchemes' dictionary should be specified." - << endl; - } - } + {} //- Construct from faceFlux and Istream linearUpwindV @@ -142,20 +130,7 @@ public: mesh.gradScheme(gradSchemeName_) ) ) - { - if (!schemeData.eof()) - { - IOWarningIn - ( - "linearUpwindV(const fvMesh&, " - "const surfaceScalarField& faceFlux, Istream&)", - schemeData - ) << "unexpected additional entries in stream." << nl - << " Only the name of the gradient scheme in the" - " 'gradSchemes' dictionary should be specified." - << endl; - } - } + {} // Member Functions From 0d0b8700ec066cafaf31457ac7030ffd33114b6b Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 3 Jun 2013 12:24:50 +0100 Subject: [PATCH 3/8] Updated header --- .../limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C index 51ed234a78..4006fd5e70 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License From 32aeb6401648fc47e1a107e5ef80a2965335a85c Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 3 Jun 2013 12:25:13 +0100 Subject: [PATCH 4/8] damBreak4phase tutorials: Updated BCs --- .../multiphaseInterFoam/laminar/damBreak4phase/0.org/U | 2 +- .../multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/U | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/U b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/U index b82b7ce18a..7ea3a0c323 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/U +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/U @@ -38,7 +38,7 @@ boundaryField } atmosphere { - type fluxCorrectedVelocity; + type pressureInletOutletVelocity; value uniform (0 0 0); } defaultFaces diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/U b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/U index b82b7ce18a..7ea3a0c323 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/U +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/U @@ -38,7 +38,7 @@ boundaryField } atmosphere { - type fluxCorrectedVelocity; + type pressureInletOutletVelocity; value uniform (0 0 0); } defaultFaces From b965b9e783ae5651973753108c5f6e75e9a7408a Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 3 Jun 2013 13:29:22 +0100 Subject: [PATCH 5/8] ENH: snappyHexMesh: added gapLevelIncrement to outer dictionary --- .../generation/snappyHexMesh/snappyHexMesh.C | 50 ++++++++++--------- .../snappyHexMesh/snappyHexMeshDict | 12 +++-- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 14bf0ee9eb..f177e7de81 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -247,7 +247,8 @@ int main(int argc, char *argv[]) refinementSurfaces surfaces ( allGeometry, - refineDict.subDict("refinementSurfaces") + refineDict.subDict("refinementSurfaces"), + refineDict.lookupOrDefault("gapLevelIncrement", 0) ); Info<< "Read refinement surfaces in = " << mesh.time().cpuTimeIncrement() << " s" << nl << endl; @@ -551,6 +552,13 @@ int main(int argc, char *argv[]) const Switch wantSnap(meshDict.lookup("snap")); const Switch wantLayers(meshDict.lookup("addLayers")); + // Refinement parameters + const refinementParameters refineParams(refineDict); + + // Snap parameters + const snapParameters snapParams(snapDict); + + if (wantRefine) { cpuTime timer; @@ -564,15 +572,20 @@ int main(int argc, char *argv[]) globalToSlavePatch ); - // Refinement parameters - refinementParameters refineParams(refineDict); if (!overwrite && !debug) { const_cast(mesh.time())++; } - refineDriver.doRefine(refineDict, refineParams, wantSnap, motionDict); + refineDriver.doRefine + ( + refineDict, + refineParams, + snapParams, + wantSnap, + motionDict + ); writeMesh ( @@ -596,20 +609,14 @@ int main(int argc, char *argv[]) globalToSlavePatch ); - // Snap parameters - snapParameters snapParams(snapDict); - // Temporary hack to get access to resolveFeatureAngle - scalar curvature; - { - refinementParameters refineParams(refineDict); - curvature = refineParams.curvature(); - } - if (!overwrite && !debug) { const_cast(mesh.time())++; } + // Use the resolveFeatureAngle from the refinement parameters + scalar curvature = refineParams.curvature(); + snapDriver.doSnap(snapDict, motionDict, curvature, snapParams); writeMesh @@ -637,17 +644,12 @@ int main(int argc, char *argv[]) // Layer addition parameters layerParameters layerParams(layerDict, mesh.boundaryMesh()); - //!!! Temporary hack to get access to maxLocalCells - bool preBalance; - { - refinementParameters refineParams(refineDict); - - preBalance = returnReduce - ( - (mesh.nCells() >= refineParams.maxLocalCells()), - orOp() - ); - } + // Use the maxLocalCells from the refinement parameters + bool preBalance = returnReduce + ( + (mesh.nCells() >= refineParams.maxLocalCells()), + orOp() + ); if (!overwrite && !debug) diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index 7d1ad76db3..ba16b1c4aa 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -153,7 +153,7 @@ castellatedMeshControls } - //- Optional increment (on top of max level) in small gaps. + //- Optional increment (on top of max level) in small gaps //gapLevelIncrement 2; //- Optional angle to detect small-large cell situation @@ -184,14 +184,17 @@ castellatedMeshControls // - used if feature snapping (see snapControls below) is used resolveFeatureAngle 30; + //- Optional increment (on top of max level) in small gaps + //gapLevelIncrement 2; + // Planar angle: // - used to determine if surface normals - // are roughly the same or opposite. Used e.g. in gap refinement + // are roughly the same or opposite. Used e.g. in proximity refinement // and to decide when to merge free-standing baffles // // If not specified same as resolveFeatureAngle - planarAngle 15; + planarAngle 30; // Region-wise refinement @@ -235,6 +238,9 @@ castellatedMeshControls // are only on the boundary of corresponding cellZones or also allow // free-standing zone faces. Not used if there are no faceZones. allowFreeStandingZoneFaces true; + + // + //useTopologicalSnapDetection false; } // Settings for the snapping. From fa45dde21d1f8e47aef37745e32c10de58439212 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 3 Jun 2013 13:30:14 +0100 Subject: [PATCH 6/8] ENH: GAMGAgglomeration: use float for average in table --- .../GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C index 75af8eb20a..dd51eb645b 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -165,7 +165,7 @@ void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels) << setw(8) << setprecision(4) << totFaceCellRatio/totNprocs << setw(8) << setprecision(4) << maxFaceCellRatio << " " - << setw(8) << totNInt/totNprocs + << setw(8) << scalar(totNInt)/totNprocs << setw(8) << maxNInt << " " << setw(8) << setprecision(4) << totRatio/totNprocs From 15fed04026425aaad7ecf37306661f0de8300aef Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 3 Jun 2013 13:33:02 +0100 Subject: [PATCH 7/8] ENH: autoHexMesh: added geometric problem cell removal --- .../autoHexMeshDriver/autoRefineDriver.C | 47 ++- .../autoHexMeshDriver/autoRefineDriver.H | 5 + .../autoHexMeshDriver/autoSnapDriver.C | 315 +++++++++++++- .../autoHexMeshDriver/autoSnapDriver.H | 38 +- .../refinementParameters.C | 14 +- .../refinementParameters.H | 11 + .../meshRefinement/meshRefinement.H | 19 + .../meshRefinement/meshRefinementBaffles.C | 124 ++---- .../meshRefinementProblemCells.C | 397 +++++++++++------- .../refinementSurfaces/refinementSurfaces.C | 7 +- .../refinementSurfaces/refinementSurfaces.H | 3 +- 11 files changed, 677 insertions(+), 303 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C index d78866bcd7..82bfa13522 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C @@ -35,6 +35,7 @@ License #include "shellSurfaces.H" #include "mapDistributePolyMesh.H" #include "unitConversion.H" +#include "snapParameters.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -610,9 +611,16 @@ Foam::label Foam::autoRefineDriver::danglingCellRefine << " cells (out of " << mesh.globalData().nTotalCells() << ')' << endl; - // Stop when no cells to refine. No checking of minRefineCells since - // too few cells - if (nCellsToRefine == 0) + // Stop when no cells to refine. After a few iterations check if too + // few cells + if + ( + nCellsToRefine == 0 + || ( + iter >= 1 + && nCellsToRefine <= refineParams.minRefineCells() + ) + ) { Info<< "Stopping refining since too few cells selected." << nl << endl; @@ -870,6 +878,7 @@ Foam::label Foam::autoRefineDriver::shellRefine void Foam::autoRefineDriver::baffleAndSplitMesh ( const refinementParameters& refineParams, + const snapParameters& snapParams, const bool handleSnapProblems, const dictionary& motionDict ) @@ -887,10 +896,17 @@ void Foam::autoRefineDriver::baffleAndSplitMesh meshRefiner_.baffleAndSplitMesh ( handleSnapProblems, // detect&remove potential snap problem + + // Snap problem cell detection + snapParams, + refineParams.useTopologicalSnapDetection(), false, // perpendicular edge connected cells scalarField(0), // per region perpendicular angle + + // Free standing baffles !handleSnapProblems, // merge free standing baffles? refineParams.planarAngle(), + motionDict, const_cast(mesh.time()), globalToMasterPatch_, @@ -951,6 +967,7 @@ void Foam::autoRefineDriver::zonify void Foam::autoRefineDriver::splitAndMergeBaffles ( const refinementParameters& refineParams, + const snapParameters& snapParams, const bool handleSnapProblems, const dictionary& motionDict ) @@ -973,10 +990,17 @@ void Foam::autoRefineDriver::splitAndMergeBaffles meshRefiner_.baffleAndSplitMesh ( handleSnapProblems, + + // Snap problem cell detection + snapParams, + refineParams.useTopologicalSnapDetection(), handleSnapProblems, // remove perp edge connected cells perpAngle, // perp angle + + // Free standing baffles true, // merge free standing baffles? refineParams.planarAngle(), // planar angle + motionDict, const_cast(mesh.time()), globalToMasterPatch_, @@ -1081,6 +1105,7 @@ void Foam::autoRefineDriver::doRefine ( const dictionary& refineDict, const refinementParameters& refineParams, + const snapParameters& snapParams, const bool prepareForSnapping, const dictionary& motionDict ) @@ -1146,13 +1171,25 @@ void Foam::autoRefineDriver::doRefine // Introduce baffles at surface intersections. Remove sections unreachable // from keepPoint. - baffleAndSplitMesh(refineParams, prepareForSnapping, motionDict); + baffleAndSplitMesh + ( + refineParams, + snapParams, + prepareForSnapping, + motionDict + ); // Mesh is at its finest. Do optional zoning. zonify(refineParams); // Pull baffles apart - splitAndMergeBaffles(refineParams, prepareForSnapping, motionDict); + splitAndMergeBaffles + ( + refineParams, + snapParams, + prepareForSnapping, + motionDict + ); // Do something about cells with refined faces on the boundary if (prepareForSnapping) diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.H b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.H index c44a14a794..a72f3c0796 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.H +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.H @@ -43,6 +43,8 @@ namespace Foam // Forward declaration of classes class refinementParameters; +class snapParameters; + class meshRefinement; class decompositionMethod; class fvMeshDistribute; @@ -121,6 +123,7 @@ class autoRefineDriver void baffleAndSplitMesh ( const refinementParameters& refineParams, + const snapParameters& snapParams, const bool handleSnapProblems, const dictionary& motionDict ); @@ -131,6 +134,7 @@ class autoRefineDriver void splitAndMergeBaffles ( const refinementParameters& refineParams, + const snapParameters& snapParams, const bool handleSnapProblems, const dictionary& motionDict ); @@ -176,6 +180,7 @@ public: ( const dictionary& refineDict, const refinementParameters& refineParams, + const snapParameters& snapParams, const bool prepareForSnapping, const dictionary& motionDict ); diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C index 4c262bd132..3927305177 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C @@ -121,7 +121,7 @@ Foam::pointField Foam::autoSnapDriver::smoothPatchDisplacement ( const motionSmoother& meshMover, const List& baffles -) const +) { const indirectPrimitivePatch& pp = meshMover.patch(); @@ -615,14 +615,14 @@ Foam::autoPtr Foam::autoSnapDriver::mergeZoneBaffles Foam::scalarField Foam::autoSnapDriver::calcSnapDistance ( + const fvMesh& mesh, const snapParameters& snapParams, const indirectPrimitivePatch& pp -) const +) { const edgeList& edges = pp.edges(); const labelListList& pointEdges = pp.pointEdges(); const pointField& localPoints = pp.localPoints(); - const fvMesh& mesh = meshRefiner_.mesh(); scalarField maxEdgeLen(localPoints.size(), -GREAT); @@ -655,13 +655,14 @@ Foam::scalarField Foam::autoSnapDriver::calcSnapDistance void Foam::autoSnapDriver::preSmoothPatch ( + const meshRefinement& meshRefiner, const snapParameters& snapParams, const label nInitErrors, const List& baffles, motionSmoother& meshMover -) const +) { - const fvMesh& mesh = meshRefiner_.mesh(); + const fvMesh& mesh = meshRefiner.mesh(); labelList checkFaces; @@ -724,11 +725,11 @@ void Foam::autoSnapDriver::preSmoothPatch { const_cast(mesh.time())++; Info<< "Writing patch smoothed mesh to time " - << meshRefiner_.timeName() << '.' << endl; - meshRefiner_.write + << meshRefiner.timeName() << '.' << endl; + meshRefiner.write ( debug, - mesh.time().path()/meshRefiner_.timeName() + mesh.time().path()/meshRefiner.timeName() ); Info<< "Dumped mesh in = " << mesh.time().cpuTimeIncrement() << " s\n" << nl << endl; @@ -742,12 +743,11 @@ void Foam::autoSnapDriver::preSmoothPatch // Get (pp-local) indices of points that are both on zone and on patched surface Foam::labelList Foam::autoSnapDriver::getZoneSurfacePoints ( + const fvMesh& mesh, const indirectPrimitivePatch& pp, const word& zoneName -) const +) { - const fvMesh& mesh = meshRefiner_.mesh(); - label zoneI = mesh.faceZones().findZoneID(zoneName); if (zoneI == -1) @@ -755,7 +755,7 @@ Foam::labelList Foam::autoSnapDriver::getZoneSurfacePoints FatalErrorIn ( "autoSnapDriver::getZoneSurfacePoints" - "(const indirectPrimitivePatch&, const word&)" + "(const fvMesh&, const indirectPrimitivePatch&, const word&)" ) << "Cannot find zone " << zoneName << exit(FatalError); } @@ -793,17 +793,17 @@ Foam::labelList Foam::autoSnapDriver::getZoneSurfacePoints Foam::vectorField Foam::autoSnapDriver::calcNearestSurface ( + const meshRefinement& meshRefiner, const scalarField& snapDist, - motionSmoother& meshMover -) const + const indirectPrimitivePatch& pp +) { Info<< "Calculating patchDisplacement as distance to nearest surface" << " point ..." << endl; - const indirectPrimitivePatch& pp = meshMover.patch(); const pointField& localPoints = pp.localPoints(); - const refinementSurfaces& surfaces = meshRefiner_.surfaces(); - const fvMesh& mesh = meshRefiner_.mesh(); + const refinementSurfaces& surfaces = meshRefiner.surfaces(); + const fvMesh& mesh = meshRefiner.mesh(); // Displacement per patch point vectorField patchDisp(localPoints.size(), vector::zero); @@ -815,9 +815,9 @@ Foam::vectorField Foam::autoSnapDriver::calcNearestSurface // Divide surfaces into zoned and unzoned labelList zonedSurfaces = - meshRefiner_.surfaces().getNamedSurfaces(); + meshRefiner.surfaces().getNamedSurfaces(); labelList unzonedSurfaces = - meshRefiner_.surfaces().getUnnamedSurfaces(); + meshRefiner.surfaces().getUnnamedSurfaces(); // 1. All points to non-interface surfaces @@ -870,6 +870,7 @@ Foam::vectorField Foam::autoSnapDriver::calcNearestSurface ( getZoneSurfacePoints ( + mesh, pp, faceZoneNames[zoneSurfI] ) @@ -966,6 +967,254 @@ Foam::vectorField Foam::autoSnapDriver::calcNearestSurface } +////XXXXXXXXX +//// Get (pp-local) indices of points that are on both patches +//Foam::labelList Foam::autoSnapDriver::getPatchSurfacePoints +//( +// const fvMesh& mesh, +// const indirectPrimitivePatch& allPp, +// const polyPatch& pp +//) +//{ +// // Could use PrimitivePatch & localFaces to extract points but might just +// // as well do it ourselves. +// +// boolList pointOnZone(allPp.nPoints(), false); +// +// forAll(pp, i) +// { +// const face& f = pp[i]; +// +// forAll(f, fp) +// { +// label meshPointI = f[fp]; +// +// Map