PrimitivePatchBdryPoints.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 "PrimitivePatch.H"
30 #include "HashSet.H"
31 
32 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
33 
34 template<class FaceList, class PointField>
35 void
37 {
38  DebugInFunction << "Calculating boundary points" << nl;
39 
40  if (boundaryPointsPtr_)
41  {
42  // Error to recalculate if already allocated
44  << "boundaryPoints already calculated"
45  << abort(FatalError);
46  }
47 
48  const edgeList& e = edges();
49 
50  labelHashSet bp(2*e.size());
51 
52  for (label edgeI = nInternalEdges_; edgeI < e.size(); edgeI++)
53  {
54  const edge& curEdge = e[edgeI];
55 
56  bp.insert(curEdge.start());
57  bp.insert(curEdge.end());
58  }
59 
60  boundaryPointsPtr_.reset(new labelList(bp.sortedToc()));
61 
62  DebugInfo << " Finished." << nl;
63 }
64 
65 
66 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:71
Foam::edgeList
List< edge > edgeList
A List of edges.
Definition: edgeList.H:63
PrimitivePatch.H
DebugInFunction
#define DebugInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:365
HashSet.H
Foam::FatalError
error FatalError
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:381
DebugInfo
#define DebugInfo
Report an information message using Foam::Info.
Definition: messageStream.H:359
Foam::nl
constexpr char nl
Definition: Ostream.H:385
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::labelHashSet
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys and label hasher.
Definition: HashSet.H:409
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:85