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 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  //- Construct null, 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 FixedList of four point labels
85  inline tetCell(const FixedList<label, 4>& lst);
86 
87  //- Construct from an initializer list of four point labels
88  inline explicit tetCell(std::initializer_list<label> lst);
89 
90  //- Construct from Istream
91  inline tetCell(Istream& is);
92 
93 
94  // Member Functions
95 
96  // Access
97 
98  //- Return i-th face
99  inline triFace face(const label facei) const;
100 
101  //- Return first face adjacent to the given edge
102  inline label edgeFace(const label edgei) const;
103 
104  //- Return face adjacent to the given face sharing the same edge
105  inline label edgeAdjacentFace
106  (
107  const label edgei,
108  const label facei
109  ) const;
110 
111  //- Return i-th edge
112  inline edge tetEdge(const label edgei) const;
113 
114 
115  // Operations
116 
117  //- Return tet shape cell
118  cellShape tetCellShape() const;
119 
120  //- Return the tetrahedron
121  inline tetPointRef tet(const UList<point>& points) const;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
126 
127 //- Contiguous data for tetCell
128 template<> struct is_contiguous<tetCell> : std::true_type {};
129 
130 //- Contiguous label data for tetCell
131 template<> struct is_contiguous_label<tetCell> : std::true_type {};
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #include "tetCellI.H"
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
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()
Construct null, with invalid point labels (-1)
Definition: tetCellI.H:34
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::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::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:121
Foam::tetCell::face
triFace face(const label facei) const
Return i-th face.
Definition: tetCellI.H:75
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:158
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:101
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:178
Foam::FixedList
A 1D vector of objects of type <T> with a fixed length <N>.
Definition: HashTable.H:104
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
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