partTet.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  partTet
26 
27 Description
28  A partTet is a primitive needed during mesh smoothing
29 
30 SourceFiles
31  partTetI.H
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef partTet_H
36 #define partTet_H
37 
38 #include "pointField.H"
39 #include "edge.H"
40 #include "FixedList.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class Istream;
48 class Ostream;
49 
50 /*---------------------------------------------------------------------------*\
51  class partTet Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class partTet
55 {
56 protected:
57 
58  // Protected data
59  label data_[4];
60 
61 public:
62 
63  // Constructors
64  //- Null construct
65  inline partTet();
66 
67  //- Construct from point labels
68  inline partTet
69  (
70  const label a,
71  const label b,
72  const label c,
73  const label d
74  );
75 
76  // Destructor
77  ~partTet();
78 
79 
80  // Member Functions
81 
82  // Access
83 
84  //- Return vertices
85  inline label a() const;
86 
87  inline label b() const;
88 
89  inline label c() const;
90 
91  inline label d() const;
92 
93  inline label size() const;
94 
95  // Searches
96  //- find position of the node in the partTet
97  inline label whichPosition(const label) const;
98 
99  // Properties
100 
101  //- Return face normal
102  template<class PointField>
103  inline vector Sa(const PointField&) const;
104 
105  template<class PointField>
106  inline vector Sb(const PointField&) const;
107 
108  template<class PointField>
109  inline vector Sc(const PointField&) const;
110 
111  template<class PointField>
112  inline vector Sd(const PointField&) const;
113 
114 
115  //- Return volume
116  template<class PointField>
117  inline scalar mag(const PointField&) const;
118 
119  //- Return circum-centre
120  template<class PointField>
121  inline point crcmCentre(const PointField&) const;
122 
123  template<class PointField>
124  inline scalar crcmRadius(const PointField&) const;
125 
126  //- Return centroid of the tetrahedron
127  template<class PointField>
128  inline point centroid(const PointField&) const;
129 
130  //- Return edges
131  inline FixedList<edge, 6> edges() const;
132 
133  //- Return edge
134  inline edge getEdge(const label) const;
135 
136  // Member operators
137 
138  inline label operator[](const label) const;
139 
140  inline void operator=(const partTet&);
141 
142  inline bool operator==(const partTet&) const;
143  inline bool operator!=(const partTet&) const;
144 
145  // IOstream operators
146 
147  friend Ostream& operator<<(Ostream&, const partTet&);
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #include "partTetI.H"
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
Foam::partTet::Sc
vector Sc(const PointField &) const
Definition: partTetI.H:126
Foam::partTet::operator<<
friend Ostream & operator<<(Ostream &, const partTet &)
Definition: partTetI.H:288
Foam::partTet::crcmRadius
scalar crcmRadius(const PointField &) const
Definition: partTetI.H:183
Foam::partTet::Sb
vector Sb(const PointField &) const
Definition: partTetI.H:112
Foam::partTet::data_
label data_[4]
Definition: partTet.H:58
Foam::partTet::d
label d() const
Definition: partTetI.H:78
Foam::partTet::b
label b() const
Definition: partTetI.H:68
Foam::partTet::operator!=
bool operator!=(const partTet &) const
Definition: partTetI.H:281
Foam::edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:58
Foam::partTet
Definition: partTet.H:53
Foam::partTet::crcmCentre
point crcmCentre(const PointField &) const
Return circum-centre.
Definition: partTetI.H:169
Foam::partTet::operator[]
label operator[](const label) const
Definition: partTetI.H:256
Foam::partTet::Sd
vector Sd(const PointField &) const
Definition: partTetI.H:140
Foam::partTet::centroid
point centroid(const PointField &) const
Return centroid of the tetrahedron.
Definition: partTetI.H:197
Foam::partTet::operator=
void operator=(const partTet &)
Definition: partTetI.H:261
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:59
Foam::partTet::size
label size() const
Definition: partTetI.H:83
Foam::partTet::c
label c() const
Definition: partTetI.H:73
Foam::partTet::getEdge
edge getEdge(const label) const
Return edge.
Definition: partTetI.H:220
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::partTet::edges
FixedList< edge, 6 > edges() const
Return edges.
Definition: partTetI.H:207
edge.H
partTetI.H
Foam::partTet::Sa
vector Sa(const PointField &) const
Return face normal.
Definition: partTetI.H:98
pointField.H
Foam::partTet::mag
scalar mag(const PointField &) const
Return volume.
Definition: partTetI.H:154
Foam::partTet::~partTet
~partTet()
Definition: partTetI.H:57
Foam::partTet::partTet
partTet()
Null construct.
Definition: partTetI.H:39
Foam::Vector< scalar >
Foam::partTet::whichPosition
label whichPosition(const label) const
find position of the node in the partTet
Definition: partTetI.H:88
Foam::FixedList
A 1D vector of objects of type <T> with a fixed size <Size>.
Definition: FixedList.H:53
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
FixedList.H
Foam::partTet::a
label a() const
Return vertices.
Definition: partTetI.H:63
Foam::partTet::operator==
bool operator==(const partTet &) const
Definition: partTetI.H:267