pyrMatcher.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-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 Class
28  Foam::pyrMatcher
29 
30 Description
31  A cellMatcher for pyr cells (cellModel::PYR)
32 
33 See also
34  cellMatcher, cellModel
35 
36 SourceFiles
37  pyrMatcher.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef pyrMatcher_H
42 #define pyrMatcher_H
43 
44 #include "cellMatcher.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class pyrMatcher Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class pyrMatcher
56 :
57  public cellMatcher
58 {
59  // Static Data Members
60 
61  // Constants for this shape
62  static constexpr label vertPerCell = 5;
63  static constexpr label facePerCell = 5;
64  static constexpr label maxVertPerFace = 4;
65 
66 
67  // Private Member Functions
68 
69  //- No copy construct
70  pyrMatcher(const pyrMatcher&) = delete;
71 
72  //- No copy assignment
73  pyrMatcher& operator=(const pyrMatcher&) = delete;
74 
75 
76 public:
77 
78  // Constructors
79 
80  //- Default construct
81  pyrMatcher();
82 
83 
84  //- Destructor
85  ~pyrMatcher() = default;
86 
87 
88  // Static Functions
89 
90  //- Test if given list of faces satisfies criteria for PYR.
91  //- (4 tri, 1 quad)
92  static bool test(const UList<face>& faces);
93 
94  //- Test if given cell satisfies criteria for PYR.
95  //- (4 tri, 1 quad)
96  static bool test(const primitiveMesh& mesh, const label celli);
97 
98 
99  // Member Functions
100 
101  virtual label nVertPerCell() const
102  {
103  return vertPerCell;
104  }
105 
106  virtual label nFacePerCell() const
107  {
108  return facePerCell;
109  }
110 
111  virtual label nMaxVertPerFace() const
112  {
113  return maxVertPerFace;
114  }
115 
116  virtual label faceHashValue() const;
117 
118  virtual bool faceSizeMatch(const faceList&, const labelList&) const;
119 
120  virtual bool matchShape
121  (
122  const bool checkOnly,
123  const faceList& faces,
124  const labelList& faceOwner,
125  const label celli,
126  const labelList& myFaces
127  );
128 
129  virtual bool isA(const faceList& faces)
130  {
131  return pyrMatcher::test(faces);
132  }
133 
134  virtual bool isA(const primitiveMesh& mesh, const label celli)
135  {
136  return pyrMatcher::test(mesh, celli);
137  }
138 
139  virtual bool matches
140  (
141  const primitiveMesh& mesh,
142  const label celli,
143  cellShape& shape
144  );
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:63
Foam::pyrMatcher::faceHashValue
virtual label faceHashValue() const
Definition: pyrMatcher.C:290
Foam::pyrMatcher::matchShape
virtual bool matchShape(const bool checkOnly, const faceList &faces, const labelList &faceOwner, const label celli, const labelList &myFaces)
Definition: pyrMatcher.C:135
Foam::cellMatcher
Base class for cellshape matchers (hexMatch, prismMatch, etc.). These are classes which given a mesh ...
Definition: cellMatcher.H:95
Foam::pyrMatcher::matches
virtual bool matches(const primitiveMesh &mesh, const label celli, cellShape &shape)
Definition: pyrMatcher.C:307
Foam::pyrMatcher
A cellMatcher for pyr cells (cellModel::PYR)
Definition: pyrMatcher.H:50
Foam::pyrMatcher::nFacePerCell
virtual label nFacePerCell() const
Definition: pyrMatcher.H:101
Foam::pyrMatcher::nMaxVertPerFace
virtual label nMaxVertPerFace() const
Definition: pyrMatcher.H:106
Foam::pyrMatcher::faceSizeMatch
virtual bool faceSizeMatch(const faceList &, const labelList &) const
Definition: pyrMatcher.C:297
Foam::pyrMatcher::nVertPerCell
virtual label nVertPerCell() const
Definition: pyrMatcher.H:96
Foam::pyrMatcher::isA
virtual bool isA(const faceList &faces)
Definition: pyrMatcher.H:124
Foam::pyrMatcher::isA
virtual bool isA(const primitiveMesh &mesh, const label celli)
Definition: pyrMatcher.H:129
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::cellShape
An analytical geometric cellShape.
Definition: cellShape.H:65
Foam
Definition: atmBoundaryLayer.C:26
Foam::faceList
List< face > faceList
A List of faces.
Definition: faceListFwd.H:41
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:58
cellMatcher.H
Foam::UList< face >
Foam::pyrMatcher::pyrMatcher
pyrMatcher()
Definition: pyrMatcher.C:120
Foam::pyrMatcher::test
static bool test(const UList< face > &faces)
Definition: pyrMatcher.C:107
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:74
Foam::pyrMatcher::~pyrMatcher
~pyrMatcher()=default