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-2025 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 Data
57 
58  //- Reference to mesh
59  const polyMesh& mesh_;
60 
61  //- For every face the original cell in mesh
62  labelList meshCells_;
63 
64 
65  // Private Member Functions
66 
67  void calculate
68  (
69  const scalarField&,
70  const scalar lowerThreshold,
71  const scalar upperThreshold,
72  const bool triangulate
73  );
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("thresholdCellFaces");
79 
80 
81  // Constructors
82 
83  //- Construct from mesh, field and threshold value
85  (
86  const polyMesh&,
87  const scalarField&,
88  const scalar lowerThreshold,
89  const scalar upperThreshold,
90  const bool triangulate = false
91  );
92 
93 
94  // Member Functions
95 
96  //- For every face original cell in mesh
98  {
99  return meshCells_;
100  }
101 
102  //- For every face original cell in mesh
103  const labelList& meshCells() const
104  {
105  return meshCells_;
106  }
107 };
108 
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 } // End namespace Foam
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #endif
120 
121 // ************************************************************************* //
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:85
virtual label triangulate()
Triangulate in-place, returning the number of triangles added.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
Selects the mesh cell faces specified by a threshold value. Non-triangulated by default.
TypeName("thresholdCellFaces")
Runtime type information.
labelList & meshCells()
For every face original cell in mesh.
thresholdCellFaces(const polyMesh &, const scalarField &, const scalar lowerThreshold, const scalar upperThreshold, const bool triangulate=false)
Construct from mesh, field and threshold value.
Namespace for OpenFOAM.