Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
OpenFOAM
meshes
primitiveShapes
tetrahedron
tetrahedron.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) 1991-2010 OpenCFD Ltd.
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::tetrahedron
26
27
Description
28
A tetrahedron primitive.
29
30
Ordering of edges needs to be the same for a tetrahedron
31
class, a tetrahedron cell shape model and a tetCell.
32
33
SourceFiles
34
tetrahedronI.H
35
tetrahedron.C
36
37
\*---------------------------------------------------------------------------*/
38
39
#ifndef tetrahedron_H
40
#define tetrahedron_H
41
42
#include <
OpenFOAM/point.H
>
43
#include <
OpenFOAM/primitiveFieldsFwd.H
>
44
#include <
OpenFOAM/pointHit.H
>
45
46
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48
namespace
Foam
49
{
50
51
class
Istream;
52
class
Ostream;
53
54
// Forward declaration of friend functions and operators
55
56
template
<
class
Po
int
,
class
Po
int
Ref>
class
tetrahedron;
57
58
template
<
class
Po
int
,
class
Po
int
Ref>
59
inline
Istream&
operator
>>
60
(
61
Istream&,
62
tetrahedron<Point, PointRef>&
63
);
64
65
template
<
class
Po
int
,
class
Po
int
Ref>
66
inline
Ostream&
operator
<<
67
(
68
Ostream&,
69
const
tetrahedron<Point, PointRef>&
70
);
71
72
73
/*---------------------------------------------------------------------------*\
74
class tetrahedron Declaration
75
\*---------------------------------------------------------------------------*/
76
77
template
<
class
Po
int
,
class
Po
int
Ref>
78
class
tetrahedron
79
{
80
// Private data
81
82
PointRef a_, b_, c_, d_;
83
84
85
public
:
86
87
// Member constants
88
89
enum
90
{
91
nVertices
= 4,
// Number of vertices in tetrahedron
92
nEdges
= 6
// Number of edges in tetrahedron
93
};
94
95
96
// Constructors
97
98
//- Construct from points
99
inline
tetrahedron
100
(
101
const
Point&
a
,
102
const
Point&
b
,
103
const
Point&
c
,
104
const
Point&
d
105
);
106
107
//- Construct from Istream
108
inline
tetrahedron
(
Istream
&);
109
110
111
// Member Functions
112
113
// Access
114
115
//- Return vertices
116
inline
const
Point&
a
()
const
;
117
118
inline
const
Point&
b
()
const
;
119
120
inline
const
Point&
c
()
const
;
121
122
inline
const
Point&
d
()
const
;
123
124
125
// Properties
126
127
//- Return face normal
128
inline
vector
Sa
()
const
;
129
130
inline
vector
Sb
()
const
;
131
132
inline
vector
Sc
()
const
;
133
134
inline
vector
Sd
()
const
;
135
136
//- Return centre (centroid)
137
inline
Point
centre
()
const
;
138
139
//- Return volume
140
inline
scalar
mag
()
const
;
141
142
//- Return circum-centre
143
inline
Point
circumCentre
()
const
;
144
145
//- Return circum-radius
146
inline
scalar
circumRadius
()
const
;
147
148
//- Return (min)containment sphere, i.e. the smallest sphere with
149
// all points inside. Returns pointHit with:
150
// - hit : if sphere is equal to circumsphere
151
// (biggest sphere)
152
// - point : centre of sphere
153
// - distance : radius of sphere
154
// - eligiblemiss: false
155
// Tol (small compared to 1, e.g. 1E-9) is used to determine
156
// whether point is inside: mag(pt - ctr) < (1+tol)*radius.
157
pointHit
containmentSphere
(
const
scalar tol)
const
;
158
159
//- Fill buffer with shape function products
160
void
gradNiSquared
(
scalarField
& buffer)
const
;
161
162
void
gradNiDotGradNj
(
scalarField
& buffer)
const
;
163
164
void
gradNiGradNi
(
tensorField
& buffer)
const
;
165
166
void
gradNiGradNj
(
tensorField
& buffer)
const
;
167
168
169
// IOstream operators
170
171
friend
Istream
&
operator
>> <Point, PointRef>
172
(
173
Istream
&,
174
tetrahedron
&
175
);
176
177
friend
Ostream
& operator<< <Point, PointRef>
178
(
179
Ostream
&,
180
const
tetrahedron
&
181
);
182
};
183
184
185
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186
187
}
// End namespace Foam
188
189
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190
191
#include <
OpenFOAM/tetrahedronI.H
>
192
193
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194
195
#ifdef NoRepository
196
# include <
OpenFOAM/tetrahedron.C
>
197
#endif
198
199
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200
201
#endif
202
203
// ************************ vim: set sw=4 sts=4 et: ************************ //