pointFeatureEdgesTypes.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) 2013-2015 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "pointFeatureEdgesTypes.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
33 (
34  const extendedFeatureEdgeMesh& feMesh,
35  const label pointLabel
36 )
37 :
38  HashTable<label, extendedFeatureEdgeMesh::edgeStatus, Hash<label>>(),
39  feMesh_(feMesh),
40  pointLabel_(pointLabel)
41 {}
42 
43 
44 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
45 
48 {
49  const labelList& pEds = feMesh_.pointEdges()[pointLabel_];
50 
51  List<extendedFeatureEdgeMesh::edgeStatus> allEdStat(pEds.size());
52 
53  forAll(pEds, i)
54  {
55  label edgeI = pEds[i];
56 
57  extendedFeatureEdgeMesh::edgeStatus& eS = allEdStat[i];
58 
59  eS = feMesh_.getEdgeStatus(edgeI);
60 
61  this->operator()(eS)++;
62  }
63 
64  return allEdStat;
65 }
66 
67 
68 // * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
69 
70 Foam::Ostream& Foam::operator<<
71 (
72  Ostream& os,
73  const pointFeatureEdgesTypes& p
74 )
75 {
76  os << "Point = " << p.pointLabel_ << endl;
77 
78  forAllConstIters(p, iter)
79  {
80  os << " "
82  << " = "
83  << iter.val()
84  << endl;
85  }
86 
87  return os;
88 }
89 
90 
91 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
Foam::extendedEdgeMesh::edgeStatus
edgeStatus
Definition: extendedEdgeMesh.H:104
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::pointFeatureEdgesTypes::pointFeatureEdgesTypes
pointFeatureEdgesTypes(const extendedFeatureEdgeMesh &feMesh, const label pointLabel)
Construct from components.
os
OBJstream os(runTime.globalPath()/outputName)
Foam::extendedEdgeMesh::edgeStatusNames_
static const Enum< edgeStatus > edgeStatusNames_
Definition: extendedEdgeMesh.H:114
pointFeatureEdgesTypes.H
forAllConstIters
forAllConstIters(mixture.phases(), phase)
Definition: pEqn.H:28
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::pointFeatureEdgesTypes::calcPointFeatureEdgesTypes
List< extendedFeatureEdgeMesh::edgeStatus > calcPointFeatureEdgesTypes()
Fill the pointFeatureEdgesType class with the types of feature.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56