tetPoints.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-2012 OpenFOAM Foundation
9  Copyright (C) 2017-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::tetPoints
29 
30 Description
31  Tet storage. Null constructable (unfortunately tetrahedron<point, point>
32  is not)
33 
34 SourceFiles
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef tetPoints_H
39 #define tetPoints_H
40 
41 #include "tetrahedron.H"
42 #include "FixedList.H"
43 #include "treeBoundBox.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class tetPoints Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class tetPoints
55 :
56  public FixedList<point, 4>
57 {
58 public:
59 
60  // Constructors
61 
62  //- Default construct
63  inline tetPoints()
64  {}
65 
66  //- Construct from four points
67  inline tetPoints
68  (
69  const point& a,
70  const point& b,
71  const point& c,
72  const point& d
73  )
74  {
75  operator[](0) = a;
76  operator[](1) = b;
77  operator[](2) = c;
78  operator[](3) = d;
79  }
80 
81  //- Copy construct from subset of points
82  inline tetPoints
83  (
84  const UList<point>& points,
85  const FixedList<label, 4>& indices
86  )
87  :
88  FixedList<point, 4>(points, indices)
89  {}
90 
91 
92  // Member Functions
93 
94  //- Return the tetrahedron
95  inline tetPointRef tet() const
96  {
97  return tetPointRef
98  (
99  operator[](0),
100  operator[](1),
101  operator[](2),
102  operator[](3)
103  );
104  }
105 
106  //- Calculate the bounding box
107  inline treeBoundBox bounds() const
108  {
109  treeBoundBox bb(operator[](0));
110  for (label i = 1; i < size(); ++i)
111  {
112  bb.add(operator[](i));
113  }
114  return bb;
115  }
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
Foam::treeBoundBox
Standard boundBox with extra functionality for use in octree.
Definition: treeBoundBox.H:86
Foam::FixedList< point, 4 >::size
static constexpr label size() noexcept
Return the number of elements in the FixedList.
Definition: FixedList.H:416
Foam::tetPointRef
tetrahedron< point, const point & > tetPointRef
A tetrahedron using referred points.
Definition: tetPointRef.H:47
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
treeBoundBox.H
Foam::tetPoints::tet
tetPointRef tet() const
Return the tetrahedron.
Definition: tetPoints.H:94
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::FixedList< point, 4 >::operator[]
point & operator[](const label i)
Return element of FixedList.
Definition: FixedListI.H:412
Foam::tetPoints
Tet storage. Null constructable (unfortunately tetrahedron<point, point> is not)
Definition: tetPoints.H:53
Foam::Vector< scalar >
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::tetPoints::bounds
treeBoundBox bounds() const
Calculate the bounding box.
Definition: tetPoints.H:106
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
FixedList.H
tetrahedron.H
Foam::tetrahedron
A tetrahedron primitive.
Definition: tetrahedron.H:63
Foam::boundBox::add
void add(const boundBox &bb)
Extend to include the second box.
Definition: boundBoxI.H:191
Foam::tetPoints::tetPoints
tetPoints()
Default construct.
Definition: tetPoints.H:62