Loading...
Searching...
No Matches
snappySnapDriverTemplates.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2015 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "snappySnapDriver.H"
30
31// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
32
33template<class FaceList>
34Foam::labelList Foam::snappySnapDriver::getFacePoints
35(
37 const FaceList& faces
38)
39{
40 // Could use PrimitivePatch & localFaces to extract points but might just
41 // as well do it ourselves.
42
43 boolList pointOnZone(pp.nPoints(), false);
44
45 forAll(faces, i)
46 {
47 const face& f = faces[i];
48
49 forAll(f, fp)
50 {
51 label meshPointi = f[fp];
52
53 const auto iter = pp.meshPointMap().cfind(meshPointi);
54
55 if (iter.good())
56 {
57 const label pointi = iter.val();
58 pointOnZone[pointi] = true;
59 }
60 }
61 }
62
63 return findIndices(pointOnZone, true);
64}
65
66
67// ************************************************************************* //
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
A face is a list of labels corresponding to mesh vertices.
Definition face.H:71
List< label > labelList
A List of labels.
Definition List.H:62
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
List< bool > boolList
A List of bools.
Definition List.H:60
labelList findIndices(const ListType &input, typename ListType::const_reference val, label start=0)
Linear search to find all occurrences of given element.
labelList f(nPoints)
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299