hexMatcher.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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::hexMatcher
28 
29 Description
30  A cellMatcher for hex cells (cellModel::HEX).
31 
32 See also
33  cellMatcher, cellModel
34 
35 SourceFiles
36  hexMatcher.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef hexMatcher_H
41 #define hexMatcher_H
42 
43 #include "cellMatcher.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class hexMatcher Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class hexMatcher
55 :
56  public cellMatcher
57 {
58  // Static Data Members
59 
60  // Constants for this shape
61  static constexpr label vertPerCell = 8;
62  static constexpr label facePerCell = 6;
63  static constexpr label maxVertPerFace = 4;
64 
65 
66  // Private Member Functions
67 
68  //- No copy construct
69  hexMatcher(const hexMatcher&) = delete;
70 
71  //- No copy assignment
72  hexMatcher& operator=(const hexMatcher&) = delete;
73 
74 
75 public:
76 
77  // Constructors
78 
79  //- Construct null
80  hexMatcher();
81 
82  //- Destructor
83  ~hexMatcher();
84 
85 
86  // Member Functions
87 
88  virtual label nVertPerCell() const
89  {
90  return vertPerCell;
91  }
92 
93  virtual label nFacePerCell() const
94  {
95  return facePerCell;
96  }
97 
98  virtual label nMaxVertPerFace() const
99  {
100  return maxVertPerFace;
101  }
102 
103  virtual label faceHashValue() const;
104 
105  virtual bool faceSizeMatch(const faceList&, const labelList&) const;
106 
107  virtual bool matchShape
108  (
109  const bool checkOnly,
110  const faceList& faces,
111  const labelList& faceOwner,
112  const label celli,
113  const labelList& myFaces
114  );
115 
116  virtual bool isA(const primitiveMesh& mesh, const label celli);
117 
118  virtual bool isA(const faceList&);
119 
120  virtual bool matches
121  (
122  const primitiveMesh& mesh,
123  const label celli,
124  cellShape& shape
125  );
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Foam::hexMatcher::~hexMatcher
~hexMatcher()
Destructor.
Definition: hexMatcher.C:48
Foam::hexMatcher::faceSizeMatch
virtual bool faceSizeMatch(const faceList &, const labelList &) const
Check whether number of face sizes match the shape.
Definition: hexMatcher.C:249
Foam::hexMatcher::nFacePerCell
virtual label nFacePerCell() const
Definition: hexMatcher.H:92
Foam::hexMatcher::nVertPerCell
virtual label nVertPerCell() const
Definition: hexMatcher.H:87
Foam::hexMatcher::matchShape
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: hexMatcher.C:55
Foam::cellMatcher
Base class for cellshape matchers (hexMatch, prismMatch, etc.). These are classes which given a mesh ...
Definition: cellMatcher.H:101
Foam::hexMatcher
A cellMatcher for hex cells (cellModel::HEX).
Definition: hexMatcher.H:53
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::hexMatcher::nMaxVertPerFace
virtual label nMaxVertPerFace() const
Definition: hexMatcher.H:97
Foam::hexMatcher::isA
virtual bool isA(const primitiveMesh &mesh, const label celli)
Exact match. Uses faceSizeMatch.
Definition: hexMatcher.C:273
Foam::hexMatcher::matches
virtual bool matches(const primitiveMesh &mesh, const label celli, cellShape &shape)
Like isA but also constructs a cellShape (if shape matches)
Definition: hexMatcher.C:301
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::cellShape
An analytical geometric cellShape.
Definition: cellShape.H:71
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::hexMatcher::faceHashValue
virtual label faceHashValue() const
Hash value of all face sizes of this shape. Can be used for.
Definition: hexMatcher.C:242
Foam::List< face >
cellMatcher.H
Foam::hexMatcher::hexMatcher
hexMatcher()
Construct null.
Definition: hexMatcher.C:34
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:78