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 | Copyright (C) 2011-2012 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::tetPoints
26 
27 Description
28  Tet storage. Null constructable (unfortunately tetrahedron<point, point>
29  is not)
30 
31 SourceFiles
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef tetPoints_H
36 #define tetPoints_H
37 
38 #include "tetrahedron.H"
39 #include "FixedList.H"
40 #include "treeBoundBox.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class tetPoints Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class tetPoints
52 :
53  public FixedList<point, 4>
54 {
55 public:
56 
57  // Constructors
58 
59  //- Construct null
60  inline tetPoints()
61  {}
62 
63  //- Construct from four points
64  inline tetPoints
65  (
66  const point& a,
67  const point& b,
68  const point& c,
69  const point& d
70  )
71  {
72  operator[](0) = a;
73  operator[](1) = b;
74  operator[](2) = c;
75  operator[](3) = d;
76  }
77 
78  // Member Functions
79 
80  //- Return the tetrahedron
81  inline tetPointRef tet() const
82  {
83  return tetPointRef
84  (
85  operator[](0),
86  operator[](1),
87  operator[](2),
88  operator[](3)
89  );
90  }
91 
92  //- Calculate the bounding box
93  inline treeBoundBox bounds() const
94  {
95  treeBoundBox bb(operator[](0), operator[](0));
96  for (label i = 1; i < size(); i++)
97  {
98  bb.min() = min(bb.min(), operator[](i));
99  bb.max() = max(bb.max(), operator[](i));
100  }
101  return bb;
102  }
103 };
104 
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 } // End namespace Foam
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 #endif
113 
114 // ************************************************************************* //
A tetrahedron primitive.
Definition: tetrahedron.H:62
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:59
A 1D vector of objects of type <T> with a fixed size <Size>.
Definition: FixedList.H:53
const point & min() const
Minimum describing the bounding box.
Definition: boundBoxI.H:54
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
tetrahedron< point, const point & > tetPointRef
Definition: tetrahedron.H:78
const point & max() const
Maximum describing the bounding box.
Definition: boundBoxI.H:60
treeBoundBox bounds() const
Calculate the bounding box.
Definition: tetPoints.H:92
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
point & operator[](const label)
Return element of FixedList.
label size() const
Return the number of elements in the FixedList.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
tetPointRef tet() const
Return the tetrahedron.
Definition: tetPoints.H:80
tetPoints()
Construct null.
Definition: tetPoints.H:59
Tet storage. Null constructable (unfortunately tetrahedron<point, point> is not)
Definition: tetPoints.H:50
const dimensionedScalar c
Speed of light in a vacuum.
Standard boundBox + extra functionality for use in octree.
Definition: treeBoundBox.H:87
Namespace for OpenFOAM.