thresholdCellFaces.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::thresholdCellFaces
26 
27 Description
28  Selects the mesh cell faces specified by a threshold value.
29  Non-triangulated by default.
30 
31 SourceFiles
32  thresholdCellFaces.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef thresholdCellFaces_H
37 #define thresholdCellFaces_H
38 
39 #include "MeshedSurface.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class polyMesh;
47 
48 /*---------------------------------------------------------------------------*\
49  Class thresholdCellFaces Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public MeshedSurface<face>
55 {
56  // Private Typedefs
57 
59 
60  //- Reference to mesh
61  const polyMesh& mesh_;
62 
63  //- For every face the original cell in mesh
64  labelList meshCells_;
65 
66 
67  // Private Member Functions
68 
69  void calculate
70  (
71  const scalarField&,
72  const scalar lowerThreshold,
73  const scalar upperThreshold,
74  const bool triangulate
75  );
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("thresholdCellFaces");
81 
82 
83  // Constructors
84 
85  //- Construct from mesh, field and threshold value
87  (
88  const polyMesh&,
89  const scalarField&,
90  const scalar lowerThreshold,
91  const scalar upperThreshold,
92  const bool triangulate = false
93  );
94 
95 
96  // Member Functions
97 
98  //- For every face original cell in mesh
100  {
101  return meshCells_;
102  }
103 
104  //- For every face original cell in mesh
105  const labelList& meshCells() const
106  {
107  return meshCells_;
108  }
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
Selects the mesh cell faces specified by a threshold value. Non-triangulated by default.
TypeName("thresholdCellFaces")
Runtime type information.
thresholdCellFaces(const polyMesh &, const scalarField &, const scalar lowerThreshold, const scalar upperThreshold, const bool triangulate=false)
Construct from mesh, field and threshold value.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:72
labelList & meshCells()
For every face original cell in mesh.
virtual label triangulate()
Triangulate in-place, returning the number of triangles added.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:76
Namespace for OpenFOAM.