thresholdCellFaces.H
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 OpenFOAM Foundation
9  Copyright (C) 2018 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 Class
28  Foam::thresholdCellFaces
29 
30 Description
31  Selects the mesh cell faces specified by a threshold value.
32  Non-triangulated by default.
33 
34 SourceFiles
35  thresholdCellFaces.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef thresholdCellFaces_H
40 #define thresholdCellFaces_H
41 
42 #include "MeshedSurface.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 class polyMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class thresholdCellFaces Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 :
57  public MeshedSurface<face>
58 {
59  //- Private typedefs for convenience
61 
62  //- Reference to mesh
63  const polyMesh& mesh_;
64 
65  //- For each face, the original cell in mesh
66  labelList meshCells_;
67 
68 
69  // Private Member Functions
70 
71  void calculate
72  (
73  const scalarField& field,
74  const scalar lowerThreshold,
75  const scalar upperThreshold,
76  const bool triangulate
77  );
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("thresholdCellFaces");
83 
84 
85  // Constructors
86 
87  //- Construct from mesh, field and threshold values
89  (
90  const polyMesh& mesh,
91  const scalarField& field,
92  const scalar lowerThreshold,
93  const scalar upperThreshold,
94  const bool triangulate = false
95  );
96 
97 
98  // Member Functions
99 
100  //- For each face, the original cell in mesh
101  const labelList& meshCells() const
102  {
103  return meshCells_;
104  }
105 
106  //- For each face, the original cell in mesh
108  {
109  return meshCells_;
110  }
111 
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace Foam
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
Foam::MeshedSurface< face >::triangulate
virtual label triangulate()
Triangulate in-place, returning the number of triangles added.
Definition: MeshedSurface.C:972
Foam::thresholdCellFaces::thresholdCellFaces
thresholdCellFaces(const polyMesh &mesh, const scalarField &field, const scalar lowerThreshold, const scalar upperThreshold, const bool triangulate=false)
Construct from mesh, field and threshold values.
Definition: thresholdCellFaces.C:271
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::thresholdCellFaces::TypeName
TypeName("thresholdCellFaces")
Runtime type information.
Foam::Field< scalar >
Foam::thresholdCellFaces::meshCells
labelList & meshCells()
For each face, the original cell in mesh.
Definition: thresholdCellFaces.H:106
field
rDeltaTY field()
Foam::thresholdCellFaces
Selects the mesh cell faces specified by a threshold value. Non-triangulated by default.
Definition: thresholdCellFaces.H:54
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< label >
Foam::thresholdCellFaces::meshCells
const labelList & meshCells() const
For each face, the original cell in mesh.
Definition: thresholdCellFaces.H:100
Foam::MeshedSurface
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: triSurfaceTools.H:80
MeshedSurface.H