tetCell.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-2017 OpenFOAM Foundation
9  Copyright (C) 2019-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::tetCell
29 
30 Description
31  A tetrahedral cell primitive.
32 
33  It is important that the ordering of edges is the same for a tetrahedron
34  class, a tetrahedron cell shape model and a tetCell
35 
36 SourceFiles
37  tetCell.C
38  tetCellI.H
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef tetCell_H
43 #define tetCell_H
44 
45 #include "FixedList.H"
46 #include "triFace.H"
47 #include "edge.H"
48 #include "pointField.H"
49 #include "tetPointRef.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 // Forward Declarations
57 class cellShape;
58 
59 /*---------------------------------------------------------------------------*\
60  Class tetCell Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 class tetCell
64 :
65  public FixedList<label, 4>
66 {
67 public:
68 
69  // Constructors
70 
71  //- Default construct, with invalid point labels (-1)
72  inline tetCell();
73 
74  //- Construct from four point labels
75  inline tetCell
76  (
77  const label a,
78  const label b,
79  const label c,
80  const label d
81  );
82 
83  //- Construct from an initializer list of four point labels
84  inline explicit tetCell(std::initializer_list<label> list);
85 
86  //- Construct from FixedList of four point labels
87  inline tetCell(const FixedList<label, 4>& list);
88 
89  //- Copy construct from a subset of point labels
90  inline tetCell
91  (
92  const labelUList& list,
93  const FixedList<label, 4>& indices
94  );
95 
96  //- Construct from Istream
97  inline tetCell(Istream& is);
98 
99 
100  // Member Functions
101 
102  // Access
103 
104  //- Return i-th face
105  inline Foam::triFace face(const label facei) const;
106 
107  //- Return first face adjacent to the given edge
108  inline label edgeFace(const label edgei) const;
109 
110  //- Return face adjacent to the given face sharing the same edge
111  inline label edgeAdjacentFace
112  (
113  const label edgei,
114  const label facei
115  ) const;
116 
117  //- Return i-th edge from tet.
118  inline Foam::edge tetEdge(const label edgei) const;
119 
120  //- Return i-th edge. Identical to tetEdge but with generic name
121  inline Foam::edge edge(const label edgei) const;
122 
123  //- Return i-th edge reversed
124  inline Foam::edge reverseEdge(const label edgei) const;
125 
126 
127  // Operations
128 
129  //- Return tet shape cell
130  cellShape tetCellShape() const;
131 
132  //- Return the tetrahedron
133  inline tetPointRef tet(const UList<point>& points) const;
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
138 
139 //- Contiguous data for tetCell
140 template<> struct is_contiguous<tetCell> : std::true_type {};
141 
142 //- Contiguous label data for tetCell
143 template<> struct is_contiguous_label<tetCell> : std::true_type {};
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #include "tetCellI.H"
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
Foam::edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:63
tetPointRef.H
triFace.H
Foam::tetCell::tetCell
tetCell()
Default construct, with invalid point labels (-1)
Definition: tetCellI.H:31
Foam::is_contiguous_label
A template class to specify if a data type is composed solely of Foam::label elements.
Definition: contiguous.H:83
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::tetCell::edgeAdjacentFace
label edgeAdjacentFace(const label edgei, const label facei) const
Return face adjacent to the given face sharing the same edge.
Definition: tetCellI.H:128
Foam::tetCell::face
Foam::triFace face(const label facei) const
Return i-th face.
Definition: tetCellI.H:82
Foam::cellShape
An analytical geometric cellShape.
Definition: cellShape.H:69
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::tetCell::tetEdge
Foam::edge tetEdge(const label edgei) const
Return i-th edge from tet.
Definition: tetCellI.H:165
edge.H
Foam::tetCell::tetCellShape
cellShape tetCellShape() const
Return tet shape cell.
Definition: tetCell.C:33
Foam::tetCell::edgeFace
label edgeFace(const label edgei) const
Return first face adjacent to the given edge.
Definition: tetCellI.H:108
pointField.H
Foam::triFace
A triangular face using a FixedList of labels corresponding to mesh vertices.
Definition: triFace.H:69
Foam::tetCell::edge
Foam::edge edge(const label edgei) const
Return i-th edge. Identical to tetEdge but with generic name.
Definition: tetCellI.H:185
Foam::tetCell::tet
tetPointRef tet(const UList< point > &points) const
Return the tetrahedron.
Definition: tetCellI.H:198
Foam::FixedList
A 1D vector of objects of type <T> with a fixed length <N>.
Definition: HashTable.H:104
Foam::UList< label >
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::tetCell
A tetrahedral cell primitive.
Definition: tetCell.H:62
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::tetCell::reverseEdge
Foam::edge reverseEdge(const label edgei) const
Return i-th edge reversed.
Definition: tetCellI.H:191
tetCellI.H
FixedList.H
Foam::is_contiguous
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:75
Foam::tetrahedron
A tetrahedron primitive.
Definition: tetrahedron.H:65