From 8476c1228a8cbd896c073fc28e4f0b8baf9696a7 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 20 Jun 2012 04:41:26 +0100 Subject: [PATCH] ENH: topoSet: added regionToFace source --- .../mesh/manipulation/topoSet/topoSetDict | 8 + src/meshTools/Make/files | 1 + .../faceSources/regionToFace/regionToFace.C | 401 ++++++++++++++++++ .../faceSources/regionToFace/regionToFace.H | 151 +++++++ 4 files changed, 561 insertions(+) create mode 100644 src/meshTools/sets/faceSources/regionToFace/regionToFace.C create mode 100644 src/meshTools/sets/faceSources/regionToFace/regionToFace.H diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSetDict b/applications/utilities/mesh/manipulation/topoSet/topoSetDict index 4c2180f21d..1f58d59dde 100644 --- a/applications/utilities/mesh/manipulation/topoSet/topoSetDict +++ b/applications/utilities/mesh/manipulation/topoSet/topoSetDict @@ -238,6 +238,14 @@ FoamFile // cos 0.01; // Tolerance (max cos of angle) // } // +// // Walk on faces in faceSet, starting from face nearest given position +// source regionToFace; +// sourceInfo +// { +// set f0; +// nearPoint (0.1 0.1 0.005); +// } +// // // // pointSet diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index 3329c2b28d..392fa45998 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -110,6 +110,7 @@ $(faceSources)/patchToFace/patchToFace.C $(faceSources)/boundaryToFace/boundaryToFace.C $(faceSources)/zoneToFace/zoneToFace.C $(faceSources)/boxToFace/boxToFace.C +$(faceSources)/regionToFace/regionToFace.C pointSources = sets/pointSources $(pointSources)/labelToPoint/labelToPoint.C diff --git a/src/meshTools/sets/faceSources/regionToFace/regionToFace.C b/src/meshTools/sets/faceSources/regionToFace/regionToFace.C new file mode 100644 index 0000000000..20182eb7f5 --- /dev/null +++ b/src/meshTools/sets/faceSources/regionToFace/regionToFace.C @@ -0,0 +1,401 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "regionToFace.H" +#include "polyMesh.H" +#include "faceSet.H" +#include "mappedPatchBase.H" +#include "indirectPrimitivePatch.H" +#include "PatchTools.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + +defineTypeNameAndDebug(regionToFace, 0); + +addToRunTimeSelectionTable(topoSetSource, regionToFace, word); + +addToRunTimeSelectionTable(topoSetSource, regionToFace, istream); + +} + + +Foam::topoSetSource::addToUsageTable Foam::regionToFace::usage_ +( + regionToFace::typeName, + "\n Usage: regionToFace (x y z)\n\n" + " Select all faces in the connected region of the faceSet" + " starting from the point.\n" +); + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +// Synchronise edges +void Foam::regionToFace::syncEdges +( + const labelList& patchEdges, + const labelList& coupledEdges, + const bool syncNonCollocated, + + PackedBoolList& isChangedEdge, + DynamicList