tetMatcher.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::tetMatcher
28 
29 Description
30  A cellMatcher for tet cells (cellModel::TET)
31 
32 See also
33  cellMatcher, cellModel
34 
35 SourceFiles
36  tetMatcher.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef tetMatcher_H
41 #define tetMatcher_H
42 
43 #include "cellMatcher.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class tetMatcher Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class tetMatcher
55 :
56  public cellMatcher
57 {
58  // Static Data Members
59 
60  // Constants for this shape
61  static constexpr label vertPerCell = 4;
62  static constexpr label facePerCell = 4;
63  static constexpr label maxVertPerFace = 3;
64 
65 
66  // Private Member Functions
67 
68  //- No copy construct
69  tetMatcher(const tetMatcher&) = delete;
70 
71  //- No copy assignment
72  tetMatcher& operator=(const tetMatcher&) = delete;
73 
74 
75 public:
76 
77  // Constructors
78 
79  //- Construct null
80  tetMatcher();
81 
82  //- Destructor
83  ~tetMatcher();
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::tetMatcher::faceHashValue
virtual label faceHashValue() const
Hash value of all face sizes of this shape. Can be used for.
Definition: tetMatcher.C:182
Foam::tetMatcher::nFacePerCell
virtual label nFacePerCell() const
Definition: tetMatcher.H:92
Foam::tetMatcher
A cellMatcher for tet cells (cellModel::TET)
Definition: tetMatcher.H:53
Foam::cellMatcher
Base class for cellshape matchers (hexMatch, prismMatch, etc.). These are classes which given a mesh ...
Definition: cellMatcher.H:101
Foam::tetMatcher::matches
virtual bool matches(const primitiveMesh &mesh, const label celli, cellShape &shape)
Like isA but also constructs a cellShape (if shape matches)
Definition: tetMatcher.C:241
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::tetMatcher::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: tetMatcher.C:58
Foam::tetMatcher::faceSizeMatch
virtual bool faceSizeMatch(const faceList &, const labelList &) const
Check whether number of face sizes match the shape.
Definition: tetMatcher.C:189
Foam::tetMatcher::~tetMatcher
~tetMatcher()
Destructor.
Definition: tetMatcher.C:50
Foam::tetMatcher::isA
virtual bool isA(const primitiveMesh &mesh, const label celli)
Exact match. Uses faceSizeMatch.
Definition: tetMatcher.C:213
Foam::List< face >
cellMatcher.H
Foam::tetMatcher::nMaxVertPerFace
virtual label nMaxVertPerFace() const
Definition: tetMatcher.H:97
Foam::tetMatcher::nVertPerCell
virtual label nVertPerCell() const
Definition: tetMatcher.H:87
Foam::tetMatcher::tetMatcher
tetMatcher()
Construct null.
Definition: tetMatcher.C:36
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:78