oppositeFace.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 -------------------------------------------------------------------------------
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::oppositeFace
28 
29 Description
30  Class containing opposite face for a prismatic cell with addressing
31  and a possibility of failure.
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef Foam_oppositeFace_H
36 #define Foam_oppositeFace_H
37 
38 #include "face.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class oppositeFace Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class oppositeFace
50 :
51  public face
52 {
53  // Private Data
54 
55  //- Master face index
56  const label masterIndex_;
57 
58  //- Opposite face index
59  const label oppositeIndex_;
60 
61 
62 public:
63 
64  // Constructors
65 
66  //- Construct from components
68  (
69  const face& f,
70  const label masterIndex,
71  const label oppositeIndex
72  )
73  :
74  face(f),
75  masterIndex_(masterIndex),
76  oppositeIndex_(oppositeIndex)
77 
78  {}
79 
80 
81  // Member Functions
82 
83  //- Master face index
84  label masterIndex() const noexcept
85  {
86  return masterIndex_;
87  }
88 
89  //- Opposite face index
90  label oppositeIndex() const noexcept
91  {
92  return oppositeIndex_;
93  }
94 
95  //- Does the opposite face exist?
96  bool good() const noexcept
97  {
98  return oppositeIndex_ >= 0;
99  }
100 
101  //- Does the opposite face exist?
102  bool found() const noexcept { return good(); }
103 };
104 
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 } // End namespace Foam
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 #endif
113 
114 // ************************************************************************* //
Class containing opposite face for a prismatic cell with addressing and a possibility of failure...
Definition: oppositeFace.H:42
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:68
bool found() const noexcept
Does the opposite face exist?
Definition: oppositeFace.H:109
oppositeFace(const face &f, const label masterIndex, const label oppositeIndex)
Construct from components.
Definition: oppositeFace.H:67
bool good() const noexcept
Does the opposite face exist?
Definition: oppositeFace.H:101
const direction noexcept
Definition: Scalar.H:258
labelList f(nPoints)
label masterIndex() const noexcept
Master face index.
Definition: oppositeFace.H:85
label oppositeIndex() const noexcept
Opposite face index.
Definition: oppositeFace.H:93
Namespace for OpenFOAM.