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 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  //- Construct null
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  // Member Functions
82 
83  //- Return the tetrahedron
84  inline tetPointRef tet() const
85  {
86  return tetPointRef
87  (
88  operator[](0),
89  operator[](1),
90  operator[](2),
91  operator[](3)
92  );
93  }
94 
95  //- Calculate the bounding box
96  inline treeBoundBox bounds() const
97  {
98  treeBoundBox bb(operator[](0));
99  for (label i = 1; i < size(); ++i)
100  {
101  bb.add(operator[](i));
102  }
103  return bb;
104  }
105 };
106 
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 } // End namespace Foam
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 #endif
115 
116 // ************************************************************************* //
Foam::treeBoundBox
Standard boundBox with extra functionality for use in octree.
Definition: treeBoundBox.H:87
Foam::FixedList< point, 4 >::size
static constexpr label size() noexcept
Return the number of elements in the FixedList.
Definition: FixedList.H:368
Foam::tetPointRef
tetrahedron< point, const point & > tetPointRef
Definition: tetPointRef.H:46
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
treeBoundBox.H
Foam::tetPoints::tet
tetPointRef tet() const
Return the tetrahedron.
Definition: tetPoints.H:83
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:364
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::tetPoints::bounds
treeBoundBox bounds() const
Calculate the bounding box.
Definition: tetPoints.H:95
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:65
Foam::boundBox::add
void add(const boundBox &bb)
Extend to include the second box.
Definition: boundBoxI.H:191
Foam::tetPoints::tetPoints
tetPoints()
Construct null.
Definition: tetPoints.H:62