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 
68 public:
69 
70  // Constructors
71 
72  //- Default construct, with invalid point labels (-1)
73  inline tetCell();
74 
75  //- Construct from four point labels
76  inline tetCell
77  (
78  const label a,
79  const label b,
80  const label c,
81  const label d
82  );
83 
84  //- Construct from an initializer list of four point labels
85  inline explicit tetCell(std::initializer_list<label> list);
86 
87  //- Construct from FixedList of four point labels
88  inline tetCell(const FixedList<label, 4>& list);
89 
90  //- Copy construct from a subset of the input list
91  inline tetCell
92  (
93  const labelUList& list,
94  const FixedList<label, 4>& indices
95  );
96 
97  //- Construct from Istream
98  inline tetCell(Istream& is);
99 
100 
101  // Member Functions
102 
103  // Access
104 
105  //- Return i-th face
106  inline triFace face(const label facei) const;
107 
108  //- Return first face adjacent to the given edge
109  inline label edgeFace(const label edgei) const;
110 
111  //- Return face adjacent to the given face sharing the same edge
112  inline label edgeAdjacentFace
113  (
114  const label edgei,
115  const label facei
116  ) const;
117 
118  //- Return i-th edge
119  inline edge tetEdge(const label edgei) const;
120 
121 
122  // Operations
123 
124  //- Return tet shape cell
125  cellShape tetCellShape() const;
126 
127  //- Return the tetrahedron
128  inline tetPointRef tet(const UList<point>& points) const;
129 };
130 
131 
132 // * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
133 
134 //- Contiguous data for tetCell
135 template<> struct is_contiguous<tetCell> : std::true_type {};
136 
137 //- Contiguous label data for tetCell
138 template<> struct is_contiguous_label<tetCell> : std::true_type {};
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #include "tetCellI.H"
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
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:35
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:132
Foam::tetCell::face
triFace face(const label facei) const
Return i-th face.
Definition: tetCellI.H:86
Foam::cellShape
An analytical geometric cellShape.
Definition: cellShape.H:71
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::tetCell::tetEdge
edge tetEdge(const label edgei) const
Return i-th edge.
Definition: tetCellI.H:169
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:112
pointField.H
Foam::triFace
A triangular face using a FixedList of labels corresponding to mesh vertices.
Definition: triFace.H:70
Foam::tetCell::tet
tetPointRef tet(const UList< point > &points) const
Return the tetrahedron.
Definition: tetCellI.H:189
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.
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