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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::pyrMatcher
29
30Description
31 A cellMatcher for pyr cells (cellModel::PYR)
32
33See also
34 cellMatcher, cellModel
35
36SourceFiles
37 pyrMatcher.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef pyrMatcher_H
42#define pyrMatcher_H
43
44#include "cellMatcher.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class pyrMatcher Declaration
53\*---------------------------------------------------------------------------*/
55class 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
76public:
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
101 virtual label nVertPerCell() const
102 {
103 return vertPerCell;
104 }
106 virtual label nFacePerCell() const
107 {
108 return facePerCell;
109 }
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 );
129 virtual bool isA(const faceList& faces)
130 {
131 return pyrMatcher::test(faces);
132 }
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// ************************************************************************* //
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
Base class for cellshape matchers (hexMatch, prismMatch, etc.). These are classes which given a mesh ...
Definition: cellMatcher.H:100
An analytical geometric cellShape.
Definition: cellShape.H:72
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:79
A cellMatcher for pyr cells (cellModel::PYR)
Definition: pyrMatcher.H:57
virtual bool faceSizeMatch(const faceList &, const labelList &) const
Check whether number of face sizes match the shape.
Definition: pyrMatcher.C:304
static bool test(const UList< face > &faces)
Definition: pyrMatcher.C:114
virtual bool isA(const primitiveMesh &mesh, const label celli)
Exact match. Uses faceSizeMatch.
Definition: pyrMatcher.H:133
virtual bool matchShape(const bool checkOnly, const faceList &faces, const labelList &faceOwner, const label celli, const labelList &myFaces)
Low level shape recognition. Return true if matches.
Definition: pyrMatcher.C:142
virtual label nVertPerCell() const
Definition: pyrMatcher.H:100
virtual bool matches(const primitiveMesh &mesh, const label celli, cellShape &shape)
Like isA but also constructs a cellShape (if shape matches)
Definition: pyrMatcher.C:314
pyrMatcher()
Default construct.
Definition: pyrMatcher.C:127
~pyrMatcher()=default
Destructor.
virtual label nMaxVertPerFace() const
Definition: pyrMatcher.H:110
virtual label faceHashValue() const
Hash value of all face sizes of this shape. Can be used for.
Definition: pyrMatcher.C:297
virtual label nFacePerCell() const
Definition: pyrMatcher.H:105
virtual bool isA(const faceList &faces)
Exact match given all the faces forming a cell. No checks.
Definition: pyrMatcher.H:128
dynamicFvMesh & mesh
Namespace for OpenFOAM.