OpenFOAM
v2406
The open source CFD toolbox
Roots.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) 2017 OpenFOAM Foundation
9
-------------------------------------------------------------------------------
10
License
11
This file is part of OpenFOAM.
12
13
OpenFOAM is free software: you can redistribute it and/or modify it
14
under the terms of the GNU General Public License as published by
15
the Free Software Foundation, either version 3 of the License, or
16
(at your option) any later version.
17
18
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21
for more details.
22
23
You should have received a copy of the GNU General Public License
24
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26
Class
27
Foam::Roots
28
29
Description
30
Templated storage for the roots of polynomial equations, plus flags to
31
indicate the nature of the roots.
32
33
SourceFiles
34
RootsI.H
35
Roots.C
36
37
\*---------------------------------------------------------------------------*/
38
39
#ifndef Roots_H
40
#define Roots_H
41
42
#include "
VectorSpace.H
"
43
44
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46
namespace
Foam
47
{
48
49
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51
namespace
roots
52
{
53
54
//- Types of root
55
enum
type
56
{
57
real
= 0,
58
complex
,
59
posInf
,
60
negInf
,
61
nan
62
};
63
64
}
65
66
/*---------------------------------------------------------------------------*\
67
Class Roots Declaration
68
\*---------------------------------------------------------------------------*/
69
70
template
<direction N>
71
class
Roots
72
:
73
public
VectorSpace
<Roots<N>, scalar, N>
74
{
75
// Private data
76
77
//- Root types, encoded into a single integer
78
label types_;
79
80
public
:
81
82
// Constructors
83
84
//- Default construct as 'nan'
85
inline
Roots
();
86
87
//- Construct with a uniform value
88
inline
Roots
(
const
roots::type
t,
const
scalar
x
);
89
90
//- Construct by concatenation
91
inline
Roots
92
(
93
const
roots::type
t,
94
const
scalar
x
,
95
const
Roots<N - 1>
& xs
96
);
97
98
//- Construct by concatenation
99
inline
Roots
100
(
101
const
Roots<N - 1>
& xs,
102
const
roots::type
t,
103
const
scalar
x
104
);
105
106
//- Construct by concatenation
107
template
<direction M>
108
inline
Roots
(
const
Roots<M>
& xs,
const
Roots<N - M>
& ys);
109
110
111
// Member Functions
112
113
//- Set the type of the i-th root
114
inline
void
type
(
const
direction
i,
const
roots::type
t);
115
116
//- Return the type of the i-th root
117
inline
roots::type
type
(
const
direction
i)
const
;
118
};
119
120
121
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122
123
}
// End namespace Foam
124
125
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126
127
#include "
RootsI.H
"
128
129
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130
131
#endif
132
133
// ************************************************************************* //
Foam::roots::complex
Definition:
Roots.H:55
RootsI.H
Foam::roots::type
type
Types of root.
Definition:
Roots.H:52
Foam::direction
uint8_t direction
Definition:
direction.H:46
VectorSpace.H
Foam::VectorSpace
Templated vector space.
Definition:
VectorSpace.H:52
Foam::roots::nan
Definition:
Roots.H:58
Foam::Roots
Templated storage for the roots of polynomial equations, plus flags to indicate the nature of the roo...
Definition:
Roots.H:68
x
x
Definition:
LISASMDCalcMethod2.H:52
Foam::roots::real
Definition:
Roots.H:54
Foam::Roots::Roots
Roots()
Default construct as 'nan'.
Definition:
RootsI.H:24
Foam::roots::posInf
Definition:
Roots.H:56
Foam::Roots::type
void type(const direction i, const roots::type t)
Set the type of the i-th root.
Definition:
RootsI.H:115
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:26
Foam::roots::negInf
Definition:
Roots.H:57
src
OpenFOAM
primitives
polynomialEqns
Roots.H
Generated by
1.8.14